F1 abschalten



  • Hallo,

    wie setzt ich meine F1-Taste außer Bertieb?

    Mein Versuch:

    BOOL CGDTDlg::PreTranslateMessage(MSG* pMsg) 
    {
    	if (pMsg->message == WM_KEYDOWN)
        {
            // Wenn ESCAPE, dann Nachricht verwerfen
            if (pMsg->wParam == VK_ESCAPE)
            // Nachricht verwerfen!
                return 1;
    		// Wenn F1, dann Nachricht verwerfen
            if (pMsg->wParam == VK_F1)
    		// Nachricht verwerfen!
                return 1;
        }
    
    	return CDialog::PreTranslateMessage(pMsg);
    }
    

    Geht für alle von mir getesteten Tasen außer für F1. Warum?

    Gruß Sven



  • Weils ein Syskey ist. 😉
    F10 macht denselben Ärger...



  • Überlade

    CWinApp::OnHelp
    afx_msg void OnHelp( );

    Remarks

    You must add an

    ON_COMMAND( ID_HELP, OnHelp )

    statement to your CWinApp class message map to enable this member function. Usually you will also add an accelerator-key entry for the F1 key. Enabling the F1 key is only a convention, not a requirement.

    If enabled, called by the framework when the user presses the F1 key.

    und dann kannst Du mit F1 machen was Du willst.

    Gruß


Anmelden zum Antworten