热键问题 我在自己的程序里定义了热键,为何在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下好像是不能用。原因不明,可能是系统保留了。 Excel.Application的一个简单问题 delphi中断点错位的问题 WideString应该用在什么地方? 请教简单语法错误, 低级的编译错误? 请问怎样把FOXMAIL和OUTLOOK的地址薄中的姓名,EMAIL等信息. 菜鸟问题:Delphi 中如何像 Sql Server 2000 中的保存图片! 帮忙写一个SQL语句(SQL SERVER) 200分求解决用LQ-300K打印商场的收银单纸张设置的难题 [讨论] 关于DELPHI的指针操作 关于面向对象的数据库程序设计,很头疼 后天考研,散分
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.