如何关闭“我的电脑”

Dickson 2007-05-19 10:08:40
“我的电脑”的标题可能会改变,比如C盘啊D盘啊

而且不能用结束EXPLORER进程
...全文
315 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
wanlion 2007-05-20
  • 打赏
  • 举报
回复
我觉得rainstormmaster 的方法不错
嗷嗷叫的老马 2007-05-20
  • 打赏
  • 举报
回复
..........收藏......

这Windows里还有太多的秘密......

不知道有没有什么书详细讲讲过?
mndsoft 2007-05-19
  • 打赏
  • 举报
回复
修改注册表,查一下吧。
还有一个,这个帖子楼主的意思是不是要编程解决,不是的话,可能要到操作系统里去问了,呵呵
rainstormmaster 2007-05-19
  • 打赏
  • 举报
回复
//嘎嘎,今天终于被我看到这个代码了

怎么说"终于"啊?这段代码很普通啊
清晨曦月 2007-05-19
  • 打赏
  • 举报
回复
2 枚举ShellWindows中的窗口,要关闭的时候调用quit方法即可:


嘎嘎,今天终于被我看到这个代码了。..............收藏
rainstormmaster 2007-05-19
  • 打赏
  • 举报
回复
两种思路:
1 用findwindow之类的api查找所有顶级窗口,然后根据类名或对应进程信息,判断其是否为需要的窗口,关闭时,用sendmessage发送WM_CLOSE消息即可

2 枚举ShellWindows中的窗口,要关闭的时候调用quit方法即可:
Option Explicit
'需要引用 Microsoft Internet Controls
Dim mShellWindows As New ShellWindows
Private Sub Command1_Click()
Dim b As InternetExplorer
For Each b In mShellWindows
If b.FullName = VBA.Environ$("windir") & "\explorer.exe" Then
Debug.Print b.LocationName
End If
Next
End Sub



Private Sub Command2_Click()
'关闭所有符合你要求的窗口
Dim b As InternetExplorer
For Each b In mShellWindows
If b.FullName = VBA.Environ$("windir") & "\explorer.exe" Then
b.Quit
End If
Next
End Sub
嗷嗷叫的老马 2007-05-19
  • 打赏
  • 举报
回复
哈,是想关闭资源管理器窗口而已吧...........

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧