CreateProcess ignores dwX,dwY parameters in STARTUPINFO

G

Guest

I am trying to create a process at a particular set of coordinates (for
example 1,1) but the CreateProcess api seemingly ignores the settings in the
dwX and dwY properties of the STARTUPINFO structure which I have initialized
as follows:

STARTUPINFO si;
ZeroMemory((PVOID)&si, sizeof(si));
si.cb = sizeof(si);
si.dwFlags = STARTF_USEPOSITION;
si.dwX = 1;
si.dwX = 1;

PROCESS_INFORMATION pi;

and start the application as follows:

CreateProcess(NULL, "notepad.exe", NULL, NULL, FALSE,
CREATE_DEFAULT_ERROR_MODE, NULL, NULL, &si, &pi);

The application window is not displayed at coordinates 1,1.
 
J

Jochen Kalmbach [MVP]

Hi itmanager!
I am trying to create a process at a particular set of coordinates (for
example 1,1) but the CreateProcess api seemingly ignores the settings in the
dwX and dwY properties of the STARTUPINFO structure

I doubt that CreateProcess ignores these settings.
The problem is that the called application must handle these parameters
which are passed in WinMain...
CreateProcess(NULL, "notepad.exe", NULL, NULL, FALSE,
CREATE_DEFAULT_ERROR_MODE, NULL, NULL, &si, &pi);

And it seems that notepad is not using these values...

See: GetStartupInfo
http://msdn.microsoft.com/library/en-us/dllproc/base/getstartupinfo.asp


Greetings
Jochen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top