viết 1 unimgsbox
có 1 một button "Dong y" và "huy"
cho 1 timer1
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
private sub CMD_click()
timer1.enable=true
msgbox "abc","Example",vbokcanle
end sub
private sub timer1_timer()
a=findwindowex(me.hwnd,#32770”,"Button","OK")
sendmesage a,&HC,0,"Dong y"
a=findwindowex(me.hwnd,#32770”,"Button","Cancle")
sendmesage a,&HC,0,"Huy"
timer1.enable =false
end sub