header: unicodification
Dimitrie O. Paun
dpaun at rogers.com
Tue Mar 22 23:54:44 CST 2005
ChangeLog
Complete unicodification of the header common control.
Index: dlls/comctl32/header.c
===================================================================
RCS file: /var/cvs/wine/dlls/comctl32/header.c,v
retrieving revision 1.71
diff -u -r1.71 header.c
--- dlls/comctl32/header.c 23 Feb 2005 12:41:43 -0000 1.71
+++ dlls/comctl32/header.c 23 Mar 2005 05:45:55 -0000
@@ -174,7 +174,7 @@
if (r.right - r.left == 0)
return phdi->rect.right;
- if (GetWindowLongA (hwnd, GWL_STYLE) & HDS_BUTTONS) {
+ if (GetWindowLongW (hwnd, GWL_STYLE) & HDS_BUTTONS) {
if (phdi->bDown) {
DrawEdge (hdc, &r, BDR_RAISEDOUTER,
BF_RECT | BF_FLAT | BF_MIDDLE | BF_ADJUST);
@@ -200,7 +200,7 @@
dis.rcItem = r;
dis.itemData = phdi->lParam;
oldBkMode = SetBkMode(hdc, TRANSPARENT);
- SendMessageA (infoPtr->hwndNotify, WM_DRAWITEM,
+ SendMessageW (infoPtr->hwndNotify, WM_DRAWITEM,
(WPARAM)dis.CtlID, (LPARAM)&dis);
if (oldBkMode != TRANSPARENT)
SetBkMode(hdc, oldBkMode);
@@ -218,7 +218,7 @@
HDC hdcBitmap;
INT yD, yS, cx, cy, rx, ry;
- GetObjectA (phdi->hbm, sizeof(BITMAP), (LPVOID)&bmp);
+ GetObjectW (phdi->hbm, sizeof(BITMAP), (LPVOID)&bmp);
ry = r.bottom - r.top;
rx = r.right - r.left;
@@ -257,7 +257,7 @@
INT xD, yD, yS, cx, cy, rx, ry, tx;
RECT textRect;
- GetObjectA (phdi->hbm, sizeof(BITMAP), (LPVOID)&bmp);
+ GetObjectW (phdi->hbm, sizeof(BITMAP), (LPVOID)&bmp);
textRect = r;
if (phdi->fmt & HDF_STRING) {
@@ -385,7 +385,7 @@
if ((x <= rect.right) && (infoPtr->uNumItem > 0)) {
rect.left = x;
- if (GetWindowLongA (hwnd, GWL_STYLE) & HDS_BUTTONS)
+ if (GetWindowLongW (hwnd, GWL_STYLE) & HDS_BUTTONS)
DrawEdge (hdc, &rect, EDGE_RAISED, BF_TOP|BF_LEFT|BF_BOTTOM|BF_SOFT);
else
DrawEdge (hdc, &rect, EDGE_ETCHED, BF_BOTTOM);
@@ -558,7 +558,7 @@
nmhdr.idFrom = GetWindowLongPtrW (hwnd, GWLP_ID);
nmhdr.code = code;
- return (BOOL)SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
+ return (BOOL)SendMessageW (infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr);
}
@@ -587,7 +587,7 @@
nmitem.iOrder = infoPtr->items[iItem].iOrder;
nmitem.iImage = infoPtr->items[iItem].iImage;
- return (BOOL)SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
+ return (BOOL)SendMessageW (infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM)nmhdr.hdr.idFrom, (LPARAM)&nmhdr);
}
@@ -1106,7 +1106,7 @@
lpLayout->pwpos->x = lpLayout->prc->left;
lpLayout->pwpos->y = lpLayout->prc->top;
lpLayout->pwpos->cx = lpLayout->prc->right - lpLayout->prc->left;
- if (GetWindowLongA (hwnd, GWL_STYLE) & HDS_HIDDEN)
+ if (GetWindowLongW (hwnd, GWL_STYLE) & HDS_HIDDEN)
lpLayout->pwpos->cy = 0;
else {
lpLayout->pwpos->cy = infoPtr->nHeight;
@@ -1304,21 +1304,21 @@
HEADER_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr;
- TEXTMETRICA tm;
+ TEXTMETRICW tm;
HFONT hOldFont;
HDC hdc;
infoPtr = (HEADER_INFO *)Alloc (sizeof(HEADER_INFO));
- SetWindowLongPtrA (hwnd, 0, (DWORD_PTR)infoPtr);
+ SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
infoPtr->hwndNotify = ((LPCREATESTRUCTA)lParam)->hwndParent;
infoPtr->uNumItem = 0;
infoPtr->hFont = 0;
infoPtr->items = 0;
infoPtr->bRectsValid = FALSE;
- infoPtr->hcurArrow = LoadCursorA (0, (LPSTR)IDC_ARROW);
- infoPtr->hcurDivider = LoadCursorA (COMCTL32_hModule, MAKEINTRESOURCEA(IDC_DIVIDER));
- infoPtr->hcurDivopen = LoadCursorA (COMCTL32_hModule, MAKEINTRESOURCEA(IDC_DIVIDEROPEN));
+ infoPtr->hcurArrow = LoadCursorW (0, (LPWSTR)IDC_ARROW);
+ infoPtr->hcurDivider = LoadCursorW (COMCTL32_hModule, MAKEINTRESOURCEW(IDC_DIVIDER));
+ infoPtr->hcurDivopen = LoadCursorW (COMCTL32_hModule, MAKEINTRESOURCEW(IDC_DIVIDEROPEN));
infoPtr->bPressed = FALSE;
infoPtr->bTracking = FALSE;
infoPtr->iMoveItem = 0;
@@ -1327,11 +1327,11 @@
infoPtr->bUnicode = IsWindowUnicode (hwnd);
infoPtr->iMargin = 3*GetSystemMetrics(SM_CXEDGE);
infoPtr->nNotifyFormat =
- SendMessageA (infoPtr->hwndNotify, WM_NOTIFYFORMAT, (WPARAM)hwnd, NF_QUERY);
+ SendMessageW (infoPtr->hwndNotify, WM_NOTIFYFORMAT, (WPARAM)hwnd, NF_QUERY);
hdc = GetDC (0);
hOldFont = SelectObject (hdc, GetStockObject (SYSTEM_FONT));
- GetTextMetricsA (hdc, &tm);
+ GetTextMetricsW (hdc, &tm);
infoPtr->nHeight = tm.tmHeight + VERT_BORDER;
SelectObject (hdc, hOldFont);
ReleaseDC (0, hdc);
@@ -1359,8 +1359,8 @@
if (infoPtr->himl)
ImageList_Destroy (infoPtr->himl);
+ SetWindowLongPtrW (hwnd, 0, 0);
Free (infoPtr);
- SetWindowLongPtrA (hwnd, 0, 0);
return 0;
}
@@ -1385,7 +1385,7 @@
pt.y = (INT)HIWORD(lParam);
HEADER_InternalHitTest (hwnd, &pt, &flags, &nItem);
- if ((GetWindowLongA (hwnd, GWL_STYLE) & HDS_BUTTONS) && (flags == HHT_ONHEADER))
+ if ((GetWindowLongW (hwnd, GWL_STYLE) & HDS_BUTTONS) && (flags == HHT_ONHEADER))
HEADER_SendHeaderNotify (hwnd, HDN_ITEMDBLCLICKA, nItem,0);
else if ((flags == HHT_ONDIVIDER) || (flags == HHT_ONDIVOPEN))
HEADER_SendHeaderNotify (hwnd, HDN_DIVIDERDBLCLICKA, nItem,0);
@@ -1398,7 +1398,7 @@
HEADER_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
- DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
+ DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
POINT pt;
UINT flags;
INT nItem;
@@ -1452,7 +1452,7 @@
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
/*
- *DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
+ *DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
*/
POINT pt;
UINT flags;
@@ -1551,7 +1551,7 @@
case NF_REQUERY:
infoPtr->nNotifyFormat =
- SendMessageA ((HWND)wParam, WM_NOTIFYFORMAT,
+ SendMessageW ((HWND)wParam, WM_NOTIFYFORMAT,
(WPARAM)hwnd, (LPARAM)NF_QUERY);
return infoPtr->nNotifyFormat;
}
@@ -1564,7 +1564,7 @@
HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
- DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
+ DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
POINT pt;
UINT flags;
INT nItem, nWidth;
@@ -1661,7 +1661,7 @@
ClientToScreen(hwnd, &pt);
/* Send a WM_CONTEXTMENU message in response to the RBUTTONUP */
- SendMessageA( hwnd, WM_CONTEXTMENU, (WPARAM) hwnd, MAKELPARAM(pt.x, pt.y));
+ SendMessageW( hwnd, WM_CONTEXTMENU, (WPARAM) hwnd, MAKELPARAM(pt.x, pt.y));
return bRet;
}
@@ -1697,7 +1697,7 @@
HEADER_SetFont (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
- TEXTMETRICA tm;
+ TEXTMETRICW tm;
HFONT hFont, hOldFont;
HDC hdc;
@@ -1707,7 +1707,7 @@
hdc = GetDC (0);
hOldFont = SelectObject (hdc, hFont);
- GetTextMetricsA (hdc, &tm);
+ GetTextMetricsW (hdc, &tm);
infoPtr->nHeight = tm.tmHeight + VERT_BORDER;
SelectObject (hdc, hOldFont);
ReleaseDC (0, hdc);
@@ -1727,7 +1727,7 @@
{
TRACE("hwnd=%p msg=%x wparam=%x lParam=%lx\n", hwnd, msg, wParam, lParam);
if (!HEADER_GetInfoPtr (hwnd) && (msg != WM_CREATE))
- return DefWindowProcA (hwnd, msg, wParam, lParam);
+ return DefWindowProcW (hwnd, msg, wParam, lParam);
switch (msg) {
/* case HDM_CLEARFILTER: */
@@ -1857,22 +1857,22 @@
VOID
HEADER_Register (void)
{
- WNDCLASSA wndClass;
+ WNDCLASSW wndClass;
- ZeroMemory (&wndClass, sizeof(WNDCLASSA));
+ ZeroMemory (&wndClass, sizeof(WNDCLASSW));
wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS;
wndClass.lpfnWndProc = HEADER_WindowProc;
wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = sizeof(HEADER_INFO *);
- wndClass.hCursor = LoadCursorA (0, (LPSTR)IDC_ARROW);
- wndClass.lpszClassName = WC_HEADERA;
+ wndClass.hCursor = LoadCursorW (0, (LPWSTR)IDC_ARROW);
+ wndClass.lpszClassName = WC_HEADERW;
- RegisterClassA (&wndClass);
+ RegisterClassW (&wndClass);
}
VOID
HEADER_Unregister (void)
{
- UnregisterClassA (WC_HEADERA, NULL);
+ UnregisterClassW (WC_HEADERW, NULL);
}
--
Dimi.
More information about the wine-patches
mailing list