如何關閉楓之谷啟動視窗(免按Play)

楓之谷啟動視窗怎麼關閉呢?當然是ESC,也就是關閉視窗的意思
所以我們不能幹掉進程,不然遊戲就被關掉了...
這時候就要叫視窗關閉啊~
所以用PostMessage

  1. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  2. Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
  3. Private Const WM_CLOSE = &H10

  4. Private Sub Timer1_Timer()
  5. Dim hwn As Long
  6. hwn = FindWindow("StartUpDlgClass", "MapleStory")
  7. PostMessage hwn, WM_CLOSE, 0, 0
  8. End Sub

留言

  1. 洋蔥

    怎辦 我打上去她顯示編譯錯誤 錯再PostMessage

    她說 沒有定義SUB 或 FUNCTION

    回覆刪除

張貼留言

本月最夯

偷用電腦,怎知?事件檢視器全記錄!(開機時間、啟動項時間...)