issues reading lParam

Apr 26, 2016 at 6:23am
Hello all, im trying to read the message WM_SHOWWINDOW to know when my parent
window is being restored after being minimized.
But it appears that i cant read the lParam the right way ( or that i did not understood why and when that message is sent ?)

should it works this way :

case WM_SHOWWINDOW:
if(lParam == SW_PARENTOPENING)
{
do something there.
}
return 0;

?

thanks
Apr 26, 2016 at 11:13am
Try this to see what you get:
1
2
3
4
5
6
7
    case WM_SHOWWINDOW:
    {
      char buffer[256] = {0};
      sprintf(buffer, "WM_SHOWWINDOW - lParam = %d", lParam);
      ::MessageBoxA(0, buffer, "Info", MB_OK);
    }
    return 0;


You need to include <stdio.h>
Apr 26, 2016 at 12:19pm
WM_SHOWWINDOW - lParam = 0, at the lauch of the program.
(i had to use sprintf_s, visualstudio saying me sprintf was unsafe ?)

not sure what you expected ?
Apr 26, 2016 at 12:35pm
WM_SHOWWINDOW - lParam = 0, at the lauch of the program.

Well this normal, does it mean the message box was only shown once?

How is the second created?
Could you maybe post the code?
Apr 26, 2016 at 12:57pm
only once, yes.

well.. the code is pretty big. what do you want to see ?
Apr 26, 2016 at 2:29pm
1
2
3
4
5
6
7
8
	case WM_SIZE:
		if (wParam == SIZE_MINIMIZED)
			FUK = 1;
		if (wParam == SIZE_RESTORED && FUK == 1)
		{
			InvalidateRect(hWnd, NULL, TRUE);
			FUK = 0;
		}

this, is working. should i be ashamed and keep searching ? ^^
Apr 26, 2016 at 4:27pm
should i be ashamed and keep searching ? ^^

Why be ashamed? To err is human. :-)

what do you want to see ?

The code where you create the windows.
Topic archived. No new replies allowed.