Solved

CreateProcess and STARTUPINFO

Posted on 1997-08-18
2
1,024 Views
Last Modified: 2013-11-19
I am launching an MFC application using the CreateProcess function from antother MFC app and am trying to set the initial position and size of the new application by using the dwX, dwY, dwXSize, and dwYSize members of the STARTUPINFO structure. The documentation states that "these coordinates are only used if the child process creates its first overlapped window with CW_USEDEFAULT" as parameters for x and nWidth in CreateWindow. How can you set these parameters in CreateWindow in an MFC app? I tried setting the cx and x memebrs of the CREATESTRUCT in PreCreateWindow, but this does not work. How can I set the initial position and size of an MFC app created using CreateProcess?
0
Comment
Question by:JagerM
2 Comments
 
LVL 1

Accepted Solution

by:
cnasarre earned 150 total points
ID: 1304080
Your launched application should call GetStartupInfo() at the
end of InitInstance() and call AfxGetMainWnd()->MoveWindow()
with the retrieved parameters in order to set its initial
position
0
 

Author Comment

by:JagerM
ID: 1304081
Perfect. Pretty simple, guess I should have done more digging. Thanks.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question