seuwind
asked on
how to put my dialog top of all windows
I have a thread to monitor a special event. if the event happens, the thread will send a message to my main program.
Then the program will creat a modal dialog. I hope this dialog displays at the top of all windows. I learned SetForegroundWindows can do it. I put this function in the dialog class( in OnInitdialog),but it can't work. What's wrong?
Then the program will creat a modal dialog. I hope this dialog displays at the top of all windows. I learned SetForegroundWindows can do it. I put this function in the dialog class( in OnInitdialog),but it can't work. What's wrong?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, DrDelphi and Rheinqold
I do as you told me, but it still doesn't work. I wonder where should I call the SetWindowPos. Is it true to call it in OnInitDialog?
I do as you told me, but it still doesn't work. I wonder where should I call the SetWindowPos. Is it true to call it in OnInitDialog?
ASKER
Oh, I success
It is true to call SetWindowPos in OnInitDialog. I made a mistake just now.Now it works properly.But I still want to know why SetForegroundWindow doesn't work. If you know,pleas tell me.
Thank you.
Regards
It is true to call SetWindowPos in OnInitDialog. I made a mistake just now.Now it works properly.But I still want to know why SetForegroundWindow doesn't work. If you know,pleas tell me.
Thank you.
Regards
Thanx for the points, but I'm sorry that I don't know why SetForegroundWindow didn't work.
Good luck!!