Article View: borland.public.cppbuilder.nativeapi
Article #6657Re: Positioning the window opened by ShellExecute()
From: Vladimir Stefanovic
Date: Thu, 21 Apr 2005 18:31
Date: Thu, 21 Apr 2005 18:31
71 lines
3429 bytes
3429 bytes
Thangs again,
I saved the topic and will try the code tomorrow.
--
Best regards,
Vladimir Stefanovic
"John" <john@nospam> wrote in message
news:opsplhcdgptqe2av@news.noeatingpuzzlepieces...
> Hi Vladimir!
>
>> In Win32API Help it says:
>>
>> <quote>
>> SW_SHOWDEFAULT Sets the show state based on the SW_ flag
>> specified in the STARTUPINFO structure passed to the CreateProcess
>> function by the program that started the application. An application
>> should call ShowWindow with this flag to set the initial show state of
>> its
>> main window.
>> <quote>
>>
>> But I do not know how to use that...
>>
>
> It is simple when you know how. See for yourself.
>
>
>
> DWORD ReturnCode;
> STARTUPINFO StartupInfo;
> PROCESS_INFORMATION ProcessInformation;
> BOOL bProcessOk;
>
> memset( &StartupInfo, 0, sizeof(STARTUPINFO) );
> StartupInfo.cb = sizeof( STARTUPINFO );
> StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
>
>
> // StartupInfo.wShowWindow = SW_SHOWMINNOACTIVE;
> // StartupInfo.wShowWindow = SW_HIDE;
> StartupInfo.wShowWindow = SW_SHOWNORMAL;
>
> memset( &ProcessInformation, 0, sizeof(PROCESS_INFORMATION) );
>
> bProcessOk = CreateProcess( (LPCTSTR) NULL, // pointer
> to name of executable module
> (LPTSTR) szCommand, // pointer
> to command line string
> (LPSECURITY_ATTRIBUTES) NULL, // pointer
> to process security attributes
> (LPSECURITY_ATTRIBUTES) NULL, // pointer
> to thread security attributes
> (BOOL) TRUE, // handle
> inheritance flag
> (DWORD) CREATE_NEW_CONSOLE |
> NORMAL_PRIORITY_CLASS, // creation flags
> (LPVOID) NULL, // pointer
> to new environment block
> (LPCTSTR) NULL, // pointer
> to current directory name
> (LPSTARTUPINFO) &StartupInfo, // pointer
> to STARTUPINFO
> (LPPROCESS_INFORMATION)
> &ProcessInformation ) ; // pointer to PROCESS_INFORMATION
> if ( !bProcessOk ) {
> // Error treatment...
> ReturnCode = GetLastError();
> }
Technical Details
Message-ID:
<4267f199@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<4267b289@newsgroups.borland.com> <l4pf61d2lil1m87birrtkr4e37h5qlsee9@4ax.com> <4267e96b@newsgroups.borland.com> <opsplhcdgptqe2av@news.noeatingpuzzlepieces>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,1bac591bc979b6c X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Vladimir Stefanovic" <antivari@po.sbb.co.yu> Newsgroups: borland.public.cppbuilder.nativeapi References: <4267b289@newsgroups.borland.com> <l4pf61d2lil1m87birrtkr4e37h5qlsee9@4ax.com> <4267e96b@newsgroups.borland.com> <opsplhcdgptqe2av@news.noeatingpuzzlepieces> Subject: Re: Positioning the window opened by ShellExecute() Date: Thu, 21 Apr 2005 20:31:43 +0200 Lines: 73 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 NNTP-Posting-Host: 82.117.212.65 Message-ID: <4267f199@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1114108313 82.117.212.65 (21 Apr 2005 11:31:53 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail