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

Startup Window Position

Status
Not open for further replies.

sweep123

Technical User
May 1, 2003
185
0
0
GB
I am trying to start two instances of an application with the Window position a bit different for each application - i.e. cascade.

But one hide the other, what am I doing wrong, see code snipit below.

if(g_pIDX2->GetCheck ())
{
GetStartupInfo(&si[1]);
// Set the position of the window for IDX 2
si[1].dwFlags = si[1].dwFlags | STARTF_USEPOSITION;
si[1].dwX = 20;
si[1].dwY = 20;
CreateProcess(NULL, "c:\\IDX_Emu\\debug\\IDX_Emu.exe", // Name of app to launch
NULL, // Default process security attributes
NULL, // Default thread security attributes
FALSE, // Don't inherit handles from the parent
0, // Normal priority
NULL, // Use the same environment as the parent
NULL, // Launch in the current directory
&si[1], // Startup Information
&pi[1]); // Process information stored upon return
}
if(g_pIDX3->GetCheck ())
{
GetStartupInfo(&si[2]);
// Set the position of the window for IDX 2
si[2].dwFlags = STARTF_USEPOS
 
use SetWindowPos

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
OK but how? I only have a handle to the process or thread and SetWindowPos required CWnd.

Also I dont understand why the original code did not position the Windows offset from each other.

Regards,

Sweep123
 
ok, I have understood you now,
you can specify coordinates in Create, the parameter RECT&.

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top