0

I have an application that displays a dialogue box during operation. The issue is that sometimes I'll have multiple applications open and this dialogue box will appear behind those others.

Can I administratively tell Windows to always give certain applications foreground priority? So if/when they pop-up a window, it'll always be on top?

Mike B
  • 2,690

1 Answers1

1

There is no global setting for this. The applications itself must support this (set the wndTopMost flag) and must give you an option whether you want this feature or not (like Taskmgr.exe)

magicandre1981
  • 98,168
  • 30
  • 181
  • 248
  • It's possible to inject this flag from another program. In fact, fairly trivial. – Bob Jul 22 '14 at 04:04
  • @bob injecting 3rpd party code is possible but an ugly hack which can cause system stability issue, that's why I don't post this as suggestions. – magicandre1981 Jul 22 '14 at 04:05
  • wndTopMost is not fully correct - that's purely a MFC thing. The correct Win32 function is SetWindowPos with HWND_TOPMOST. All it requires is a handle to the window (again easy, with another Win32 function), actually, and there's nothing really unsafe about calling this from a process that does not own the window. It's not an ugly hack, and there's no "code injection" going on. – Bob Jul 22 '14 at 04:12
  • The only potential instability is if the target window somehow relied on not being on top (and I can't think of any reason that would happen). And even then that's not system instability, just the one application. – Bob Jul 22 '14 at 04:14