microcephalic Posted November 6, 2004 Posted November 6, 2004 I am trying to figure out how to obtain the values needed to successfully execute a SendMessage I'm using to try to close a dialog box. My question is how do I figure out the value of my window (the hwnd value), the message I want to send (the wMsg value), and the remaing parameter values (wParam and lParam)? Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" _ (ByVal hwnd As Integer, _ ByVal wMsg As Integer, _ ByVal wParam As Integer, _ ByVal lParam As Long) As Integer Quote
Administrators PlausiblyDamp Posted November 7, 2004 Administrators Posted November 7, 2004 You could always try the FindWindow API Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As IntPtr, _ ByVal Msg As Integer, ByVal wParam As UIntPtr, _ ByVal lParam As IntPtr) As IntPtr Declare Auto Function FindWindow Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr 'use like Dim hWnd as IntPtr = FindWindow("", "") and use the returned value as the first parameter to SendMessage. As to what you pass for the other 3 parameters depends on what you are trying to do. For a list of windows Messages you may want to Look on MSDN Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
microcephalic Posted November 7, 2004 Author Posted November 7, 2004 (edited) Thanks, I found the name of the window now and checked out MSDN. It looks like I could use WM_COMMAND to help me "press" the save button on my dialog box. Would WM_COMMAND be the right choice to do something like this? Thanks so much for your help! Edited November 7, 2004 by microcephalic Quote
microcephalic Posted November 7, 2004 Author Posted November 7, 2004 Basically what I am trying to do is to simulate a left mouse click on the save button in a dialog box. Quote
VBInfinite Posted February 28, 2005 Posted February 28, 2005 I found this website: locohacker.net, they have source code for findwindow & sendmessage for paltalk. Go there if you;r interesting. Quote
Recommended Posts