int wid, hgt, posx, posy;
int dispx = GetSystemMetrics( SM_CXVIRTUALSCREEN);
int dispy = GetSystemMetrics( SM_CYVIRTUALSCREEN);
+ posx=0;
+ posy=0;
/* Make section name */
sprintf(sec_name, "Term-%d", i);
if (i == 0) return (1);
/* Build the path */
- path_build(buf, 1024, ANGBAND_DIR_XTRA_SOUND, sound_file[v][Rand_simple(i)]);
+ path_build(buf, 1024, ANGBAND_DIR_XTRA_SOUND, sound_file[v][Rand_external(i)]);
#ifdef WIN32
/* validate_dir(ANGBAND_DIR_XTRA_HELP); */
}
+bool is_already_running()
+{
+ bool result = FALSE;
+ HANDLE hMutex;
+
+ hMutex = CreateMutex(NULL, TRUE, VERSION_NAME);
+ if (GetLastError() == ERROR_ALREADY_EXISTS)
+ {
+ result = TRUE;
+ }
+ return result;
+}
+
int FAR PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrevInst,
LPSTR lpCmdLine, int nCmdShow)
/* Save globally */
hInstance = hInst;
+
+
+ /* Prevent multiple run */
+ if (is_already_running())
+ {
+ MessageBox(NULL,
+ _("ÊѶòÈÚÅܤϤ¹¤Ç¤Ëµ¯Æ°¤·¤Æ¤¤¤Þ¤¹¡£", "Hengband is already running."),
+ _("¥¨¥é¡¼¡ª", "Error") ,
+ MB_ICONEXCLAMATION | MB_OK | MB_ICONSTOP);
+ return FALSE;
+ }
/* Initialize */
if (hPrevInst == NULL)