Added allow multiple instances option

This commit is contained in:
pagefault
2001-05-24 18:52:41 +00:00
parent 97e0d9cc2c
commit d9270da37b
5 changed files with 19 additions and 7 deletions

View File

@@ -581,7 +581,7 @@ NEWSYM GUIWBAdd, db 25
NEWSYM BlackAndWhite, db 0 NEWSYM BlackAndWhite, db 0
NEWSYM MouseWheel, db 1 NEWSYM MouseWheel, db 1
NEWSYM AlternateTimer, db 0 NEWSYM AlternateTimer, db 0
NEWSYM SuspendInBackground, db 0 NEWSYM AllowMultipleInst, db 0
GUIsave equ $-GUIRAdd GUIsave equ $-GUIRAdd

View File

@@ -2634,7 +2634,7 @@ DisplayGUIOptnsClick:
%ifdef __WIN32__ %ifdef __WIN32__
GUIClickCButton 12,168,byte[AlwaysOnTop] GUIClickCButton 12,168,byte[AlwaysOnTop]
GUIClickCButton 12,178,byte[SaveMainWindowPos] GUIClickCButton 12,178,byte[SaveMainWindowPos]
GUIClickCButton 12,188,byte[SuspendInBackground] GUIClickCButton 12,188,byte[AllowMultipleInst]
GUIClickCButton 124,23,byte[MouseWheel] GUIClickCButton 124,23,byte[MouseWheel]
%endif %endif

View File

@@ -4759,7 +4759,7 @@ DisplayGUIOptns:
.nocheck10 .nocheck10
GUIDisplayIconWin 10,12,178,[GUITemp] GUIDisplayIconWin 10,12,178,[GUITemp]
mov dword[GUITemp],GUIIconDataCheckBoxUC mov dword[GUITemp],GUIIconDataCheckBoxUC
cmp byte[SuspendInBackground],1 cmp byte[AllowMultipleInst],1
jne .nocheck11 jne .nocheck11
mov dword[GUITemp],GUIIconDataCheckBoxC mov dword[GUITemp],GUIIconDataCheckBoxC
.nocheck11 .nocheck11
@@ -4919,7 +4919,7 @@ GUIGUIOptnsTextG db 'BACK',0
GUIGUIOptnsTextH db 'TITLE',0 GUIGUIOptnsTextH db 'TITLE',0
GUIGUIOptnsTextI db 'WIN',0 GUIGUIOptnsTextI db 'WIN',0
GUIGUIOptnsTextJ db 'WHEEL MOUSE',0 GUIGUIOptnsTextJ db 'WHEEL MOUSE',0
GUIGUIOptnsTextK db 'SUSPEND IN BACKGROUND',0 GUIGUIOptnsTextK db 'ALLOW MULTIPLE INSTANCES',0
DisplayGUIAbout: DisplayGUIAbout:
; cmp byte[OSPort],3 ; cmp byte[OSPort],3

View File

@@ -191,7 +191,6 @@ extern BYTE HighPriority;
extern BYTE AlwaysOnTop; extern BYTE AlwaysOnTop;
extern BYTE SaveMainWindowPos; extern BYTE SaveMainWindowPos;
extern BYTE AlternateTimer; extern BYTE AlternateTimer;
extern BYTE SuspendInBackground;
extern signed short int MainWindowX; extern signed short int MainWindowX;
extern signed short int MainWindowY; extern signed short int MainWindowY;
extern int CurKeyPos; extern int CurKeyPos;
@@ -1589,7 +1588,7 @@ void CheckTimers(void)
void UpdateVFrame(void) void UpdateVFrame(void)
{ {
if (SuspendInBackground == 1 && IsActivated == 0) WaitMessage(); // if (SuspendInBackground == 1 && IsActivated == 0) WaitMessage();
int DataNeeded; int DataNeeded;
int SPCSize=256; int SPCSize=256;

View File

@@ -20,6 +20,7 @@
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
#include <direct.h> #include <direct.h>
#include <winuser.h>
extern void zstart(void); extern void zstart(void);
extern void DosExit(void); extern void DosExit(void);
@@ -37,7 +38,7 @@ extern unsigned char Palette0, SPC700sh, OffBy1Line, DSPDisable,
romtype, scanlines, showallext, smallscreenon, soundon, romtype, scanlines, showallext, smallscreenon, soundon,
spcon, vsyncon, DisplayS, fname, filefound, SnowOn, spcon, vsyncon, DisplayS, fname, filefound, SnowOn,
NetChatFirst,NetServer,NetNewNick, NetChatFirst,NetServer,NetNewNick,
NetFilename,GUINetTextk2,NetQuitAfter,UDPConfig; NetFilename,GUINetTextk2,NetQuitAfter,UDPConfig,AllowMultipleInst;
void ccmdline(void); void ccmdline(void);
@@ -80,6 +81,18 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdSh
hInst=hInstance; hInst=hInstance;
if (AllowMultipleInst == 0)
{
HWND hFindWindow;
hFindWindow = FindWindow("ZSNESWIN", NULL);
if (hFindWindow != NULL)
{
SetForegroundWindow(hFindWindow);
DosExit();
}
}
// Commandline: /ABCDE <nickname> <fname> <IP Addy> // Commandline: /ABCDE <nickname> <fname> <IP Addy>
// nickname = user nickname // nickname = user nickname
// fname = filename w/ full path (if L) or path name (if C) // fname = filename w/ full path (if L) or path name (if C)