怎么F12键就是不能做虚拟键呢?
我做了个后台程序,监控当按下F9 F10 F11 F12键时分别注销 重启 关机 休眠。
但按F12键怎么都没反映,请问是为什么?F12的VK是123吧。
--------------
附源程序部分:
//热键处理过程
procedure TForm1.WMHotKey (var Msg : TWMHotKey);
begin
case msg.HotKey of //分别为注销、重启、关机、休眠
1500001:begin GetSystemPrivilege; ExitWindowsEx(EWX_LOGOFF, 0); end;
1500002:begin GetSystemPrivilege; ExitWindowsEx(EWX_REBOOT, 0); end;
1500003:begin GetSystemPrivilege; ExitWindowsEx(EWX_POWEROFF, 0); end;
1500004:begin GetSystemPrivilege; SetSystemPowerState(false,true); end;
end;
end;
//向系统注册热键 F9:120 F10:121 F11:122 F12:123 Scroll:145
RegisterHotKey(handle,1500001,0,120);
RegisterHotKey(handle,1500002,0,121);
RegisterHotKey(handle,1500003,0,122);
RegisterHotKey(handle,1500004,0,123);
================================
请教为什么RegisterHotKey(handle,1500004,0,123);这句无法注册F12键?也就是说,我按F9 F10 F11都有反映,但不管我怎么按F12键,就是用锤子敲都没用。但如果我用Scrolllock键就没任何问题,即RegisterHotKey(handle,1500004,0,145);
百思不得其解。
请高手回答。谢谢!!!!!!!!!!!!!!!!1