nappaji
January 18th, 2008, 05:00 PM
<code>
//-----------------------------------------------------------------------------
// Name: MsgProc()
// Desc: The window's message handler
//-----------------------------------------------------------------------------
LRESULT WINAPI MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
switch( msg )
{
case WM_DESTROY:
Cleanup();
PostQuitMessage( 0 );
return 0;
}
return DefWindowProc( hWnd, msg, wParam, lParam );
}
</code>
I have the above MsgProc function used to handle windows messages.
As you can see, during the WN_DESTROY message, I call a function called Cleanup().
I want to pass in parameters (a structure variable) into this Cleanup function. To so that, I need to pass the parameters through the MsgProc function.
How do I accomplish this? MsgProc takes in only 4 parameters, how do I add additional parameters?
//-----------------------------------------------------------------------------
// Name: MsgProc()
// Desc: The window's message handler
//-----------------------------------------------------------------------------
LRESULT WINAPI MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
switch( msg )
{
case WM_DESTROY:
Cleanup();
PostQuitMessage( 0 );
return 0;
}
return DefWindowProc( hWnd, msg, wParam, lParam );
}
</code>
I have the above MsgProc function used to handle windows messages.
As you can see, during the WN_DESTROY message, I call a function called Cleanup().
I want to pass in parameters (a structure variable) into this Cleanup function. To so that, I need to pass the parameters through the MsgProc function.
How do I accomplish this? MsgProc takes in only 4 parameters, how do I add additional parameters?