I got the Display properties window up, but I have no idea to go about making vb6 click the ok button.
I used WinID from Gigemboy's sig, and I got the results below.
What info should I use and with what code?
Printable View
I got the Display properties window up, but I have no idea to go about making vb6 click the ok button.
I used WinID from Gigemboy's sig, and I got the results below.
What info should I use and with what code?
try this:VB Code:
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 Const BM_CLICK = &HF5 Private Sub Command1_Click() Dim lhWnd As Long lhWnd = FindWindowEx(0&, 0&, "#32770", vbNullString) lhWnd = FindWindowEx(lhWnd, 0&, "Button", "OK") SendMessage lhWnd, BM_CLICK, 0&, 0& End Sub
Cheers I'll try that out tonight!
Brilliant stuff there Bushmobile!
One problem:
No Worries :thumb:Quote:
Originally Posted by kregg
Don't worry, Kregg. Most of us have that problem. :(Quote:
Originally Posted by kregg