Re: [Dev-C++] How do you find a file's path?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: MaXxX <ma...@rp...> - 2003-01-22 08:34:24
|
On Wednesday, January 22, 2003, at 10:27 +0530 (which was 05:57 where I live), you scribbled the following: >> I have developed a basic application using C++-Dev that creates a >> process that runs IExplorer. Unfortunately, CreateProcess will not >> launch IExplorer unless I specify the latter's complete path (e.g., >> C:\program files\Explorer\ieexplore.exe) as second parameter value: >> CreateProcess( NULL, "C:\\Program Files\\Explorer\\Iexplore.exe", ...). >> I would like to search for IExplorer on the user's PC before creating >> the process. What is the easiest way to do that on Windows? > You'll have to do a recursive search on all available disks, or, if you want > to save time, only on the primary disk (the one with windows - use > GetWindowsDirectory() for identifying it), using FindFirstFile() and > FindNextFile(). You could also use the registry settings. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE -- Brain fried; core dumped. |\ /| \~~~/ \~~~/ WWW: http://none :( | \/ | /\ > < \~/ > < E-M: maxxx[at]rpg.pl |____| /__\ /___\ /_\ /___\ ICQ: 3146019 |