Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Fri, 28 Mar 2008 06:28:43 -0700,    group: microsoft.public.platformsdk.shell        back       


ShellExecuteEx and Directory   
When I call ShellExecuteEx and set the Directory parameter to a path
shouldn't the new process's current directory be set to that path?  I
am not seeing that happen unless I set the current directory of my
process to that directory then call ShellExecuteEx.   The apparently
the new process inherites the current directory of my process and it
works.   Any thoughts?

Jim
-- 
www.mustangpeak.net
date: Fri, 28 Mar 2008 06:28:43 -0700   author:   Jim

Re: ShellExecuteEx and Directory   
Jim wrote:
> When I call ShellExecuteEx and set the Directory parameter to a path
> shouldn't the new process's current directory be set to that path?

Yes, and it works fine for me. For example, the following code opens a new instance of Notepad with the current directory set to "C:\":

SHELLEXECUTEINFO info = {sizeof(info)};
info.lpFile = _T("notepad.exe");
info.lpDirectory = _T("c:\\");
info.nShow = SW_SHOW;
ShellExecuteEx(&info);

Do you have a specific example of something that's not working for you?

-- 
Jim Barry, Microsoft MVP
date: Fri, 28 Mar 2008 13:52:20 -0000   author:   Jim Barry

Re: ShellExecuteEx and Directory   
Jim Barry wrote:

> Jim wrote:
> > When I call ShellExecuteEx and set the Directory parameter to a path
> > shouldn't the new process's current directory be set to that path?
> 
> Yes, and it works fine for me. For example, the following code opens
> a new instance of Notepad with the current directory set to "C:\":
> 
> SHELLEXECUTEINFO info = {sizeof(info)};
> info.lpFile = _T("notepad.exe");
> info.lpDirectory = _T("c:\\");
> info.nShow = SW_SHOW;
> ShellExecuteEx(&info);
> 
> Do you have a specific example of something that's not working for
> you?

Sorry to waste your time Jim, I think I recieved some incorrect
information.  It is working for me too.

Jim
-- 
www.mustangpeak.net
date: Fri, 28 Mar 2008 09:41:21 -0700   author:   Jim

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us