Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Windows COM Shell Explorer , +
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 16-Nov-12 20:14pm
ohsorry564
Edited 17-Nov-12 14:36pm
v3
Comments
Sergey Alexandrovich Kryukov at 17-Nov-12 22:04pm
   
What is "files selected message" and "message" in general? What does it mean its "selection"?
--SA
ohsorry at 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 at 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 at 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 at 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
ohsorry at 18-Nov-12 0:55am
   
i don't need to handle single click.i just need to query the selected file name from Explorer's syslistview32 control.
Sergey Alexandrovich Kryukov at 18-Nov-12 11:02am
   
On what event? I guess this is the only issue now...
--SA
ohsorry at 18-Nov-12 19:57pm
   
……

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

  Print Answers RSS
0 OriginalGriff 240
1 Kamal Rocks 184
2 BillWoodruff 173
3 Sergey Alexandrovich Kryukov 170
4 PIEBALDconsult 160
0 OriginalGriff 5,695
1 DamithSL 4,506
2 Maciej Los 4,007
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,180


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 17 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100