1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
Declare Function ShowWindow Lib "user32" Alias "ShowWindow" ( _
ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long
sub machin_chose()
While lPopupHandle = 0
DoEvents
lPopupHandle = FindWindowEx(0, 0&, "#32770", "Nom de ma fenetre")
Wend
hwnd = FindWindowEx(0, 0&, "#32770", "Nom de ma fenetre")
hwnd_button = FindWindowEx(hwnd, 0, "Button", "OK")
Application.wait Now + TimeValue("00:00:02")
'
showwindow hwnd, 5
'SetActiveWindow hwnd ' prend la main sur la fenêtre
SendKeys "login"
SendKeys "{TAB}"
SendKeys "mdp"
SendKeys "{enter}"
Application.wait Now + TimeValue("00:00:02")
SendKeys "{NUMLOCK}", True
SendMessage hwnd_button, BM_CLICK, ByVal CLng(1), ByVal CLng(0) ' click sur le bouton
end sub |
Partager