Const WM_COMMAND = &H111
Const BN_CLICKED = 0
Const WM_CLOSE = &H10
Const BM_CLICK = &HF5
'----------------------------------
Dim hwnd_form1 = jk.FindWindow(Nothing, "Form1")
' Dim hButton = jk.FindWindowEx(0, 0, Nothing, "Form1") '也可以用這個
'FindWindowEx(0,0,物件類別,物件標頭名) '不知道物件類別就填Nothing,不限類別依名稱全都找出來
Dim hButton = jk.FindWindowEx(hwnd_form1, 0, Nothing, "否(&N)")
'JK: 標頭名稱可VS2008工具 SPY++去找 難搞的標題字串給我找到了>> "否(&N)"
'-------------------------------------
'方法一:(送訊息給主窗體,主窗體再帶參數去引發BUTTON點擊 ,但是參數定義不定確定 ,以下測試OK)
' Dim AA = jk.SendMessage(hwnd_form1, WM_COMMAND, 0, hButton)
'方法二" (這個比較直觀,直接送訊息給BUTTON的HANDLE))
' Dim BB = jk.SendMessage(hButton, BM_CLICK, 0, hButton)
' SendMessage(要傳給的主視窗HANDLE,要傳過去的動作訊息代碼,帶參數Wp,帶參數Lp)