Added allow multiple instances option
This commit is contained in:
@@ -581,7 +581,7 @@ NEWSYM GUIWBAdd, db 25
|
||||
NEWSYM BlackAndWhite, db 0
|
||||
NEWSYM MouseWheel, db 1
|
||||
NEWSYM AlternateTimer, db 0
|
||||
NEWSYM SuspendInBackground, db 0
|
||||
NEWSYM AllowMultipleInst, db 0
|
||||
|
||||
GUIsave equ $-GUIRAdd
|
||||
|
||||
|
||||
@@ -2634,7 +2634,7 @@ DisplayGUIOptnsClick:
|
||||
%ifdef __WIN32__
|
||||
GUIClickCButton 12,168,byte[AlwaysOnTop]
|
||||
GUIClickCButton 12,178,byte[SaveMainWindowPos]
|
||||
GUIClickCButton 12,188,byte[SuspendInBackground]
|
||||
GUIClickCButton 12,188,byte[AllowMultipleInst]
|
||||
GUIClickCButton 124,23,byte[MouseWheel]
|
||||
%endif
|
||||
|
||||
|
||||
@@ -4759,7 +4759,7 @@ DisplayGUIOptns:
|
||||
.nocheck10
|
||||
GUIDisplayIconWin 10,12,178,[GUITemp]
|
||||
mov dword[GUITemp],GUIIconDataCheckBoxUC
|
||||
cmp byte[SuspendInBackground],1
|
||||
cmp byte[AllowMultipleInst],1
|
||||
jne .nocheck11
|
||||
mov dword[GUITemp],GUIIconDataCheckBoxC
|
||||
.nocheck11
|
||||
@@ -4919,7 +4919,7 @@ GUIGUIOptnsTextG db 'BACK',0
|
||||
GUIGUIOptnsTextH db 'TITLE',0
|
||||
GUIGUIOptnsTextI db 'WIN',0
|
||||
GUIGUIOptnsTextJ db 'WHEEL MOUSE',0
|
||||
GUIGUIOptnsTextK db 'SUSPEND IN BACKGROUND',0
|
||||
GUIGUIOptnsTextK db 'ALLOW MULTIPLE INSTANCES',0
|
||||
|
||||
DisplayGUIAbout:
|
||||
; cmp byte[OSPort],3
|
||||
|
||||
@@ -191,7 +191,6 @@ extern BYTE HighPriority;
|
||||
extern BYTE AlwaysOnTop;
|
||||
extern BYTE SaveMainWindowPos;
|
||||
extern BYTE AlternateTimer;
|
||||
extern BYTE SuspendInBackground;
|
||||
extern signed short int MainWindowX;
|
||||
extern signed short int MainWindowY;
|
||||
extern int CurKeyPos;
|
||||
@@ -1589,7 +1588,7 @@ void CheckTimers(void)
|
||||
void UpdateVFrame(void)
|
||||
{
|
||||
|
||||
if (SuspendInBackground == 1 && IsActivated == 0) WaitMessage();
|
||||
// if (SuspendInBackground == 1 && IsActivated == 0) WaitMessage();
|
||||
|
||||
int DataNeeded;
|
||||
int SPCSize=256;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <direct.h>
|
||||
#include <winuser.h>
|
||||
|
||||
extern void zstart(void);
|
||||
extern void DosExit(void);
|
||||
@@ -37,7 +38,7 @@ extern unsigned char Palette0, SPC700sh, OffBy1Line, DSPDisable,
|
||||
romtype, scanlines, showallext, smallscreenon, soundon,
|
||||
spcon, vsyncon, DisplayS, fname, filefound, SnowOn,
|
||||
NetChatFirst,NetServer,NetNewNick,
|
||||
NetFilename,GUINetTextk2,NetQuitAfter,UDPConfig;
|
||||
NetFilename,GUINetTextk2,NetQuitAfter,UDPConfig,AllowMultipleInst;
|
||||
|
||||
void ccmdline(void);
|
||||
|
||||
@@ -80,6 +81,18 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdSh
|
||||
|
||||
hInst=hInstance;
|
||||
|
||||
if (AllowMultipleInst == 0)
|
||||
{
|
||||
HWND hFindWindow;
|
||||
hFindWindow = FindWindow("ZSNESWIN", NULL);
|
||||
|
||||
if (hFindWindow != NULL)
|
||||
{
|
||||
SetForegroundWindow(hFindWindow);
|
||||
DosExit();
|
||||
}
|
||||
}
|
||||
|
||||
// Commandline: /ABCDE <nickname> <fname> <IP Addy>
|
||||
// nickname = user nickname
|
||||
// fname = filename w/ full path (if L) or path name (if C)
|
||||
|
||||
Reference in New Issue
Block a user