喜欢这样自信人的答复: 我用到了控件:ApplicationEvents procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean); begin if Msg.message=WM_KeyDown then //F2 给作者写信 if msg.wParam=vk_f2 then begin ShellExecute(0,nil,'mailto:[email protected]','','',SW_NORMAL); end; //F3网上留言 F3=S=VK_F3=114 晕 //if (msg.wParam=VK_F3) and (msg.wParam<>114) then // if msg.wParam=VK_F3 then //begin // shellexecute(handle,nil,'http://www.Csina.com.cn/smlyb/write.asp',nil,nil,sw_normal); // end; //F4技术支持 F4 =R =vk_f4=115 晕 // if msg.wParam=vk_f4 then // begin // shellexecute(handle,nil,'http://www.Csina.com.cn',nil,nil,sw_normal); //end;end;
TO:: hellolongbin(一个人[.net学习中……]) 有何高招??跟大家共享吧
对不起回了以后忘了继续关注这个贴子 还是我上面说的,不论114还是vkf3都是F3键而不会是s键,而且你的f3如果是s的话那为什么f2没有触发r呢? 你可以新建一个工程,放一个ApplicationEvents控件,然后 procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean); begin if Msg.message=WM_KeyDown then begin if msg.wParam=113 then ShowMessage('f2') else if msg.wParam=vk_f3 then ShowMessage('f3'); end; end; 试试
上面的话有几处ASCII码错误 R:82 S:83 r:114 s:115 不过不影响阅读
我单步跟踪程序到 if msg.wParam=vk_f3 结果发现vk_f3 的值跟小写的s的值同是114所以就发生了这样的事
其属性为none
F3=S=VK_F3=114
F4=R=VK_F4=115按F3 跟按S键是一样的效果
按F4 跟按R键是一样的效果如何解决??
我用到了控件:ApplicationEvents
procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
begin
if Msg.message=WM_KeyDown then
//F2 给作者写信
if msg.wParam=vk_f2 then
begin
ShellExecute(0,nil,'mailto:[email protected]','','',SW_NORMAL);
end; //F3网上留言 F3=S=VK_F3=114 晕
//if (msg.wParam=VK_F3) and (msg.wParam<>114) then
// if msg.wParam=VK_F3 then
//begin
// shellexecute(handle,nil,'http://www.Csina.com.cn/smlyb/write.asp',nil,nil,sw_normal);
// end; //F4技术支持 F4 =R =vk_f4=115 晕
// if msg.wParam=vk_f4 then
// begin // shellexecute(handle,nil,'http://www.Csina.com.cn',nil,nil,sw_normal);
//end;end;
有何高招??跟大家共享吧
还是我上面说的,不论114还是vkf3都是F3键而不会是s键,而且你的f3如果是s的话那为什么f2没有触发r呢?
你可以新建一个工程,放一个ApplicationEvents控件,然后
procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
begin
if Msg.message=WM_KeyDown then
begin
if msg.wParam=113 then ShowMessage('f2')
else if msg.wParam=vk_f3 then ShowMessage('f3');
end;
end;
试试
R:82
S:83
r:114
s:115
不过不影响阅读
if msg.wParam=vk_f3
结果发现vk_f3 的值跟小写的s的值同是114所以就发生了这样的事