Hey moeur, :wave:
Sweet code there to integrate Spy++ functionality into your custom app. Does it flash the target window or put a box around it temporarily? I'll check it out when I get home. Could you add that modification? :ehh:
Printable View
Hey moeur, :wave:
Sweet code there to integrate Spy++ functionality into your custom app. Does it flash the target window or put a box around it temporarily? I'll check it out when I get home. Could you add that modification? :ehh:
I was thinking it would be nice to have that feature, but so far have not figured out how to do it. I was looking at Spy++ and noticed that it looks like they are using some kind of window shadow effect.
i have 1 button in my program and all the code is down here but if i push the button nothing happens but push i again on the same butten then mijn setup on the other program go 1 step ahead
how is this possable
VB Code:
'Returns handle to target window Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _ ByVal lpClassName As String, _ ByVal lpWindowName As String _ ) As Integer 'Returns handle to target control Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" ( _ ByVal hWnd1 As Integer, _ ByVal hWnd2 As Integer, _ ByVal lpsz1 As String, _ ByVal lpsz2 As String _ ) As Integer Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" ( _ ByVal hwnd As Integer, _ ByVal wMsg As Integer, _ ByVal wParam As Integer, _ ByVal lParam As Integer _ ) As Integer 'The message we want to send Const BM_CLICK = &HF5 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim hWndForm As Integer ' handle to target window Dim hWndButton As Integer ' handle to the button Dim strCaptionForm As String 'caption of the target form Dim strClassButton As String ' Button Class Dim strCaptionButton As String ' Button Caption Dim strClassForm As String 'Form Class Name strCaptionForm = "Adobe Reader 7.0 - Setup" strCaptionButton = "&Next >" strClassButton = "Button" strClassForm = "MsiDialogCloseClass" 'Get handle to desired form ' if this returns 0 we didn't get it hWndForm = FindWindow(strClassForm, strCaptionForm) MsgBox(hWndForm) If hWndForm = 0 Then MsgBox("Sorry, could not find requested form") Exit Sub End If 'Get handle to desired button on form ' if this returns 0 we didn't get it hWndButton = FindWindowEx(hWndForm, 0, strClassButton, strCaptionButton) MsgBox(hWndButton) If hWndButton = 0 Then MsgBox("Sorry, could not find requested button") Else 'Send click message to button Call SendMessage(hWndButton, BM_CLICK, 0, 0) End If End Sub End Class
Maybe you'd be better off using the VBasic SendKeys statement?
1. make Adobe Reader 7.0 - Setup the active window
2. Sendkeys("{ENTER}")
if the &Next > key is not the default, then you'll have to send some {TAB} keys first.
Get it?
The name had 2 spaces after it to answer ur previsous question moeur, i really cnt get this to work, gladh u guys are still working on it :), elenar have u got the code to work yet?
To fix this code mate DMW - Client Login must have 2 spaces after it, "DMW - Client Login "Quote:
Originally Posted by eleanor
This info is excellent guys!
I made the Spy++ equilivent program, and see the class name, caption, and handle for most things, however, I have encountered a problem:
I am trying to "Press" a button. The button is the Play button in Music Match Jukebox. In using the program (and also tried Spy++), there is no Caption; it is blank. The form has all the relevent info, but the button has the following info:
Handle: 406EA
Caption:
Class Name: AfxOleControl70u
Also, how do I send other things, such as Ctrl + right arrow?
Thanks for your help!
KyferEz