在VB.Net中使用Shell.MinimizeAll() [英] Using Shell.MinimizeAll() in VB.Net
问题描述
我对使用shell非常熟悉,我只是想确保我做对了。我所追求的只是使用Shell.MinimizeAll()命令。该程序创建用作背景图块的图像,我正在添加设置为壁纸功能。因此,我想隐藏任何打开的窗口,以便用户可以看到桌面。
我做了什么:
1.添加了对 Shell32.dll
的引用
2.在.vb文件中添加 Imports Shell32
3.在最小化所有窗口的子中,我补充:
I''m not terribly familiar with working with the shell, and I just want to be sure I did this right. All I was after was to use the Shell.MinimizeAll() command. The program creates images for use as background tiles, and I''m adding a "set as wallpaper" feature. As such, I wanted to hide any open windows so the user can see the desktop.
What I did:
1. Added a reference to Shell32.dll
2. Added Imports Shell32
to the .vb file
3. In the sub that minimizes all windows, I added:
Dim sh As New Shell
sh.MinimizeAll()
效果很好,但我很怀疑没有什么比这更容易了。我所做的是一种可以接受的做法吗?
Works great, but I''m suspicious. Nothing is ever this easy. Is what I''ve done considered an acceptable practice?
推荐答案
它完全符合你的要求。
Shell.MinimizeAll()文档 [ ^ ]
你有疑问吗?嗯,当我找到问题的解决方案比我想象的容易得多时,我戴上派对帽并开始在办公室里跳舞:D
It does exactly what you what it to.
Shell.MinimizeAll() documentation[^]
You''re suspicious? hmm, when I find a solution to a problem to be much easier than I expected, I put on the the party hat and start dancing around the office :D
第1步: - 首先将shell32.dll添加到您的项目参考。
*打开您的项目。然后单击项目菜单项。
*然后单击添加引用
*然后GoTo浏览对话框中的选项卡
*在文件名中复制这一行c:\windows\system32\shell32.dll
*点击确定。
第2步
现在转到代码窗口你可以写下面写的代码: -
Step 1 :- First Add shell32.dll to your Project Reference.
* open your project . Then click on Project Menu Item.
* Then click on Add Reference
* Then GoTo Browse Tab In Dialog Box
* In File name copy this line "c:\windows\system32\shell32.dll"
* Click Ok.
Step 2
Now Goto Code Window you can write code written below :-
Imports Shell32 **** 'Import the shell32.dll to your code
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim shell As New Shell32.Shell *****'An object is created of type shell32
shell.MinimizeAll() *******''''It will minimize all windows
End Sub
End Class
这篇关于在VB.Net中使用Shell.MinimizeAll()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!