发布于 2005-03-02 17:08:38
0楼
是很麻烦。
在项目中去花太大的精力去做Help文件,有一点舍本逐末;但是从技术提高的角度来说,还是有意义的。
我的做法是单击鼠标右键时,触发相应的主题;
响应F1是有点难度,按键捕捉并不难:
#include "apdefap.h"
void OnKeyDown(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName, UINT nChar,
UINT nRepCnt, UINT nFlags)
{
#pragma code("user32.dll");
int GetAsyncKeyState(int vKey);
#pragma code();
int nRet;
printf("Tastaturcode=%d\r\n",nChar);
// Request on F1
if (nChar==112) {
// If F1 operates then check whether Shift - key
nRet = GetAsyncKeyState(VK_SHIFT);
// Bites staid for key pressed
if (nRet & 0x8000) {
printf("SHIFT-F1\r\n");
////////////////////////////////////
// Here further instructions can be edited,
// which are triggered at the corresponding
// keys combination.
}
// If F1 operates then check whether Ctrl - key
nRet = GetAsyncKeyState(VK_CONTROL);
// Bites staid for key pressed
if (nRet & 0x8000) {
printf("CONTROL-F1\r\n");
////////////////////////////////////
// Here further instructions can be edited,
// which are triggered at the corresponding
// keys combination.
}
//Wenn F1 dann Abfrage ob ALTGR-Taste betätigt
if (nFlags & KF_ALTDOWN) {
printf("ALT/CONTROL-F1\r\n");
////////////////////////////////////
// Here further instructions can be edited,
// which are triggered at the corresponding
// keys combination.
}
// Alt-key can not yet be requested, since this is a system - Key
// If F1 operates then check whether ALT - key
nRet = GetAsyncKeyState(VK_MENU);
// Bites staid for key pressed
if (nRet & 0x8000) {
printf("ALT-F1\r\n");
////////////////////////////////////
// Here further instructions can be edited,
// which are triggered at the corresponding
// keys combination.
}
}
}