By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,327 Members | 849 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,327 IT Pros & Developers. It's quick & easy.

Systemwide-HotKey

P: n/a
Hi all
Can anybody suggest a very simple system-wide hotkey?

A bit of Example code is what I am looking for

Thanks in advance

Farhana

Nov 13 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
fa*********@yahoo.co.in wrote:
Hi all
Can anybody suggest a very simple system-wide hotkey?

A bit of Example code is what I am looking for

Thanks in advance

Farhana
Public Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As
IntPtr, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal s As String)
As Int32
Const WM_SETHOTKEY As Long = &H32
Const HotKey_Alt_F12 As Long = &H47B

Private Sub MainFrm_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

SendMessage(Me.Handle, WM_SETHOTKEY, HotKey_Alt_F12, 0)

End Sub
This example will create a system-wide Hotkey combination of Alt-F12.
Press this combination and your application will be given the focus,
even if it's been minimized. (Watch for wrapping)

Hope this helps.

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
Nov 13 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.