|
-
Oct 9th, 2006, 02:15 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] Click OK Button in VB6
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?
Last edited by kregg; Aug 11th, 2007 at 04:50 PM.
-
Oct 9th, 2006, 02:32 PM
#2
Re: Click OK Button in VB6
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
-
Oct 10th, 2006, 04:53 AM
#3
Thread Starter
Fanatic Member
Re: Click OK Button in VB6
Cheers I'll try that out tonight!
-
Oct 10th, 2006, 07:30 AM
#4
Thread Starter
Fanatic Member
Re: Click OK Button in VB6
Brilliant stuff there Bushmobile!
One problem:
Last edited by kregg; Aug 11th, 2007 at 04:50 PM.
-
Oct 10th, 2006, 10:42 AM
#5
Re: Click OK Button in VB6
 Originally Posted by kregg
Brilliant stuff there Bushmobile!
One problem:
No Worries
-
Oct 10th, 2006, 10:56 AM
#6
Hyperactive Member
Re: Click OK Button in VB6
 Originally Posted by kregg
Brilliant stuff there Bushmobile!
One problem:
Don't worry, Kregg. Most of us have that problem.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|