| version 1.31, 2003/11/21 06:51:14 | version 1.32, 2003/11/24 07:40:02 | 
| Line 1226  static void processwait(UINT cnt) { | Line 1226  static void processwait(UINT cnt) { | 
 | else { | else { | 
 | Sleep(1); | Sleep(1); | 
 | } | } | 
 |  | soundmng_sync(); | 
 | } | } | 
 |  |  | 
 |  |  | 
| Line 1234  int WINAPI WinMain(HINSTANCE hInstance, | Line 1235  int WINAPI WinMain(HINSTANCE hInstance, | 
 | WNDCLASS        wc; | WNDCLASS        wc; | 
 | MSG                     msg; | MSG                     msg; | 
 | HMENU           hMenu; | HMENU           hMenu; | 
| HWND            hwndorg; | HWND            hWnd; | 
 | UINT            i; | UINT            i; | 
 | #ifdef OPENING_WAIT | #ifdef OPENING_WAIT | 
 | UINT32          tick; | UINT32          tick; | 
| Line 1254  int WINAPI WinMain(HINSTANCE hInstance, | Line 1255  int WINAPI WinMain(HINSTANCE hInstance, | 
 |  |  | 
 | CopyMemory(szClassName, np2oscfg.winid, 3); | CopyMemory(szClassName, np2oscfg.winid, 3); | 
 |  |  | 
| if ((hwndorg = FindWindow(szClassName, NULL)) != NULL) { | if ((hWnd = FindWindow(szClassName, NULL)) != NULL) { | 
 | sstpmsg_running(); | sstpmsg_running(); | 
| ShowWindow(hwndorg, SW_RESTORE); | ShowWindow(hWnd, SW_RESTORE); | 
| SetForegroundWindow(hwndorg); | SetForegroundWindow(hWnd); | 
 | dosio_term(); | dosio_term(); | 
 | return(FALSE); | return(FALSE); | 
 | } | } | 
| Line 1307  int WINAPI WinMain(HINSTANCE hInstance, | Line 1308  int WINAPI WinMain(HINSTANCE hInstance, | 
 | WS_THICKFRAME | WS_MINIMIZEBOX, | WS_THICKFRAME | WS_MINIMIZEBOX, | 
 | np2oscfg.winx, np2oscfg.winy, 640, 400, | np2oscfg.winx, np2oscfg.winy, 640, 400, | 
 | NULL, NULL, hInstance, NULL); | NULL, NULL, hInstance, NULL); | 
 |  | hWnd = hWndMain; | 
 | scrnmng_initialize(); | scrnmng_initialize(); | 
 |  |  | 
 | xmenu_setsound(np2cfg.SOUND_SW); | xmenu_setsound(np2cfg.SOUND_SW); | 
| Line 1330  int WINAPI WinMain(HINSTANCE hInstance, | Line 1332  int WINAPI WinMain(HINSTANCE hInstance, | 
 | xmenu_setsstp(np2oscfg.sstp); | xmenu_setsstp(np2oscfg.sstp); | 
 | xmenu_setmouse(np2oscfg.MOUSE_SW); | xmenu_setmouse(np2oscfg.MOUSE_SW); | 
 |  |  | 
| ShowWindow(hWndMain, nCmdShow); | ShowWindow(hWnd, nCmdShow); | 
| UpdateWindow(hWndMain); | UpdateWindow(hWnd); | 
 |  |  | 
 | #ifdef OPENING_WAIT | #ifdef OPENING_WAIT | 
 | tick = GetTickCount(); | tick = GetTickCount(); | 
| Line 1340  int WINAPI WinMain(HINSTANCE hInstance, | Line 1342  int WINAPI WinMain(HINSTANCE hInstance, | 
 | // めにゅー追加 | // めにゅー追加 | 
 | if (np2oscfg.statsave) { | if (np2oscfg.statsave) { | 
 | char buf[16]; | char buf[16]; | 
| hMenu = GetMenu(hWndMain); | hMenu = GetMenu(hWnd); | 
 | hStat = CreatePopupMenu(); | hStat = CreatePopupMenu(); | 
 | for (i=0; i<STATSAVEMAX; i++) { | for (i=0; i<STATSAVEMAX; i++) { | 
 | wsprintf(buf, "Save %d", i); | wsprintf(buf, "Save %d", i); | 
| Line 1354  int WINAPI WinMain(HINSTANCE hInstance, | Line 1356  int WINAPI WinMain(HINSTANCE hInstance, | 
 | InsertMenu(hMenu, 1, MF_BYPOSITION | MF_POPUP, (UINT)hStat, "S&tat"); | InsertMenu(hMenu, 1, MF_BYPOSITION | MF_POPUP, (UINT)hStat, "S&tat"); | 
 | } | } | 
 | sysmenu_initialize(); | sysmenu_initialize(); | 
| DrawMenuBar(hWndMain); | DrawMenuBar(hWnd); | 
 |  |  | 
 | // ver0.30 | // ver0.30 | 
 | if (file_attr_c(np2help) == (short)-1) { | if (file_attr_c(np2help) == (short)-1) { | 
| EnableMenuItem(GetMenu(hWndMain), IDM_HELP, MF_GRAYED); | EnableMenuItem(GetMenu(hWnd), IDM_HELP, MF_GRAYED); | 
 | } | } | 
 |  |  | 
 | sysmenu_settoolwin(np2oscfg.toolwin); | sysmenu_settoolwin(np2oscfg.toolwin); | 
| Line 1379  int WINAPI WinMain(HINSTANCE hInstance, | Line 1381  int WINAPI WinMain(HINSTANCE hInstance, | 
 | scrnmode ^= SCRNMODE_FULLSCREEN; | scrnmode ^= SCRNMODE_FULLSCREEN; | 
 | if (scrnmng_create(scrnmode) != SUCCESS) { | if (scrnmng_create(scrnmode) != SUCCESS) { | 
 | if (sstpmsg_dxerror()) { | if (sstpmsg_dxerror()) { | 
| MessageBox(hWndMain, "Couldn't create DirectDraw Object", | MessageBox(hWnd, "Couldn't create DirectDraw Object", | 
 | np2oscfg.titles, MB_OK | MB_ICONSTOP); | np2oscfg.titles, MB_OK | MB_ICONSTOP); | 
 | } | } | 
 | return(FALSE); | return(FALSE); | 
| Line 1422  int WINAPI WinMain(HINSTANCE hInstance, | Line 1424  int WINAPI WinMain(HINSTANCE hInstance, | 
 |  |  | 
 | pccore_reset(); | pccore_reset(); | 
 |  |  | 
 | if (!(scrnmode & SCRNMODE_FULLSCREEN)) { |  | 
 | if (np2oscfg.toolwin) { |  | 
 | toolwin_create(); |  | 
 | } |  | 
 | if (np2oscfg.keydisp) { |  | 
 | kdispwin_create(); |  | 
 | } |  | 
 | } |  | 
 |  |  | 
 | np2opening = 0; | np2opening = 0; | 
 |  |  | 
 | // れじうむ | // れじうむ | 
| Line 1442  int WINAPI WinMain(HINSTANCE hInstance, | Line 1435  int WINAPI WinMain(HINSTANCE hInstance, | 
 | for (i=0; i<4; i++) np2arg.disk[i] = NULL; | for (i=0; i<4; i++) np2arg.disk[i] = NULL; | 
 | } | } | 
 | else if (id == IDCANCEL) { | else if (id == IDCANCEL) { | 
| DestroyWindow(hWndMain); | DestroyWindow(hWnd); | 
 | mousemng_disable(MOUSEPROC_WINUI); | mousemng_disable(MOUSEPROC_WINUI); | 
 | S98_trash(); | S98_trash(); | 
 | pccore_term(); | pccore_term(); | 
| Line 1464  int WINAPI WinMain(HINSTANCE hInstance, | Line 1457  int WINAPI WinMain(HINSTANCE hInstance, | 
 | } | } | 
 | } | } | 
 |  |  | 
 |  | if (!(scrnmode & SCRNMODE_FULLSCREEN)) { | 
 |  | if (np2oscfg.toolwin) { | 
 |  | toolwin_create(); | 
 |  | } | 
 |  | if (np2oscfg.keydisp) { | 
 |  | kdispwin_create(); | 
 |  | } | 
 |  | } | 
 |  |  | 
 | while(1) { | while(1) { | 
 | if (!np2stopemulate) { | if (!np2stopemulate) { | 
 | if (PeekMessage(&msg, 0, 0, 0, PM_NOREMOVE)) { | if (PeekMessage(&msg, 0, 0, 0, PM_NOREMOVE)) { | 
 | if (!GetMessage(&msg, NULL, 0, 0)) { | if (!GetMessage(&msg, NULL, 0, 0)) { | 
 | break; | break; | 
 | } | } | 
| if ((msg.hwnd != hWndMain) || | if ((msg.hwnd != hWnd) || | 
 | ((msg.message != WM_SYSKEYDOWN) && | ((msg.message != WM_SYSKEYDOWN) && | 
 | (msg.message != WM_SYSKEYUP))) { | (msg.message != WM_SYSKEYUP))) { | 
 | TranslateMessage(&msg); | TranslateMessage(&msg); |