MCPcopy Create free account
hub / github.com/TASEmulators/fceux / SetMainWindowStuff

Function SetMainWindowStuff

src/drivers/win/window.cpp:2784–2839  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2782}
2783
2784void SetMainWindowStuff()
2785{
2786 RECT tmp;
2787
2788 GetWindowRect(hAppWnd, &tmp);
2789
2790 if (ismaximized)
2791 {
2792 winwidth = tmp.right - tmp.left;
2793 winheight = tmp.bottom - tmp.top;
2794
2795 ShowWindow(hAppWnd, SW_SHOWMAXIMIZED);
2796 } else
2797 {
2798 RECT srect;
2799
2800 if(WindowXC != ( 1 << 30 ))
2801 {
2802 /* Subtracting and adding for if(eoptions&EO_USERFORCE) below. */
2803 tmp.bottom -= tmp.top;
2804 tmp.bottom += WindowYC;
2805
2806 tmp.right -= tmp.left;
2807 tmp.right += WindowXC;
2808
2809
2810 tmp.left = WindowXC;
2811 tmp.top = WindowYC;
2812 WindowXC = 1 << 30;
2813 }
2814
2815 CalcWindowSize(&srect);
2816
2817 SetWindowPos(
2818 hAppWnd,
2819 HWND_TOP,
2820 tmp.left,
2821 tmp.top,
2822 srect.right,
2823 srect.bottom,
2824 SWP_SHOWWINDOW
2825 );
2826
2827 winwidth = srect.right;
2828 winheight = srect.bottom;
2829
2830 ShowWindow(hAppWnd, SW_SHOWNORMAL);
2831 }
2832
2833 if (eoptions & EO_BESTFIT && !windowedfailed)
2834 {
2835 RECT client_recr;
2836 GetClientRect(hAppWnd, &client_recr);
2837 recalculateBestFitRect(client_recr.right - client_recr.left, client_recr.bottom - client_recr.top);
2838 }
2839}
2840
2841/// @return Flag that indicates failure (0) or success (1).

Callers 5

SetVideoModeFunction · 0.85
ToggleHideMenuFunction · 0.85
AppWndProcFunction · 0.85
CreateMainWindowFunction · 0.85
Replay_LoadMovieFunction · 0.85

Calls 2

CalcWindowSizeFunction · 0.85
recalculateBestFitRectFunction · 0.85

Tested by

no test coverage detected