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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bringing an application to the top

Status
Not open for further replies.

BlackTL

Technical User
Aug 11, 2003
29
US
Hi Guys,

I was wondering if anyone here knows how to automatically bring an application to the top when it receives a specific message from the server.

Any help would be appreciated!

Thanks,
Rosh
 
Damnit! I can't believe it was that easy. I tried for hours to get this darn thing working! Is there anyway to remember what window order my application was? I basically wanted to get the application -> Bring it to the top -> If the user wishes to ignore a message, the application will go back to the position/order it was before it was brought to the top. Make sense?

Thank you for your help!

Roshan
 
BlackTl,

If your prompt will always be launched from the same window, then do this..
Code:
[green]//Create an object of the parent class in the prompt's .h file[/green]
[blue]
CYourOriginalClass *mParent;
[/blue]
[green]//When you initialize the prompt in the first window set the parent there[/green]
[blue]
CMyPrompt *Test;
Test= new CMyPrompt(this);
[red]Test->mParent=this;[/red]
Test->DoModal();
[/blue]

[green]//Then in your prompt when you want to show the window again do this[/green]
[blue] this->mParent->SetFocus(); [/blue]
[green]//or[/green]
[blue] this->mParent->SetForeGroundWindow(); [/blue]
[green]//Which ever one tickles your fancy the most![/green]

Hope that helps,
Ron [thumbsup2]

cout << "If you don't know where you want to go, we'll make sure you get taken";
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top