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

Recommended Answers

All 3 Replies

Check out FindWindow(). You'll need the Explorer class name, which is "ExploreWClass".

commented: A little elaboration would have been better, but great response. +12

god but will it give me the address of files on the desktop

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);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.