Click here to Skip to main content
15,881,709 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
How can i capture the file selected message in Windows Explorer?

on desktop or in windows explorer if a file or a folder's (or something else with a icon ) status is selected,then show a messagebox and print it's full name?

if multiple selected print all of them?
suppose I have the Explorer Window handler.

thankyou.

[edit]unnecessary code block removed[/edit]
Posted
Updated 17-Nov-12 13:36pm
v3
Comments
Sergey Alexandrovich Kryukov 17-Nov-12 22:04pm    
What is "files selected message" and "message" in general? What does it mean its "selection"?
--SA
ohsorry 17-Nov-12 22:51pm    
files selected message,for instance,you click a file in your Explore window,then the file is selected.do i make myself clear?maybe not a message,a event?
Sergey Alexandrovich Kryukov 17-Nov-12 22:59pm    
If you mean the Explorer application, the one ready-to-use, bundled with Windows, you can write some application which can be registered as Shell extension; then it will be always working not just with Explorers, but with any Shell-based alternative file managers, which is very important. The problem though is: I don't think the selection itself is the even you can hook. But you can add items to context menu and handle menu items. Besides, you can just register a file type, so some your application will be executed as "Run"...
--SA
ohsorry 17-Nov-12 23:11pm    
Sergey Alexandrovich Kryukov,thank you very much.as you said,i will try to write some contextmenu shell extentsion.but i still want do this,when i click a file in Explorer window,immediately show a messagebox print the file's full name.any way i can do this?i'v read this article Querying information from an Explorer window:http://blogs.msdn.com/b/oldnewthing/archive/2004/07/20/188696.aspx
but i can not translate it to C#.
In Window 7,there is a detail bar in the bottom of Explorer window,when user select a file,the bar will show some more detail information about the file.
that is exactly what i want to do.
Sergey Alexandrovich Kryukov 18-Nov-12 0:34am    
I doubt you can do it: a single click just selects. You can do it on double click. Besides, you don't really want to handle a single click: it will disrupt standard UI behavior.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900