用sendmessage为何不行!!!!!!

tanjunrong123 2004-03-05 05:20:18
Dim str1 As String
str1 = InputBox("input the proname want to close:")
hwnd1 = FindWindow(vbNullString, str1)
If hwnd1 = 0 Then
MsgBox 0
Else
MsgBox hwnd1
a = SendMessage(hwnd1, WM_CLOSE, 1, 1)
End If
利用上段代码可以检测到要关闭的程序是否打开,但不能关闭,请教高手!!!
...全文
99 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
seabird125 2004-06-30
  • 打赏
  • 举报
回复
最好后面带个doevents
呵呵.
CatchWind 2004-06-30
  • 打赏
  • 举报
回复
用Postmessage吧,
a=PostMessage(hwnd1, WM_CLOSE, 0&, 0&)
flisun 2004-06-30
  • 打赏
  • 举报
回复
a = SendMessage(hwnd1, WM_CLOSE,0, 0)

1,486

社区成员

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

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