Hello
I'm having a problem with my program that is sending a key to a window of a game based on the q3 engine. The problem is sendmessage() returns 0 which menas that it failed. So I retrieved the error which is 1400 which belongs to INVALID_WINDOW_HANDLE.
But I'm 99,9999999% sure the window handle is right.... I once printed it to the console and checked it with a program which shows all windows and their hwnd and it matched.
I'll supply the source:
Declaration of functions
Declaration of hwnd
the sendmessage() use
Anyone that might have an idea why it comes with this INVALID_WINDOW_HANDLE....
I'm having a problem with my program that is sending a key to a window of a game based on the q3 engine. The problem is sendmessage() returns 0 which menas that it failed. So I retrieved the error which is 1400 which belongs to INVALID_WINDOW_HANDLE.
But I'm 99,9999999% sure the window handle is right.... I once printed it to the console and checked it with a program which shows all windows and their hwnd and it matched.
I'll supply the source:
Declaration of functions
VB.NET:
Public Declare Auto Function FindWindow Lib "user32.dll" _
Alias "FindWindow" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As IntPtr
Declare Auto Function SendMessage Lib "user32" (ByVal hWnd As IntPtr, ByVal Msg As IntPtr, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr
Declaration of hwnd
VB.NET:
Public hwnd As IntPtr
hwnd = FindWindow("SoF2 MP", "SoF2 MP")
the sendmessage() use
VB.NET:
SendMessage(hwnd, &H100, &H6D, &H4A0001)
SendMessage(hwnd, &H101, &H6D, &HC04A0001)
Anyone that might have an idea why it comes with this INVALID_WINDOW_HANDLE....