F1 Taste sperren
-
ich möchte gerne die F1 taste sperren kann mir jemand sagen wie das geht?
mit PreTranslateMessage kann an die damit irgendwie sperren es darf nichts passieren wenn ich darauf drücke
-
In PreTranslateMessage prüfen ob die ankommende Nachricht WM_KEYDOWN ist, dann check ob es die F1 Taste is - Falls ja: PreTranslateMessage verlassen und damit die Zustellung der Nachricht unterbinden.
-
das geht so leicht nicht weil er immer die hilfe aufmachen will
-
Hiho,
vielleicht hilft dir das:
Help Commands in the Message Map To support the Help Topics menu item, F1 help, and SHIFT+F1 help, AppWizard adds four entries to the message map for your CFrameWnd-derived or CMDIFrameWnd-derived class. This message map is in the MainFrm.cpp file, and the relevant message map entries are located below the // Global help commands comment. After you run AppWizard, click Context-Sensitive Help. The message map for class CMainFrame will look like the following for an MDI application: // CMainFrame BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd) //{{AFX_MSG_MAP(CMainFrame) // NOTE - the ClassWizard will add and remove mapping macros here. // DO NOT EDIT what you see in these blocks of generated code ! ON_WM_CREATE() //}}AFX_MSG_MAP // Global help commands ON_COMMAND(ID_HELP_FINDER, CMDIFrameWnd::OnHelpFinder) ON_COMMAND(ID_HELP, CMDIFrameWnd::OnHelp) ON_COMMAND(ID_CONTEXT_HELP, CMDIFrameWnd::OnContextHelp) ON_COMMAND(ID_DEFAULT_HELP, CMDIFrameWnd::OnHelpFinder) END_MESSAGE_MAP() For an SDI application, references to CMDIFrameWnd in this code are replaced by references to CFrameWnd. About the Help Commands The four help-related message-map entries follow the // Global help commands comment. The following table explains the purpose of each command ID used in these entries. Help-Related Command IDs Command ID Purpose ID_HELP_FINDER Responds to the Help Topics item on the Help menu by displaying the Windows Contents screen. ID_HELP Responds to F1 by displaying a specific topic in Windows Help. ID_CONTEXT_HELP Responds to SHIFT+F1 by putting the application into Help mode. ID_DEFAULT_HELP Used when a specific help context cannot be found. Notice that all of these commands are mapped to member functions of class CMDIFrameWnd (in the case of an MDI application), or to CFrameWnd (in the case of an SDI application). Unlike most of the other commands you place into the message map, these have handler functions that are predefined by the class library. Making the message-map entry enables the command. The application’s accelerator table defines F1 for ID_HELP and SHIFT+F1 for ID_CONTEXT_HELP. You can change the keys used for these help functions by using Visual C++ to change the key values in the accelerator table. When the user chooses a Help menu command (or uses one of the context-sensitive Help techniques described in F1 Help Support and SHIFT+F1 Help Support in the article Help: F1 and SHIFT+F1 Help), the framework calls the CWinApp::WinHelp member function. This action, in turn, starts the Windows Help program and passes context information to it.
-
Überschreib die virtuelle Methode 'WinHelp' und lösch alles aus der raus.