Add appendix picture
Does the OnFileOpen function depend on the operating system version?
Question 1: Does the OnFileOpen function depend on the operating system version?
Question 2: In the figure, what is the name of the function associated with the red box, and in which class is it displayed?
问题 1:OnFileOpen 函数是否依赖于操作系统版本?
问题 2:在图中,与红色方框相关联的函数的名称是什么?该函数被定义在哪个类中?
Windows for business | Windows Client for IT Pros | User experience | Other
2 answers
Sort by: Oldest
-
Daphne Huynh (WICLOUD CORPORATION) 1,570 Reputation points Microsoft External Staff Moderator
2026-10-01T02:57:02.44+00:00 Welcome to Microsoft Q&A!
Thank you for sharing the concern.
Question 1: Does the OnFileOpen function depend on the operating system version?
No. The
OnFileOpenfunction itself is not dependent on a specific Windows operating system version. In MFC applications,CWinApp::OnFileOpenis a framework command handler that responds to theID_FILE_OPENcommand and initiates the standard file-opening process provided by the MFC framework. Its implementation is defined by the application framework rather than by a particular version of Windows.The File Open command is typically connected through the application's message map as follows:
ON_COMMAND(ID_FILE_OPEN, &CWinApp::OnFileOpen)While the appearance of the File Open dialog may vary between Windows versions because the operating system provides the user interface, the
OnFileOpenhandler itself remains consistent from the application's perspective.Question 2: What is the name of the function associated with the red box, and in which class is it displayed?
Based on the screenshot provided, the red box highlights the standard Open toolbar button. In a typical MFC application, this command is commonly associated with:
CWinApp::OnFileOpenThe File Open command is mapped to
CWinApp::OnFileOpenthrough the application's message map. Therefore:- Function name: OnFileOpen
- Class: CWinApp (or a class derived from CWinApp if the application overrides the default implementation)
Based on the image you provided below (Appendix), Figure 1. Open Toolbar Button (highlighted in red)
It shows the toolbar button referenced in your question. The highlighted icon represents the standard Open command, which is typically mapped to
CWinApp::OnFileOpenin MFC applications.Reference: CWinApp Class | Microsoft Learn
If you find it useful, please click Accept Answer. Thank you for choosing Microsoft Q&A.
Note: I kindly recommend posting questions in a single language whenever possible. This helps community members and subject matter experts review and respond more efficiently. If you prefer to ask questions in Chinese, you may also consider posting in the Microsoft Q&A China community, where a larger Chinese-speaking audience may be available to assist.