很基础的东西,没有很难嘛!
Global $bPaused = False
Global $iPID
Global $iZ = 1
HotKeySet('{PAUSE}', 'HotKeyPressed')
HotKeySet('{ESC}', 'HotKeyPressed')
HotKeySet('{F10}', 'HotKeyPressed')
HotKeySet('{F9}', 'HotKeyPressed')
While 1
Sleep(100)
WEnd
Func HotKeyPressed()
Switch @HotKeyPressed
Case '{PAUSE}'
$bPaused = Not $bPaused
While $bPaused
Sleep(100)
ToolTip($iZ)
$iZ += 1
WEnd
ToolTip('')
Case '{ESC}'
Exit
Case '{F10}'
runnote()
Case '{F9}'
endnote()
EndSwitch
EndFunc ;==>HotKeyPressed
Func runnote()
$iPID = Run('notepad.exe')
$hWnd = WinWait('[CLASS:Notepad]')
ControlSend($hWnd, '', 'Edit1', '现在的日期/时间: {F5}')
EndFunc ;==>runnote
Func endnote()
If ProcessExists($iPID) Then
ProcessClose($iPID)
EndIf
EndFunc ;==>endnote
|