123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- #if _WIN32_WINNT < 0x0400
- #define _WIN32_WINNT 0x0400
- #endif
- #ifdef __cplusplus
- extern "C"
- {
- #endif
- #include "EditXP.h"
- extern HHOOK g_hPrevHookXP ;
- extern PCLASSXP g_pClassXP ;
- extern COLORREF g_crDialogbkColor;
- VOID WINAPI EditDrawEditBoxXP(PCLASSXP pCxp)
- {
- HDC hDC;
- RECT Rect;
- LONG lExStyle;
- HANDLE hHandle;
- lExStyle = GetWindowLong(pCxp->hWnd, GWL_EXSTYLE);
- if ((GetWindowLong(pCxp->hWnd, GWL_STYLE) & WS_BORDER) ||
- (lExStyle & WS_EX_CLIENTEDGE) || (lExStyle & WS_EX_STATICEDGE))
- {
-
- hDC = GetWindowDC(pCxp->hWnd);
-
- GetWindowRect(pCxp->hWnd, &Rect);
- Rect.right -= Rect.left;
- Rect.bottom -= Rect.top;
- Rect.top = Rect.left = 0;
-
- hHandle = (HANDLE) CreateSolidBrush(
- (pCxp->dwState & CXPS_DISABLED) ? (GetSysColor(COLOR_BTNFACE) - 0x00202020) : 0x00BD9E7B);
- FrameRect(hDC, &Rect, (HBRUSH) hHandle);
- DeleteObject((HGDIOBJ) hHandle);
-
- if ((lExStyle & WS_EX_CLIENTEDGE) || (lExStyle & WS_EX_STATICEDGE))
- {
- InflateRect(&Rect, -1, -1);
- if ((pCxp->dwState & CXPS_DISABLED) || (pCxp->dwState & CXPS_READONLY))
- hHandle = (HANDLE) GetSysColorBrush(COLOR_WINDOW);
- else
- hHandle = (HANDLE) GetSysColorBrush(g_crDialogbkColor);
- FrameRect(hDC, &Rect, (HBRUSH) hHandle);
- if ((lExStyle & WS_EX_CLIENTEDGE) && (lExStyle & WS_EX_STATICEDGE))
- {
- InflateRect(&Rect, -1, -1);
- FrameRect(hDC, &Rect, (HBRUSH)hHandle);
- }
- }
-
- ReleaseDC(pCxp->hWnd, hDC);
- }
- }
- LRESULT EditWindowProc(PCLASSXP pCxp, UINT message,WPARAM wParam, LPARAM lParam)
- {
- LONG lReturn;
- HWND hWnd = pCxp->hWnd;
- switch(message)
- {
- case WM_NCPAINT:
- case WM_PAINT:
- lReturn = (LONG) DefWindowProc(hWnd, message, wParam, lParam);
- EditDrawEditBoxXP(pCxp);
- return lReturn;
- case EM_SETREADONLY:
- CXPM_SETSTATE(pCxp->dwState, CXPS_READONLY, wParam);
- EditDrawEditBoxXP(pCxp);
- break;
- }
- lReturn = (LONG) CallWindowProc(pCxp->wpPrev, hWnd, message, wParam, lParam);
- switch (message)
- {
- case WM_DESTROY:
- DeleteClassXP(hWnd);
- }
- return lReturn;
- return lReturn;
- }
- #ifdef __cplusplus
- }
- #endif
|