热键冲突(100分)

  • 主题发起人 主题发起人 E_SHARK
  • 开始时间 开始时间
E

E_SHARK

Unregistered / Unconfirmed
GUEST, unregistred user!
我在两个不同的程序中定义了相同的热键,但是总是第一个启动的程序对热键又反应,不明白是怎么会事情,请高手指导,代码如下:<br> &nbsp; &nbsp;procedure hotykey(var msg:TMessage); message WM_HOTKEY;<br> &nbsp;YZIEMID:=GLOBALADDATOM('HOTKEY1');<br> &nbsp;REGISTERHOTKEY(HANDLE,YZIEMID,MOD_CONTROL,VK_F1);<br>procedure TFrms_Main.hotykey(var msg: TMessage);<br>begin<br><br> &nbsp;IF (MSG.LPARAMLO=MOD_CONTROL) AND (MSG.LPARAMHI=VK_F1)<br> &nbsp; &nbsp; AND (APPLICATION.Title ='1') THEN<br> &nbsp; &nbsp;BEGIN<br> &nbsp; &nbsp; &nbsp;IF MYHOS.SJLX ='1' THEN<br> &nbsp; &nbsp; &nbsp; &nbsp;BEGIN<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FRMS_MAIN.SB1.PANELS[1].TEXT:='速记法:拼音';<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MYHOS.SJLX:='2';<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;EXIT;<br> &nbsp; &nbsp; &nbsp; &nbsp;END;<br> &nbsp; &nbsp; &nbsp;IF MYHOS.SJLX ='2' THEN<br> &nbsp; &nbsp; &nbsp; &nbsp;BEGIN<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FRMS_MAIN.SB1.PANELS[1].TEXT:='速记法:中文';<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MYHOS.SJLX:='3';<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;EXIT;<br> &nbsp; &nbsp; &nbsp; &nbsp;END;<br><br> &nbsp; &nbsp; &nbsp;IF MYHOS.SJLX ='3' THEN<br> &nbsp; &nbsp; &nbsp; &nbsp;BEGIN<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FRMS_MAIN.SB1.PANELS[1].TEXT:='速记法:五笔';<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MYHOS.SJLX:='1';<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;EXIT;<br> &nbsp; &nbsp; &nbsp; &nbsp;END;<br> &nbsp; &nbsp;END;<br><br>end;
 
定义了相同的热键,总是第一个启动的程序对热键有反应。难道你还指望一次热键做两件事啊。<br><br>举个列子<br>WINDOWS系统中默认的中英文输入法切换是 CTRL + SPACE<br>其实 DELPHI 中也有对 CTRL + SPACE 做定义的,就是自动弹出代码<br>我把 WINDOWS系统中默认的中英文输入法切换给换掉,在DELPHI中 才能通过<br> CTRL + SPACE 自动弹出代码
 
接受答案了.
 

Similar threads

I
回复
0
查看
502
import
I
I
回复
0
查看
682
import
I
I
回复
0
查看
665
import
I
I
回复
0
查看
529
import
I
后退
顶部