I try to close my App with the Escape Key, but is'nt working .....
I do this in a Module:
Option Explicit
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer

Public Const VK_ESCAPE = &H1B
Sub Main()

Load frmMainX
frmMainX.Show
Load frmMainY
frmMainY.Show

If GetAsyncKeyState(VK_ESCAPE) <> 0 Then
Unload frmMainX
Unload frmMainX
End If


End Sub

May someone could tell me what i do wrong?

Thx,

Susn