Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows always on top..

Status
Not open for further replies.

ronnyjljr

IS-IT--Management
Nov 23, 2003
249
US
I strike again!

I had posted a little while ago about one of my sub dialogs popping up and being always on top. I am still having the same problem. I have a main dialog that shows. Then I call another dialog through:

Code:
[blue]
CMyDialog *Test;
Test = new CMyDialog(this);
Test->CREATE(IDD_MYDIALOG,this);
Test->ShowWindow(1);
[/blue]

The window shows up and is always on top even when it loses focus (stays on top but the title bar is dimmed). I have tried playing with the three states of the windows (POPUP,CHILD,OVERLAPPED) and none of them solve this problem.

What could it be?

Thanks,
Ron

/**************
Me: When will the project be finished?
Them: What project?
Me: The one you have been working on for the last 3 years!
Them: Ohh, we can't finish it?
Me: Why?
Them: We don't know how to program...
 
Well if you don't want the window to always be on top, then just make it a normal window instead of a dialog.
 
The program is completely dialog based. So a "Normal" window will not work.

-Ron

/**************
Me: When will the project be finished?
Them: What project?
Me: The one you have been working on for the last 3 years!
Them: Ohh, we can't finish it?
Me: Why?
Them: We don't know how to program...
 
you can try with:

SetActiveWindow(this->m_hWnd);
SetForegroundWindow(this->m_hWnd);

after your code.

Do not forget to call DestroyWindow to close the modeless window.

HTH,

s-)

Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top