MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / WndProc

Method WndProc

source/Windows/WinFrame.cpp:1021–1969  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1019}
1020
1021LRESULT Win32Frame::WndProc(
1022 HWND window,
1023 UINT message,
1024 WPARAM wparam,
1025 LPARAM lparam)
1026{
1027 switch (message)
1028 {
1029 case WM_ACTIVATE: // Sent when window is activated/deactivated. wParam indicates WA_ACTIVE, WA_INACTIVE, etc
1030 // Eg. Deactivate when Config dialog is active, AppleWin app loses focus, etc
1031 JoyReset();
1032 SetUsingCursor(FALSE);
1033 RevealCursor();
1034 FullScreenRevealCursor();
1035 g_bFrameActive = (wparam != WA_INACTIVE);
1036 break;
1037
1038 case WM_ACTIVATEAPP: // Sent when different app's window is activated/deactivated.
1039 // Eg. Deactivate when AppleWin app loses focus
1040 g_bAppActive = (wparam ? TRUE : FALSE);
1041 break;
1042
1043 case WM_SIZE:
1044 switch(wparam)
1045 {
1046 case SIZE_RESTORED:
1047 case SIZE_MAXIMIZED:
1048 g_windowMinimized = false;
1049 break;
1050 case SIZE_MINIMIZED:
1051 g_windowMinimized = true;
1052 break;
1053 default: // SIZE_MAXSHOW, SIZE_MAXHIDE
1054 break;
1055 }
1056 break;
1057
1058 case WM_CLOSE:
1059 LogFileOutput("WM_CLOSE\n");
1060 if (g_bIsFullScreen && g_bRestart)
1061 g_bRestartFullScreen = true;
1062 if (g_bIsFullScreen)
1063 SetNormalMode();
1064 if (!IsIconic(window))
1065 GetWindowRect(window,&framerect);
1066 RegSaveValue(REG_PREFS, REGVALUE_PREF_WINDOW_X_POS, 1, framerect.left);
1067 RegSaveValue(REG_PREFS, REGVALUE_PREF_WINDOW_Y_POS, 1, framerect.top);
1068 FrameReleaseDC();
1069 SetUsingCursor(FALSE);
1070 if (helpquit) {
1071 helpquit = 0;
1072 HtmlHelp(NULL,NULL,HH_CLOSE_ALL,0);
1073 }
1074 if (g_TimerIDEvent_100msec)
1075 {
1076 BOOL bRes = KillTimer(g_hFrameWindow, g_TimerIDEvent_100msec);
1077 LogFileOutput("KillTimer(g_TimerIDEvent_100msec), res=%d\n", bRes ? 1 : 0);
1078 g_TimerIDEvent_100msec = 0;

Callers 1

FrameWndProcMethod · 0.80

Calls 15

JoyResetFunction · 0.85
LogFileOutputFunction · 0.85
RegSaveValueFunction · 0.85
Snapshot_ShutdownFunction · 0.85
DebugDestroyFunction · 0.85
CpuDestroyFunction · 0.85
MemDestroyFunction · 0.85
SpkrDestroyFunction · 0.85
DirectInputUninitFunction · 0.85
DSInitFunction · 0.85
DirectInputInitFunction · 0.85
SpkrInitializeFunction · 0.85

Tested by

no test coverage detected