VC++: keeping the application window in foreground

I want to to keep the dialog box in foreground like the Windows NT Task Manager Window.
m3Asked:
Who is Participating?
 
MikeP090797Commented:
Use:
SetWindowPos(hWnd, HWND_TOPMOST, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE
0
 
m3Author Commented:
Edited text of question
0
 
m3Author Commented:
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.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
MikeP090797Commented:
If you are using MFC, the m_hWnd member contains the window handle.
0
 
m3Author Commented:
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.

0
 
MikeP090797Commented:
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
0
 
m3Author Commented:
Finally, it works.
Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.