m3
asked on
VC++: keeping the application window in foreground
I want to to keep the dialog box in foreground like the Windows NT Task Manager Window.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I still doesn't know how I can get the first parameter which is the handle to my window. I tried GetWindow but it still struggling with it.
If you are using MFC, the m_hWnd member contains the window handle.
ASKER
How I couldn't get this parameter in InitInstance, may be because my window is related a my view Class and I don't know how I can export it to App class.
I tried to implemented directly in my view class but because the View Class drives from CWnd it understands that I'm using Cwnd:SetWindowPos which is a different function.
I tried to implemented directly in my view class but because the View Class drives from CWnd it understands that I'm using Cwnd:SetWindowPos which is a different function.
Add :: before SetWindowPos
::SetWindowPos
CWnd::SetWindowPos is exactly the same function as the ::SetWindowPos, but you don't have to specify the window handle, it takes it automaticly from m_hWnd. IF your window is a dialog, do it in the OnInitDialog member
::SetWindowPos
CWnd::SetWindowPos is exactly the same function as the ::SetWindowPos, but you don't have to specify the window handle, it takes it automaticly from m_hWnd. IF your window is a dialog, do it in the OnInitDialog member
ASKER
Finally, it works.
Thanks.
Thanks.
ASKER