I was trying to show a window using ShowWindow
in a Callback function that called is set by a SetTime
after I have hided it, but it didn't worked.
Please check the following code example.
#define _WIN32_WINNT 0x0500
#include<windows.h>
void CALLBACK f(HWND hwnd, UINT uMsg, UINT timerId, DWORD dwTime)
{
MessageBoxA(NULL,"Test","test2",MB_OK);
ShowWindow( hwnd, SW_SHOW ); //This will not show the window :(
MessageBoxA(NULL,"Is it shown?","test2",MB_OK);
}
int main()
{
MSG msg;
ShowWindow( GetConsoleWindow(), SW_HIDE );
SetTimer(NULL, 0, 1000*3, &f);
while(GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}
Thank you.