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

Bring a window to the front.

Status
Not open for further replies.

AbelMorelos

Programmer
Jun 10, 2005
6
MX
Hello guys! I'm a Java programmer switching to C++(I'm starting to like this language but I´m very far of being good enought with C++)... and for now I need the assistance of some experts.

I have a Java application running under the "System" account, and I have to launch a GUI(display a chm file) when the user presses a "Help" button. When you press this button, I send a message(using JNI) to a NamedPipe to spawn the needed process, I'm doing this because I need this process to run under the current logged user account in Windows instead of the System account. But I have a problem, in some machines this GUI appears in the front of my application, and this is ok, but in other machines my Help window is behind my application(it seems to be happening always in Win2k and in some machines with XP). The question is: There is some way to force my Help window to be always in the front? I'm using a CreateProcess call to launch the Help window.

This defect was assigned to me, because the code owner is on vacations, so, help plese!

Regards!
Abel Morelos

 
The CreateProcess has a parameter defined as LPSTARTUPINFO lpStartupInfo which is a pointer to a STARTUPINFO structure.
This structure has two members of interest:
* dwFlags which must be set to STARTF_USESHOWWINDOW
* wShowWindow which must be set to SW_SHOWNORMAL or SW_SHOW (the only difference is that for SW_SHOWNORMAL, "If the window is minimized or maximized, the system restores it to its original size and position")

Did you try that?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top