--- np2/win9x/np2.cpp 2006/12/24 00:52:29 1.67 +++ np2/win9x/np2.cpp 2007/01/08 08:52:21 1.71 @@ -66,13 +66,9 @@ static TCHAR szClassName[] = _T("NP2-Ma BOOL winui_en; NP2OSCFG np2oscfg = { -#if !defined(SUPPORT_PC9821) - OEMTEXT("Neko Project II"), -#else - OEMTEXT("Neko Project 21"), -#endif + OEMTEXT(PROJECTNAME) OEMTEXT(PROJECTSUBNAME), OEMTEXT("NP2"), - CW_USEDEFAULT, CW_USEDEFAULT, 1, 1, 0, 1, 0, 0, + CW_USEDEFAULT, CW_USEDEFAULT, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, KEY_UNKNOWN, 0, 0, 0, 0, {1, 2, 2, 1}, {5, 0, 0x3e, 19200, @@ -84,7 +80,7 @@ static TCHAR szClassName[] = _T("NP2-Ma {0, 0, 0x3e, 19200, OEMTEXT(""), OEMTEXT(""), OEMTEXT(""), OEMTEXT("")}, 0xffffff, 0xffbf6a, 0, 0, - 0, 1, 0, 9801, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + 0, 1, 0, 9801, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; OEMCHAR fddfolder[MAX_PATH]; OEMCHAR hddfolder[MAX_PATH]; @@ -364,7 +360,7 @@ static void np2popup(HWND hWnd, LPARAM l HMENU hMenu; POINT pt; - mainmenu = (HMENU)GetWindowLong(hWnd, NP2GWL_HMENU); + mainmenu = (HMENU)GetWindowLongPtr(hWnd, NP2GWLP_HMENU); if (mainmenu == NULL) { return; } @@ -379,11 +375,11 @@ static void np2popup(HWND hWnd, LPARAM l static void np2cmd(HWND hWnd, UINT16 cmd) { - HINSTANCE hInst; + HINSTANCE hinst; UINT update; BOOL b; - hInst = GetWindowInst(hWnd); + hinst = (HINSTANCE)GetWindowLongPtr(hWnd, GWLP_HINSTANCE); update = 0; switch(cmd) { case IDM_RESET: @@ -410,7 +406,7 @@ static void np2cmd(HWND hWnd, UINT16 cmd case IDM_CONFIG: winuienter(); sstpmsg_config(); - DialogBox(hInst, MAKEINTRESOURCE(IDD_CONFIG), + DialogBox(hinst, MAKEINTRESOURCE(IDD_CONFIG), hWnd, (DLGPROC)CfgDialogProc); if (!scrnmng_isfullscreen()) { UINT8 thick; @@ -851,7 +847,7 @@ static void np2cmd(HWND hWnd, UINT16 cmd case IDM_MPUPC98: winuienter(); - DialogBox(hInst, MAKEINTRESOURCE(IDD_MPUPC98), + DialogBox(hinst, MAKEINTRESOURCE(IDD_MPUPC98), hWnd, (DLGPROC)MidiDialogProc); winuileave(); break; @@ -899,7 +895,7 @@ static void np2cmd(HWND hWnd, UINT16 cmd case IDM_CALENDAR: winuienter(); - DialogBox(hInst, MAKEINTRESOURCE(IDD_CALENDAR), + DialogBox(hinst, MAKEINTRESOURCE(IDD_CALENDAR), hWnd, (DLGPROC)ClndDialogProc); winuileave(); break; @@ -947,7 +943,7 @@ static void np2cmd(HWND hWnd, UINT16 cmd sstpmsg_about(); if (sstp_result() != SSTP_SENDING) { winuienter(); - DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUT), + DialogBox(hinst, MAKEINTRESOURCE(IDD_ABOUT), hWnd, (DLGPROC)AboutDialogProc); winuileave(); } @@ -1070,8 +1066,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT case IDM_SCRNMUL16: if ((!scrnmng_isfullscreen()) && !(GetWindowLong(hWndMain, GWL_STYLE) & WS_MINIMIZE)) { - sysmenu_setscrnmul(wParam - IDM_SCRNMUL); - scrnmng_setmultiple(wParam - IDM_SCRNMUL); + sysmenu_setscrnmul((UINT8)(wParam - IDM_SCRNMUL)); + scrnmng_setmultiple((int)(wParam - IDM_SCRNMUL)); } break; @@ -1135,7 +1131,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT BITMAP bmp; HDC hmdc; HBRUSH hbrush; - hinst = GetWindowInst(hWnd); + hinst = (HINSTANCE)GetWindowLongPtr(hWnd, GWLP_HINSTANCE); GetClientRect(hWnd, &rect); width = rect.right - rect.left; height = rect.bottom - rect.top; @@ -1275,7 +1271,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT #if defined(SUPPORT_DCLOCK) else { POINT p; - if ((GetCursorPos(&p)) && (p.y >= 466)) { + if ((GetCursorPos(&p)) && + (scrnmng_isdispclockclick(&p))) { np2oscfg.clk_x++; sysmng_update(SYS_UPDATEOSCFG); dclock_reset(); @@ -1306,8 +1303,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT #if defined(SUPPORT_DCLOCK) else { POINT p; - if ((GetCursorPos(&p)) && (p.y >= 466) && - (np2oscfg.clk_x)) { + if ((GetCursorPos(&p)) && + (scrnmng_isdispclockclick(&p)) && + (np2oscfg.clk_x)) { np2oscfg.clk_fnt++; sysmng_update(SYS_UPDATEOSCFG); dclock_reset(); @@ -1523,7 +1521,7 @@ int WINAPI WinMain(HINSTANCE hInstance, wc.style = CS_BYTEALIGNCLIENT | CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS; wc.lpfnWndProc = WndProc; wc.cbClsExtra = 0; - wc.cbWndExtra = NP2GWL_SIZE; + wc.cbWndExtra = NP2GWLP_SIZE; wc.hInstance = hInst; wc.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON1)); wc.hCursor = LoadCursor(NULL, IDC_ARROW); @@ -1839,6 +1837,6 @@ int WINAPI WinMain(HINSTANCE hInstance, viewer_term(); // ver0.30 - return(msg.wParam); + return((int)msg.wParam); }