Make your own free website on Tripod.com

AllApi.net

[an error occurred while processing this directive]
 
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long
Private Declare Function DefWindowProc Lib "user32" Alias "DefWindowProcA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Const WM_SETHOTKEY = &H32
Const WM_SHOWWINDOW = &H18
Const HK_SHIFTA = &H141 'Shift + A
Const HK_SHIFTB = &H142 'Shift + B
Const HK_CONTROLA = &H241 'Control + A
Const HK_ALTZ = &H45A
'The value of the key-combination has to
'declared in lowbyte/highbyte-format
'That means as a hex-number: the last two
'characters specify the lowbyte (e.g.: 41 = a),
'the first the highbyte (e.g.: 01 = 1 = Shift)
Private Sub Form_Load()
    'KPD-Team 1999
    'URL: http://www.allapi.net/
    'E-Mail: KPDTeam@Allapi.net
    Me.WindowState = vbMinimized
    'Let windows know what hotkey you want for
    'your app, setting of lParam has no effect
    erg& = SendMessage(Me.hwnd, WM_SETHOTKEY, HK_ALTZ, 0)
    'Check if succesfull
    If erg& <> 1 Then
    MsgBox "You need another hotkey", vbOKOnly, "Error"
    End If
    'Tell windows what it should do, when the hotkey
    'is pressed -> show the window!
    'The setting of wParam and lParam has no effect
    erg& = DefWindowProc(Me.hwnd, WM_SHOWWINDOW, 0, 0)
End Sub


 
Copyright © 1998-2000, The KPD-Team.
Send mail to KPDTeam@Allapi.net with comments about this web site.
This site is located at
http://www.Allapi.net/