Link to home
Start Free TrialLog in
Avatar of superleo
superleo

asked on

How to make messagebox prompting on the top of window?

Hi! experts,
When focus is on Internet explorer or other application, my messagebox prompts at the back of the current screen.  So, I don't know the message box is prompting out.
How can I make a messagebox being on the top of windows when everytime it prompts user?
ASKER CERTIFIED SOLUTION
Avatar of DanRollins
DanRollins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 1cand01t
1cand01t


with ur own dialog box or message window u can use following function to place ur window at the topmost position without disturbing or changing ur focus from other applications.
(like MSN Messenger popup messages):

BOOL SetWindowPos (
const CWnd* pWndInsertAfter,
int x,
int y,
int cx,
int cy,
UINT nFlags );

for example:

SetWindowPos(&wndTopMost,0,0,200,100,SWP_NOACTIVATE);

'wndTopMost' will place ur dialog box or Window at the topmost level, and 'SWP_NOACTIVATE' will prevent shifting ur focus from any other application.

i hope this will help u.

good luck