I have this little 'note' window, But I need help to get it to stay on the foreground of your window.
I'm using the Dev-BloodShed C++ compiler. Version 4.9.9.2
this is the code:
1 2 3 4 5 6 7 8
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
MessageBox(NULL, "You won't stay on the foreground!", "Note", MB_OK);
return 0;
}
Look this is what I mean, If I mix C++ with Win32 the win32 will appear on the background, that way you can't see it unless the C++ program has ended.
In order for a modal dialog box to stay on the foreground, it must be owned by the window having the focus, and your message boxes are orphans (first parameter of MessageBox).
Try to create a window for your application first.