Solved

CreateProcess and STARTUPINFO

Posted on 1997-08-18
2
1,017 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
Comment Utility
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
Comment Utility
Perfect. Pretty simple, guess I should have done more digging. Thanks.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
bobThere java chalenge 45 81
Get filename and folder into excel 7 67
Host to IP 7 73
How to know only "File created" with EventLog 3 29
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now