Alright, I've made a program that uses several hotkeys. To do this, I implemented subclassing. When I exit the program, I get an error...
I have the SetWindowLong() codes inside a form that is active the whole program, but the program starts with a Sub Main().
The referenced procedure is in a module, as advised. Code is as follows:
Code:
Public Function CheckMessage(ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Select Case uMsg
Case WM_HOTKEY
HotKeyPress wParam
CheckMessage = 1
Exit Function
Case Else
CheckMessage = CallWindowProc(PrevProc, hWnd, uMsg, wParam, lParam)
End Select
End Function
When I use the hotkey CTRL-SHIFT-F5 my program ends. As I unload the form I'm using in the module, the form initiates the code:
I was registering the same function keys as hotkeys, but with different key combinations. I had functions for one set of keys when CTRL only was down, and another set for when CRTL + SHIFT was pressed down. I got rid of this and the error dissapeared.