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

@@ -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)