求助!热键激活程序(10分)

  • 主题发起人 主题发起人 boby
  • 开始时间 开始时间
B

boby

Unregistered / Unconfirmed
GUEST, unregistred user!
I'm a Delphi新手!<br>&nbsp; 我将窗口最小化后,如何通过按一个键再将窗口恢复。<br>盼高手速速指教!
 
呵呵,Alt+Tab 就可以
 
这类的控件很多,再不就用Hook,捕捉消息也可以。
 
...<br>public<br>&nbsp; procedure WMhotkeyhandle(var msg:Tmessage);message wm_hotkey;<br>...<br>var<br>&nbsp; hotkeyid:integer;<br>&nbsp; ifhide:boolean;<br>implementation<br>...<br>procedure TForm1.FormCreate(Sender: TObject);<br>... &nbsp;<br>&nbsp; ifhide := false;<br>&nbsp; hotkeyid := GlobalAddAtom('My HotKey')-$C000;<br>&nbsp; registerhotkey(handle,hotkeyid,mod_control or mod_alt,$4D);<br>//设定快捷键为Alt+Ctrl+M<br>...<br>procedure TForm1.FormHide(Sender: TObject);<br>...<br>&nbsp; ifhide := true;<br>...<br>procedure TForm1.Wmhotkeyhandle(var msg:Tmessage);<br>begin<br>&nbsp; if (msg.LParamHi=$4D) and (msg.lparamLo=mod_control or mod_alt) then<br>&nbsp; begin<br>&nbsp; &nbsp;msg.Result:=1;<br>&nbsp; &nbsp;if ifhide then begin<br>&nbsp; &nbsp; application.Restore;<br>&nbsp; &nbsp; ifhide := false;<br>&nbsp; &nbsp;end;<br>&nbsp; end;<br>end;<br>...<br><br>还有问题吗?<br><br><br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;beta
 
登录全局热键
 
beta Very Thankful
 
后退
顶部