DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C++ (http://www.daniweb.com/forums/forum8.html)
-   -   windows api help (http://www.daniweb.com/forums/thread181761.html)

nsvanjani Mar 16th, 2009 2:33 am
windows api help
 
hello programmers
is there any win32 api or technique by which we can fetch the address of the active window of explorer(not the internet explorer)

please help

MrSpigot Mar 16th, 2009 7:43 am
Re: windows api help
 
Check out FindWindow(). You'll need the Explorer class name, which is "ExploreWClass".

nsvanjani Mar 17th, 2009 4:12 am
Re: windows api help
 
god but will it give me the address of files on the desktop

MrSpigot Mar 17th, 2009 5:17 am
Re: windows api help
 
Quote:

Originally Posted by nsvanjani (Post 826659)
god but will it give me the address of files on the desktop

Well no.... it will give you the address of an active File Explorer window as requested.
If you just want to get to files on the desktop you can just look at the contents of C:\WINDOWS\DESKTOP, or better still, as Windows may be installed elsewhere, use the DESKTOP subdir of GetWindowsDirectory().
Or better still use:
LPITEMIDLIST pidl; 
SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP,  &pidl);
// Convert the item ID list's binary
// representation into a file system path
char szPath[_MAX_PATH];
SHGetPathFromIDList(pidl, szPath);


All times are GMT -4. The time now is 1:23 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC