热键问题 我在自己的程序里定义了热键,为何在win2000和winxp中可以呼出,但在win98中却失灵,怎么也不行。为什么? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 interfaceuses k22;uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, Menus;type TForm1 = class(TForm) PopupMenu1: TPopupMenu; N1: TMenuItem; X1: TMenuItem; procedure FormCreate(Sender: TObject); procedure HotKeyDown(var Msg: Tmessage); message WM_HOTKEY; private { Private declarations } public { Public declarations } end;var Form1: TForm1; HotKeyId:Integer;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);beginform1.Hide;application.ShowMainForm:=false;HotKeyId:=GlobalAddAtom('MyHotKey');RegisterHotKey(Handle, hotkeyid, MOD_CONTROL, VK_F12);end;procedure TForm1.X1Click(Sender: TObject);beginAboutBox.showmodal;end;procedure TForm1.N1Click(Sender: TObject);begin UnRegisterHotKey(handle, HotKeyId); application.Terminate;end;procedure TForm1.HotKeyDown(var Msg: Tmessage);beginif (Msg.LparamLo = MOD_CONTROL) AND (Msg.LParamHi = VK_F12) then beginForm1.PopupMenu1.Popup((screen.Width-form1.Width) div 2+250 ,(screen.Height-form1.Height) div 2 );end;end;end. 楼主说错了吧,CTRL+F12在win98下应该是有用的,但在2000/xp下好像是不能用。原因不明,可能是系统保留了。 Tchart中动态创建的series,无法动态删除,请帮忙看看为什么。 下面的代码在D7 D2007运行结果不一样,把数据类型从Integer 改成 其它正确范围内 结果又不一样 是不是我的算法有问题? delphi中 调用存储过程的困惑vde 求教TNMFTP的问题 TrichEdit可以同时显示不同的字体和颜色吗? InstallShield问题 为什么??? 关于查找的问题 这条sql该怎么写 求救——请帮忙寻找《客户关系管理系统》的论文 请问在var处声明的变量与在其他处(如private)声明的变量有何不同? 关于面向对象的数据库程序设计,很头疼 后天考研,散分
uses k22;
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, Menus;
type
TForm1 = class(TForm)
PopupMenu1: TPopupMenu;
N1: TMenuItem;
X1: TMenuItem;
procedure FormCreate(Sender: TObject);
procedure HotKeyDown(var Msg: Tmessage); message WM_HOTKEY;
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
HotKeyId:Integer;
implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
begin
form1.Hide;
application.ShowMainForm:=false;
HotKeyId:=GlobalAddAtom('MyHotKey');
RegisterHotKey(Handle, hotkeyid, MOD_CONTROL, VK_F12);
end;procedure TForm1.X1Click(Sender: TObject);
begin
AboutBox.showmodal;
end;procedure TForm1.N1Click(Sender: TObject);
begin
UnRegisterHotKey(handle, HotKeyId);
application.Terminate;
end;procedure TForm1.HotKeyDown(var Msg: Tmessage);
begin
if (Msg.LparamLo = MOD_CONTROL) AND (Msg.LParamHi = VK_F12) then
begin
Form1.PopupMenu1.Popup((screen.Width-form1.Width) div 2+250
,(screen.Height-form1.Height) div 2 );
end;
end;end.