|
-
March 11th, 2009, 06:04 AM
#1
capturing explorer events
how can we capture the file name and path that is selected in my computer or explorer in windows normally in our program...plz any way i fthere plz tell i really need it
-
March 11th, 2009, 06:29 AM
#2
Re: capturing explorer events
Well you will need to hook into windows. And for doing that you should have good understanding in Win32 APIs. Start with SetWindowsHook API and then you will find that it will take more than just 1 API to do that.
-
March 11th, 2009, 12:18 PM
#3
Re: capturing explorer events
vikrant3mahajan,
This will capture the file path you select and assign it to a string FileName.
Code:
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
openFileDialog.Filter = "Excel Files (*.xls)|*.xls|All Files (*.*)|*.*";
if (openFileDialog.ShowDialog(this) == DialogResult.OK)
{
string FileName = openFileDialog.FileName;
}
-
March 11th, 2009, 12:34 PM
#4
Re: capturing explorer events
@admdev: The OP is looking for a hook into Windows Explorer here. It doesn't sound like he wants to open his own dialog. Also, you should wrap that in a using statement so that the dialog is disposed of after the code has run
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|