我想實作的功能是 在多檔案視圖程式中,點擊主視窗“新建”選單,然后彈出一個對話框,在對話框的幾個編輯框中設定引數后,點擊“確定”按鈕,在子框架視窗中創建一張表并顯示,但是我在對話框的按鈕處理函式中不知道如何呼叫CWinApp類的OnFileNew函式,或者說不知道能不能呼叫,所以感覺沒辦法繼續下去了,請大神們指導!
uj5u.com熱心網友回復:
OnFileNew沒有任何實際意義,只是框架預留的介面呼叫是可以的,但是呼叫它干嘛呢,
相關功能還是要你自己實作
uj5u.com熱心網友回復:
僅供參考:WM_COMMAND
The WM_COMMAND message is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated.
WM_COMMAND
wNotifyCode = HIWORD(wParam); // notification code
wID = LOWORD(wParam); // item, control, or accelerator identifier
hwndCtl = (HWND) lParam; // handle of control
Parameters
wNotifyCode
Value of the high-order word of wParam. Specifies the notification code if the message is from a control. If the message is from an accelerator, this parameter is 1. If the message is from a menu, this parameter is 0.
wID
Value of the low-order word of wParam. Specifies the identifier of the menu item, control, or accelerator.
hwndCtl
Value of lParam. Handle to the control sending the message if the message is from a control. Otherwise, this parameter is NULL.
Return Values
If an application processes this message, it should return zero.
Remarks
Accelerator keystrokes that select items from the window menu are translated into WM_SYSCOMMAND messages.
If an accelerator keystroke occurs that corresponds to a menu item when the window that owns the menu is minimized, no WM_COMMAND message is sent. However, if an accelerator keystroke occurs that does not match any of the items in the window's menu or in the window menu, a WM_COMMAND message is sent, even if the window is minimized.
If an application enables a menu separator, the system sends a WM_COMMAND message with the low-word of the wParam parameter set to zero when the user selects the separator.
QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Requires version 1.0 or later.
Header: Declared in winuser.h.
See Also
Edit Controls Overview, Edit Control Messages, WM_SYSCOMMAND
uj5u.com熱心網友回復:
主要是我搞不清楚OnFileNew的作業程序,這個相關功能我不知道怎么實作,不知道具體步驟,所以才想著呼叫這個介面函式,求指導
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/103853.html
標籤:資源
