F5 Programmatically

Announcements and discussion for PInvoke

Moderators: Luke Jefferson, Robert

F5 Programmatically

Postby bhaidar » Tue Oct 28, 2008 4:37 pm

Hello,
I have developed a Shell Extension in C# using the EZnamespace Framework.

I need to programmatically call "F5" on Windows from my code.

What method I shall call on the Win32 API to simulate the F5 key?

Thank you
bhaidar
 
Posts: 4
Joined: Tue Oct 28, 2008 4:34 pm

Postby Robert » Tue Oct 28, 2008 5:14 pm

Hi,

Have a look at http://www.codeproject.com/KB/cpp/sendkeys_cpp_Article.aspx - it's an example in C++, but it should give you pointers to the right APIs to be looking at...

Hope that helps,
Robert
Robert Chipperfield
Developer, Red Gate Software Ltd
Robert
 
Posts: 410
Joined: Mon Oct 30, 2006 11:15 am
Location: Cambridge, UK

Postby bhaidar » Tue Oct 28, 2008 5:27 pm

That's cool!

Thanks a lot. I will have a look at it and come back for any further questions!

Thanks
bhaidar
 
Posts: 4
Joined: Tue Oct 28, 2008 4:34 pm

Postby bhaidar » Wed Oct 29, 2008 9:45 am

Hi Robert,
That article was of great help.
I found SendKeys.Send() method in C# helpful to do what I want.

I still need one more thing please, is there a Win32 API method to call the "Auto-Fit" inside Windows Explorer?

In Windows Vista, you can right-click a column and then click "Auto Fit all columns". Is there a method inside the Win32 API that help me do this programmatically?

Thank you.
bhaidar
 
Posts: 4
Joined: Tue Oct 28, 2008 4:34 pm

Postby Robert » Wed Oct 29, 2008 10:34 am

Glad to hear you've got it working :-).

I'm afraid I don't know of a way of doing the auto-fit programmatically, but I've not really played around a lot with shell extensions, so I'm probably not the best person to ask!

Someone did post a similar question on MSDN, but there haven't been any replies yet.

Cheers,
Robert
Robert Chipperfield
Developer, Red Gate Software Ltd
Robert
 
Posts: 410
Joined: Mon Oct 30, 2006 11:15 am
Location: Cambridge, UK

Postby bhaidar » Wed Oct 29, 2008 11:12 am

Thanks Robert for all your help.

I hope someone would jump in and help on the issue of Auto-Fit.

Thanks
bhaidar
 
Posts: 4
Joined: Tue Oct 28, 2008 4:34 pm


Return to PInvoke.Net

Who is online

Users browsing this forum: Majestic-12 [Bot] and 0 guests