home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!mips!decwrl!decwrl!infopiz!lupine!motcsd!udc!mcdphx!ennews!intertel!boyd_m
- From: boyd_m@inter-tel.com (Mark Boyd)
- Newsgroups: comp.os.ms-windows.programmer.misc
- Subject: Re: Where is the executable?
- Message-ID: <1992Aug20.003734.12504@inter-tel.com>
- Date: 20 Aug 92 00:37:34 GMT
- References: <157930002@hpcvra.cv.hp.com>
- Organization: Inter-Tel, Inc. (Chandler, AZ)
- Lines: 17
-
- In <157930002@hpcvra.cv.hp.com> daveo@hpcvra.cv.hp.com (Dave Ochs) writes:
-
- >This is probably something simple I have overlooked, but is there a way
- >to tell exactly where a program is executing from ... I am not talking
- >about the "current directory," but where the executable is?
-
- GetModuleFileName fills a "string" with the fully quailifed path of your
- executable. Here's the C prototype:
-
- int GetModuleFileName (HINSTANCE hInst, LPSTR lpszFilename,
- int cbFileName);
-
- --
- +-----------------------------------------------------------------------------+
- | Mark Boyd | Internet: boyd_m@inter-tel.com |
- | Inter-Tel, Inc. | "Is anybody home...Mary" - Queensryche OMC |
- +-----------------------------------------------------------------------------+
-