怎样实现WIN2000下屏幕键盘的效果?拿出全部家档了!(200分)

  • 主题发起人 主题发起人 wuyu613
  • 开始时间 开始时间
W

wuyu613

Unregistered / Unconfirmed
GUEST, unregistred user!
我用SPY++看win2000下屏幕键盘,发现上面的按钮都不是窗体,而且点击屏幕键盘,原先的活动窗口不会受影响,屏幕键盘始终都不会被激活,这是怎么实现的?以前的相关帖子我都看了,但是没有满意的答案,请各位大侠帮忙!!!最好有代码。
 
实际上 软键盘是一种特殊的窗体 顺便看看我的代码<br>http://www.2ccc.com/article.asp?articleid=942
 
To:刘麻子,“软键盘是一种特殊的窗体”<br>能说得详细一些么?
 
&nbsp; &nbsp;似乎可以调用ImmCreateSoftKeyboard函数创建,<br>&nbsp; &nbsp; 还可以调用ImmShowSoftKeyboard函数显示或者隐藏软键盘。<br>&nbsp; &nbsp; 我也在研究这个,等弄出来了告诉您。 &nbsp; :)
 
好,wating...
 
还有谁有比较好的答案阿,大家帮帮忙吧,200分每人拿么?
 
看看软键盘的窗口:<br>&nbsp;WS_POPUP<br>&nbsp;WS_VISIBLE<br>&nbsp;WS_DISABLED<br>&nbsp;WS_CLIPSIBLINGS<br>&nbsp;WS_CAPTION<br>&nbsp;WS_BORDER<br>ExStyle:<br>&nbsp;WS_EX_DLGMODALFRAME<br>&nbsp;WS_EX_WINDOWEDGE<br>&nbsp;WS_EX_OVERLAPPEDWINDOW<br>&nbsp;WS_EX_PALETTEWINDOW<br>他是一个DISABLED的窗口,然后上面的键都是自己画出来的,不会有焦点
 
留个邮箱我给你各例题
 
unit Unit1;<br><br>interface<br><br>uses<br>&nbsp; Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br>&nbsp; Dialogs, StdCtrls, Buttons, sndkey32, ExtCtrls; &nbsp;//关键是使用sndkey32单元<br><br>type<br>&nbsp; TSendKey = record<br>&nbsp; &nbsp; Name : ShortString;<br>&nbsp; &nbsp; VKey : Byte;<br>&nbsp; end;<br><br>&nbsp; TForm1 = class(TForm)<br>&nbsp; &nbsp; C_a: TSpeedButton;<br>&nbsp; &nbsp; C_b: TSpeedButton;<br>&nbsp; &nbsp; C_c: TSpeedButton;<br>&nbsp; &nbsp; C_d: TSpeedButton;<br>&nbsp; &nbsp; C_e: TSpeedButton;<br>&nbsp; &nbsp; C_f: TSpeedButton;<br>&nbsp; &nbsp; C_g: TSpeedButton;<br>&nbsp; &nbsp; C_h: TSpeedButton;<br>&nbsp; &nbsp; C_i: TSpeedButton;<br>&nbsp; &nbsp; C_j: TSpeedButton;<br>&nbsp; &nbsp; C_k: TSpeedButton;<br>&nbsp; &nbsp; C_l: TSpeedButton;<br>&nbsp; &nbsp; C_m: TSpeedButton;<br>&nbsp; &nbsp; C_n: TSpeedButton;<br>&nbsp; &nbsp; C_o: TSpeedButton;<br>&nbsp; &nbsp; C_p: TSpeedButton;<br>&nbsp; &nbsp; C_q: TSpeedButton;<br>&nbsp; &nbsp; C_r: TSpeedButton;<br>&nbsp; &nbsp; C_s: TSpeedButton;<br>&nbsp; &nbsp; C_t: TSpeedButton;<br>&nbsp; &nbsp; C_u: TSpeedButton;<br>&nbsp; &nbsp; C_v: TSpeedButton;<br>&nbsp; &nbsp; C_w: TSpeedButton;<br>&nbsp; &nbsp; C_x: TSpeedButton;<br>&nbsp; &nbsp; C_y: TSpeedButton;<br>&nbsp; &nbsp; C_z: TSpeedButton;<br>&nbsp; &nbsp; Comm_Tab: TSpeedButton;<br>&nbsp; &nbsp; Comm_CAPSLOCK: TSpeedButton;<br>&nbsp; &nbsp; Comm_BACKSPACE: TSpeedButton;<br>&nbsp; &nbsp; Comm_ENTER: TSpeedButton;<br>&nbsp; &nbsp; Comm_ESC: TSpeedButton;<br>&nbsp; &nbsp; Comm_Shift: TSpeedButton;<br>&nbsp; &nbsp; SpeedButton1: TSpeedButton;<br>&nbsp; &nbsp; C_: TSpeedButton;<br>&nbsp; &nbsp; N_1: TSpeedButton;<br>&nbsp; &nbsp; N_2: TSpeedButton;<br>&nbsp; &nbsp; N_3: TSpeedButton;<br>&nbsp; &nbsp; N_4: TSpeedButton;<br>&nbsp; &nbsp; N_5: TSpeedButton;<br>&nbsp; &nbsp; N_6: TSpeedButton;<br>&nbsp; &nbsp; N_7: TSpeedButton;<br>&nbsp; &nbsp; N_8: TSpeedButton;<br>&nbsp; &nbsp; N_9: TSpeedButton;<br>&nbsp; &nbsp; N_0: TSpeedButton;<br>&nbsp; &nbsp; Memo1: TMemo;<br>&nbsp; &nbsp; F_doudao: TSpeedButton;<br>&nbsp; &nbsp; F_juhao: TSpeedButton;<br>&nbsp; &nbsp; F_wenfao: TSpeedButton;<br>&nbsp; &nbsp; SpeedButton2: TSpeedButton;<br>&nbsp; &nbsp; SpeedButton3: TSpeedButton;<br>&nbsp; &nbsp; SpeedButton4: TSpeedButton;<br>&nbsp; &nbsp; SpeedButton5: TSpeedButton;<br>&nbsp; &nbsp; SpeedButton6: TSpeedButton;<br>&nbsp; &nbsp; SpeedButton7: TSpeedButton;<br>&nbsp; &nbsp; SpeedButton8: TSpeedButton;<br>&nbsp; &nbsp; SpeedButton9: TSpeedButton;<br>&nbsp; &nbsp; procedure C_aClick(Sender: TObject);<br>&nbsp; &nbsp; procedure Comm_TabClick(Sender: TObject);<br>&nbsp; &nbsp; procedure Comm_ShiftClick(Sender: TObject);<br>&nbsp; private<br>&nbsp; &nbsp; { Private declarations }<br>&nbsp; public<br>&nbsp; &nbsp; { Public declarations }<br>&nbsp; end;<br><br>var<br>&nbsp; Form1: TForm1;<br>&nbsp; Sh:string;<br><br>implementation<br><br>{$R *.dfm}<br><br>procedure TForm1.C_aClick(Sender: TObject);<br>begin<br>&nbsp; SendKeys(Pchar(sh+(sender as TSpeedButton).Caption), false);<br>&nbsp; SpeedButton1.Down:=true;<br>&nbsp; sh:='';<br>end;<br><br>procedure TForm1.Comm_TabClick(Sender: TObject);<br>begin<br>&nbsp; SendKeys(Pchar('{'+(sender as TSpeedButton).Caption+'}'), false);<br>end;<br><br>procedure TForm1.Comm_ShiftClick(Sender: TObject);<br>begin<br>&nbsp; sh:='+';<br>end;<br><br>end.<br><br>简单吧
 
我的邮箱:wuyu613@163.com<br>谢谢!
 
weichao9999:<br>&nbsp; &nbsp; 你的程序在我这怎么出现这样的错误?<br>&nbsp; &nbsp; [Fatal Error] dfw.pas(7): File not found: 'sndkey32.dcu'
 
xianjun:<br>&nbsp; &nbsp; 我是新手,你能说得具体点么,最好有程序,先谢谢了!
 
在您的机器上找到 'sndkey32.dcu' &nbsp; 然后复制到 &nbsp;bin 或者您 自己程序的目录 看看
 
在DELPHI的安装盘上有 sndkey32.pas 文件
 
look delphi help !!!!!!!
 
后退
顶部