|
-
Aug 8th, 2000, 08:21 AM
#1
Thread Starter
Member
Can someone tell me why this code won't work? No errors or anything, just won't work....... Thnx
Form Code
=========
Private Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal MSG As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function RegisterHotKey Lib "user32" (ByVal hWnd As Long, ByVal id As Long, ByVal fsModifiers As Long, ByVal vk As Long) As Long
Private Declare Function UnregisterHotKey Lib "user32" (ByVal hWnd As Long, ByVal id As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const HK_F9 = &H78
Private Const HK_F10 = &H79
Private Const HK_F11 = &H7A
Private Const HK_F12 = &H7B
Private Const GWL_WNDPROC = (-4)
Private lPrevWndProc As Long
Private Function SubClassedWnd(ByVal hWnd As Long, ByVal MSG As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
If MSG = HK_F9 And wParam = 1 Then
Msgbox "F9 Pressed"
mtdpxf.Display -1, (Actions.F9Value.text)
End If
If MSG = HK_F10 And wParam = 2 Then
mtdpxf.Display -1, (Actions.F10Value.text)
End If
If MSG = HK_F11 And wParam = 3 Then
mtdpxf.Display -1, (Actions.F11Value.text)
End If
If MSG = HK_F12 And wParam = 4 Then
mtdpxf.Display -1, (Actions.F12Value.text)
End If
SubClassedWnd = CallWindowProc(lPrevWndProc, hWnd, MSG, wParam, lParam)
End Function
Public Sub SetHotKey(ByVal hWnd As Long)
lPrevWndProc = SetWindowLong(hWnd, GWL_WNDPROC, AddressOf SubClassedWnd)
Call RegisterHotKey(hWnd, 1, 0, vbKeyF9)
Call RegisterHotKey(hWnd, 2, 0, vbKeyF10)
Call RegisterHotKey(hWnd, 3, 0, vbKeyF11)
Call RegisterHotKey(hWnd, 4, 0, vbKeyF12)
End Sub
Public Sub RemoveHotKey(ByVal hWnd As Long)
Call UnregisterHotKey(hWnd, 1)
Call UnregisterHotKey(hWnd, 2)
Call UnregisterHotKey(hWnd, 3)
Call UnregisterHotKey(hWnd, 4)
Call SetWindowLong(hWnd, GWL_WNDPROC, lPrevWndProc)
End Sub
Vince McMullin
Aka Vam, Vinny Mac
Its just that simple
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
|