Hi,
I'm trying to figuere out how to subclass the FSX window, no luck so far (or I woldn't be posting here off course
)
Here's what I came up with so far.
And then the A300WinProc:
OldWndProc gets a valid number but unfortunately the A300WinProc is never called. Anyone see anything that's wrong ?
Thx,
Björn
I'm trying to figuere out how to subclass the FSX window, no luck so far (or I woldn't be posting here off course
Here's what I came up with so far.
Code:
BOOL WINAPI DllMain (HINSTANCE hDLL, DWORD dwReason, LPVOID lpReserved)
{
HWND hwnd = FindWindow("FS98MAIN",NULL);
switch(dwReason)
{
case DLL_PROCESS_ATTACH:
OldWndProc = (WNDPROC)SetClassLong(hwnd, GCL_WNDPROC, (LONG)A300WinProc);
break;
}
return TRUE;
}
And then the A300WinProc:
Code:
LRESULT CALLBACK A300WinProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
LRESULT lr = 1;
HWND hFSMainWnd;
switch(msg)
{
case WM_KEYFIRST:
break;
case WM_DESTROY:
if (OldWndProc){
hFSMainWnd = FindWindow("FS98MAIN",NULL);
SetWindowLong(hFSMainWnd, GWL_WNDPROC, (LONG)OldWndProc);
OldWndProc = NULL;
}
break;
}
return CallWindowProc((WNDPROC)OldWndProc, hwnd, msg, wParam, lParam);
}
OldWndProc gets a valid number but unfortunately the A300WinProc is never called. Anyone see anything that's wrong ?
Thx,
Björn

