Added new command line: -multimon

By default, when AppleWin starts, if the emulator is off the primary screen it will reset the position to re-center it.  If -multimon is specified AppleWin will keep the existing X, and Y position so that it starts up on the secondary monitor.
This commit is contained in:
mpohoreski 2011-02-20 18:59:53 +00:00
parent a7781fc89c
commit 817261d0e8
3 changed files with 12 additions and 7 deletions

View file

@ -868,7 +868,10 @@ int APIENTRY WinMain (HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
{ {
g_bEnableSpeech = true; g_bEnableSpeech = true;
} }
else if(strcmp(lpCmdLine,"-multimon") == 0)
{
g_bMultiMon = true;
}
lpCmdLine = lpNextArg; lpCmdLine = lpNextArg;
} }

View file

@ -96,6 +96,7 @@ static RECT framerect = {0,0,0,0};
HWND g_hFrameWindow = (HWND)0; HWND g_hFrameWindow = (HWND)0;
BOOL g_bIsFullScreen = 0; BOOL g_bIsFullScreen = 0;
BOOL g_bMultiMon = 0; // OFF = load window position & clamp initial frame to screen, ON = use window position as is
static BOOL helpquit = 0; static BOOL helpquit = 0;
static BOOL g_bPaintingWindow = 0; static BOOL g_bPaintingWindow = 0;
@ -1839,7 +1840,7 @@ void FrameCreateWindow ()
+ GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYCAPTION)
+ MAGICY; + MAGICY;
// // Restore Window X Position
int nXPos = -1; int nXPos = -1;
{ {
@ -1847,15 +1848,15 @@ void FrameCreateWindow ()
if (RegLoadValue(TEXT(REG_PREFS), TEXT("Window X-Position"), 1, (DWORD*)&nXPos)) if (RegLoadValue(TEXT(REG_PREFS), TEXT("Window X-Position"), 1, (DWORD*)&nXPos))
{ {
if (nXPos > nXScreen) if ((nXPos > nXScreen) && !g_bMultiMon)
nXPos = -1; // Not fully visible, so default to centre position nXPos = -1; // Not fully visible, so default to centre position
} }
if (nXPos == -1) if ((nXPos == -1) && !g_bMultiMon)
nXPos = nXScreen / 2; nXPos = nXScreen / 2;
} }
// // Restore Window Y Position
int nYPos = -1; int nYPos = -1;
{ {
@ -1863,11 +1864,11 @@ void FrameCreateWindow ()
if (RegLoadValue(TEXT(REG_PREFS), TEXT("Window Y-Position"), 1, (DWORD*)&nYPos)) if (RegLoadValue(TEXT(REG_PREFS), TEXT("Window Y-Position"), 1, (DWORD*)&nYPos))
{ {
if (nYPos > nYScreen) if ((nYPos > nYScreen) && !g_bMultiMon)
nYPos = -1; // Not fully visible, so default to centre position nYPos = -1; // Not fully visible, so default to centre position
} }
if (nYPos == -1) if ((nYPos == -1) && g_bMultiMon)
nYPos = nYScreen / 2; nYPos = nYScreen / 2;
} }

View file

@ -24,6 +24,7 @@
extern HWND g_hFrameWindow; extern HWND g_hFrameWindow;
extern HDC g_hFrameDC; extern HDC g_hFrameDC;
extern BOOL g_bIsFullScreen; extern BOOL g_bIsFullScreen;
extern BOOL g_bMultiMon;
// Emulator // Emulator
extern bool g_bFreshReset; extern bool g_bFreshReset;