I'm trying to start a message loop for a win32 program, and one of the parameters I have to set is the callback routine to handle the messages. But I have to assign the address of this routine to a procedure pointer, and I have no clue how to do it!
So basically, how do I set wc.lpfnWndProc to the address of WindowProc()?
I am including a piece of my code here:
WNDCLASS wc;
ATOM MyAtom;
// Register the window class for the main window.
if (!hPrevInstance)
{
wc.style = CS_NOCLOSE;
wc.lpfnWndProc = ????;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = GetStockObject(WHITE_BRUSH);
wc.lpszMenuName = "MainMenu";
wc.lpszClassName = "MainWndClass";
MyAtom=RegisterClass(&wc);
.
.
.
RESULT CALLBACK WindowProc(HWND hwnd, // handle of window
UINT uMsg, // message identifier
WPARAM wParam, // first message parameter
LPARAM lParam) // second message parameter
{
return (LRESULT)1;
}
Thanx! [sig][/sig]
So basically, how do I set wc.lpfnWndProc to the address of WindowProc()?
I am including a piece of my code here:
WNDCLASS wc;
ATOM MyAtom;
// Register the window class for the main window.
if (!hPrevInstance)
{
wc.style = CS_NOCLOSE;
wc.lpfnWndProc = ????;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = GetStockObject(WHITE_BRUSH);
wc.lpszMenuName = "MainMenu";
wc.lpszClassName = "MainWndClass";
MyAtom=RegisterClass(&wc);
.
.
.
RESULT CALLBACK WindowProc(HWND hwnd, // handle of window
UINT uMsg, // message identifier
WPARAM wParam, // first message parameter
LPARAM lParam) // second message parameter
{
return (LRESULT)1;
}
Thanx! [sig][/sig]