--- np2/win9x/dialog/np2class.cpp 2004/01/22 01:10:05 1.5 +++ np2/win9x/dialog/np2class.cpp 2007/01/08 07:52:01 1.10 @@ -5,7 +5,7 @@ #include "np2class.h" -const char np2dlgclass[] = "np2dialog"; +const TCHAR np2dlgclass[] = _T("np2dialog"); void np2class_initialize(HINSTANCE hinst) { @@ -71,17 +71,17 @@ int CALLBACK np2class_propetysheet(HWND void np2class_wmcreate(HWND hWnd) { - SetWindowLong(hWnd, NP2GWL_HMENU, 0); + SetWindowLongPtr(hWnd, NP2GWLP_HMENU, 0); } void np2class_wmdestroy(HWND hWnd) { HMENU hmenu; - hmenu = (HMENU)GetWindowLong(hWnd, NP2GWL_HMENU); + hmenu = (HMENU)GetWindowLongPtr(hWnd, NP2GWLP_HMENU); if (hmenu != NULL) { DestroyMenu(hmenu); - SetWindowLong(hWnd, NP2GWL_HMENU, 0); + SetWindowLongPtr(hWnd, NP2GWLP_HMENU, 0); } } @@ -90,7 +90,7 @@ void np2class_enablemenu(HWND hWnd, BOOL HMENU hmenu; BOOL draw; - hmenu = (HMENU)GetWindowLong(hWnd, NP2GWL_HMENU); + hmenu = (HMENU)GetWindowLongPtr(hWnd, NP2GWLP_HMENU); draw = FALSE; if (enable) { if (hmenu) { @@ -108,16 +108,16 @@ void np2class_enablemenu(HWND hWnd, BOOL } } } - SetWindowLong(hWnd, NP2GWL_HMENU, (LONG)hmenu); + SetWindowLongPtr(hWnd, NP2GWLP_HMENU, (LONG_PTR)hmenu); if (draw) { DrawMenuBar(hWnd); } } -void np2class_windowtype(HWND hWnd, BYTE type) { +void np2class_windowtype(HWND hWnd, UINT8 type) { - RECT rect; - DWORD style; + RECT rect; + DWORD style; GetClientRect(hWnd, &rect); style = GetWindowLong(hWnd, GWL_STYLE); @@ -146,11 +146,34 @@ void np2class_windowtype(HWND hWnd, BYTE rect.right - rect.left, rect.bottom - rect.top); } +void np2class_frametype(HWND hWnd, UINT8 thick) { + + RECT rect; + DWORD style; + + GetClientRect(hWnd, &rect); + style = GetWindowLong(hWnd, GWL_STYLE); + if (thick) { + style |= WS_THICKFRAME; + } + else { + style &= ~WS_THICKFRAME; + } + SetWindowLong(hWnd, GWL_STYLE, style); + SetWindowPos(hWnd, 0, 0, 0, 0, 0, + SWP_FRAMECHANGED | SWP_DRAWFRAME | + SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER); + winloc_setclientsize(hWnd, + rect.right - rect.left, rect.bottom - rect.top); +} + + + HMENU np2class_gethmenu(HWND hWnd) { HMENU ret; - ret = (HMENU)GetWindowLong(hWnd, NP2GWL_HMENU); + ret = (HMENU)GetWindowLongPtr(hWnd, NP2GWLP_HMENU); if (ret == NULL) { ret = GetMenu(hWnd); }