Solved

CreateProcess and STARTUPINFO

Posted on 1997-08-18
2
1,022 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Thin secure Windows 10 5 102
Excel file not created as expected 7 79
Problem to App 4 97
Increment column based of a FK 8 31
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

829 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