国产成人AV一区二区三区在线_国产成人精品无码免费看_国产成人无码无卡在线观看_国产精品成人A区在线观看_国产日韩精品欧美一区_国产亚洲精品自在久久蜜TV_久草热久草热线频97精品_久久久噜噜噜久久中文福利_久久婷婷五月综合色国产免费观看_日日狠狠久久偷偷色综合0,九一桃色在线观看,久久97精品久久久久久久不卡,国产成人精品亚洲精品

用vb關(guān)閉其他應(yīng)用程序的窗體(已知窗口句柄)

訪客2024-12-21 20:22:211

'我寫了一個(gè)代碼,,用findwindow查找窗口獲取窗口句柄,,然后用sendmessage發(fā)送關(guān)閉信息使其關(guān)閉。但是我在findwindow函數(shù)里面顯示返回值,句柄是對(duì)的,??墒莝endmessage函數(shù)好像沒用一樣,,連最簡(jiǎn)單的窗體(如vbs彈窗,,vb測(cè)試的窗體沒用cancel)都關(guān)不了,請(qǐng)問是什么問題?也沒用報(bào)錯(cuò),,但是關(guān)不掉,,我也沒加語句 on error resume next 或者goto。別說直接結(jié)束,,我本身做彈窗攔截,,一出來就關(guān),不要手動(dòng)操作,,還不如直接點(diǎn)關(guān)閉按鈕關(guān)掉,。我的代碼:Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Longprivate Declare Function SendMessage Lib "user32" Alias "SendMessageA" (Byval hwnd As Long, Byval wMsg As Long,Byval wParam As Long,lParam As Any) As Long '聲明a = FindWindow(vbNullString, "標(biāo)題")'sendmessage關(guān)窗口:SendMessage a, WM_CLOSE, 0, 0自己寫的,有什么不對(duì)求大神請(qǐng)教,。

你的WM_CLOSE沒有定義,,當(dāng)然不行

定義一個(gè)

Private Const WM_CLOSE = &H10

或直接

SendMessage a, &H10, 0, 0

文章評(píng)論