Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Sun, 7 Sep 2008 07:46:38 -0700 (PDT),    group: microsoft.public.win32.programmer.ui        back       


Program Folder?   
How do I retrieve the current program's start-up directory in Win32 C?
date: Sun, 7 Sep 2008 07:46:38 -0700 (PDT)   author:   Harry Potter

Re: Program Folder?   
>How do I retrieve the current program's start-up directory in Win32 C?

Just use magic Harry.

... alternatively...

If you're looking for the start-up directory, it'll be what
GetCurrentDirectory returns at the start of your application. If
you're actually looking for the directory the EXE is in, use
GetModuleFileName with a NULL module handle and parse the resultant
path to get the directory.

Dave
date: Sun, 07 Sep 2008 16:01:45 +0100   author:   David Lowndes lid

Re: Program Folder?   
On Sep 7, 3:46 pm, Harry Potter  wrote:
> How do I retrieve the current program's start-up directory in
> Win32 C?

GetCurrentDirectory (before you've changed it to something else, of
course).

http://msdn.microsoft.com/en-us/library/aa364934(VS.85).aspx

Richard.
http://www.rtrussell.co.uk/
To reply by email change 'news' to my forename.
date: Sun, 7 Sep 2008 08:03:13 -0700 (PDT)   author:   unknown

Re: Program Folder?   
I's quite possible the current directory is not the EXE dir. That might 
happen very often, for example, if the exe was started by opening an 
associated document file.

"David Lowndes" <DavidL@example.invalid> wrote in message 
news:mvq7c4t152i4n9ojg3kq8eej6553e0oqff@4ax.com...
> >How do I retrieve the current program's start-up directory in Win32 C?
>
> Just use magic Harry.
>
> ... alternatively...
>
> If you're looking for the start-up directory, it'll be what
> GetCurrentDirectory returns at the start of your application. If
> you're actually looking for the directory the EXE is in, use
> GetModuleFileName with a NULL module handle and parse the resultant
> path to get the directory.
>
> Dave
date: Sun, 7 Sep 2008 18:10:40 -0700   author:   Alexander Grigoriev

Re: Program Folder?   
>I's quite possible the current directory is not the EXE dir.

I know. The OP asked for the "start-up directory".

Dave
date: Mon, 08 Sep 2008 11:38:36 +0100   author:   David Lowndes lid

Re: Program Folder?   
People often mean either "EXE directory" and/or "current directory"when they 
ask for "startup" directory.

"David Lowndes" <DavidL@example.invalid> wrote in message 
news:s30ac4p6mcnnldiktpc68a8rurid68jt40@4ax.com...
> >I's quite possible the current directory is not the EXE dir.
>
> I know. The OP asked for the "start-up directory".
>
> Dave
date: Tue, 9 Sep 2008 21:18:55 -0700   author:   Alexander Grigoriev

Re: Program Folder?   
>People often mean either "EXE directory" and/or "current directory"when they 
>ask for "startup" directory.

Which is why I gave both possible answers in my original reply :)

Dave
date: Wed, 10 Sep 2008 08:05:38 +0100   author:   David Lowndes lid

Re: Program Folder?   
On Sep 8, 2:10 am, "Alexander Grigoriev"  wrote:
> I's quite possible the current directory is not the EXE dir. That
> might happen very often, for example, if the exe was started by
> opening an associated document file.

Or simply by running the EXE by means of a shortcut, in which case the
'startup' directory is set according to the 'Start in:' property.

Richard.
http://www.rtrussell.co.uk/
To reply by email change 'news' to my forename.
date: Wed, 10 Sep 2008 12:37:29 -0700 (PDT)   author:   unknown

Google
 
Web ureader.com


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