if you don't want DirectX in it then sub-classing the window procedure is easy, along with creating a window. here is how you sub-class it:
first get the handle to the original window. then use:
SetClassLong(HandleToDBWindow, GWL_WNDPROC, NewWindowProcFunction)
NewWindowProcFunction is the pointer to the procedure function(you get this by using the function name without the parameters or parentheses). This also returns the pointer to the old window procedure(which you will need. so save it as a WNDPROC* variable) your new procedure function should look something like this
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_LBUTTONDOWN:
// Present a message box when the user clicks on the window
MessageBoxA(hWnd, "Mouse Click!", "DarkBASIC", MB_OK);
break;
default:
return OldWndProc(hWnd, msg, wParam, lParam);
}
return 0;
}
that will show a message box when the user clicks the left mouse button. other messages are sent to the old window procedure(that's why we saved it) Of course as you see this is all in c++ so you will need a dll. Oh and the SetClassLong takes a parameter of LONG so you need to type cast the pointer to LONG like this
(LONG)(funcptr)
you cannot do this from dbc because dbc doesn't support pointers and you cannot get a function pointer in dbc.
After that you can create a new window with the dbc class("DBG") which i didn't know the name till now lol. i just got the class handle from WinAPI and the window handle lol. You cannot call "GetMessage" from dbc though. or i have never gotten it to work.
New Site! Check it out \/