Hi. My program has two dialogs, main and sub.
Once i click a button, sub dlg will be shown up.
Here is code.
I want the sub dlg to be on TOP_MOST of all windows on the desk top.
So, I did like this,
::SendMessaage(dlg.GetSafeHwnd(), HWND_TOPMOST, rt.left, rt.top, rt.width(), rt.height());
However, it didn't work. I mean, the sendmessage might not work.
What's the problem?? When I sendMessage with main Dlg, it works.
You don't use SendMessage() for that. I guess you mixed up. I guess you meant SetWindowPos(): http://msdn.microsoft.com/en-us/library/windows/desktop/ms633545(v=vs.85).aspx .
You have to do the call to SetWindowPos() AFTER the dialog box window has been created (so you can get a handle, but BEFORE you enter the modal loop. I guess the best place would be during initialization? This looks like MFC, so see of that works for you.