Hi, Your OnKeyDownMyList() looks like this : void Cxxx::OnKeyDownMyList( NMHDR* pNMHDR, LRESULT* pResult ) { LV_KEYDOWN* pLVKeyDow = ( LV_KEYDOWN* ) pNMHDR; *pResult = 0; }
Here you can use the wVKey member of the pLVKeyDow.. Example : void Cxxx::OnKeyDownMyList( NMHDR* pNMHDR, LRESULT* pResult ) { LV_KEYDOWN* pLVKeyDow = ( LV_KEYDOWN* ) pNMHDR; if( pLVKeyDow->wVKey == VK_DELETE ) { // Call the function that deletes the selected item... } *pResult = 0; }
volkan878
Posts
-
Getting key presses from MFC -
include file error/#include "hotel_misview.h" If this is how you wrote it in your code too, you better remove the "/" before the #define preprocessor.
-
Saving Documents Without Confimation DialogThank you all for your responses. I think the most efficient way for to overcome the problem, as DavidCrow suggested, will be overriding CDocument::SaveModified(). After David's post i wondered what MSDN says about SaveModified() and it says : "Called by the framework before a modified document is to be closed. The default implementation of this function displays a message box asking the user whether to save the changes to the document, if any have been made. Override this function if your program requires a different prompting procedure. This is an advanced overridable" So, altough i wished to discover a method like TurnOffTheStupidDialog(), i think i'll go for overriding it. Anyway, thank you again for your replies.
-
Saving Documents Without Confimation DialogHi, I have an MDI project. When some changes occur in a view i call the view's document's SetModifiedFlag() method and when the user attempts to close the child frame, it asks to save the recent changes and that's OK. I also have a Save Project button on the toolbar and when it is pressed it calls CDocTemplate::SaveAllModified() method and saves the modified documents but the problem is it still pops a confirmation dialog. It looks rather silly when the user presses "Save" and it says "Do you want to save?".. Is there a way that i can "silently" save the documents without displaying the confirmation dialog box? Any idea is welcome. Thanks in advance.