Anyone know which function to call to get me the handle of the file currently selected? Or any information about it at all?
Anyone know which function to call to get me the handle of the file currently selected? Or any information about it at all?
CreateFile or OpenFile might help you.
* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with xfce4.
They would, but I need to find which file to Open/Create, first, that's the problem.
FindFirstFile and FindNextFile might be of some use
http://www.adrianxw.dk/SoftwareSite/index.html
Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.
- Mike McShaffry
Do you mean selected via the default open dialog?
If so, you want to look at the GetOpenFileName function.
The path is pointed to by lpstrFile in the OPENFILENAME struct
Open source isn't a matter of life or death......
.......its much more important than that!!
SuSE Linux - GCC 3.4.2
XP Pro - Visual Studio 2005 TS, MinGW 3.4.2
No, I mean, when you're on the desktop, you have no windows/dialogs open, and you select a file, by single-clicking on it. It highlights blue. Windows has to keep the handle for that file somewhere. I just need to know where.
I don't think a handle is created for it until you try to open it. Highlighting it probably does nothing "under the hood".
Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.
- Mike McShaffry
Well, windows has to have some way of figuring out which file you have selected if you open it via the enter key... it's obviously stored SOMEWHERE... there's no function to get any information about the file?
Not in the way you're talking about. The other methods suggested here will though and knowing the Windows API there's probably more ways of getting all sorts of information too.
Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.
- Mike McShaffry
When you select a file using explorer.exe, only that program knows where it is. Since explorer.exe is a separate application, you can't find out directly what file is selected. However since it probably uses a ListView control, you could do some complicated DLL injection and message hooking, but I don't think it's worth it.Originally Posted by Erondial
Okay. Thanks.