1

Is it possible create MFC form that cold stay on the top of all applications on PC not allowing to do anything else without entering required information.

vico
  • 17,051
  • 45
  • 159
  • 315
  • possible duplicate of [Always-in-front dialogs](http://stackoverflow.com/questions/593403/always-in-front-dialogs) – Helix Quar Apr 04 '14 at 05:51

2 Answers2

0

Win32 doesn't support system-modal dialogs any more, as far as I'm aware. This is a relic from 16 bit Windows versions.

You can try yourself with a MB_SYSTEMMODAL type MessageBox.

Closest thing would be to utilize a screen-sized window to display a dimmed desktop background while your dialog is shown. This simulates the behaviour of the user account control -- except that you still can switch tasks.

thomiel
  • 2,467
  • 22
  • 37
0

You can obtain something similar setting your window on "TopMost". You can do it on property sheet in design mode, or programmatically with this line:

SetWindowPos( pWnd->m_hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE );

Hope this will fit your needs.

IssamTP
  • 2,408
  • 1
  • 25
  • 48