Long time no use of VB, made a small thing, with a very comfortable:)
Frmmain.frm
'---------------------------------------------------------------------------------------
' Author: Ah Xi
' Purpose:vb realize the simple function of the Boss key
'---------------------------------------------------------------------------------------
Sub Form_Load () Sub Form_Load ()
DIM ret as Long
Prewinproc = GetWindowLong (Me.hwnd, GWL_WNDPROC)
ret = SetWindowLong (Me.hwnd, GWL_WNDPROC, AddressOf WNDPROC)
Idhotkey = 1
' Hold down ctrl+q to implement the switch
modifiers = Mod_control
Uvirtkey = Vbkeyq
ret = RegisterHotKey (Me.hwnd, Idhotkey, modifiers, Uvirtkey)
' Min Flower to Tray
Trayaddicon frmmain, App.Path & "\pbs.ico", "System tray"
End Sub
Sub Form_Unload () Sub Form_Unload (Cancel as Integer)
DIM ret as Long
ret = SetWindowLong (Me.hwnd, GWL_WNDPROC, Prewinproc)
Call Unregisterhotkey (Me.hwnd, Uvirtkey)
' Remove tray icon when exiting
Trayremoveicon
End Sub
Sub Form_resize () Sub Form_resize ()
' Window minimized
If me.windowstate = vbminimized Then me.hide
End Sub
Sub Form_mousemove () Sub Form_mousemove (Button As Integer, Shift As Integer, X as single, Y as single)
' Mouse event when bubble clicks
Dim result as Long
Dim CEvent as Single
CEvent = X/screen.twipsperpixelx
Select Case CEvent
Case MouseMove
Trayballoon frmmain, "One key hidden program v0.1 by a XI", Niif_info
Case Leftup
Case Leftdown
Frmmain. WindowState = 0
Frmmain. Show
Case Leftdbclick
Case Middleup
Case Middledown
Case Middledbclick
Case Rightup
Case Rightdown
Case Rightdbclick
Case Balloonclick
End Select
End Sub
Sub Label1_click () Sub Label1_click ()
End Sub
Sub Label2_click () Sub Label2_click ()
End Sub