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 OnFileOpen function itself is not dependent on a specific Windows operating system version. In MFC applications, CWinApp::OnFileOpen is a framework command handler that responds to the ID_FILE_OPEN command 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 OnFileOpen handler 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::OnFileOpen
The File Open command is mapped to CWinApp::OnFileOpen through 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::OnFileOpen in 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.