| version 1.5, 2003/11/21 06:51:16 | version 1.7, 2003/11/22 12:49:49 | 
| Line 1 | Line 1 | 
 | #include        "compiler.h" | #include        "compiler.h" | 
 |  | #include        <gx.h> | 
 | #include        "resource.h" | #include        "resource.h" | 
 | #include        "strres.h" | #include        "strres.h" | 
 | #include        "np2.h" | #include        "np2.h" | 
| Line 200  LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 201  LRESULT CALLBACK WndProc(HWND hWnd, UINT | 
 | //                      PostQuitMessage(0); | //                      PostQuitMessage(0); | 
 | break; | break; | 
 |  |  | 
 |  | case WM_ACTIVATE: | 
 |  | if (LOWORD(wParam) != WA_INACTIVE) { | 
 |  | GXResume(); | 
 |  | scrnmng_enable(TRUE); | 
 |  | scrndraw_redraw(); | 
 |  | soundmng_enable(SNDPROC_MAIN); | 
 |  | } | 
 |  | else { | 
 |  | soundmng_disable(SNDPROC_MAIN); | 
 |  | scrnmng_enable(FALSE); | 
 |  | GXSuspend(); | 
 |  | } | 
 |  | break; | 
 |  |  | 
 | #if defined(WAVEMNG_CBMAIN) | #if defined(WAVEMNG_CBMAIN) | 
 | case MM_WOM_DONE: | case MM_WOM_DONE: | 
 | soundmng_cb(MM_WOM_DONE, (HWAVEOUT)wParam, (WAVEHDR *)lParam); | soundmng_cb(MM_WOM_DONE, (HWAVEOUT)wParam, (WAVEHDR *)lParam); | 
| Line 306  int WINAPI WinMain(HINSTANCE hInstance, | Line 321  int WINAPI WinMain(HINSTANCE hInstance, | 
 | pccore_init(); | pccore_init(); | 
 | S98_init(); | S98_init(); | 
 |  |  | 
 | scrndraw_redraw(); |  | 
 | pccore_reset(); | pccore_reset(); | 
 |  | scrndraw_redraw(); | 
 |  |  | 
 |  | sysrunning = TRUE; | 
 |  |  | 
 | if (np2oscfg.resume) { | if (np2oscfg.resume) { | 
 | id = flagload(str_sav, str_resume, FALSE); | id = flagload(str_sav, str_resume, FALSE); | 
 | if (id == DID_CANCEL) { | if (id == DID_CANCEL) { | 
| DestroyWindow(hWndMain); | DestroyWindow(hWnd); | 
 | goto np2main_err3; | goto np2main_err3; | 
 | } | } | 
 | } | } | 
 |  |  | 
 | sysrunning = TRUE; |  | 
 |  |  | 
 | while(taskmng_isavail()) { | while(taskmng_isavail()) { | 
 | 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.message != WM_SYSKEYDOWN) && | if ((msg.hwnd != hWnd) || | 
| (msg.message != WM_SYSKEYUP)) { | ((msg.message != WM_SYSKEYDOWN) && | 
|  | (msg.message != WM_SYSKEYUP))) { | 
 | TranslateMessage(&msg); | TranslateMessage(&msg); | 
 | } | } | 
 | DispatchMessage(&msg); | DispatchMessage(&msg); | 
| Line 388  int WINAPI WinMain(HINSTANCE hInstance, | Line 404  int WINAPI WinMain(HINSTANCE hInstance, | 
 | } | } | 
 | } | } | 
 |  |  | 
| sysrunning = 0; | soundmng_disable(SNDPROC_MAIN); | 
|  | sysrunning = FALSE; | 
 |  |  | 
 | DestroyWindow(hWnd); | DestroyWindow(hWnd); | 
 |  |  |