update comctl32 to Wine 1.1.13.

not including ros specific stuff for now while I work out what we still need

svn path=/trunk/; revision=38822
This commit is contained in:
Ged Murphy 2009-01-17 16:43:06 +00:00
parent f997492021
commit ebec7c2e3f
31 changed files with 933 additions and 912 deletions

View file

@ -817,7 +817,7 @@ static BOOL ANIMATE_Create(HWND hWnd, const CREATESTRUCTW *lpcs)
} }
/* allocate memory for info structure */ /* allocate memory for info structure */
infoPtr = (ANIMATE_INFO *)Alloc(sizeof(ANIMATE_INFO)); infoPtr = Alloc(sizeof(ANIMATE_INFO));
if (!infoPtr) return FALSE; if (!infoPtr) return FALSE;
/* store crossref hWnd <-> info structure */ /* store crossref hWnd <-> info structure */
@ -962,7 +962,7 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP
return DefWindowProcW(hWnd, uMsg, wParam, lParam); return DefWindowProcW(hWnd, uMsg, wParam, lParam);
default: default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP)) if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam); ERR("unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam);
return DefWindowProcW(hWnd, uMsg, wParam, lParam); return DefWindowProcW(hWnd, uMsg, wParam, lParam);

View file

@ -164,7 +164,7 @@ static void COMBOEX_DumpItem (CBE_ITEMDATA const *item)
static void COMBOEX_DumpInput (COMBOBOXEXITEMW const *input) static void COMBOEX_DumpInput (COMBOBOXEXITEMW const *input)
{ {
TRACE("input - mask=%08x, iItem=%d, pszText=%p, cchTM=%d, iImage=%d\n", TRACE("input - mask=%08x, iItem=%ld, pszText=%p, cchTM=%d, iImage=%d\n",
input->mask, input->iItem, input->pszText, input->cchTextMax, input->mask, input->iItem, input->pszText, input->cchTextMax,
input->iImage); input->iImage);
if (input->mask & CBEIF_TEXT) if (input->mask & CBEIF_TEXT)
@ -198,7 +198,7 @@ static INT COMBOEX_Notify (COMBOEX_INFO *infoPtr, INT code, NMHDR *hdr)
static INT static INT
COMBOEX_NotifyItem (COMBOEX_INFO *infoPtr, INT code, NMCOMBOBOXEXW *hdr) COMBOEX_NotifyItem (COMBOEX_INFO *infoPtr, UINT code, NMCOMBOBOXEXW *hdr)
{ {
/* Change the Text item from Unicode to ANSI if necessary for NOTIFY */ /* Change the Text item from Unicode to ANSI if necessary for NOTIFY */
if (infoPtr->NtfUnicode) if (infoPtr->NtfUnicode)
@ -211,7 +211,7 @@ COMBOEX_NotifyItem (COMBOEX_INFO *infoPtr, INT code, NMCOMBOBOXEXW *hdr)
if ((hdr->ceItem.mask & CBEIF_TEXT) && is_textW(wstr)) { if ((hdr->ceItem.mask & CBEIF_TEXT) && is_textW(wstr)) {
len = WideCharToMultiByte (CP_ACP, 0, wstr, -1, 0, 0, NULL, NULL); len = WideCharToMultiByte (CP_ACP, 0, wstr, -1, 0, 0, NULL, NULL);
if (len > 0) { if (len > 0) {
astr = (LPSTR)Alloc ((len + 1)*sizeof(CHAR)); astr = Alloc ((len + 1)*sizeof(CHAR));
if (!astr) return 0; if (!astr) return 0;
WideCharToMultiByte (CP_ACP, 0, wstr, -1, astr, len, 0, 0); WideCharToMultiByte (CP_ACP, 0, wstr, -1, astr, len, 0, 0);
hdr->ceItem.pszText = (LPWSTR)astr; hdr->ceItem.pszText = (LPWSTR)astr;
@ -320,7 +320,7 @@ static LPCWSTR COMBOEX_GetText(COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item)
if (is_textW(nmce.ceItem.pszText)) { if (is_textW(nmce.ceItem.pszText)) {
len = MultiByteToWideChar (CP_ACP, 0, (LPSTR)nmce.ceItem.pszText, -1, NULL, 0); len = MultiByteToWideChar (CP_ACP, 0, (LPSTR)nmce.ceItem.pszText, -1, NULL, 0);
buf = (LPWSTR)Alloc ((len + 1)*sizeof(WCHAR)); buf = Alloc ((len + 1)*sizeof(WCHAR));
if (buf) if (buf)
MultiByteToWideChar (CP_ACP, 0, (LPSTR)nmce.ceItem.pszText, -1, buf, len); MultiByteToWideChar (CP_ACP, 0, (LPSTR)nmce.ceItem.pszText, -1, buf, len);
if (nmce.ceItem.mask & CBEIF_DI_SETITEM) { if (nmce.ceItem.mask & CBEIF_DI_SETITEM) {
@ -348,7 +348,7 @@ static void COMBOEX_GetComboFontSize (COMBOEX_INFO *infoPtr, SIZE *size)
mydc = GetDC (0); /* why the entire screen???? */ mydc = GetDC (0); /* why the entire screen???? */
nfont = (HFONT)SendMessageW (infoPtr->hwndCombo, WM_GETFONT, 0, 0); nfont = (HFONT)SendMessageW (infoPtr->hwndCombo, WM_GETFONT, 0, 0);
ofont = (HFONT) SelectObject (mydc, nfont); ofont = SelectObject (mydc, nfont);
GetTextExtentPointW (mydc, strA, 1, size); GetTextExtentPointW (mydc, strA, 1, size);
SelectObject (mydc, ofont); SelectObject (mydc, ofont);
ReleaseDC (0, mydc); ReleaseDC (0, mydc);
@ -431,10 +431,9 @@ static void COMBOEX_ReSize (COMBOEX_INFO *infoPtr)
cy = max (iinfo.rcImage.bottom - iinfo.rcImage.top, cy); cy = max (iinfo.rcImage.bottom - iinfo.rcImage.top, cy);
TRACE("upgraded height due to image: height=%d\n", cy); TRACE("upgraded height due to image: height=%d\n", cy);
} }
SendMessageW (infoPtr->hwndSelf, CB_SETITEMHEIGHT, (WPARAM)-1, (LPARAM)cy); SendMessageW (infoPtr->hwndSelf, CB_SETITEMHEIGHT, -1, cy);
if (infoPtr->hwndCombo) { if (infoPtr->hwndCombo) {
SendMessageW (infoPtr->hwndCombo, CB_SETITEMHEIGHT, SendMessageW (infoPtr->hwndCombo, CB_SETITEMHEIGHT, 0, cy);
(WPARAM) 0, (LPARAM) cy);
if ( !(infoPtr->flags & CBES_EX_NOSIZELIMIT)) { if ( !(infoPtr->flags & CBES_EX_NOSIZELIMIT)) {
RECT comboRect; RECT comboRect;
if (GetWindowRect(infoPtr->hwndCombo, &comboRect)) { if (GetWindowRect(infoPtr->hwndCombo, &comboRect)) {
@ -468,7 +467,7 @@ static void COMBOEX_SetEditText (COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item)
} }
static CBE_ITEMDATA * COMBOEX_FindItem(COMBOEX_INFO *infoPtr, INT index) static CBE_ITEMDATA * COMBOEX_FindItem(COMBOEX_INFO *infoPtr, INT_PTR index)
{ {
CBE_ITEMDATA *item; CBE_ITEMDATA *item;
INT i; INT i;
@ -501,7 +500,7 @@ static inline BOOL COMBOEX_HasEdit(COMBOEX_INFO const *infoPtr)
/* *** CBEM_xxx message support *** */ /* *** CBEM_xxx message support *** */
static UINT COMBOEX_GetListboxText(COMBOEX_INFO *infoPtr, int n, LPWSTR buf) static UINT COMBOEX_GetListboxText(COMBOEX_INFO *infoPtr, INT_PTR n, LPWSTR buf)
{ {
CBE_ITEMDATA *item; CBE_ITEMDATA *item;
LPCWSTR str; LPCWSTR str;
@ -528,9 +527,9 @@ static UINT COMBOEX_GetListboxText(COMBOEX_INFO *infoPtr, int n, LPWSTR buf)
} }
static INT COMBOEX_DeleteItem (COMBOEX_INFO *infoPtr, INT index) static INT COMBOEX_DeleteItem (COMBOEX_INFO *infoPtr, INT_PTR index)
{ {
TRACE("(index=%d)\n", index); TRACE("(index=%ld)\n", index);
/* if item number requested does not exist then return failure */ /* if item number requested does not exist then return failure */
if ((index >= infoPtr->nb_items) || (index < 0)) return CB_ERR; if ((index >= infoPtr->nb_items) || (index < 0)) return CB_ERR;
@ -545,7 +544,7 @@ static INT COMBOEX_DeleteItem (COMBOEX_INFO *infoPtr, INT index)
static BOOL COMBOEX_GetItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit) static BOOL COMBOEX_GetItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit)
{ {
INT index = cit->iItem; INT_PTR index = cit->iItem;
CBE_ITEMDATA *item; CBE_ITEMDATA *item;
TRACE("(...)\n"); TRACE("(...)\n");
@ -608,7 +607,7 @@ static inline BOOL COMBOEX_HasEditChanged (COMBOEX_INFO const *infoPtr)
static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW const *cit) static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW const *cit)
{ {
INT index; INT_PTR index;
CBE_ITEMDATA *item; CBE_ITEMDATA *item;
NMCOMBOBOXEXW nmcit; NMCOMBOBOXEXW nmcit;
@ -622,7 +621,7 @@ static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW const *ci
if (index > infoPtr->nb_items) return -1; if (index > infoPtr->nb_items) return -1;
/* get zero-filled space and chain it in */ /* get zero-filled space and chain it in */
if(!(item = (CBE_ITEMDATA *)Alloc (sizeof(*item)))) return -1; if(!(item = Alloc (sizeof(*item)))) return -1;
/* locate position to insert new item in */ /* locate position to insert new item in */
if (index == infoPtr->nb_items) { if (index == infoPtr->nb_items) {
@ -654,7 +653,7 @@ static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW const *ci
if (is_textW(cit->pszText)) len = strlenW (cit->pszText); if (is_textW(cit->pszText)) len = strlenW (cit->pszText);
if (len > 0) { if (len > 0) {
item->pszText = (LPWSTR)Alloc ((len + 1)*sizeof(WCHAR)); item->pszText = Alloc ((len + 1)*sizeof(WCHAR));
if (!item->pszText) { if (!item->pszText) {
Free(item); Free(item);
return -1; return -1;
@ -700,7 +699,7 @@ static INT COMBOEX_InsertItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA const *ci
memcpy(&citW,cit,sizeof(COMBOBOXEXITEMA)); memcpy(&citW,cit,sizeof(COMBOBOXEXITEMA));
if (cit->mask & CBEIF_TEXT && is_textA(cit->pszText)) { if (cit->mask & CBEIF_TEXT && is_textA(cit->pszText)) {
INT len = MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, NULL, 0); INT len = MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, NULL, 0);
wstr = (LPWSTR)Alloc ((len + 1)*sizeof(WCHAR)); wstr = Alloc ((len + 1)*sizeof(WCHAR));
if (!wstr) return -1; if (!wstr) return -1;
MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, wstr, len); MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, wstr, len);
citW.pszText = wstr; citW.pszText = wstr;
@ -766,7 +765,7 @@ static HIMAGELIST COMBOEX_SetImageList (COMBOEX_INFO *infoPtr, HIMAGELIST himl)
static BOOL COMBOEX_SetItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit) static BOOL COMBOEX_SetItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit)
{ {
INT index = cit->iItem; INT_PTR index = cit->iItem;
CBE_ITEMDATA *item; CBE_ITEMDATA *item;
if (TRACE_ON(comboex)) COMBOEX_DumpInput (cit); if (TRACE_ON(comboex)) COMBOEX_DumpInput (cit);
@ -787,7 +786,7 @@ static BOOL COMBOEX_SetItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit)
COMBOEX_FreeText(item); COMBOEX_FreeText(item);
if (is_textW(cit->pszText)) len = strlenW(cit->pszText); if (is_textW(cit->pszText)) len = strlenW(cit->pszText);
if (len > 0) { if (len > 0) {
item->pszText = (LPWSTR)Alloc ((len + 1)*sizeof(WCHAR)); item->pszText = Alloc ((len + 1)*sizeof(WCHAR));
if (!item->pszText) return FALSE; if (!item->pszText) return FALSE;
strcpyW(item->pszText, cit->pszText); strcpyW(item->pszText, cit->pszText);
} else if (cit->pszText == LPSTR_TEXTCALLBACKW) } else if (cit->pszText == LPSTR_TEXTCALLBACKW)
@ -808,7 +807,7 @@ static BOOL COMBOEX_SetItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit)
if (TRACE_ON(comboex)) COMBOEX_DumpItem (item); if (TRACE_ON(comboex)) COMBOEX_DumpItem (item);
/* if original request was to update edit control, do some fast foot work */ /* if original request was to update edit control, do some fast foot work */
if (cit->iItem == -1) { if (cit->iItem == -1 && cit->mask & CBEIF_TEXT) {
COMBOEX_SetEditText (infoPtr, item); COMBOEX_SetEditText (infoPtr, item);
RedrawWindow (infoPtr->hwndCombo, 0, 0, RDW_ERASE | RDW_INVALIDATE); RedrawWindow (infoPtr->hwndCombo, 0, 0, RDW_ERASE | RDW_INVALIDATE);
} }
@ -824,7 +823,7 @@ static BOOL COMBOEX_SetItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA const *cit)
memcpy(&citW, cit, sizeof(COMBOBOXEXITEMA)); memcpy(&citW, cit, sizeof(COMBOBOXEXITEMA));
if ((cit->mask & CBEIF_TEXT) && is_textA(cit->pszText)) { if ((cit->mask & CBEIF_TEXT) && is_textA(cit->pszText)) {
INT len = MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, NULL, 0); INT len = MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, NULL, 0);
wstr = (LPWSTR)Alloc ((len + 1)*sizeof(WCHAR)); wstr = Alloc ((len + 1)*sizeof(WCHAR));
if (!wstr) return FALSE; if (!wstr) return FALSE;
MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, wstr, len); MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, wstr, len);
citW.pszText = wstr; citW.pszText = wstr;
@ -871,7 +870,7 @@ COMBOEX_FindStringExact (COMBOEX_INFO *infoPtr, INT start, LPCWSTR str)
} }
static DWORD_PTR COMBOEX_GetItemData (COMBOEX_INFO *infoPtr, INT index) static DWORD_PTR COMBOEX_GetItemData (COMBOEX_INFO *infoPtr, INT_PTR index)
{ {
CBE_ITEMDATA const *item1; CBE_ITEMDATA const *item1;
CBE_ITEMDATA const *item2; CBE_ITEMDATA const *item2;
@ -894,7 +893,7 @@ static DWORD_PTR COMBOEX_GetItemData (COMBOEX_INFO *infoPtr, INT index)
} }
static INT COMBOEX_SetCursel (COMBOEX_INFO *infoPtr, INT index) static INT COMBOEX_SetCursel (COMBOEX_INFO *infoPtr, INT_PTR index)
{ {
CBE_ITEMDATA *item; CBE_ITEMDATA *item;
INT sel; INT sel;
@ -902,7 +901,7 @@ static INT COMBOEX_SetCursel (COMBOEX_INFO *infoPtr, INT index)
if (!(item = COMBOEX_FindItem(infoPtr, index))) if (!(item = COMBOEX_FindItem(infoPtr, index)))
return SendMessageW (infoPtr->hwndCombo, CB_SETCURSEL, index, 0); return SendMessageW (infoPtr->hwndCombo, CB_SETCURSEL, index, 0);
TRACE("selecting item %d text=%s\n", index, debugstr_txt(item->pszText)); TRACE("selecting item %ld text=%s\n", index, debugstr_txt(item->pszText));
infoPtr->selected = index; infoPtr->selected = index;
sel = (INT)SendMessageW (infoPtr->hwndCombo, CB_SETCURSEL, index, 0); sel = (INT)SendMessageW (infoPtr->hwndCombo, CB_SETCURSEL, index, 0);
@ -911,7 +910,7 @@ static INT COMBOEX_SetCursel (COMBOEX_INFO *infoPtr, INT index)
} }
static DWORD_PTR COMBOEX_SetItemData (COMBOEX_INFO *infoPtr, INT index, DWORD_PTR data) static DWORD_PTR COMBOEX_SetItemData (COMBOEX_INFO *infoPtr, INT_PTR index, DWORD_PTR data)
{ {
CBE_ITEMDATA *item1; CBE_ITEMDATA *item1;
CBE_ITEMDATA const *item2; CBE_ITEMDATA const *item2;
@ -976,7 +975,7 @@ static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs)
INT i; INT i;
/* allocate memory for info structure */ /* allocate memory for info structure */
infoPtr = (COMBOEX_INFO *)Alloc (sizeof(COMBOEX_INFO)); infoPtr = Alloc (sizeof(COMBOEX_INFO));
if (!infoPtr) return -1; if (!infoPtr) return -1;
/* initialize info structure */ /* initialize info structure */
@ -1109,7 +1108,7 @@ static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs)
* Create an item structure to represent the data in the * Create an item structure to represent the data in the
* EDIT control. It is allocated zero-filled. * EDIT control. It is allocated zero-filled.
*/ */
infoPtr->edit = (CBE_ITEMDATA *)Alloc (sizeof (CBE_ITEMDATA)); infoPtr->edit = Alloc (sizeof (CBE_ITEMDATA));
if (!infoPtr->edit) { if (!infoPtr->edit) {
COMBOEX_Destroy(infoPtr); COMBOEX_Destroy(infoPtr);
return -1; return -1;
@ -1119,13 +1118,14 @@ static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs)
} }
static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam, LPARAM lParam) static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam)
{ {
LRESULT lret; LRESULT lret;
INT command = HIWORD(wParam); INT command = HIWORD(wParam);
CBE_ITEMDATA *item = 0; CBE_ITEMDATA *item = 0;
WCHAR wintext[520]; WCHAR wintext[520];
INT cursel, n, oldItem; INT cursel, n;
INT_PTR oldItem;
NMCBEENDEDITW cbeend; NMCBEENDEDITW cbeend;
DWORD oldflags; DWORD oldflags;
HWND parent = infoPtr->hwndNotify; HWND parent = infoPtr->hwndNotify;
@ -1225,7 +1225,7 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam, LPARAM lPa
*/ */
oldItem = SendMessageW (infoPtr->hwndCombo, CB_GETCURSEL, 0, 0); oldItem = SendMessageW (infoPtr->hwndCombo, CB_GETCURSEL, 0, 0);
if (!(item = COMBOEX_FindItem(infoPtr, oldItem))) { if (!(item = COMBOEX_FindItem(infoPtr, oldItem))) {
ERR("item %d not found. Problem!\n", oldItem); ERR("item %ld not found. Problem!\n", oldItem);
break; break;
} }
infoPtr->selected = oldItem; infoPtr->selected = oldItem;
@ -1408,7 +1408,7 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT const *di
item->mask &= ~CBEIF_TEXT; item->mask &= ~CBEIF_TEXT;
if( (len = GetWindowTextLengthW(infoPtr->hwndEdit)) ) { if( (len = GetWindowTextLengthW(infoPtr->hwndEdit)) ) {
item->mask |= CBEIF_TEXT; item->mask |= CBEIF_TEXT;
item->pszText = (LPWSTR)Alloc ((len + 1)*sizeof(WCHAR)); item->pszText = Alloc ((len + 1)*sizeof(WCHAR));
if (item->pszText) if (item->pszText)
GetWindowTextW(infoPtr->hwndEdit, item->pszText, len+1); GetWindowTextW(infoPtr->hwndEdit, item->pszText, len+1);
@ -1713,7 +1713,7 @@ static LRESULT COMBOEX_WindowPosChanging (COMBOEX_INFO *infoPtr, WINDOWPOS *wp)
static LRESULT WINAPI static LRESULT WINAPI
COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
HWND hwndComboex = (HWND)GetPropW(hwnd, COMBOEX_SUBCLASS_PROP); HWND hwndComboex = GetPropW(hwnd, COMBOEX_SUBCLASS_PROP);
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr (hwndComboex); COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr (hwndComboex);
NMCBEENDEDITW cbeend; NMCBEENDEDITW cbeend;
WCHAR edit_text[260]; WCHAR edit_text[260];
@ -1751,7 +1751,7 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
hwnd, uMsg, wParam, lParam); hwnd, uMsg, wParam, lParam);
case WM_KEYDOWN: { case WM_KEYDOWN: {
INT oldItem, selected, step = 1; INT_PTR oldItem, selected, step = 1;
CBE_ITEMDATA *item; CBE_ITEMDATA *item;
switch ((INT)wParam) switch ((INT)wParam)
@ -1788,7 +1788,7 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
oldItem = SendMessageW (infoPtr->hwndCombo, CB_GETCURSEL, 0, 0); oldItem = SendMessageW (infoPtr->hwndCombo, CB_GETCURSEL, 0, 0);
InvalidateRect (infoPtr->hwndCombo, 0, 0); InvalidateRect (infoPtr->hwndCombo, 0, 0);
if (!(item = COMBOEX_FindItem(infoPtr, oldItem))) { if (!(item = COMBOEX_FindItem(infoPtr, oldItem))) {
ERR("item %d not found. Problem!\n", oldItem); ERR("item %ld not found. Problem!\n", oldItem);
break; break;
} }
infoPtr->selected = oldItem; infoPtr->selected = oldItem;
@ -1830,7 +1830,7 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (selected != -1) { if (selected != -1) {
cmp_func_t cmptext = get_cmp_func(infoPtr); cmp_func_t cmptext = get_cmp_func(infoPtr);
item = COMBOEX_FindItem (infoPtr, selected); item = COMBOEX_FindItem (infoPtr, selected);
TRACE("handling VK_RETURN, selected = %d, selected_text=%s\n", TRACE("handling VK_RETURN, selected = %ld, selected_text=%s\n",
selected, debugstr_txt(item->pszText)); selected, debugstr_txt(item->pszText));
TRACE("handling VK_RETURN, edittext=%s\n", TRACE("handling VK_RETURN, edittext=%s\n",
debugstr_w(edit_text)); debugstr_w(edit_text));
@ -1911,7 +1911,7 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
static LRESULT WINAPI static LRESULT WINAPI
COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
HWND hwndComboex = (HWND)GetPropW(hwnd, COMBOEX_SUBCLASS_PROP); HWND hwndComboex = GetPropW(hwnd, COMBOEX_SUBCLASS_PROP);
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr (hwndComboex); COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr (hwndComboex);
NMCBEENDEDITW cbeend; NMCBEENDEDITW cbeend;
NMMOUSE nmmse; NMMOUSE nmmse;
@ -2080,7 +2080,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
LPCWSTR lastwrk; LPCWSTR lastwrk;
cmp_func_t cmptext = get_cmp_func(infoPtr); cmp_func_t cmptext = get_cmp_func(infoPtr);
INT selected = SendMessageW (infoPtr->hwndCombo, INT_PTR selected = SendMessageW (infoPtr->hwndCombo,
CB_GETCURSEL, 0, 0); CB_GETCURSEL, 0, 0);
/* lstrlenW( lastworkingURL ) */ /* lstrlenW( lastworkingURL ) */
@ -2094,7 +2094,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
lastwrk = COMBOEX_GetText(infoPtr, item); lastwrk = COMBOEX_GetText(infoPtr, item);
} }
TRACE("handling EN_CHANGE, selected = %d, selected_text=%s\n", TRACE("handling EN_CHANGE, selected = %ld, selected_text=%s\n",
selected, debugstr_w(lastwrk)); selected, debugstr_w(lastwrk));
TRACE("handling EN_CHANGE, edittext=%s\n", TRACE("handling EN_CHANGE, edittext=%s\n",
debugstr_w(edit_text)); debugstr_w(edit_text));
@ -2274,7 +2274,7 @@ COMBOEX_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* Window messages passed to parent */ /* Window messages passed to parent */
case WM_COMMAND: case WM_COMMAND:
return COMBOEX_Command (infoPtr, wParam, lParam); return COMBOEX_Command (infoPtr, wParam);
case WM_NOTIFY: case WM_NOTIFY:
if (infoPtr->NtfUnicode) if (infoPtr->NtfUnicode)
@ -2310,7 +2310,7 @@ COMBOEX_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return 0; return 0;
default: default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP)) if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n",uMsg,wParam,lParam); ERR("unknown msg %04x wp=%08lx lp=%08lx\n",uMsg,wParam,lParam);
return DefWindowProcW (hwnd, uMsg, wParam, lParam); return DefWindowProcW (hwnd, uMsg, wParam, lParam);
} }

View file

@ -148,6 +148,8 @@ HWND COMCTL32_CreateToolTip (HWND);
VOID COMCTL32_RefreshSysColors(void); VOID COMCTL32_RefreshSysColors(void);
void COMCTL32_DrawInsertMark(HDC hDC, const RECT *lpRect, COLORREF clrInsertMark, BOOL bHorizontal); void COMCTL32_DrawInsertMark(HDC hDC, const RECT *lpRect, COLORREF clrInsertMark, BOOL bHorizontal);
void COMCTL32_EnsureBitmapSize(HBITMAP *pBitmap, int cxMinWidth, int cyMinHeight, COLORREF crBackground); void COMCTL32_EnsureBitmapSize(HBITMAP *pBitmap, int cxMinWidth, int cyMinHeight, COLORREF crBackground);
void COMCTL32_GetFontMetrics(HFONT hFont, TEXTMETRICW *ptm);
BOOL COMCTL32_IsReflectedMessage(UINT uMsg);
INT Str_GetPtrWtoA (LPCWSTR lpSrc, LPSTR lpDest, INT nMaxLen); INT Str_GetPtrWtoA (LPCWSTR lpSrc, LPSTR lpDest, INT nMaxLen);
INT Str_GetPtrAtoW (LPCSTR lpSrc, LPWSTR lpDest, INT nMaxLen); INT Str_GetPtrAtoW (LPCSTR lpSrc, LPWSTR lpDest, INT nMaxLen);
BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc); BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc);
@ -173,8 +175,8 @@ typedef struct
/* undocumented functions */ /* undocumented functions */
LPVOID WINAPI Alloc (DWORD); LPVOID WINAPI Alloc (DWORD) __WINE_ALLOC_SIZE(1);
LPVOID WINAPI ReAlloc (LPVOID, DWORD); LPVOID WINAPI ReAlloc (LPVOID, DWORD) __WINE_ALLOC_SIZE(2);
BOOL WINAPI Free (LPVOID); BOOL WINAPI Free (LPVOID);
DWORD WINAPI GetSize (LPVOID); DWORD WINAPI GetSize (LPVOID);

View file

@ -32,6 +32,7 @@
<file>string.c</file> <file>string.c</file>
<file>syslink.c</file> <file>syslink.c</file>
<file>tab.c</file> <file>tab.c</file>
<file>theme_button.c</file>
<file>theme_combo.c</file> <file>theme_combo.c</file>
<file>theme_dialog.c</file> <file>theme_dialog.c</file>
<file>theme_edit.c</file> <file>theme_edit.c</file>

View file

@ -16,17 +16,20 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/* UTF-8 */
#pragma code_page(65001)
LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140 IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140
STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Properties for %s" CAPTION "Properties for %s"
FONT 9, "MS UI Gothic" FONT 9, "MS Shell Dlg"
BEGIN BEGIN
DEFPUSHBUTTON "OK", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP DEFPUSHBUTTON "OK", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP
PUSHBUTTON "キャンセル", IDCANCEL,58,122,50,14 PUSHBUTTON "キャンセル", IDCANCEL,58,122,50,14
PUSHBUTTON "適用(&A)", IDC_APPLY_BUTTON,112,122,50,14,WS_DISABLED PUSHBUTTON "適用(&A)", IDC_APPLY_BUTTON,112,122,50,14,WS_DISABLED
PUSHBUTTON "ヘルプ", IDHELP,166,122,50,14,WS_TABSTOP|WS_GROUP PUSHBUTTON "ヘルプ", IDHELP,166,122,50,14,WS_TABSTOP|WS_GROUP
CONTROL "Tab", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114 CONTROL "Tab", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114
END END
@ -34,13 +37,13 @@ END
IDD_WIZARD DIALOG DISCARDABLE 0, 0, 290, 159 IDD_WIZARD DIALOG DISCARDABLE 0, 0, 290, 159
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Wizard" CAPTION "Wizard"
FONT 9, "MS UI Gothic" FONT 9, "MS Shell Dlg"
BEGIN BEGIN
PUSHBUTTON "< 戻る(&B)", IDC_BACK_BUTTON,71,138,50,14 PUSHBUTTON "< 戻る(&B)", IDC_BACK_BUTTON,71,138,50,14
DEFPUSHBUTTON "進む(&N) >", IDC_NEXT_BUTTON,121,138,50,14 DEFPUSHBUTTON "進む(&N) >", IDC_NEXT_BUTTON,121,138,50,14
DEFPUSHBUTTON "完了", IDC_FINISH_BUTTON,121,138,50,14 DEFPUSHBUTTON "完了", IDC_FINISH_BUTTON,121,138,50,14
PUSHBUTTON "キャンセル", IDCANCEL,178,138,50,14 PUSHBUTTON "キャンセル", IDCANCEL,178,138,50,14
PUSHBUTTON "ヘルプ", IDHELP,235,138,50,14,WS_GROUP PUSHBUTTON "ヘルプ", IDHELP,235,138,50,14,WS_GROUP
LTEXT "", IDC_SUNKEN_LINE,7,129,278,1,SS_SUNKEN LTEXT "", IDC_SUNKEN_LINE,7,129,278,1,SS_SUNKEN
CONTROL "Tab", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS | WS_DISABLED,7,7,258,5 CONTROL "Tab", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS | WS_DISABLED,7,7,258,5
LTEXT "", IDC_SUNKEN_LINEHEADER,0,35,290,1,SS_LEFT | SS_SUNKEN | WS_CHILD | WS_VISIBLE LTEXT "", IDC_SUNKEN_LINEHEADER,0,35,290,1,SS_LEFT | SS_SUNKEN | WS_CHILD | WS_VISIBLE
@ -50,17 +53,17 @@ END
IDD_TBCUSTOMIZE DIALOG DISCARDABLE 10, 20, 357, 125 IDD_TBCUSTOMIZE DIALOG DISCARDABLE 10, 20, 357, 125
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Customize Toolbar" CAPTION "Customize Toolbar"
FONT 9, "MS UI Gothic" FONT 9, "MS Shell Dlg"
BEGIN BEGIN
DEFPUSHBUTTON "閉じる(&C)", IDCANCEL,308,6,44,14 DEFPUSHBUTTON "閉じる(&C)", IDCANCEL,308,6,44,14
PUSHBUTTON "リセット(R&)", IDC_RESET_BTN,308,23,44,14 PUSHBUTTON "リセット(R&)", IDC_RESET_BTN,308,23,44,14
PUSHBUTTON "ヘルプ(&H)", IDC_HELP_BTN,308,40,44,14 PUSHBUTTON "ヘルプ(&H)", IDC_HELP_BTN,308,40,44,14
PUSHBUTTON "上へ (&U)", IDC_MOVEUP_BTN,308,74,44,14 PUSHBUTTON "上へ (&U)", IDC_MOVEUP_BTN,308,74,44,14
PUSHBUTTON "下へ (&D)", IDC_MOVEDN_BTN,308,91,44,14 PUSHBUTTON "下へ (&D)", IDC_MOVEDN_BTN,308,91,44,14
LTEXT "A&vailable buttons:", -1,4,5,84,10 LTEXT "A&vailable buttons:", -1,4,5,84,10
LISTBOX IDC_AVAILBTN_LBOX,4,17,120,100, LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP LISTBOX IDC_AVAILBTN_LBOX,4,17,120,100, LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
PUSHBUTTON "追加(&A) ->", IDOK, 131, 42, 44, 14 PUSHBUTTON "追加(&A) ->", IDOK, 131, 42, 44, 14
PUSHBUTTON "<- 削除(&R)", IDC_REMOVE_BTN,131,62,44,14 PUSHBUTTON "<- 削除(&R)", IDC_REMOVE_BTN,131,62,44,14
LTEXT "&Toolbar buttons:", -1,182,5,78,10 LTEXT "&Toolbar buttons:", -1,182,5,78,10
LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
END END
@ -85,3 +88,5 @@ STRINGTABLE DISCARDABLE
{ {
HKY_NONE "None" HKY_NONE "None"
} }
#pragma code_page(default)

View file

@ -17,7 +17,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
LANGUAGE LANG_KOREAN, SUBLANG_NEUTRAL LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140 IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140
STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE

View file

@ -123,11 +123,11 @@ static const char manifest[] =
static const char manifest_filename[] = ARCH "_" NAME "_" PUBLIC_KEY "_" VERSION "_none_deadbeef.manifest"; static const char manifest_filename[] = ARCH "_" NAME "_" PUBLIC_KEY "_" VERSION "_none_deadbeef.manifest";
LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); static LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
LPWSTR COMCTL32_wSubclass = NULL; static LPWSTR COMCTL32_wSubclass = NULL;
HMODULE COMCTL32_hModule = 0; HMODULE COMCTL32_hModule = 0;
LANGID COMCTL32_uiLang = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL); static LANGID COMCTL32_uiLang = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL);
HBRUSH COMCTL32_hPattern55AABrush = NULL; HBRUSH COMCTL32_hPattern55AABrush = NULL;
COMCTL32_SysColor comctl32_color; COMCTL32_SysColor comctl32_color;
@ -878,7 +878,7 @@ CreateMappedBitmap (HINSTANCE hInstance, INT_PTR idBitmap, UINT wFlags,
hglb = LoadResource (hInstance, hRsrc); hglb = LoadResource (hInstance, hRsrc);
if (hglb == 0) if (hglb == 0)
return 0; return 0;
lpBitmap = (LPBITMAPINFOHEADER)LockResource (hglb); lpBitmap = LockResource (hglb);
if (lpBitmap == NULL) if (lpBitmap == NULL)
return 0; return 0;
@ -889,7 +889,7 @@ CreateMappedBitmap (HINSTANCE hInstance, INT_PTR idBitmap, UINT wFlags,
else else
nColorTableSize = 0; nColorTableSize = 0;
nSize = lpBitmap->biSize + nColorTableSize * sizeof(RGBQUAD); nSize = lpBitmap->biSize + nColorTableSize * sizeof(RGBQUAD);
lpBitmapInfo = (LPBITMAPINFOHEADER)GlobalAlloc (GMEM_FIXED, nSize); lpBitmapInfo = GlobalAlloc (GMEM_FIXED, nSize);
if (lpBitmapInfo == NULL) if (lpBitmapInfo == NULL)
return 0; return 0;
RtlMoveMemory (lpBitmapInfo, lpBitmap, nSize); RtlMoveMemory (lpBitmapInfo, lpBitmap, nSize);
@ -932,7 +932,7 @@ CreateMappedBitmap (HINSTANCE hInstance, INT_PTR idBitmap, UINT wFlags,
DeleteDC (hdcDst); DeleteDC (hdcDst);
} }
ReleaseDC (NULL, hdcScreen); ReleaseDC (NULL, hdcScreen);
GlobalFree ((HGLOBAL)lpBitmapInfo); GlobalFree (lpBitmapInfo);
FreeResource (hglb); FreeResource (hglb);
return hbm; return hbm;
@ -1117,7 +1117,7 @@ BOOL WINAPI SetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass,
* from there. */ * from there. */
/* See if we have been called for this window */ /* See if we have been called for this window */
stack = (LPSUBCLASS_INFO)GetPropW (hWnd, COMCTL32_wSubclass); stack = GetPropW (hWnd, COMCTL32_wSubclass);
if (!stack) { if (!stack) {
/* allocate stack */ /* allocate stack */
stack = Alloc (sizeof(SUBCLASS_INFO)); stack = Alloc (sizeof(SUBCLASS_INFO));
@ -1196,7 +1196,7 @@ BOOL WINAPI GetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass,
TRACE ("(%p, %p, %lx, %p)\n", hWnd, pfnSubclass, uID, pdwRef); TRACE ("(%p, %p, %lx, %p)\n", hWnd, pfnSubclass, uID, pdwRef);
/* See if we have been called for this window */ /* See if we have been called for this window */
stack = (LPSUBCLASS_INFO)GetPropW (hWnd, COMCTL32_wSubclass); stack = GetPropW (hWnd, COMCTL32_wSubclass);
if (!stack) if (!stack)
return FALSE; return FALSE;
@ -1239,7 +1239,7 @@ BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR u
TRACE ("(%p, %p, %lx)\n", hWnd, pfnSubclass, uID); TRACE ("(%p, %p, %lx)\n", hWnd, pfnSubclass, uID);
/* Find the Subclass to remove */ /* Find the Subclass to remove */
stack = (LPSUBCLASS_INFO)GetPropW (hWnd, COMCTL32_wSubclass); stack = GetPropW (hWnd, COMCTL32_wSubclass);
if (!stack) if (!stack)
return FALSE; return FALSE;
@ -1284,7 +1284,7 @@ BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR u
* Window procedure for all subclassed windows. * Window procedure for all subclassed windows.
* Saves the current subclassing stack position to support nested messages * Saves the current subclassing stack position to support nested messages
*/ */
LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) static LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
LPSUBCLASS_INFO stack; LPSUBCLASS_INFO stack;
LPSUBCLASSPROCS proc; LPSUBCLASSPROCS proc;
@ -1292,7 +1292,7 @@ LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
TRACE ("(%p, 0x%08x, 0x%08lx, 0x%08lx)\n", hWnd, uMsg, wParam, lParam); TRACE ("(%p, 0x%08x, 0x%08lx, 0x%08lx)\n", hWnd, uMsg, wParam, lParam);
stack = (LPSUBCLASS_INFO)GetPropW (hWnd, COMCTL32_wSubclass); stack = GetPropW (hWnd, COMCTL32_wSubclass);
if (!stack) { if (!stack) {
ERR ("Our sub classing stack got erased for %p!! Nothing we can do\n", hWnd); ERR ("Our sub classing stack got erased for %p!! Nothing we can do\n", hWnd);
return 0; return 0;
@ -1343,7 +1343,7 @@ LRESULT WINAPI DefSubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
TRACE ("(%p, 0x%08x, 0x%08lx, 0x%08lx)\n", hWnd, uMsg, wParam, lParam); TRACE ("(%p, 0x%08x, 0x%08lx, 0x%08lx)\n", hWnd, uMsg, wParam, lParam);
/* retrieve our little stack from the Properties */ /* retrieve our little stack from the Properties */
stack = (LPSUBCLASS_INFO)GetPropW (hWnd, COMCTL32_wSubclass); stack = GetPropW (hWnd, COMCTL32_wSubclass);
if (!stack) { if (!stack) {
ERR ("Our sub classing stack got erased for %p!! Nothing we can do\n", hWnd); ERR ("Our sub classing stack got erased for %p!! Nothing we can do\n", hWnd);
return 0; return 0;
@ -1561,6 +1561,61 @@ void COMCTL32_EnsureBitmapSize(HBITMAP *pBitmap, int cxMinWidth, int cyMinHeight
return; return;
} }
void COMCTL32_GetFontMetrics(HFONT hFont, TEXTMETRICW *ptm)
{
HDC hdc = GetDC(NULL);
HFONT hOldFont;
hOldFont = SelectObject(hdc, hFont);
GetTextMetricsW(hdc, ptm);
SelectObject(hdc, hOldFont);
ReleaseDC(NULL, hdc);
}
#ifndef OCM__BASE /* avoid including olectl.h */
#define OCM__BASE (WM_USER+0x1c00)
#endif
/***********************************************************************
* COMCTL32_IsReflectedMessage [internal]
*
* Some parents reflect notify messages - for some messages sent by the child,
* they send it back with the message code increased by OCM__BASE (0x2000).
* This allows better subclassing of controls. We don't need to handle such
* messages but we don't want to print ERRs for them, so this helper function
* identifies them.
*
* Some of the codes are in the CCM_FIRST..CCM_LAST range, but there is no
* colision with defined CCM_ codes.
*/
BOOL COMCTL32_IsReflectedMessage(UINT uMsg)
{
switch (uMsg)
{
case OCM__BASE + WM_COMMAND:
case OCM__BASE + WM_CTLCOLORBTN:
case OCM__BASE + WM_CTLCOLOREDIT:
case OCM__BASE + WM_CTLCOLORDLG:
case OCM__BASE + WM_CTLCOLORLISTBOX:
case OCM__BASE + WM_CTLCOLORMSGBOX:
case OCM__BASE + WM_CTLCOLORSCROLLBAR:
case OCM__BASE + WM_CTLCOLORSTATIC:
case OCM__BASE + WM_DRAWITEM:
case OCM__BASE + WM_MEASUREITEM:
case OCM__BASE + WM_DELETEITEM:
case OCM__BASE + WM_VKEYTOITEM:
case OCM__BASE + WM_CHARTOITEM:
case OCM__BASE + WM_COMPAREITEM:
case OCM__BASE + WM_HSCROLL:
case OCM__BASE + WM_VSCROLL:
case OCM__BASE + WM_PARENTNOTIFY:
case OCM__BASE + WM_NOTIFY:
return TRUE;
default:
return FALSE;
}
}
/*********************************************************************** /***********************************************************************
* MirrorIcon [COMCTL32.414] * MirrorIcon [COMCTL32.414]
* *

View file

@ -707,7 +707,7 @@ DATETIME_HitTest (const DATETIME_INFO *infoPtr, POINT pt)
static LRESULT static LRESULT
DATETIME_LButtonDown (DATETIME_INFO *infoPtr, WORD wKey, INT x, INT y) DATETIME_LButtonDown (DATETIME_INFO *infoPtr, INT x, INT y)
{ {
POINT pt; POINT pt;
int old, new; int old, new;
@ -769,7 +769,7 @@ DATETIME_LButtonDown (DATETIME_INFO *infoPtr, WORD wKey, INT x, INT y)
static LRESULT static LRESULT
DATETIME_LButtonUp (DATETIME_INFO *infoPtr, WORD wKey) DATETIME_LButtonUp (DATETIME_INFO *infoPtr)
{ {
if(infoPtr->bCalDepressed) { if(infoPtr->bCalDepressed) {
infoPtr->bCalDepressed = FALSE; infoPtr->bCalDepressed = FALSE;
@ -865,7 +865,7 @@ DATETIME_EraseBackground (const DATETIME_INFO *infoPtr, HDC hdc)
static LRESULT static LRESULT
DATETIME_Notify (DATETIME_INFO *infoPtr, int idCtrl, LPNMHDR lpnmh) DATETIME_Notify (DATETIME_INFO *infoPtr, LPNMHDR lpnmh)
{ {
TRACE ("Got notification %x from %p\n", lpnmh->code, lpnmh->hwndFrom); TRACE ("Got notification %x from %p\n", lpnmh->code, lpnmh->hwndFrom);
TRACE ("info: %p %p %p\n", infoPtr->hwndSelf, infoPtr->hMonthCal, infoPtr->hUpdown); TRACE ("info: %p %p %p\n", infoPtr->hwndSelf, infoPtr->hMonthCal, infoPtr->hUpdown);
@ -890,7 +890,7 @@ DATETIME_Notify (DATETIME_INFO *infoPtr, int idCtrl, LPNMHDR lpnmh)
static LRESULT static LRESULT
DATETIME_KeyDown (DATETIME_INFO *infoPtr, DWORD vkCode, LPARAM flags) DATETIME_KeyDown (DATETIME_INFO *infoPtr, DWORD vkCode)
{ {
int fieldNum = infoPtr->select & DTHT_DATEFIELD; int fieldNum = infoPtr->select & DTHT_DATEFIELD;
int wrap = 0; int wrap = 0;
@ -902,83 +902,6 @@ DATETIME_KeyDown (DATETIME_INFO *infoPtr, DWORD vkCode, LPARAM flags)
FIXME ("Callbacks not implemented yet\n"); FIXME ("Callbacks not implemented yet\n");
} }
if (vkCode >= '0' && vkCode <= '9') {
/* this is a somewhat simplified version of what Windows does */
SYSTEMTIME *date = &infoPtr->date;
switch (infoPtr->fieldspec[fieldNum]) {
case ONEDIGITYEAR:
case TWODIGITYEAR:
date->wYear = date->wYear - (date->wYear%100) +
(date->wYear%10)*10 + (vkCode-'0');
date->wDayOfWeek = DATETIME_CalculateDayOfWeek(
date->wDay,date->wMonth,date->wYear);
DATETIME_SendDateTimeChangeNotify (infoPtr);
break;
case INVALIDFULLYEAR:
case FULLYEAR:
date->wYear = (date->wYear%1000)*10 + (vkCode-'0');
date->wDayOfWeek = DATETIME_CalculateDayOfWeek(
date->wDay,date->wMonth,date->wYear);
DATETIME_SendDateTimeChangeNotify (infoPtr);
break;
case ONEDIGITMONTH:
case TWODIGITMONTH:
if ((date->wMonth%10) > 1 || (vkCode-'0') > 2)
date->wMonth = vkCode-'0';
else
date->wMonth = (date->wMonth%10)*10+vkCode-'0';
date->wDayOfWeek = DATETIME_CalculateDayOfWeek(
date->wDay,date->wMonth,date->wYear);
DATETIME_SendDateTimeChangeNotify (infoPtr);
break;
case ONEDIGITDAY:
case TWODIGITDAY:
/* probably better checking here would help */
if ((date->wDay%10) >= 3 && (vkCode-'0') > 1)
date->wDay = vkCode-'0';
else
date->wDay = (date->wDay%10)*10+vkCode-'0';
date->wDayOfWeek = DATETIME_CalculateDayOfWeek(
date->wDay,date->wMonth,date->wYear);
DATETIME_SendDateTimeChangeNotify (infoPtr);
break;
case ONEDIGIT12HOUR:
case TWODIGIT12HOUR:
if ((date->wHour%10) > 1 || (vkCode-'0') > 2)
date->wHour = vkCode-'0';
else
date->wHour = (date->wHour%10)*10+vkCode-'0';
DATETIME_SendDateTimeChangeNotify (infoPtr);
break;
case ONEDIGIT24HOUR:
case TWODIGIT24HOUR:
if ((date->wHour%10) > 2)
date->wHour = vkCode-'0';
else if ((date->wHour%10) == 2 && (vkCode-'0') > 3)
date->wHour = vkCode-'0';
else
date->wHour = (date->wHour%10)*10+vkCode-'0';
DATETIME_SendDateTimeChangeNotify (infoPtr);
break;
case ONEDIGITMINUTE:
case TWODIGITMINUTE:
if ((date->wMinute%10) > 5)
date->wMinute = vkCode-'0';
else
date->wMinute = (date->wMinute%10)*10+vkCode-'0';
DATETIME_SendDateTimeChangeNotify (infoPtr);
break;
case ONEDIGITSECOND:
case TWODIGITSECOND:
if ((date->wSecond%10) > 5)
date->wSecond = vkCode-'0';
else
date->wSecond = (date->wSecond%10)*10+vkCode-'0';
DATETIME_SendDateTimeChangeNotify (infoPtr);
break;
}
}
switch (vkCode) { switch (vkCode) {
case VK_ADD: case VK_ADD:
case VK_UP: case VK_UP:
@ -1025,6 +948,94 @@ DATETIME_KeyDown (DATETIME_INFO *infoPtr, DWORD vkCode, LPARAM flags)
} }
static LRESULT
DATETIME_Char (DATETIME_INFO *infoPtr, WPARAM vkCode)
{
int fieldNum = infoPtr->select & DTHT_DATEFIELD;
if (vkCode >= '0' && vkCode <= '9') {
int num = vkCode-'0';
int newDays;
/* this is a somewhat simplified version of what Windows does */
SYSTEMTIME *date = &infoPtr->date;
switch (infoPtr->fieldspec[fieldNum]) {
case ONEDIGITYEAR:
case TWODIGITYEAR:
date->wYear = date->wYear - (date->wYear%100) +
(date->wYear%10)*10 + num;
date->wDayOfWeek = DATETIME_CalculateDayOfWeek(
date->wDay,date->wMonth,date->wYear);
DATETIME_SendDateTimeChangeNotify (infoPtr);
break;
case INVALIDFULLYEAR:
case FULLYEAR:
date->wYear = (date->wYear%1000)*10 + num;
date->wDayOfWeek = DATETIME_CalculateDayOfWeek(
date->wDay,date->wMonth,date->wYear);
DATETIME_SendDateTimeChangeNotify (infoPtr);
break;
case ONEDIGITMONTH:
case TWODIGITMONTH:
if ((date->wMonth%10) > 1 || num > 2)
date->wMonth = num;
else
date->wMonth = (date->wMonth%10)*10+num;
date->wDayOfWeek = DATETIME_CalculateDayOfWeek(
date->wDay,date->wMonth,date->wYear);
DATETIME_SendDateTimeChangeNotify (infoPtr);
break;
case ONEDIGITDAY:
case TWODIGITDAY:
newDays = (date->wDay%10)*10+num;
if (newDays > MONTHCAL_MonthLength(date->wMonth, date->wYear))
date->wDay = num;
else
date->wDay = newDays;
date->wDayOfWeek = DATETIME_CalculateDayOfWeek(
date->wDay,date->wMonth,date->wYear);
DATETIME_SendDateTimeChangeNotify (infoPtr);
break;
case ONEDIGIT12HOUR:
case TWODIGIT12HOUR:
if ((date->wHour%10) > 1 || num > 2)
date->wHour = num;
else
date->wHour = (date->wHour%10)*10+num;
DATETIME_SendDateTimeChangeNotify (infoPtr);
break;
case ONEDIGIT24HOUR:
case TWODIGIT24HOUR:
if ((date->wHour%10) > 2)
date->wHour = num;
else if ((date->wHour%10) == 2 && num > 3)
date->wHour = num;
else
date->wHour = (date->wHour%10)*10+num;
DATETIME_SendDateTimeChangeNotify (infoPtr);
break;
case ONEDIGITMINUTE:
case TWODIGITMINUTE:
if ((date->wMinute%10) > 5)
date->wMinute = num;
else
date->wMinute = (date->wMinute%10)*10+num;
DATETIME_SendDateTimeChangeNotify (infoPtr);
break;
case ONEDIGITSECOND:
case TWODIGITSECOND:
if ((date->wSecond%10) > 5)
date->wSecond = num;
else
date->wSecond = (date->wSecond%10)*10+num;
DATETIME_SendDateTimeChangeNotify (infoPtr);
break;
}
}
return 0;
}
static LRESULT static LRESULT
DATETIME_VScroll (DATETIME_INFO *infoPtr, WORD wScroll) DATETIME_VScroll (DATETIME_INFO *infoPtr, WORD wScroll)
{ {
@ -1138,7 +1149,7 @@ DATETIME_SendSimpleNotify (const DATETIME_INFO *infoPtr, UINT code)
} }
static LRESULT static LRESULT
DATETIME_Size (DATETIME_INFO *infoPtr, WORD flags, INT width, INT height) DATETIME_Size (DATETIME_INFO *infoPtr, INT width, INT height)
{ {
/* set size */ /* set size */
infoPtr->rcClient.bottom = height; infoPtr->rcClient.bottom = height;
@ -1225,7 +1236,7 @@ static LRESULT
DATETIME_Create (HWND hwnd, const CREATESTRUCTW *lpcs) DATETIME_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
{ {
static const WCHAR SysMonthCal32W[] = { 'S', 'y', 's', 'M', 'o', 'n', 't', 'h', 'C', 'a', 'l', '3', '2', 0 }; static const WCHAR SysMonthCal32W[] = { 'S', 'y', 's', 'M', 'o', 'n', 't', 'h', 'C', 'a', 'l', '3', '2', 0 };
DATETIME_INFO *infoPtr = (DATETIME_INFO *)Alloc (sizeof(DATETIME_INFO)); DATETIME_INFO *infoPtr = Alloc (sizeof(DATETIME_INFO));
STYLESTRUCT ss = { 0, lpcs->style }; STYLESTRUCT ss = { 0, lpcs->style };
if (!infoPtr) return -1; if (!infoPtr) return -1;
@ -1234,9 +1245,9 @@ DATETIME_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
infoPtr->dwStyle = lpcs->style; infoPtr->dwStyle = lpcs->style;
infoPtr->nrFieldsAllocated = 32; infoPtr->nrFieldsAllocated = 32;
infoPtr->fieldspec = (int *) Alloc (infoPtr->nrFieldsAllocated * sizeof(int)); infoPtr->fieldspec = Alloc (infoPtr->nrFieldsAllocated * sizeof(int));
infoPtr->fieldRect = (RECT *) Alloc (infoPtr->nrFieldsAllocated * sizeof(RECT)); infoPtr->fieldRect = Alloc (infoPtr->nrFieldsAllocated * sizeof(RECT));
infoPtr->buflen = (int *) Alloc (infoPtr->nrFieldsAllocated * sizeof(int)); infoPtr->buflen = Alloc (infoPtr->nrFieldsAllocated * sizeof(int));
infoPtr->hwndNotify = lpcs->hwndParent; infoPtr->hwndNotify = lpcs->hwndParent;
infoPtr->select = -1; /* initially, nothing is selected */ infoPtr->select = -1; /* initially, nothing is selected */
infoPtr->bDropdownEnabled = TRUE; infoPtr->bDropdownEnabled = TRUE;
@ -1323,7 +1334,7 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return SendMessageW (infoPtr->hMonthCal, WM_GETFONT, wParam, lParam); return SendMessageW (infoPtr->hMonthCal, WM_GETFONT, wParam, lParam);
case WM_NOTIFY: case WM_NOTIFY:
return DATETIME_Notify (infoPtr, (int)wParam, (LPNMHDR)lParam); return DATETIME_Notify (infoPtr, (LPNMHDR)lParam);
case WM_ENABLE: case WM_ENABLE:
return DATETIME_Enable (infoPtr, (BOOL)wParam); return DATETIME_Enable (infoPtr, (BOOL)wParam);
@ -1339,7 +1350,10 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return DATETIME_Paint (infoPtr, (HDC)wParam); return DATETIME_Paint (infoPtr, (HDC)wParam);
case WM_KEYDOWN: case WM_KEYDOWN:
return DATETIME_KeyDown (infoPtr, wParam, lParam); return DATETIME_KeyDown (infoPtr, wParam);
case WM_CHAR:
return DATETIME_Char (infoPtr, wParam);
case WM_KILLFOCUS: case WM_KILLFOCUS:
return DATETIME_KillFocus (infoPtr, (HWND)wParam); return DATETIME_KillFocus (infoPtr, (HWND)wParam);
@ -1351,13 +1365,13 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return DATETIME_SetFocus (infoPtr, (HWND)wParam); return DATETIME_SetFocus (infoPtr, (HWND)wParam);
case WM_SIZE: case WM_SIZE:
return DATETIME_Size (infoPtr, wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam)); return DATETIME_Size (infoPtr, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
return DATETIME_LButtonDown (infoPtr, (WORD)wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam)); return DATETIME_LButtonDown (infoPtr, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
case WM_LBUTTONUP: case WM_LBUTTONUP:
return DATETIME_LButtonUp (infoPtr, (WORD)wParam); return DATETIME_LButtonUp (infoPtr);
case WM_VSCROLL: case WM_VSCROLL:
return DATETIME_VScroll (infoPtr, (WORD)wParam); return DATETIME_VScroll (infoPtr, (WORD)wParam);
@ -1381,7 +1395,7 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return (LRESULT) infoPtr->hFont; return (LRESULT) infoPtr->hFont;
default: default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP)) if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n", ERR("unknown msg %04x wp=%08lx lp=%08lx\n",
uMsg, wParam, lParam); uMsg, wParam, lParam);
return DefWindowProcW (hwnd, uMsg, wParam, lParam); return DefWindowProcW (hwnd, uMsg, wParam, lParam);

View file

@ -106,7 +106,7 @@ HRESULT WINAPI DPA_LoadStream (HDPA *phDpa, DPALOADPROC loadProc,
if (!phDpa || !loadProc || !pStream) if (!phDpa || !loadProc || !pStream)
return E_INVALIDARG; return E_INVALIDARG;
*phDpa = (HDPA)NULL; *phDpa = NULL;
position.QuadPart = 0; position.QuadPart = 0;

View file

@ -257,7 +257,7 @@ FlatSB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return FlatSB_Destroy (hwnd, wParam, lParam); return FlatSB_Destroy (hwnd, wParam, lParam);
default: default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP)) if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n", ERR("unknown msg %04x wp=%08lx lp=%08lx\n",
uMsg, wParam, lParam); uMsg, wParam, lParam);
return DefWindowProcW (hwnd, uMsg, wParam, lParam); return DefWindowProcW (hwnd, uMsg, wParam, lParam);

View file

@ -249,7 +249,7 @@ HEADER_SetItemBounds (HWND hwnd)
} }
static LRESULT static LRESULT
HEADER_Size (HWND hwnd, WPARAM wParam) HEADER_Size (HWND hwnd)
{ {
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
@ -577,7 +577,7 @@ HEADER_Refresh (HWND hwnd, HDC hdc)
static void static void
HEADER_RefreshItem (HWND hwnd, HDC hdc, INT iItem) HEADER_RefreshItem (HWND hwnd, INT iItem)
{ {
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
@ -1073,7 +1073,7 @@ HEADER_DeleteItem (HWND hwnd, WPARAM wParam)
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(hwnd); HEADER_INFO *infoPtr = HEADER_GetInfoPtr(hwnd);
INT iItem = (INT)wParam; INT iItem = (INT)wParam;
INT iOrder; INT iOrder;
INT i; UINT i;
TRACE("[iItem=%d]\n", iItem); TRACE("[iItem=%d]\n", iItem);
@ -1250,7 +1250,7 @@ HEADER_GetUnicodeFormat (HWND hwnd)
static LRESULT static LRESULT
HEADER_HitTest (HWND hwnd, WPARAM wParam, LPARAM lParam) HEADER_HitTest (HWND hwnd, LPARAM lParam)
{ {
LPHDHITTESTINFO phti = (LPHDHITTESTINFO)lParam; LPHDHITTESTINFO phti = (LPHDHITTESTINFO)lParam;
@ -1332,7 +1332,7 @@ HEADER_InsertItemT (HWND hwnd, INT nItem, const HDITEMW *phdi, BOOL bUnicode)
static LRESULT static LRESULT
HEADER_Layout (HWND hwnd, WPARAM wParam, LPARAM lParam) HEADER_Layout (HWND hwnd, LPARAM lParam)
{ {
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
LPHDLAYOUT lpLayout = (LPHDLAYOUT)lParam; LPHDLAYOUT lpLayout = (LPHDLAYOUT)lParam;
@ -1447,14 +1447,14 @@ HEADER_SetUnicodeFormat (HWND hwnd, WPARAM wParam)
static LRESULT static LRESULT
HEADER_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) HEADER_Create (HWND hwnd, LPARAM lParam)
{ {
HEADER_INFO *infoPtr; HEADER_INFO *infoPtr;
TEXTMETRICW tm; TEXTMETRICW tm;
HFONT hOldFont; HFONT hOldFont;
HDC hdc; HDC hdc;
infoPtr = (HEADER_INFO *)Alloc (sizeof(HEADER_INFO)); infoPtr = Alloc (sizeof(HEADER_INFO));
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
infoPtr->hwndNotify = ((LPCREATESTRUCTA)lParam)->hwndParent; infoPtr->hwndNotify = ((LPCREATESTRUCTA)lParam)->hwndParent;
@ -1490,7 +1490,7 @@ HEADER_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
HEADER_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam) HEADER_Destroy (HWND hwnd)
{ {
HTHEME theme = GetWindowTheme(hwnd); HTHEME theme = GetWindowTheme(hwnd);
CloseThemeData(theme); CloseThemeData(theme);
@ -1498,7 +1498,7 @@ HEADER_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
} }
static LRESULT static LRESULT
HEADER_NCDestroy (HWND hwnd, WPARAM wParam, LPARAM lParam) HEADER_NCDestroy (HWND hwnd)
{ {
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HEADER_ITEM *lpItem; HEADER_ITEM *lpItem;
@ -1544,7 +1544,7 @@ HEADER_IsDragDistance(const HEADER_INFO *infoPtr, const POINT *pt)
} }
static LRESULT static LRESULT
HEADER_LButtonDblClk (HWND hwnd, WPARAM wParam, LPARAM lParam) HEADER_LButtonDblClk (HWND hwnd, LPARAM lParam)
{ {
POINT pt; POINT pt;
UINT flags; UINT flags;
@ -1564,7 +1564,7 @@ HEADER_LButtonDblClk (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
HEADER_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) HEADER_LButtonDown (HWND hwnd, LPARAM lParam)
{ {
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE); DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
@ -1589,7 +1589,7 @@ HEADER_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* Send WM_CUSTOMDRAW */ /* Send WM_CUSTOMDRAW */
hdc = GetDC (hwnd); hdc = GetDC (hwnd);
HEADER_RefreshItem (hwnd, hdc, nItem); HEADER_RefreshItem (hwnd, nItem);
ReleaseDC (hwnd, hdc); ReleaseDC (hwnd, hdc);
TRACE("Pressed item %d!\n", nItem); TRACE("Pressed item %d!\n", nItem);
@ -1620,7 +1620,7 @@ HEADER_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
HEADER_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam) HEADER_LButtonUp (HWND hwnd, LPARAM lParam)
{ {
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE); DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
@ -1670,7 +1670,7 @@ HEADER_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
{ {
infoPtr->items[infoPtr->iMoveItem].bDown = FALSE; infoPtr->items[infoPtr->iMoveItem].bDown = FALSE;
hdc = GetDC (hwnd); hdc = GetDC (hwnd);
HEADER_RefreshItem (hwnd, hdc, infoPtr->iMoveItem); HEADER_RefreshItem (hwnd, infoPtr->iMoveItem);
ReleaseDC (hwnd, hdc); ReleaseDC (hwnd, hdc);
HEADER_SendNotifyWithHDItemT(hwnd, HDN_ITEMCLICKW, infoPtr->iMoveItem, NULL); HEADER_SendNotifyWithHDItemT(hwnd, HDN_ITEMCLICKW, infoPtr->iMoveItem, NULL);
@ -1735,7 +1735,7 @@ HEADER_NotifyFormat (HWND hwnd, WPARAM wParam, LPARAM lParam)
} }
static LRESULT static LRESULT
HEADER_MouseLeave (HWND hwnd, WPARAM wParam, LPARAM lParam) HEADER_MouseLeave (HWND hwnd)
{ {
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
/* Reset hot-tracked item when mouse leaves control. */ /* Reset hot-tracked item when mouse leaves control. */
@ -1743,7 +1743,7 @@ HEADER_MouseLeave (HWND hwnd, WPARAM wParam, LPARAM lParam)
HDC hdc = GetDC (hwnd); HDC hdc = GetDC (hwnd);
infoPtr->iHotItem = -1; infoPtr->iHotItem = -1;
if (oldHotItem != -1) HEADER_RefreshItem (hwnd, hdc, oldHotItem); if (oldHotItem != -1) HEADER_RefreshItem (hwnd, oldHotItem);
ReleaseDC (hwnd, hdc); ReleaseDC (hwnd, hdc);
return 0; return 0;
@ -1751,7 +1751,7 @@ HEADER_MouseLeave (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) HEADER_MouseMove (HWND hwnd, LPARAM lParam)
{ {
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE); DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
@ -1814,7 +1814,7 @@ HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->items[infoPtr->iMoveItem].bDown = FALSE; infoPtr->items[infoPtr->iMoveItem].bDown = FALSE;
if (oldState != infoPtr->items[infoPtr->iMoveItem].bDown) { if (oldState != infoPtr->items[infoPtr->iMoveItem].bDown) {
hdc = GetDC (hwnd); hdc = GetDC (hwnd);
HEADER_RefreshItem (hwnd, hdc, infoPtr->iMoveItem); HEADER_RefreshItem (hwnd, infoPtr->iMoveItem);
ReleaseDC (hwnd, hdc); ReleaseDC (hwnd, hdc);
} }
@ -1866,8 +1866,8 @@ HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
TRACKMOUSEEVENT tme; TRACKMOUSEEVENT tme;
if (oldHotItem != infoPtr->iHotItem && !infoPtr->bDragging) { if (oldHotItem != infoPtr->iHotItem && !infoPtr->bDragging) {
hdc = GetDC (hwnd); hdc = GetDC (hwnd);
if (oldHotItem != -1) HEADER_RefreshItem (hwnd, hdc, oldHotItem); if (oldHotItem != -1) HEADER_RefreshItem (hwnd, oldHotItem);
if (infoPtr->iHotItem != -1) HEADER_RefreshItem (hwnd, hdc, infoPtr->iHotItem); if (infoPtr->iHotItem != -1) HEADER_RefreshItem (hwnd, infoPtr->iHotItem);
ReleaseDC (hwnd, hdc); ReleaseDC (hwnd, hdc);
} }
tme.cbSize = sizeof( tme ); tme.cbSize = sizeof( tme );
@ -1895,7 +1895,7 @@ HEADER_Paint (HWND hwnd, WPARAM wParam)
static LRESULT static LRESULT
HEADER_RButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam) HEADER_RButtonUp (HWND hwnd, LPARAM lParam)
{ {
BOOL bRet; BOOL bRet;
POINT pt; POINT pt;
@ -1917,7 +1917,7 @@ HEADER_RButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
HEADER_SetCursor (HWND hwnd, WPARAM wParam, LPARAM lParam) HEADER_SetCursor (HWND hwnd, LPARAM lParam)
{ {
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
POINT pt; POINT pt;
@ -2033,14 +2033,14 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return HEADER_GetUnicodeFormat (hwnd); return HEADER_GetUnicodeFormat (hwnd);
case HDM_HITTEST: case HDM_HITTEST:
return HEADER_HitTest (hwnd, wParam, lParam); return HEADER_HitTest (hwnd, lParam);
case HDM_INSERTITEMA: case HDM_INSERTITEMA:
case HDM_INSERTITEMW: case HDM_INSERTITEMW:
return HEADER_InsertItemT (hwnd, (INT)wParam, (LPHDITEMW)lParam, msg == HDM_INSERTITEMW); return HEADER_InsertItemT (hwnd, (INT)wParam, (LPHDITEMW)lParam, msg == HDM_INSERTITEMW);
case HDM_LAYOUT: case HDM_LAYOUT:
return HEADER_Layout (hwnd, wParam, lParam); return HEADER_Layout (hwnd, lParam);
case HDM_ORDERTOINDEX: case HDM_ORDERTOINDEX:
return HEADER_OrderToIndex(hwnd, wParam); return HEADER_OrderToIndex(hwnd, wParam);
@ -2067,13 +2067,13 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return HEADER_SetUnicodeFormat (hwnd, wParam); return HEADER_SetUnicodeFormat (hwnd, wParam);
case WM_CREATE: case WM_CREATE:
return HEADER_Create (hwnd, wParam, lParam); return HEADER_Create (hwnd, lParam);
case WM_DESTROY: case WM_DESTROY:
return HEADER_Destroy (hwnd, wParam, lParam); return HEADER_Destroy (hwnd);
case WM_NCDESTROY: case WM_NCDESTROY:
return HEADER_NCDestroy (hwnd, wParam, lParam); return HEADER_NCDestroy (hwnd);
case WM_ERASEBKGND: case WM_ERASEBKGND:
return 1; return 1;
@ -2085,25 +2085,25 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return HEADER_GetFont (hwnd); return HEADER_GetFont (hwnd);
case WM_LBUTTONDBLCLK: case WM_LBUTTONDBLCLK:
return HEADER_LButtonDblClk (hwnd, wParam, lParam); return HEADER_LButtonDblClk (hwnd, lParam);
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
return HEADER_LButtonDown (hwnd, wParam, lParam); return HEADER_LButtonDown (hwnd, lParam);
case WM_LBUTTONUP: case WM_LBUTTONUP:
return HEADER_LButtonUp (hwnd, wParam, lParam); return HEADER_LButtonUp (hwnd, lParam);
case WM_MOUSELEAVE: case WM_MOUSELEAVE:
return HEADER_MouseLeave (hwnd, wParam, lParam); return HEADER_MouseLeave (hwnd);
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
return HEADER_MouseMove (hwnd, wParam, lParam); return HEADER_MouseMove (hwnd, lParam);
case WM_NOTIFYFORMAT: case WM_NOTIFYFORMAT:
return HEADER_NotifyFormat (hwnd, wParam, lParam); return HEADER_NotifyFormat (hwnd, wParam, lParam);
case WM_SIZE: case WM_SIZE:
return HEADER_Size (hwnd, wParam); return HEADER_Size (hwnd);
case WM_THEMECHANGED: case WM_THEMECHANGED:
return HEADER_ThemeChanged (hwnd); return HEADER_ThemeChanged (hwnd);
@ -2113,10 +2113,10 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return HEADER_Paint (hwnd, wParam); return HEADER_Paint (hwnd, wParam);
case WM_RBUTTONUP: case WM_RBUTTONUP:
return HEADER_RButtonUp (hwnd, wParam, lParam); return HEADER_RButtonUp (hwnd, lParam);
case WM_SETCURSOR: case WM_SETCURSOR:
return HEADER_SetCursor (hwnd, wParam, lParam); return HEADER_SetCursor (hwnd, lParam);
case WM_SETFONT: case WM_SETFONT:
return HEADER_SetFont (hwnd, wParam, lParam); return HEADER_SetFont (hwnd, wParam, lParam);
@ -2125,7 +2125,7 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return HEADER_SetRedraw(hwnd, wParam, lParam); return HEADER_SetRedraw(hwnd, wParam, lParam);
default: default:
if ((msg >= WM_USER) && (msg < WM_APP)) if ((msg >= WM_USER) && (msg < WM_APP) && !COMCTL32_IsReflectedMessage(msg))
ERR("unknown msg %04x wp=%04lx lp=%08lx\n", ERR("unknown msg %04x wp=%04lx lp=%08lx\n",
msg, wParam, lParam ); msg, wParam, lParam );
return DefWindowProcW(hwnd, msg, wParam, lParam); return DefWindowProcW(hwnd, msg, wParam, lParam);

View file

@ -342,7 +342,7 @@ HOTKEY_KeyDown (HOTKEY_INFO *infoPtr, DWORD key, DWORD flags)
static LRESULT static LRESULT
HOTKEY_KeyUp (HOTKEY_INFO *infoPtr, DWORD key, DWORD flags) HOTKEY_KeyUp (HOTKEY_INFO *infoPtr, DWORD key)
{ {
BYTE bOldMod; BYTE bOldMod;
@ -383,7 +383,7 @@ HOTKEY_KeyUp (HOTKEY_INFO *infoPtr, DWORD key, DWORD flags)
static LRESULT static LRESULT
HOTKEY_KillFocus (HOTKEY_INFO *infoPtr, HWND receiveFocus) HOTKEY_KillFocus (HOTKEY_INFO *infoPtr)
{ {
infoPtr->bFocus = FALSE; infoPtr->bFocus = FALSE;
DestroyCaret (); DestroyCaret ();
@ -411,7 +411,7 @@ HOTKEY_NCCreate (HWND hwnd, const CREATESTRUCTW *lpcs)
dwExStyle | WS_EX_CLIENTEDGE); dwExStyle | WS_EX_CLIENTEDGE);
/* allocate memory for info structure */ /* allocate memory for info structure */
infoPtr = (HOTKEY_INFO *)Alloc (sizeof(HOTKEY_INFO)); infoPtr = Alloc (sizeof(HOTKEY_INFO));
SetWindowLongPtrW(hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW(hwnd, 0, (DWORD_PTR)infoPtr);
/* initialize info structure */ /* initialize info structure */
@ -424,7 +424,7 @@ HOTKEY_NCCreate (HWND hwnd, const CREATESTRUCTW *lpcs)
} }
static LRESULT static LRESULT
HOTKEY_SetFocus (HOTKEY_INFO *infoPtr, HWND lostFocus) HOTKEY_SetFocus (HOTKEY_INFO *infoPtr)
{ {
infoPtr->bFocus = TRUE; infoPtr->bFocus = TRUE;
@ -505,10 +505,10 @@ HOTKEY_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_KEYUP: case WM_KEYUP:
case WM_SYSKEYUP: case WM_SYSKEYUP:
return HOTKEY_KeyUp (infoPtr, wParam, lParam); return HOTKEY_KeyUp (infoPtr, wParam);
case WM_KILLFOCUS: case WM_KILLFOCUS:
return HOTKEY_KillFocus (infoPtr, (HWND)wParam); return HOTKEY_KillFocus (infoPtr);
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
return HOTKEY_LButtonDown (infoPtr); return HOTKEY_LButtonDown (infoPtr);
@ -522,13 +522,13 @@ HOTKEY_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return 0; return 0;
case WM_SETFOCUS: case WM_SETFOCUS:
return HOTKEY_SetFocus (infoPtr, (HWND)wParam); return HOTKEY_SetFocus (infoPtr);
case WM_SETFONT: case WM_SETFONT:
return HOTKEY_SetFont (infoPtr, (HFONT)wParam, LOWORD(lParam)); return HOTKEY_SetFont (infoPtr, (HFONT)wParam, LOWORD(lParam));
default: default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP)) if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n", ERR("unknown msg %04x wp=%08lx lp=%08lx\n",
uMsg, wParam, lParam); uMsg, wParam, lParam);
return DefWindowProcW (hwnd, uMsg, wParam, lParam); return DefWindowProcW (hwnd, uMsg, wParam, lParam);

View file

@ -598,7 +598,7 @@ ImageList_Create (INT cx, INT cy, UINT flags,
TRACE("(%d %d 0x%x %d %d)\n", cx, cy, flags, cInitial, cGrow); TRACE("(%d %d 0x%x %d %d)\n", cx, cy, flags, cInitial, cGrow);
himl = (HIMAGELIST)Alloc (sizeof(struct _IMAGELIST)); himl = Alloc (sizeof(struct _IMAGELIST));
if (!himl) if (!himl)
return NULL; return NULL;
@ -658,11 +658,11 @@ ImageList_Create (INT cx, INT cy, UINT flags,
himl->hbmMask = 0; himl->hbmMask = 0;
/* create blending brushes */ /* create blending brushes */
hbmTemp = CreateBitmap (8, 8, 1, 1, &aBitBlend25); hbmTemp = CreateBitmap (8, 8, 1, 1, aBitBlend25);
himl->hbrBlend25 = CreatePatternBrush (hbmTemp); himl->hbrBlend25 = CreatePatternBrush (hbmTemp);
DeleteObject (hbmTemp); DeleteObject (hbmTemp);
hbmTemp = CreateBitmap (8, 8, 1, 1, &aBitBlend50); hbmTemp = CreateBitmap (8, 8, 1, 1, aBitBlend50);
himl->hbrBlend50 = CreatePatternBrush (hbmTemp); himl->hbrBlend50 = CreatePatternBrush (hbmTemp);
DeleteObject (hbmTemp); DeleteObject (hbmTemp);
@ -1212,7 +1212,7 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
/* Create the blend Mask */ /* Create the blend Mask */
hOldBitmap = SelectObject(hBlendMaskDC, hBlendMaskBmp); hOldBitmap = SelectObject(hBlendMaskDC, hBlendMaskBmp);
hBlendBrush = fStyle & ILD_BLEND50 ? himl->hbrBlend50 : himl->hbrBlend25; hBlendBrush = fStyle & ILD_BLEND50 ? himl->hbrBlend50 : himl->hbrBlend25;
hOldBrush = (HBRUSH) SelectObject(hBlendMaskDC, hBlendBrush); hOldBrush = SelectObject(hBlendMaskDC, hBlendBrush);
PatBlt(hBlendMaskDC, 0, 0, cx, cy, PATCOPY); PatBlt(hBlendMaskDC, 0, 0, cx, cy, PATCOPY);
SelectObject(hBlendMaskDC, hOldBrush); SelectObject(hBlendMaskDC, hOldBrush);
@ -1225,7 +1225,7 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
/* now apply blend to the current image given the BlendMask */ /* now apply blend to the current image given the BlendMask */
if (clrBlend == CLR_DEFAULT) clrBlend = GetSysColor (COLOR_HIGHLIGHT); if (clrBlend == CLR_DEFAULT) clrBlend = GetSysColor (COLOR_HIGHLIGHT);
else if (clrBlend == CLR_NONE) clrBlend = GetTextColor (pimldp->hdcDst); else if (clrBlend == CLR_NONE) clrBlend = GetTextColor (pimldp->hdcDst);
hOldBrush = (HBRUSH) SelectObject (hImageDC, CreateSolidBrush(clrBlend)); hOldBrush = SelectObject (hImageDC, CreateSolidBrush(clrBlend));
BitBlt (hImageDC, 0, 0, cx, cy, hBlendMaskDC, 0, 0, 0xB8074A); /* PSDPxax */ BitBlt (hImageDC, 0, 0, cx, cy, hBlendMaskDC, 0, 0, 0xB8074A); /* PSDPxax */
DeleteObject(SelectObject(hImageDC, hOldBrush)); DeleteObject(SelectObject(hImageDC, hOldBrush));
SelectObject(hBlendMaskDC, hOldBitmap); SelectObject(hBlendMaskDC, hOldBitmap);
@ -1899,7 +1899,7 @@ static int DIB_GetDIBImageBytes( int width, int height, int depth )
/* helper for ImageList_Read, see comments below */ /* helper for ImageList_Read, see comments below */
static BOOL _read_bitmap(HIMAGELIST himl, HDC hdcIml, LPSTREAM pstm) static BOOL _read_bitmap(HDC hdcIml, LPSTREAM pstm)
{ {
BITMAPFILEHEADER bmfh; BITMAPFILEHEADER bmfh;
int bitsperpixel, palspace; int bitsperpixel, palspace;
@ -1908,13 +1908,13 @@ static BOOL _read_bitmap(HIMAGELIST himl, HDC hdcIml, LPSTREAM pstm)
int result = FALSE; int result = FALSE;
LPBYTE bits = NULL; LPBYTE bits = NULL;
if (!SUCCEEDED(IStream_Read ( pstm, &bmfh, sizeof(bmfh), NULL))) if (FAILED(IStream_Read ( pstm, &bmfh, sizeof(bmfh), NULL)))
return FALSE; return FALSE;
if (bmfh.bfType != (('M'<<8)|'B')) if (bmfh.bfType != (('M'<<8)|'B'))
return FALSE; return FALSE;
if (!SUCCEEDED(IStream_Read ( pstm, &bmi->bmiHeader, sizeof(bmi->bmiHeader), NULL))) if (FAILED(IStream_Read ( pstm, &bmi->bmiHeader, sizeof(bmi->bmiHeader), NULL)))
return FALSE; return FALSE;
if ((bmi->bmiHeader.biSize != sizeof(bmi->bmiHeader))) if ((bmi->bmiHeader.biSize != sizeof(bmi->bmiHeader)))
@ -1933,13 +1933,13 @@ static BOOL _read_bitmap(HIMAGELIST himl, HDC hdcIml, LPSTREAM pstm)
bmi->bmiHeader.biSizeImage = DIB_GetDIBImageBytes(bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight, bitsperpixel); bmi->bmiHeader.biSizeImage = DIB_GetDIBImageBytes(bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight, bitsperpixel);
/* read the palette right after the end of the bitmapinfoheader */ /* read the palette right after the end of the bitmapinfoheader */
if (palspace && !SUCCEEDED(IStream_Read(pstm, bmi->bmiColors, palspace, NULL))) if (palspace && FAILED(IStream_Read(pstm, bmi->bmiColors, palspace, NULL)))
goto error; goto error;
bits = Alloc(bmi->bmiHeader.biSizeImage); bits = Alloc(bmi->bmiHeader.biSizeImage);
if (!bits) if (!bits)
goto error; goto error;
if (!SUCCEEDED(IStream_Read(pstm, bits, bmi->bmiHeader.biSizeImage, NULL))) if (FAILED(IStream_Read(pstm, bits, bmi->bmiHeader.biSizeImage, NULL)))
goto error; goto error;
if (!StretchDIBits(hdcIml, 0, 0, bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight, if (!StretchDIBits(hdcIml, 0, 0, bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight,
@ -1992,7 +1992,7 @@ HIMAGELIST WINAPI ImageList_Read (LPSTREAM pstm)
TRACE("%p\n", pstm); TRACE("%p\n", pstm);
if (!SUCCEEDED(IStream_Read (pstm, &ilHead, sizeof(ILHEAD), NULL))) if (FAILED(IStream_Read (pstm, &ilHead, sizeof(ILHEAD), NULL)))
return NULL; return NULL;
if (ilHead.usMagic != (('L' << 8) | 'I')) if (ilHead.usMagic != (('L' << 8) | 'I'))
return NULL; return NULL;
@ -2006,14 +2006,14 @@ HIMAGELIST WINAPI ImageList_Read (LPSTREAM pstm)
if (!himl) if (!himl)
return NULL; return NULL;
if (!_read_bitmap(himl, himl->hdcImage, pstm)) if (!_read_bitmap(himl->hdcImage, pstm))
{ {
WARN("failed to read bitmap from stream\n"); WARN("failed to read bitmap from stream\n");
return NULL; return NULL;
} }
if (ilHead.flags & ILC_MASK) if (ilHead.flags & ILC_MASK)
{ {
if (!_read_bitmap(himl, himl->hdcMask, pstm)) if (!_read_bitmap(himl->hdcMask, pstm))
{ {
WARN("failed to read mask bitmap from stream\n"); WARN("failed to read mask bitmap from stream\n");
return NULL; return NULL;
@ -2740,7 +2740,7 @@ _write_bitmap(HBITMAP hBitmap, LPSTREAM pstm)
inf->bmiColors[1].rgbRed = inf->bmiColors[1].rgbGreen = inf->bmiColors[1].rgbBlue = 0xff; inf->bmiColors[1].rgbRed = inf->bmiColors[1].rgbGreen = inf->bmiColors[1].rgbBlue = 0xff;
} }
if(!SUCCEEDED(IStream_Write(pstm, data, totalSize, NULL))) if(FAILED(IStream_Write(pstm, data, totalSize, NULL)))
goto failed; goto failed;
result = TRUE; result = TRUE;
@ -2796,7 +2796,7 @@ ImageList_Write (HIMAGELIST himl, LPSTREAM pstm)
TRACE("cx %u, cy %u, flags 0x04%x, cCurImage %u, cMaxImage %u\n", TRACE("cx %u, cy %u, flags 0x04%x, cCurImage %u, cMaxImage %u\n",
ilHead.cx, ilHead.cy, ilHead.flags, ilHead.cCurImage, ilHead.cMaxImage); ilHead.cx, ilHead.cy, ilHead.flags, ilHead.cCurImage, ilHead.cMaxImage);
if(!SUCCEEDED(IStream_Write(pstm, &ilHead, sizeof(ILHEAD), NULL))) if(FAILED(IStream_Write(pstm, &ilHead, sizeof(ILHEAD), NULL)))
return FALSE; return FALSE;
/* write the bitmap */ /* write the bitmap */

View file

@ -178,7 +178,7 @@ static LRESULT IPADDRESS_Create (HWND hwnd, const CREATESTRUCTA *lpCreate)
SetWindowLongW (hwnd, GWL_STYLE, SetWindowLongW (hwnd, GWL_STYLE,
GetWindowLongW(hwnd, GWL_STYLE) & ~WS_BORDER); GetWindowLongW(hwnd, GWL_STYLE) & ~WS_BORDER);
infoPtr = (IPADDRESS_INFO *)Alloc (sizeof(IPADDRESS_INFO)); infoPtr = Alloc (sizeof(IPADDRESS_INFO));
if (!infoPtr) return -1; if (!infoPtr) return -1;
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
@ -193,7 +193,7 @@ static LRESULT IPADDRESS_Create (HWND hwnd, const CREATESTRUCTA *lpCreate)
infoPtr->Enabled = TRUE; infoPtr->Enabled = TRUE;
infoPtr->Notify = lpCreate->hwndParent; infoPtr->Notify = lpCreate->hwndParent;
hSysFont = (HFONT) GetStockObject(ANSI_VAR_FONT); hSysFont = GetStockObject(ANSI_VAR_FONT);
GetObjectW(hSysFont, sizeof(LOGFONTW), &logSysFont); GetObjectW(hSysFont, sizeof(LOGFONTW), &logSysFont);
SystemParametersInfoW(SPI_GETICONTITLELOGFONT, 0, &logFont, 0); SystemParametersInfoW(SPI_GETICONTITLELOGFONT, 0, &logFont, 0);
strcpyW(logFont.lfFaceName, logSysFont.lfFaceName); strcpyW(logFont.lfFaceName, logSysFont.lfFaceName);
@ -454,7 +454,7 @@ static BOOL IPADDRESS_GotoNextField (const IPADDRESS_INFO *infoPtr, int cur, int
LRESULT CALLBACK LRESULT CALLBACK
IPADDRESS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) IPADDRESS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
HWND Self = (HWND)GetPropW (hwnd, IP_SUBCLASS_PROP); HWND Self = GetPropW (hwnd, IP_SUBCLASS_PROP);
IPADDRESS_INFO *infoPtr = (IPADDRESS_INFO *)GetWindowLongPtrW (Self, 0); IPADDRESS_INFO *infoPtr = (IPADDRESS_INFO *)GetWindowLongPtrW (Self, 0);
CHAR c = (CHAR)wParam; CHAR c = (CHAR)wParam;
INT index, len = 0, startsel, endsel; INT index, len = 0, startsel, endsel;
@ -590,7 +590,7 @@ IPADDRESS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return IPADDRESS_IsBlank (infoPtr); return IPADDRESS_IsBlank (infoPtr);
default: default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP)) if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam); ERR("unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam);
return DefWindowProcW (hwnd, uMsg, wParam, lParam); return DefWindowProcW (hwnd, uMsg, wParam, lParam);
} }

View file

@ -95,10 +95,8 @@
* -- LVS_EX_INFOTIP * -- LVS_EX_INFOTIP
* -- LVS_EX_LABELTIP * -- LVS_EX_LABELTIP
* -- LVS_EX_MULTIWORKAREAS * -- LVS_EX_MULTIWORKAREAS
* -- LVS_EX_ONECLICKACTIVATE
* -- LVS_EX_REGIONAL * -- LVS_EX_REGIONAL
* -- LVS_EX_SIMPLESELECT * -- LVS_EX_SIMPLESELECT
* -- LVS_EX_TRACKSELECT
* -- LVS_EX_TWOCLICKACTIVATE * -- LVS_EX_TWOCLICKACTIVATE
* -- LVS_EX_UNDERLINECOLD * -- LVS_EX_UNDERLINECOLD
* -- LVS_EX_UNDERLINEHOT * -- LVS_EX_UNDERLINEHOT
@ -257,6 +255,7 @@ typedef struct tagLISTVIEW_INFO
HIMAGELIST himlState; HIMAGELIST himlState;
BOOL bLButtonDown; BOOL bLButtonDown;
BOOL bRButtonDown; BOOL bRButtonDown;
BOOL bDragging;
POINT ptClickPos; /* point where the user clicked */ POINT ptClickPos; /* point where the user clicked */
BOOL bNoItemMetrics; /* flags if item metrics are not yet computed */ BOOL bNoItemMetrics; /* flags if item metrics are not yet computed */
INT nItemHeight; INT nItemHeight;
@ -541,7 +540,7 @@ static inline int lstrncmpiW(LPCWSTR s1, LPCWSTR s2, int n)
{ {
int res; int res;
n = min(min(n, strlenW(s1)), strlenW(s2)); n = min(min(n, lstrlenW(s1)), lstrlenW(s2));
res = CompareStringW(LOCALE_USER_DEFAULT, NORM_IGNORECASE, s1, n, s2, n); res = CompareStringW(LOCALE_USER_DEFAULT, NORM_IGNORECASE, s1, n, s2, n);
return res ? res - sizeof(WCHAR) : res; return res ? res - sizeof(WCHAR) : res;
} }
@ -822,7 +821,7 @@ static BOOL notify_deleteitem(const LISTVIEW_INFO *infoPtr, INT nItem)
return IsWindow(hwnd); return IsWindow(hwnd);
} }
static int get_ansi_notification(INT unicodeNotificationCode) static int get_ansi_notification(UINT unicodeNotificationCode)
{ {
switch (unicodeNotificationCode) switch (unicodeNotificationCode)
{ {
@ -846,11 +845,12 @@ static int get_ansi_notification(INT unicodeNotificationCode)
pdi : dispinfo structure (can be unicode or ansi) pdi : dispinfo structure (can be unicode or ansi)
isW : TRUE if dispinfo is Unicode isW : TRUE if dispinfo is Unicode
*/ */
static BOOL notify_dispinfoT(const LISTVIEW_INFO *infoPtr, INT notificationCode, LPNMLVDISPINFOW pdi, BOOL isW) static BOOL notify_dispinfoT(const LISTVIEW_INFO *infoPtr, UINT notificationCode, LPNMLVDISPINFOW pdi, BOOL isW)
{ {
BOOL bResult = FALSE; BOOL bResult = FALSE;
BOOL convertToAnsi = FALSE, convertToUnicode = FALSE; BOOL convertToAnsi = FALSE, convertToUnicode = FALSE;
INT cchTempBufMax = 0, savCchTextMax = 0, realNotifCode; INT cchTempBufMax = 0, savCchTextMax = 0;
UINT realNotifCode;
LPWSTR pszTempBuf = NULL, savPszText = NULL; LPWSTR pszTempBuf = NULL, savPszText = NULL;
if ((pdi->item.mask & LVIF_TEXT) && is_textT(pdi->item.pszText, isW)) if ((pdi->item.mask & LVIF_TEXT) && is_textT(pdi->item.pszText, isW))
@ -1711,6 +1711,7 @@ static void LISTVIEW_UpdateScroll(const LISTVIEW_INFO *infoPtr)
if(vertInfo.nPage < infoPtr->nItemHeight) if(vertInfo.nPage < infoPtr->nItemHeight)
vertInfo.nPage = infoPtr->nItemHeight; vertInfo.nPage = infoPtr->nItemHeight;
if (infoPtr->nItemHeight > 0)
vertInfo.nPage /= infoPtr->nItemHeight; vertInfo.nPage /= infoPtr->nItemHeight;
} }
else if (uView != LVS_LIST) /* LVS_ICON, or LVS_SMALLICON */ else if (uView != LVS_LIST) /* LVS_ICON, or LVS_SMALLICON */
@ -2419,7 +2420,7 @@ static SUBITEM_INFO* LISTVIEW_GetSubItemPtr(HDPA hdpaSubItems, INT nSubItem)
/* we should binary search here if need be */ /* we should binary search here if need be */
for (i = 1; i < DPA_GetPtrCount(hdpaSubItems); i++) for (i = 1; i < DPA_GetPtrCount(hdpaSubItems); i++)
{ {
lpSubItem = (SUBITEM_INFO *)DPA_GetPtr(hdpaSubItems, i); lpSubItem = DPA_GetPtr(hdpaSubItems, i);
if (lpSubItem->iSubItem == nSubItem) if (lpSubItem->iSubItem == nSubItem)
return lpSubItem; return lpSubItem;
} }
@ -2604,12 +2605,12 @@ static void ranges_assert(RANGES ranges, LPCSTR desc, const char *func, int line
assert (ranges); assert (ranges);
assert (DPA_GetPtrCount(ranges->hdpa) >= 0); assert (DPA_GetPtrCount(ranges->hdpa) >= 0);
ranges_dump(ranges); ranges_dump(ranges);
prev = (RANGE *)DPA_GetPtr(ranges->hdpa, 0); prev = DPA_GetPtr(ranges->hdpa, 0);
if (DPA_GetPtrCount(ranges->hdpa) > 0) if (DPA_GetPtrCount(ranges->hdpa) > 0)
assert (prev->lower >= 0 && prev->lower < prev->upper); assert (prev->lower >= 0 && prev->lower < prev->upper);
for (i = 1; i < DPA_GetPtrCount(ranges->hdpa); i++) for (i = 1; i < DPA_GetPtrCount(ranges->hdpa); i++)
{ {
curr = (RANGE *)DPA_GetPtr(ranges->hdpa, i); curr = DPA_GetPtr(ranges->hdpa, i);
assert (prev->upper <= curr->lower); assert (prev->upper <= curr->lower);
assert (curr->lower < curr->upper); assert (curr->lower < curr->upper);
prev = curr; prev = curr;
@ -3267,6 +3268,13 @@ static BOOL LISTVIEW_GetItemAtPt(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVIte
return LISTVIEW_GetItemT(infoPtr, lpLVItem, TRUE); return LISTVIEW_GetItemT(infoPtr, lpLVItem, TRUE);
} }
static inline BOOL LISTVIEW_isHotTracking(const LISTVIEW_INFO *infoPtr)
{
return ((infoPtr->dwLvExStyle & LVS_EX_TRACKSELECT) ||
(infoPtr->dwLvExStyle & LVS_EX_ONECLICKACTIVATE) ||
(infoPtr->dwLvExStyle & LVS_EX_TWOCLICKACTIVATE));
}
/*** /***
* DESCRIPTION: * DESCRIPTION:
* Called when the mouse is being actively tracked and has hovered for a specified * Called when the mouse is being actively tracked and has hovered for a specified
@ -3287,7 +3295,7 @@ static BOOL LISTVIEW_GetItemAtPt(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVIte
*/ */
static LRESULT LISTVIEW_MouseHover(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, INT y) static LRESULT LISTVIEW_MouseHover(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, INT y)
{ {
if (infoPtr->dwLvExStyle & LVS_EX_TRACKSELECT) if (LISTVIEW_isHotTracking(infoPtr))
{ {
LVITEMW item; LVITEMW item;
POINT pt; POINT pt;
@ -3321,7 +3329,22 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN
if (!(fwKeys & MK_LBUTTON)) if (!(fwKeys & MK_LBUTTON))
infoPtr->bLButtonDown = FALSE; infoPtr->bLButtonDown = FALSE;
if (infoPtr->bLButtonDown && DragDetect(infoPtr->hwndSelf, infoPtr->ptClickPos)) if (infoPtr->bLButtonDown)
{
POINT tmp;
RECT rect;
WORD wDragWidth = GetSystemMetrics(SM_CXDRAG);
WORD wDragHeight= GetSystemMetrics(SM_CYDRAG);
rect.left = infoPtr->ptClickPos.x - wDragWidth;
rect.right = infoPtr->ptClickPos.x + wDragWidth;
rect.top = infoPtr->ptClickPos.y - wDragHeight;
rect.bottom = infoPtr->ptClickPos.y + wDragHeight;
tmp.x = x;
tmp.y = y;
if (!PtInRect(&rect, tmp))
{ {
LVHITTESTINFO lvHitTestInfo; LVHITTESTINFO lvHitTestInfo;
NMLISTVIEW nmlv; NMLISTVIEW nmlv;
@ -3333,15 +3356,20 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN
nmlv.iItem = lvHitTestInfo.iItem; nmlv.iItem = lvHitTestInfo.iItem;
nmlv.ptAction = infoPtr->ptClickPos; nmlv.ptAction = infoPtr->ptClickPos;
if (!infoPtr->bDragging)
{
notify_listview(infoPtr, LVN_BEGINDRAG, &nmlv); notify_listview(infoPtr, LVN_BEGINDRAG, &nmlv);
infoPtr->bDragging = TRUE;
}
return 0; return 0;
} }
}
else else
infoPtr->bLButtonDown = FALSE; infoPtr->bLButtonDown = FALSE;
/* see if we are supposed to be tracking mouse hovering */ /* see if we are supposed to be tracking mouse hovering */
if(infoPtr->dwLvExStyle & LVS_EX_TRACKSELECT) { if (LISTVIEW_isHotTracking(infoPtr)) {
/* fill in the trackinfo struct */ /* fill in the trackinfo struct */
trackinfo.cbSize = sizeof(TRACKMOUSEEVENT); trackinfo.cbSize = sizeof(TRACKMOUSEEVENT);
trackinfo.dwFlags = TME_QUERY; trackinfo.dwFlags = TME_QUERY;
@ -3414,8 +3442,8 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL
} }
else else
{ {
HDPA hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, lpLVItem->iItem); HDPA hdpaSubItems = DPA_GetPtr(infoPtr->hdpaItems, lpLVItem->iItem);
lpItem = (ITEM_INFO *)DPA_GetPtr(hdpaSubItems, 0); lpItem = DPA_GetPtr(hdpaSubItems, 0);
assert (lpItem); assert (lpItem);
} }
@ -3555,7 +3583,7 @@ static BOOL set_sub_item(const LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
if (!(lpLVItem->mask & (LVIF_TEXT | LVIF_IMAGE | LVIF_STATE))) return TRUE; if (!(lpLVItem->mask & (LVIF_TEXT | LVIF_IMAGE | LVIF_STATE))) return TRUE;
/* get the subitem structure, and create it if not there */ /* get the subitem structure, and create it if not there */
hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, lpLVItem->iItem); hdpaSubItems = DPA_GetPtr(infoPtr->hdpaItems, lpLVItem->iItem);
assert (hdpaSubItems); assert (hdpaSubItems);
lpSubItem = LISTVIEW_GetSubItemPtr(hdpaSubItems, lpLVItem->iSubItem); lpSubItem = LISTVIEW_GetSubItemPtr(hdpaSubItems, lpLVItem->iSubItem);
@ -3569,7 +3597,7 @@ static BOOL set_sub_item(const LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
/* we could binary search here, if need be...*/ /* we could binary search here, if need be...*/
for (i = 1; i < DPA_GetPtrCount(hdpaSubItems); i++) for (i = 1; i < DPA_GetPtrCount(hdpaSubItems); i++)
{ {
tmpSubItem = (SUBITEM_INFO *)DPA_GetPtr(hdpaSubItems, i); tmpSubItem = DPA_GetPtr(hdpaSubItems, i);
if (tmpSubItem->iSubItem > lpLVItem->iSubItem) break; if (tmpSubItem->iSubItem > lpLVItem->iSubItem) break;
} }
if (DPA_InsertPtr(hdpaSubItems, i, lpSubItem) == -1) if (DPA_InsertPtr(hdpaSubItems, i, lpSubItem) == -1)
@ -4487,10 +4515,10 @@ static BOOL LISTVIEW_DeleteAllItems(LISTVIEW_INFO *infoPtr, BOOL destroy)
if (!bSuppress) notify_deleteitem(infoPtr, i); if (!bSuppress) notify_deleteitem(infoPtr, i);
if (!(infoPtr->dwStyle & LVS_OWNERDATA)) if (!(infoPtr->dwStyle & LVS_OWNERDATA))
{ {
hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, i); hdpaSubItems = DPA_GetPtr(infoPtr->hdpaItems, i);
for (j = 0; j < DPA_GetPtrCount(hdpaSubItems); j++) for (j = 0; j < DPA_GetPtrCount(hdpaSubItems); j++)
{ {
hdrItem = (ITEMHDR *)DPA_GetPtr(hdpaSubItems, j); hdrItem = DPA_GetPtr(hdpaSubItems, j);
if (is_textW(hdrItem->pszText)) Free(hdrItem->pszText); if (is_textW(hdrItem->pszText)) Free(hdrItem->pszText);
Free(hdrItem); Free(hdrItem);
} }
@ -4608,12 +4636,12 @@ static BOOL LISTVIEW_DeleteColumn(LISTVIEW_INFO *infoPtr, INT nColumn)
for (nItem = 0; nItem < infoPtr->nItemCount; nItem++) for (nItem = 0; nItem < infoPtr->nItemCount; nItem++)
{ {
hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, nItem); hdpaSubItems = DPA_GetPtr(infoPtr->hdpaItems, nItem);
nSubItem = 0; nSubItem = 0;
lpDelItem = 0; lpDelItem = 0;
for (i = 1; i < DPA_GetPtrCount(hdpaSubItems); i++) for (i = 1; i < DPA_GetPtrCount(hdpaSubItems); i++)
{ {
lpSubItem = (SUBITEM_INFO *)DPA_GetPtr(hdpaSubItems, i); lpSubItem = DPA_GetPtr(hdpaSubItems, i);
if (lpSubItem->iSubItem == nColumn) if (lpSubItem->iSubItem == nColumn)
{ {
nSubItem = i; nSubItem = i;
@ -4767,10 +4795,10 @@ static BOOL LISTVIEW_DeleteItem(LISTVIEW_INFO *infoPtr, INT nItem)
ITEMHDR *hdrItem; ITEMHDR *hdrItem;
INT i; INT i;
hdpaSubItems = (HDPA)DPA_DeletePtr(infoPtr->hdpaItems, nItem); hdpaSubItems = DPA_DeletePtr(infoPtr->hdpaItems, nItem);
for (i = 0; i < DPA_GetPtrCount(hdpaSubItems); i++) for (i = 0; i < DPA_GetPtrCount(hdpaSubItems); i++)
{ {
hdrItem = (ITEMHDR *)DPA_GetPtr(hdpaSubItems, i); hdrItem = DPA_GetPtr(hdpaSubItems, i);
if (is_textW(hdrItem->pszText)) Free(hdrItem->pszText); if (is_textW(hdrItem->pszText)) Free(hdrItem->pszText);
Free(hdrItem); Free(hdrItem);
} }
@ -4810,15 +4838,30 @@ static BOOL LISTVIEW_EndEditLabelT(LISTVIEW_INFO *infoPtr, LPWSTR pszText, BOOL
{ {
HWND hwndSelf = infoPtr->hwndSelf; HWND hwndSelf = infoPtr->hwndSelf;
NMLVDISPINFOW dispInfo; NMLVDISPINFOW dispInfo;
INT editedItem = infoPtr->nEditLabelItem;
BOOL bSame;
TRACE("(pszText=%s, isW=%d)\n", debugtext_t(pszText, isW), isW); TRACE("(pszText=%s, isW=%d)\n", debugtext_t(pszText, isW), isW);
infoPtr->nEditLabelItem = -1;
ZeroMemory(&dispInfo, sizeof(dispInfo)); ZeroMemory(&dispInfo, sizeof(dispInfo));
dispInfo.item.mask = LVIF_PARAM | LVIF_STATE; dispInfo.item.mask = LVIF_PARAM | LVIF_STATE | LVIF_TEXT;
dispInfo.item.iItem = infoPtr->nEditLabelItem; dispInfo.item.iItem = editedItem;
dispInfo.item.iSubItem = 0; dispInfo.item.iSubItem = 0;
dispInfo.item.stateMask = ~0; dispInfo.item.stateMask = ~0;
if (!LISTVIEW_GetItemW(infoPtr, &dispInfo.item)) return FALSE; if (!LISTVIEW_GetItemW(infoPtr, &dispInfo.item)) return FALSE;
if (isW)
bSame = (lstrcmpW(dispInfo.item.pszText, pszText) == 0);
else
{
LPWSTR tmp = textdupTtoW(pszText, FALSE);
bSame = (lstrcmpW(dispInfo.item.pszText, tmp) == 0);
textfreeT(tmp, FALSE);
}
if (bSame) return TRUE;
/* add the text from the edit in */ /* add the text from the edit in */
dispInfo.item.mask |= LVIF_TEXT; dispInfo.item.mask |= LVIF_TEXT;
dispInfo.item.pszText = pszText; dispInfo.item.pszText = pszText;
@ -4832,18 +4875,18 @@ static BOOL LISTVIEW_EndEditLabelT(LISTVIEW_INFO *infoPtr, LPWSTR pszText, BOOL
if (!(infoPtr->dwStyle & LVS_OWNERDATA)) if (!(infoPtr->dwStyle & LVS_OWNERDATA))
{ {
HDPA hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, infoPtr->nEditLabelItem); HDPA hdpaSubItems = DPA_GetPtr(infoPtr->hdpaItems, editedItem);
ITEM_INFO* lpItem = (ITEM_INFO *)DPA_GetPtr(hdpaSubItems, 0); ITEM_INFO* lpItem = DPA_GetPtr(hdpaSubItems, 0);
if (lpItem && lpItem->hdr.pszText == LPSTR_TEXTCALLBACKW) if (lpItem && lpItem->hdr.pszText == LPSTR_TEXTCALLBACKW)
{ {
LISTVIEW_InvalidateItem(infoPtr, infoPtr->nEditLabelItem); LISTVIEW_InvalidateItem(infoPtr, editedItem);
return TRUE; return TRUE;
} }
} }
ZeroMemory(&dispInfo, sizeof(dispInfo)); ZeroMemory(&dispInfo, sizeof(dispInfo));
dispInfo.item.mask = LVIF_TEXT; dispInfo.item.mask = LVIF_TEXT;
dispInfo.item.iItem = infoPtr->nEditLabelItem; dispInfo.item.iItem = editedItem;
dispInfo.item.iSubItem = 0; dispInfo.item.iSubItem = 0;
dispInfo.item.pszText = pszText; dispInfo.item.pszText = pszText;
dispInfo.item.cchTextMax = textlenT(pszText, isW); dispInfo.item.cchTextMax = textlenT(pszText, isW);
@ -5487,8 +5530,8 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem,
} }
/* find the item and subitem structures before we proceed */ /* find the item and subitem structures before we proceed */
hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, lpLVItem->iItem); hdpaSubItems = DPA_GetPtr(infoPtr->hdpaItems, lpLVItem->iItem);
lpItem = (ITEM_INFO *)DPA_GetPtr(hdpaSubItems, 0); lpItem = DPA_GetPtr(hdpaSubItems, 0);
assert (lpItem); assert (lpItem);
if (isubitem) if (isubitem)
@ -6430,8 +6473,8 @@ static INT LISTVIEW_HitTest(const LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht,
*/ */
static INT WINAPI LISTVIEW_InsertCompare( LPVOID first, LPVOID second, LPARAM lParam) static INT WINAPI LISTVIEW_InsertCompare( LPVOID first, LPVOID second, LPARAM lParam)
{ {
ITEM_INFO* lv_first = (ITEM_INFO*) DPA_GetPtr( (HDPA)first, 0 ); ITEM_INFO* lv_first = DPA_GetPtr( (HDPA)first, 0 );
ITEM_INFO* lv_second = (ITEM_INFO*) DPA_GetPtr( (HDPA)second, 0 ); ITEM_INFO* lv_second = DPA_GetPtr( (HDPA)second, 0 );
INT cmpv = textcmpWT(lv_first->hdr.pszText, lv_second->hdr.pszText, TRUE); INT cmpv = textcmpWT(lv_first->hdr.pszText, lv_second->hdr.pszText, TRUE);
/* if we're sorting descending, negate the return value */ /* if we're sorting descending, negate the return value */
@ -6830,10 +6873,10 @@ static INT LISTVIEW_InsertColumnT(LISTVIEW_INFO *infoPtr, INT nColumn,
for (nItem = 0; nItem < infoPtr->nItemCount; nItem++) for (nItem = 0; nItem < infoPtr->nItemCount; nItem++)
{ {
hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, nItem); hdpaSubItems = DPA_GetPtr(infoPtr->hdpaItems, nItem);
for (i = 1; i < DPA_GetPtrCount(hdpaSubItems); i++) for (i = 1; i < DPA_GetPtrCount(hdpaSubItems); i++)
{ {
lpSubItem = (SUBITEM_INFO *)DPA_GetPtr(hdpaSubItems, i); lpSubItem = DPA_GetPtr(hdpaSubItems, i);
if (lpSubItem->iSubItem >= nNewColumn) if (lpSubItem->iSubItem >= nNewColumn)
lpSubItem->iSubItem++; lpSubItem->iSubItem++;
} }
@ -7712,8 +7755,8 @@ static BOOL LISTVIEW_SetUnicodeFormat( LISTVIEW_INFO *infoPtr, BOOL fUnicode)
static INT WINAPI LISTVIEW_CallBackCompare(LPVOID first, LPVOID second, LPARAM lParam) static INT WINAPI LISTVIEW_CallBackCompare(LPVOID first, LPVOID second, LPARAM lParam)
{ {
LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)lParam; LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)lParam;
ITEM_INFO* lv_first = (ITEM_INFO*) DPA_GetPtr( (HDPA)first, 0 ); ITEM_INFO* lv_first = DPA_GetPtr( (HDPA)first, 0 );
ITEM_INFO* lv_second = (ITEM_INFO*) DPA_GetPtr( (HDPA)second, 0 ); ITEM_INFO* lv_second = DPA_GetPtr( (HDPA)second, 0 );
/* Forward the call to the client defined callback */ /* Forward the call to the client defined callback */
return (infoPtr->pfnCompare)( lv_first->lParam , lv_second->lParam, infoPtr->lParamSort ); return (infoPtr->pfnCompare)( lv_first->lParam , lv_second->lParam, infoPtr->lParamSort );
@ -7753,8 +7796,8 @@ static BOOL LISTVIEW_SortItems(LISTVIEW_INFO *infoPtr, PFNLVCOMPARE pfnCompare,
if (infoPtr->nFocusedItem >= 0) if (infoPtr->nFocusedItem >= 0)
{ {
hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, infoPtr->nFocusedItem); hdpaSubItems = DPA_GetPtr(infoPtr->hdpaItems, infoPtr->nFocusedItem);
lpItem = (ITEM_INFO *)DPA_GetPtr(hdpaSubItems, 0); lpItem = DPA_GetPtr(hdpaSubItems, 0);
if (lpItem) lpItem->state |= LVIS_FOCUSED; if (lpItem) lpItem->state |= LVIS_FOCUSED;
} }
/* FIXME: go thorugh selected items and mark them so in lpItem->state */ /* FIXME: go thorugh selected items and mark them so in lpItem->state */
@ -7773,8 +7816,8 @@ static BOOL LISTVIEW_SortItems(LISTVIEW_INFO *infoPtr, PFNLVCOMPARE pfnCompare,
selectionMarkItem=(infoPtr->nSelectionMark>=0)?DPA_GetPtr(infoPtr->hdpaItems, infoPtr->nSelectionMark):NULL; selectionMarkItem=(infoPtr->nSelectionMark>=0)?DPA_GetPtr(infoPtr->hdpaItems, infoPtr->nSelectionMark):NULL;
for (i=0; i < infoPtr->nItemCount; i++) for (i=0; i < infoPtr->nItemCount; i++)
{ {
hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, i); hdpaSubItems = DPA_GetPtr(infoPtr->hdpaItems, i);
lpItem = (ITEM_INFO *)DPA_GetPtr(hdpaSubItems, 0); lpItem = DPA_GetPtr(hdpaSubItems, 0);
if (lpItem->state & LVIS_SELECTED) if (lpItem->state & LVIS_SELECTED)
{ {
@ -8018,7 +8061,7 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
if (!infoPtr->hwndHeader) return -1; if (!infoPtr->hwndHeader) return -1;
/* set header unicode format */ /* set header unicode format */
SendMessageW(infoPtr->hwndHeader, HDM_SETUNICODEFORMAT, (WPARAM)TRUE, (LPARAM)NULL); SendMessageW(infoPtr->hwndHeader, HDM_SETUNICODEFORMAT, TRUE, 0);
/* set header font */ /* set header font */
SendMessageW(infoPtr->hwndHeader, WM_SETFONT, (WPARAM)infoPtr->hFont, (LPARAM)TRUE); SendMessageW(infoPtr->hwndHeader, WM_SETFONT, (WPARAM)infoPtr->hFont, (LPARAM)TRUE);
@ -8578,7 +8621,6 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, IN
{ {
LVHITTESTINFO lvHitTestInfo; LVHITTESTINFO lvHitTestInfo;
static BOOL bGroupSelect = TRUE; static BOOL bGroupSelect = TRUE;
BOOL bReceivedFocus = FALSE;
POINT pt = { x, y }; POINT pt = { x, y };
INT nItem; INT nItem;
@ -8587,22 +8629,16 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, IN
/* send NM_RELEASEDCAPTURE notification */ /* send NM_RELEASEDCAPTURE notification */
if (!notify(infoPtr, NM_RELEASEDCAPTURE)) return 0; if (!notify(infoPtr, NM_RELEASEDCAPTURE)) return 0;
if (!infoPtr->bFocus)
{
bReceivedFocus = TRUE;
SetFocus(infoPtr->hwndSelf);
}
/* set left button down flag and record the click position */ /* set left button down flag and record the click position */
infoPtr->bLButtonDown = TRUE; infoPtr->bLButtonDown = TRUE;
infoPtr->ptClickPos = pt; infoPtr->ptClickPos = pt;
infoPtr->bDragging = FALSE;
lvHitTestInfo.pt.x = x; lvHitTestInfo.pt.x = x;
lvHitTestInfo.pt.y = y; lvHitTestInfo.pt.y = y;
nItem = LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, TRUE); nItem = LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, TRUE);
TRACE("at %s, nItem=%d\n", wine_dbgstr_point(&pt), nItem); TRACE("at %s, nItem=%d\n", wine_dbgstr_point(&pt), nItem);
infoPtr->nEditLabelItem = -1;
if ((nItem >= 0) && (nItem < infoPtr->nItemCount)) if ((nItem >= 0) && (nItem < infoPtr->nItemCount))
{ {
if ((infoPtr->dwLvExStyle & LVS_EX_CHECKBOXES) && (lvHitTestInfo.flags & LVHT_ONITEMSTATEICON)) if ((infoPtr->dwLvExStyle & LVS_EX_CHECKBOXES) && (lvHitTestInfo.flags & LVHT_ONITEMSTATEICON))
@ -8663,6 +8699,9 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, IN
LISTVIEW_SetSelection(infoPtr, nItem); LISTVIEW_SetSelection(infoPtr, nItem);
} }
} }
if (infoPtr->dwLvExStyle & LVS_EX_ONECLICKACTIVATE)
if(lvHitTestInfo.iItem != -1) notify_itemactivate(infoPtr,&lvHitTestInfo);
} }
else else
{ {
@ -8671,9 +8710,6 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, IN
ReleaseCapture(); ReleaseCapture();
} }
if (bReceivedFocus)
infoPtr->nEditLabelItem = -1;
return 0; return 0;
} }
@ -8707,6 +8743,12 @@ static LRESULT LISTVIEW_LButtonUp(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT
/* set left button flag */ /* set left button flag */
infoPtr->bLButtonDown = FALSE; infoPtr->bLButtonDown = FALSE;
if (infoPtr->bDragging)
{
infoPtr->bDragging = FALSE;
return 0;
}
/* if we clicked on a selected item, edit the label */ /* if we clicked on a selected item, edit the label */
if(lvHitTestInfo.iItem == infoPtr->nEditLabelItem && (lvHitTestInfo.flags & LVHT_ONITEMLABEL)) if(lvHitTestInfo.iItem == infoPtr->nEditLabelItem && (lvHitTestInfo.flags & LVHT_ONITEMLABEL))
{ {
@ -8721,6 +8763,9 @@ static LRESULT LISTVIEW_LButtonUp(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT
LISTVIEW_DelayedEditItem); LISTVIEW_DelayedEditItem);
} }
if (!infoPtr->bFocus)
SetFocus(infoPtr->hwndSelf);
return 0; return 0;
} }
@ -9198,7 +9243,7 @@ static BOOL LISTVIEW_SetCursor(const LISTVIEW_INFO *infoPtr, HWND hwnd, UINT nHi
{ {
LVHITTESTINFO lvHitTestInfo; LVHITTESTINFO lvHitTestInfo;
if(!(infoPtr->dwLvExStyle & LVS_EX_TRACKSELECT)) return FALSE; if(!(LISTVIEW_isHotTracking(infoPtr))) return FALSE;
if(!infoPtr->hHotCursor) return FALSE; if(!infoPtr->hHotCursor) return FALSE;
@ -9709,9 +9754,8 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case LVM_GETTOPINDEX: case LVM_GETTOPINDEX:
return LISTVIEW_GetTopIndex(infoPtr); return LISTVIEW_GetTopIndex(infoPtr);
/*case LVM_GETUNICODEFORMAT: case LVM_GETUNICODEFORMAT:
FIXME("LVM_GETUNICODEFORMAT: unimplemented\n"); return (infoPtr->notifyFormat == NFR_UNICODE);
return FALSE;*/
/* case LVM_GETVIEW: */ /* case LVM_GETVIEW: */
@ -10033,7 +10077,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* case WM_WININICHANGE: */ /* case WM_WININICHANGE: */
default: default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP)) if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam); ERR("unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam);
fwd_msg: fwd_msg:

View file

@ -913,7 +913,7 @@ MONTHCAL_SetFirstDayOfWeek(MONTHCAL_INFO *infoPtr, LPARAM lParam)
} }
else if(lParam >= 7) else if(lParam >= 7)
{ {
infoPtr->firstDay = localFirstDay; infoPtr->firstDay = 6; /* max first day allowed */
infoPtr->firstDayHighWord = TRUE; infoPtr->firstDayHighWord = TRUE;
} }
else else
@ -994,7 +994,7 @@ MONTHCAL_SetRange(MONTHCAL_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
MONTHCAL_GetRange(HWND hwnd, WPARAM wParam, LPARAM lParam) MONTHCAL_GetRange(HWND hwnd, LPARAM lParam)
{ {
MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd); MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd);
SYSTEMTIME *lprgSysTimeArray = (SYSTEMTIME *)lParam; SYSTEMTIME *lprgSysTimeArray = (SYSTEMTIME *)lParam;
@ -1172,7 +1172,6 @@ MONTHCAL_HitTest(const MONTHCAL_INFO *infoPtr, LPARAM lParam)
x = lpht->pt.x; x = lpht->pt.x;
y = lpht->pt.y; y = lpht->pt.y;
retval = MCHT_NOWHERE;
ZeroMemory(&lpht->st, sizeof(lpht->st)); ZeroMemory(&lpht->st, sizeof(lpht->st));
@ -1303,6 +1302,11 @@ static void MONTHCAL_GoToNextMonth(MONTHCAL_INFO *infoPtr)
nmds.cDayState = infoPtr->monthRange; nmds.cDayState = infoPtr->monthRange;
nmds.prgDayState = Alloc(infoPtr->monthRange * sizeof(MONTHDAYSTATE)); nmds.prgDayState = Alloc(infoPtr->monthRange * sizeof(MONTHDAYSTATE));
nmds.stStart = infoPtr->todaysDate;
nmds.stStart.wYear = infoPtr->currentYear;
nmds.stStart.wMonth = infoPtr->currentMonth;
nmds.stStart.wDay = 1;
SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, nmds.nmhdr.idFrom, (LPARAM)&nmds); SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, nmds.nmhdr.idFrom, (LPARAM)&nmds);
for(i=0; i<infoPtr->monthRange; i++) for(i=0; i<infoPtr->monthRange; i++)
infoPtr->monthdayState[i] = nmds.prgDayState[i]; infoPtr->monthdayState[i] = nmds.prgDayState[i];
@ -1333,6 +1337,11 @@ static void MONTHCAL_GoToPrevMonth(MONTHCAL_INFO *infoPtr)
nmds.prgDayState = Alloc nmds.prgDayState = Alloc
(infoPtr->monthRange * sizeof(MONTHDAYSTATE)); (infoPtr->monthRange * sizeof(MONTHDAYSTATE));
nmds.stStart = infoPtr->todaysDate;
nmds.stStart.wYear = infoPtr->currentYear;
nmds.stStart.wMonth = infoPtr->currentMonth;
nmds.stStart.wDay = 1;
SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, nmds.nmhdr.idFrom, (LPARAM)&nmds); SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, nmds.nmhdr.idFrom, (LPARAM)&nmds);
for(i=0; i<infoPtr->monthRange; i++) for(i=0; i<infoPtr->monthRange; i++)
infoPtr->monthdayState[i] = nmds.prgDayState[i]; infoPtr->monthdayState[i] = nmds.prgDayState[i];
@ -1383,7 +1392,7 @@ MONTHCAL_LButtonDown(MONTHCAL_INFO *infoPtr, LPARAM lParam)
if (infoPtr->hWndYearUpDown) if (infoPtr->hWndYearUpDown)
{ {
infoPtr->currentYear=SendMessageW( infoPtr->hWndYearUpDown, UDM_SETPOS, (WPARAM) 0,(LPARAM)0); infoPtr->currentYear=SendMessageW(infoPtr->hWndYearUpDown, UDM_SETPOS, 0, 0);
if(!DestroyWindow(infoPtr->hWndYearUpDown)) if(!DestroyWindow(infoPtr->hWndYearUpDown))
{ {
FIXME("Can't destroy Updown Control\n"); FIXME("Can't destroy Updown Control\n");
@ -1464,9 +1473,9 @@ MONTHCAL_LButtonDown(MONTHCAL_INFO *infoPtr, LPARAM lParam)
NULL, NULL,
NULL, NULL,
NULL); NULL);
SendMessageW( infoPtr->hWndYearUpDown, UDM_SETRANGE, (WPARAM) 0, MAKELONG (9999, 1753)); SendMessageW(infoPtr->hWndYearUpDown, UDM_SETRANGE, 0, MAKELONG (9999, 1753));
SendMessageW( infoPtr->hWndYearUpDown, UDM_SETBUDDY, (WPARAM) infoPtr->hWndYearEdit, (LPARAM)0 ); SendMessageW(infoPtr->hWndYearUpDown, UDM_SETBUDDY, (WPARAM) infoPtr->hWndYearEdit, 0);
SendMessageW( infoPtr->hWndYearUpDown, UDM_SETPOS, (WPARAM) 0,(LPARAM)infoPtr->currentYear ); SendMessageW(infoPtr->hWndYearUpDown, UDM_SETPOS, 0, infoPtr->currentYear);
return 0; return 0;
} }
@ -1498,8 +1507,8 @@ MONTHCAL_LButtonDown(MONTHCAL_INFO *infoPtr, LPARAM lParam)
MONTHCAL_CopyTime(&ht.st, &selArray[0]); MONTHCAL_CopyTime(&ht.st, &selArray[0]);
MONTHCAL_CopyTime(&ht.st, &selArray[1]); MONTHCAL_CopyTime(&ht.st, &selArray[1]);
MONTHCAL_SetSelRange(infoPtr, (LPARAM)&selArray); MONTHCAL_SetSelRange(infoPtr, (LPARAM)selArray);
MONTHCAL_SetCurSel(infoPtr, (LPARAM)&selArray); MONTHCAL_SetCurSel(infoPtr, (LPARAM)selArray);
TRACE("MCHT_CALENDARDATE\n"); TRACE("MCHT_CALENDARDATE\n");
nmsc.nmhdr.hwndFrom = infoPtr->hwndSelf; nmsc.nmhdr.hwndFrom = infoPtr->hwndSelf;
nmsc.nmhdr.idFrom = GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID); nmsc.nmhdr.idFrom = GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID);
@ -1621,7 +1630,7 @@ MONTHCAL_Timer(MONTHCAL_INFO *infoPtr, WPARAM wParam)
static LRESULT static LRESULT
MONTHCAL_MouseMove(MONTHCAL_INFO *infoPtr, WPARAM wParam, LPARAM lParam) MONTHCAL_MouseMove(MONTHCAL_INFO *infoPtr, LPARAM lParam)
{ {
MCHITTESTINFO ht; MCHITTESTINFO ht;
int oldselday, selday, hit; int oldselday, selday, hit;
@ -1647,7 +1656,7 @@ MONTHCAL_MouseMove(MONTHCAL_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
SYSTEMTIME selArray[2]; SYSTEMTIME selArray[2];
int i; int i;
MONTHCAL_GetSelRange(infoPtr, (LPARAM)&selArray); MONTHCAL_GetSelRange(infoPtr, (LPARAM)selArray);
i = 0; i = 0;
if(infoPtr->firstSelDay==selArray[0].wDay) i=1; if(infoPtr->firstSelDay==selArray[0].wDay) i=1;
TRACE("oldRange:%d %d %d %d\n", infoPtr->firstSelDay, selArray[0].wDay, selArray[1].wDay, i); TRACE("oldRange:%d %d %d %d\n", infoPtr->firstSelDay, selArray[0].wDay, selArray[1].wDay, i);
@ -1677,7 +1686,7 @@ MONTHCAL_MouseMove(MONTHCAL_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
selArray[0].wDay = tempday; selArray[0].wDay = tempday;
} }
MONTHCAL_SetSelRange(infoPtr, (LPARAM)&selArray); MONTHCAL_SetSelRange(infoPtr, (LPARAM)selArray);
} }
} }
@ -1864,6 +1873,8 @@ static LRESULT MONTHCAL_SetFont(MONTHCAL_INFO *infoPtr, HFONT hFont, BOOL redraw
lf.lfWeight = FW_BOLD; lf.lfWeight = FW_BOLD;
infoPtr->hBoldFont = CreateFontIndirectW(&lf); infoPtr->hBoldFont = CreateFontIndirectW(&lf);
MONTHCAL_UpdateSize(infoPtr);
if (redraw) if (redraw)
InvalidateRect(infoPtr->hwndSelf, NULL, FALSE); InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
@ -1875,18 +1886,18 @@ static LRESULT theme_changed (const MONTHCAL_INFO* infoPtr)
{ {
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
CloseThemeData (theme); CloseThemeData (theme);
theme = OpenThemeData (infoPtr->hwndSelf, themeClass); OpenThemeData (infoPtr->hwndSelf, themeClass);
return 0; return 0;
} }
/* FIXME: check whether dateMin/dateMax need to be adjusted. */ /* FIXME: check whether dateMin/dateMax need to be adjusted. */
static LRESULT static LRESULT
MONTHCAL_Create(HWND hwnd, WPARAM wParam, LPARAM lParam) MONTHCAL_Create(HWND hwnd, LPARAM lParam)
{ {
MONTHCAL_INFO *infoPtr; MONTHCAL_INFO *infoPtr;
/* allocate memory for info structure */ /* allocate memory for info structure */
infoPtr =(MONTHCAL_INFO*)Alloc(sizeof(MONTHCAL_INFO)); infoPtr = Alloc(sizeof(MONTHCAL_INFO));
SetWindowLongPtrW(hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW(hwnd, 0, (DWORD_PTR)infoPtr);
if(infoPtr == NULL) { if(infoPtr == NULL) {
@ -2011,7 +2022,7 @@ MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return MONTHCAL_SetFirstDayOfWeek(infoPtr, lParam); return MONTHCAL_SetFirstDayOfWeek(infoPtr, lParam);
case MCM_GETRANGE: case MCM_GETRANGE:
return MONTHCAL_GetRange(hwnd, wParam, lParam); return MONTHCAL_GetRange(hwnd, lParam);
case MCM_SETRANGE: case MCM_SETRANGE:
return MONTHCAL_SetRange(infoPtr, wParam, lParam); return MONTHCAL_SetRange(infoPtr, wParam, lParam);
@ -2038,7 +2049,7 @@ MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return MONTHCAL_LButtonDown(infoPtr, lParam); return MONTHCAL_LButtonDown(infoPtr, lParam);
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
return MONTHCAL_MouseMove(infoPtr, wParam, lParam); return MONTHCAL_MouseMove(infoPtr, lParam);
case WM_LBUTTONUP: case WM_LBUTTONUP:
return MONTHCAL_LButtonUp(infoPtr, lParam); return MONTHCAL_LButtonUp(infoPtr, lParam);
@ -2054,7 +2065,7 @@ MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return MONTHCAL_Size(infoPtr, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam)); return MONTHCAL_Size(infoPtr, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
case WM_CREATE: case WM_CREATE:
return MONTHCAL_Create(hwnd, wParam, lParam); return MONTHCAL_Create(hwnd, lParam);
case WM_SETFONT: case WM_SETFONT:
return MONTHCAL_SetFont(infoPtr, (HFONT)wParam, (BOOL)lParam); return MONTHCAL_SetFont(infoPtr, (HFONT)wParam, (BOOL)lParam);
@ -2072,7 +2083,7 @@ MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return MONTHCAL_Destroy(infoPtr); return MONTHCAL_Destroy(infoPtr);
default: default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP)) if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR( "unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam); ERR( "unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam);
return DefWindowProcW(hwnd, uMsg, wParam, lParam); return DefWindowProcW(hwnd, uMsg, wParam, lParam);
} }

View file

@ -47,12 +47,12 @@ typedef struct
#define NATIVEFONT_GetInfoPtr(hwnd) ((NATIVEFONT_INFO *)GetWindowLongPtrW (hwnd, 0)) #define NATIVEFONT_GetInfoPtr(hwnd) ((NATIVEFONT_INFO *)GetWindowLongPtrW (hwnd, 0))
static LRESULT static LRESULT
NATIVEFONT_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) NATIVEFONT_Create (HWND hwnd)
{ {
NATIVEFONT_INFO *infoPtr; NATIVEFONT_INFO *infoPtr;
/* allocate memory for info structure */ /* allocate memory for info structure */
infoPtr = (NATIVEFONT_INFO *)Alloc (sizeof(NATIVEFONT_INFO)); infoPtr = Alloc (sizeof(NATIVEFONT_INFO));
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
/* initialize info structure */ /* initialize info structure */
@ -85,7 +85,7 @@ NATIVEFONT_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
switch (uMsg) switch (uMsg)
{ {
case WM_CREATE: case WM_CREATE:
return NATIVEFONT_Create (hwnd, wParam, lParam); return NATIVEFONT_Create (hwnd);
case WM_DESTROY: case WM_DESTROY:
return NATIVEFONT_Destroy (infoPtr); return NATIVEFONT_Destroy (infoPtr);
@ -101,7 +101,7 @@ NATIVEFONT_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return DefWindowProcW (hwnd, uMsg, wParam, lParam); return DefWindowProcW (hwnd, uMsg, wParam, lParam);
default: default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP)) if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n", ERR("unknown msg %04x wp=%08lx lp=%08lx\n",
uMsg, wParam, lParam); uMsg, wParam, lParam);
return DefWindowProcW (hwnd, uMsg, wParam, lParam); return DefWindowProcW (hwnd, uMsg, wParam, lParam);

View file

@ -237,7 +237,7 @@ PAGER_DrawButton(HDC hdc, COLORREF clrBk, RECT arrowRect,
return; return;
hBrush = CreateSolidBrush(clrBk); hBrush = CreateSolidBrush(clrBk);
hOldBrush = (HBRUSH)SelectObject(hdc, hBrush); hOldBrush = SelectObject(hdc, hBrush);
FillRect(hdc, &rc, hBrush); FillRect(hdc, &rc, hBrush);
@ -801,7 +801,7 @@ PAGER_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
PAGER_INFO *infoPtr; PAGER_INFO *infoPtr;
/* allocate memory for info structure */ /* allocate memory for info structure */
infoPtr = (PAGER_INFO *)Alloc (sizeof(PAGER_INFO)); infoPtr = Alloc (sizeof(PAGER_INFO));
if (!infoPtr) return -1; if (!infoPtr) return -1;
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);

View file

@ -567,7 +567,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
/* allocate memory for info struct */ /* allocate memory for info struct */
infoPtr = (PROGRESS_INFO *)Alloc (sizeof(PROGRESS_INFO)); infoPtr = Alloc (sizeof(PROGRESS_INFO));
if (!infoPtr) return -1; if (!infoPtr) return -1;
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
@ -722,7 +722,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
return infoPtr->Marquee; return infoPtr->Marquee;
default: default:
if ((message >= WM_USER) && (message < WM_APP)) if ((message >= WM_USER) && (message < WM_APP) && !COMCTL32_IsReflectedMessage(message))
ERR("unknown msg %04x wp=%04lx lp=%08lx\n", message, wParam, lParam ); ERR("unknown msg %04x wp=%04lx lp=%08lx\n", message, wParam, lParam );
return DefWindowProcW( hwnd, message, wParam, lParam ); return DefWindowProcW( hwnd, message, wParam, lParam );
} }

View file

@ -441,7 +441,7 @@ static BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp,
(LPWSTR)RT_DIALOG); (LPWSTR)RT_DIALOG);
HGLOBAL hTemplate = LoadResource(lppsp->hInstance, HGLOBAL hTemplate = LoadResource(lppsp->hInstance,
hResource); hResource);
pTemplate = (LPDLGTEMPLATEW)LockResource(hTemplate); pTemplate = LockResource(hTemplate);
} }
else else
{ {
@ -450,7 +450,7 @@ static BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp,
(LPSTR)RT_DIALOG); (LPSTR)RT_DIALOG);
HGLOBAL hTemplate = LoadResource(lppsp->hInstance, HGLOBAL hTemplate = LoadResource(lppsp->hInstance,
hResource); hResource);
pTemplate = (LPDLGTEMPLATEA)LockResource(hTemplate); pTemplate = LockResource(hTemplate);
} }
/* /*
@ -1412,7 +1412,7 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
if(!hTemplate) if(!hTemplate)
return FALSE; return FALSE;
pTemplate = (LPDLGTEMPLATEW)LockResource(hTemplate); pTemplate = LockResource(hTemplate);
/* /*
* Make a copy of the dialog template to make it writable * Make a copy of the dialog template to make it writable
*/ */
@ -1434,7 +1434,7 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
if(!hTemplate) if(!hTemplate)
return FALSE; return FALSE;
pTemplate = (LPDLGTEMPLATEA)LockResource(hTemplate); pTemplate = LockResource(hTemplate);
/* /*
* Make a copy of the dialog template to make it writable * Make a copy of the dialog template to make it writable
*/ */
@ -1604,8 +1604,7 @@ static BOOL PROPSHEET_Back(HWND hwndDlg)
{ {
PSHNOTIFY psn; PSHNOTIFY psn;
HWND hwndPage; HWND hwndPage;
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
PropSheetInfoStr);
LRESULT result; LRESULT result;
int idx; int idx;
@ -1644,8 +1643,7 @@ static BOOL PROPSHEET_Next(HWND hwndDlg)
PSHNOTIFY psn; PSHNOTIFY psn;
HWND hwndPage; HWND hwndPage;
LRESULT msgResult = 0; LRESULT msgResult = 0;
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
PropSheetInfoStr);
int idx; int idx;
TRACE("active_page %d\n", psInfo->active_page); TRACE("active_page %d\n", psInfo->active_page);
@ -1684,8 +1682,7 @@ static BOOL PROPSHEET_Finish(HWND hwndDlg)
PSHNOTIFY psn; PSHNOTIFY psn;
HWND hwndPage; HWND hwndPage;
LRESULT msgResult = 0; LRESULT msgResult = 0;
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
PropSheetInfoStr);
TRACE("active_page %d\n", psInfo->active_page); TRACE("active_page %d\n", psInfo->active_page);
if (psInfo->active_page < 0) if (psInfo->active_page < 0)
@ -1723,8 +1720,7 @@ static BOOL PROPSHEET_Apply(HWND hwndDlg, LPARAM lParam)
int i; int i;
HWND hwndPage; HWND hwndPage;
PSHNOTIFY psn; PSHNOTIFY psn;
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
PropSheetInfoStr);
TRACE("active_page %d\n", psInfo->active_page); TRACE("active_page %d\n", psInfo->active_page);
if (psInfo->active_page < 0) if (psInfo->active_page < 0)
@ -1787,8 +1783,7 @@ static BOOL PROPSHEET_Apply(HWND hwndDlg, LPARAM lParam)
*/ */
static void PROPSHEET_Cancel(HWND hwndDlg, LPARAM lParam) static void PROPSHEET_Cancel(HWND hwndDlg, LPARAM lParam)
{ {
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
PropSheetInfoStr);
HWND hwndPage; HWND hwndPage;
PSHNOTIFY psn; PSHNOTIFY psn;
int i; int i;
@ -1831,8 +1826,7 @@ static void PROPSHEET_Cancel(HWND hwndDlg, LPARAM lParam)
*/ */
static void PROPSHEET_Help(HWND hwndDlg) static void PROPSHEET_Help(HWND hwndDlg)
{ {
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
PropSheetInfoStr);
HWND hwndPage; HWND hwndPage;
PSHNOTIFY psn; PSHNOTIFY psn;
@ -1855,8 +1849,7 @@ static void PROPSHEET_Help(HWND hwndDlg)
static void PROPSHEET_Changed(HWND hwndDlg, HWND hwndDirtyPage) static void PROPSHEET_Changed(HWND hwndDlg, HWND hwndDirtyPage)
{ {
int i; int i;
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
PropSheetInfoStr);
TRACE("\n"); TRACE("\n");
if (!psInfo) return; if (!psInfo) return;
@ -1888,8 +1881,7 @@ static void PROPSHEET_UnChanged(HWND hwndDlg, HWND hwndCleanPage)
int i; int i;
BOOL noPageDirty = TRUE; BOOL noPageDirty = TRUE;
HWND hwndApplyBtn = GetDlgItem(hwndDlg, IDC_APPLY_BUTTON); HWND hwndApplyBtn = GetDlgItem(hwndDlg, IDC_APPLY_BUTTON);
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
PropSheetInfoStr);
TRACE("\n"); TRACE("\n");
if ( !psInfo ) return; if ( !psInfo ) return;
@ -1961,8 +1953,7 @@ static void PROPSHEET_PressButton(HWND hwndDlg, int buttonID)
*/ */
static BOOL PROPSHEET_CanSetCurSel(HWND hwndDlg) static BOOL PROPSHEET_CanSetCurSel(HWND hwndDlg)
{ {
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
PropSheetInfoStr);
HWND hwndPage; HWND hwndPage;
PSHNOTIFY psn; PSHNOTIFY psn;
BOOL res = FALSE; BOOL res = FALSE;
@ -2005,7 +1996,7 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg,
HPROPSHEETPAGE hpage HPROPSHEETPAGE hpage
) )
{ {
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfoStr); PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
HWND hwndHelp = GetDlgItem(hwndDlg, IDHELP); HWND hwndHelp = GetDlgItem(hwndDlg, IDHELP);
HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL); HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
@ -2120,8 +2111,7 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg,
static void PROPSHEET_SetCurSelId(HWND hwndDlg, int id) static void PROPSHEET_SetCurSelId(HWND hwndDlg, int id)
{ {
int idx; int idx;
PropSheetInfo* psInfo = PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
(PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfoStr);
idx = PROPSHEET_FindPageByResId(psInfo, id); idx = PROPSHEET_FindPageByResId(psInfo, id);
if (idx < psInfo->nPages ) if (idx < psInfo->nPages )
@ -2154,7 +2144,7 @@ static void PROPSHEET_SetTitleA(HWND hwndDlg, DWORD dwStyle, LPCSTR lpszText)
*/ */
static void PROPSHEET_SetTitleW(HWND hwndDlg, DWORD dwStyle, LPCWSTR lpszText) static void PROPSHEET_SetTitleW(HWND hwndDlg, DWORD dwStyle, LPCWSTR lpszText)
{ {
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfoStr); PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
WCHAR szTitle[256]; WCHAR szTitle[256];
TRACE("%s (style %08x)\n", debugstr_w(lpszText), dwStyle); TRACE("%s (style %08x)\n", debugstr_w(lpszText), dwStyle);
@ -2185,7 +2175,7 @@ static void PROPSHEET_SetTitleW(HWND hwndDlg, DWORD dwStyle, LPCWSTR lpszText)
*/ */
static void PROPSHEET_SetFinishTextA(HWND hwndDlg, LPCSTR lpszText) static void PROPSHEET_SetFinishTextA(HWND hwndDlg, LPCSTR lpszText)
{ {
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfoStr); PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
HWND hwndButton = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON); HWND hwndButton = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON);
TRACE("'%s'\n", lpszText); TRACE("'%s'\n", lpszText);
@ -2214,7 +2204,7 @@ static void PROPSHEET_SetFinishTextA(HWND hwndDlg, LPCSTR lpszText)
*/ */
static void PROPSHEET_SetFinishTextW(HWND hwndDlg, LPCWSTR lpszText) static void PROPSHEET_SetFinishTextW(HWND hwndDlg, LPCWSTR lpszText)
{ {
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfoStr); PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
HWND hwndButton = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON); HWND hwndButton = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON);
TRACE("%s\n", debugstr_w(lpszText)); TRACE("%s\n", debugstr_w(lpszText));
@ -2247,7 +2237,7 @@ static LRESULT PROPSHEET_QuerySiblings(HWND hwndDlg,
int i = 0; int i = 0;
HWND hwndPage; HWND hwndPage;
LRESULT msgResult = 0; LRESULT msgResult = 0;
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfoStr); PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
while ((i < psInfo->nPages) && (msgResult == 0)) while ((i < psInfo->nPages) && (msgResult == 0))
{ {
@ -2267,8 +2257,7 @@ static BOOL PROPSHEET_AddPage(HWND hwndDlg,
HPROPSHEETPAGE hpage) HPROPSHEETPAGE hpage)
{ {
PropPageInfo * ppi; PropPageInfo * ppi;
PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
PropSheetInfoStr);
HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL); HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
TCITEMW item; TCITEMW item;
LPCPROPSHEETPAGEW ppsp = (LPCPROPSHEETPAGEW)hpage; LPCPROPSHEETPAGEW ppsp = (LPCPROPSHEETPAGEW)hpage;
@ -2277,9 +2266,7 @@ static BOOL PROPSHEET_AddPage(HWND hwndDlg,
/* /*
* Allocate and fill in a new PropPageInfo entry. * Allocate and fill in a new PropPageInfo entry.
*/ */
ppi = (PropPageInfo*) ReAlloc(psInfo->proppage, ppi = ReAlloc(psInfo->proppage, sizeof(PropPageInfo) * (psInfo->nPages + 1));
sizeof(PropPageInfo) *
(psInfo->nPages + 1));
if (!ppi) if (!ppi)
return FALSE; return FALSE;
@ -2331,8 +2318,7 @@ static BOOL PROPSHEET_RemovePage(HWND hwndDlg,
int index, int index,
HPROPSHEETPAGE hpage) HPROPSHEETPAGE hpage)
{ {
PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
PropSheetInfoStr);
HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL); HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
PropPageInfo* oldPages; PropPageInfo* oldPages;
@ -2431,28 +2417,6 @@ static BOOL PROPSHEET_RemovePage(HWND hwndDlg,
return FALSE; return FALSE;
} }
BOOL CALLBACK
EnumChildProc(HWND hwnd, LPARAM lParam)
{
WCHAR szType[20];
RealGetWindowClassW(hwnd, szType, 20);
if (strcmpW(szType, WC_EDITW) == 0)
{
if (IsWindowEnabled(hwnd) && IsWindowVisible(hwnd))
{
SetFocus(hwnd);
return FALSE;
}
}
else
{
EnumChildWindows(hwnd, EnumChildProc, 0);
}
return TRUE;
}
/****************************************************************************** /******************************************************************************
* PROPSHEET_SetWizButtons * PROPSHEET_SetWizButtons
* *
@ -2463,8 +2427,7 @@ EnumChildProc(HWND hwnd, LPARAM lParam)
*/ */
static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags) static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags)
{ {
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
PropSheetInfoStr);
HWND hwndBack = GetDlgItem(hwndDlg, IDC_BACK_BUTTON); HWND hwndBack = GetDlgItem(hwndDlg, IDC_BACK_BUTTON);
HWND hwndNext = GetDlgItem(hwndDlg, IDC_NEXT_BUTTON); HWND hwndNext = GetDlgItem(hwndDlg, IDC_NEXT_BUTTON);
HWND hwndFinish = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON); HWND hwndFinish = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON);
@ -2475,6 +2438,17 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags)
EnableWindow(hwndNext, FALSE); EnableWindow(hwndNext, FALSE);
EnableWindow(hwndFinish, FALSE); EnableWindow(hwndFinish, FALSE);
/* set the default pushbutton to an enabled button */
if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH))
SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0);
else if (dwFlags & PSWIZB_NEXT)
SendMessageW(hwndDlg, DM_SETDEFID, IDC_NEXT_BUTTON, 0);
else if (dwFlags & PSWIZB_BACK)
SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0);
else
SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0);
if (dwFlags & PSWIZB_BACK) if (dwFlags & PSWIZB_BACK)
EnableWindow(hwndBack, TRUE); EnableWindow(hwndBack, TRUE);
@ -2504,32 +2478,6 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags)
} }
else if (!(dwFlags & PSWIZB_DISABLEDFINISH)) else if (!(dwFlags & PSWIZB_DISABLEDFINISH))
EnableWindow(hwndFinish, TRUE); EnableWindow(hwndFinish, TRUE);
/* set the default pushbutton to an enabled button and give it focus */
if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH))
{
SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0);
SetFocus(hwndFinish);
}
else if (dwFlags & PSWIZB_NEXT)
{
SendMessageW(hwndDlg, DM_SETDEFID, IDC_NEXT_BUTTON, 0);
SetFocus(hwndNext);
}
else if (dwFlags & PSWIZB_BACK)
{
SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0);
SetFocus(hwndBack);
}
else
{
SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0);
SetFocus(GetDlgItem(hwndDlg, IDCANCEL));
}
/* Now try to find an edit control that deserves focus */
EnumChildWindows(PropSheet_GetCurrentPageHwnd(hwndDlg), EnumChildProc, 0);
} }
/****************************************************************************** /******************************************************************************
@ -2582,8 +2530,7 @@ static void PROPSHEET_SetHeaderSubTitleA(HWND hwndDlg, int iPageIndex, LPCSTR ps
static LRESULT PROPSHEET_HwndToIndex(HWND hwndDlg, HWND hPageDlg) static LRESULT PROPSHEET_HwndToIndex(HWND hwndDlg, HWND hPageDlg)
{ {
int index; int index;
PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
PropSheetInfoStr);
TRACE("(%p, %p)\n", hwndDlg, hPageDlg); TRACE("(%p, %p)\n", hwndDlg, hPageDlg);
@ -2599,8 +2546,7 @@ static LRESULT PROPSHEET_HwndToIndex(HWND hwndDlg, HWND hPageDlg)
*/ */
static LRESULT PROPSHEET_IndexToHwnd(HWND hwndDlg, int iPageIndex) static LRESULT PROPSHEET_IndexToHwnd(HWND hwndDlg, int iPageIndex)
{ {
PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
PropSheetInfoStr);
TRACE("(%p, %d)\n", hwndDlg, iPageIndex); TRACE("(%p, %d)\n", hwndDlg, iPageIndex);
if (iPageIndex<0 || iPageIndex>=psInfo->nPages) { if (iPageIndex<0 || iPageIndex>=psInfo->nPages) {
WARN("%d out of range.\n", iPageIndex); WARN("%d out of range.\n", iPageIndex);
@ -2615,8 +2561,7 @@ static LRESULT PROPSHEET_IndexToHwnd(HWND hwndDlg, int iPageIndex)
static LRESULT PROPSHEET_PageToIndex(HWND hwndDlg, HPROPSHEETPAGE hPage) static LRESULT PROPSHEET_PageToIndex(HWND hwndDlg, HPROPSHEETPAGE hPage)
{ {
int index; int index;
PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
PropSheetInfoStr);
TRACE("(%p, %p)\n", hwndDlg, hPage); TRACE("(%p, %p)\n", hwndDlg, hPage);
@ -2632,8 +2577,7 @@ static LRESULT PROPSHEET_PageToIndex(HWND hwndDlg, HPROPSHEETPAGE hPage)
*/ */
static LRESULT PROPSHEET_IndexToPage(HWND hwndDlg, int iPageIndex) static LRESULT PROPSHEET_IndexToPage(HWND hwndDlg, int iPageIndex)
{ {
PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
PropSheetInfoStr);
TRACE("(%p, %d)\n", hwndDlg, iPageIndex); TRACE("(%p, %d)\n", hwndDlg, iPageIndex);
if (iPageIndex<0 || iPageIndex>=psInfo->nPages) { if (iPageIndex<0 || iPageIndex>=psInfo->nPages) {
WARN("%d out of range.\n", iPageIndex); WARN("%d out of range.\n", iPageIndex);
@ -2649,8 +2593,7 @@ static LRESULT PROPSHEET_IdToIndex(HWND hwndDlg, int iPageId)
{ {
int index; int index;
LPCPROPSHEETPAGEW psp; LPCPROPSHEETPAGEW psp;
PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
PropSheetInfoStr);
TRACE("(%p, %d)\n", hwndDlg, iPageId); TRACE("(%p, %d)\n", hwndDlg, iPageId);
for (index = 0; index < psInfo->nPages; index++) { for (index = 0; index < psInfo->nPages; index++) {
psp = (LPCPROPSHEETPAGEW)psInfo->proppage[index].hpage; psp = (LPCPROPSHEETPAGEW)psInfo->proppage[index].hpage;
@ -2666,8 +2609,7 @@ static LRESULT PROPSHEET_IdToIndex(HWND hwndDlg, int iPageId)
*/ */
static LRESULT PROPSHEET_IndexToId(HWND hwndDlg, int iPageIndex) static LRESULT PROPSHEET_IndexToId(HWND hwndDlg, int iPageIndex)
{ {
PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
PropSheetInfoStr);
LPCPROPSHEETPAGEW psp; LPCPROPSHEETPAGEW psp;
TRACE("(%p, %d)\n", hwndDlg, iPageIndex); TRACE("(%p, %d)\n", hwndDlg, iPageIndex);
if (iPageIndex<0 || iPageIndex>=psInfo->nPages) { if (iPageIndex<0 || iPageIndex>=psInfo->nPages) {
@ -2686,8 +2628,7 @@ static LRESULT PROPSHEET_IndexToId(HWND hwndDlg, int iPageIndex)
*/ */
static LRESULT PROPSHEET_GetResult(HWND hwndDlg) static LRESULT PROPSHEET_GetResult(HWND hwndDlg)
{ {
PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
PropSheetInfoStr);
return psInfo->result; return psInfo->result;
} }
@ -2732,8 +2673,7 @@ static int PROPSHEET_GetPageIndex(HPROPSHEETPAGE hpage, const PropSheetInfo* psI
static void PROPSHEET_CleanUp(HWND hwndDlg) static void PROPSHEET_CleanUp(HWND hwndDlg)
{ {
int i; int i;
PropSheetInfo* psInfo = (PropSheetInfo*) RemovePropW(hwndDlg, PropSheetInfo* psInfo = RemovePropW(hwndDlg, PropSheetInfoStr);
PropSheetInfoStr);
TRACE("\n"); TRACE("\n");
if (!psInfo) return; if (!psInfo) return;
@ -2821,17 +2761,21 @@ static INT do_loop(const PropSheetInfo *psInfo)
static INT_PTR PROPSHEET_PropertySheet(PropSheetInfo* psInfo, BOOL unicode) static INT_PTR PROPSHEET_PropertySheet(PropSheetInfo* psInfo, BOOL unicode)
{ {
INT_PTR bRet = 0; INT_PTR bRet = 0;
HWND parent = NULL;
if (psInfo->active_page >= psInfo->nPages) psInfo->active_page = 0; if (psInfo->active_page >= psInfo->nPages) psInfo->active_page = 0;
TRACE("startpage: %d of %d pages\n", psInfo->active_page, psInfo->nPages); TRACE("startpage: %d of %d pages\n", psInfo->active_page, psInfo->nPages);
psInfo->unicode = unicode; psInfo->unicode = unicode;
psInfo->ended = FALSE; psInfo->ended = FALSE;
if(!psInfo->isModeless)
{
parent = psInfo->ppshheader.hwndParent;
if (parent) EnableWindow(parent, FALSE);
}
bRet = PROPSHEET_CreateDialog(psInfo); bRet = PROPSHEET_CreateDialog(psInfo);
if(!psInfo->isModeless) if(!psInfo->isModeless)
{ {
HWND parent = GetParent(psInfo->hwnd);
if (parent) EnableWindow(parent, FALSE);
bRet = do_loop(psInfo); bRet = do_loop(psInfo);
if (parent) EnableWindow(parent, TRUE); if (parent) EnableWindow(parent, TRUE);
} }
@ -2853,8 +2797,7 @@ static INT_PTR PROPSHEET_PropertySheet(PropSheetInfo* psInfo, BOOL unicode)
*/ */
INT_PTR WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh) INT_PTR WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh)
{ {
PropSheetInfo* psInfo = (PropSheetInfo*) GlobalAlloc(GPTR, PropSheetInfo* psInfo = GlobalAlloc(GPTR, sizeof(PropSheetInfo));
sizeof(PropSheetInfo));
UINT i, n; UINT i, n;
const BYTE* pByte; const BYTE* pByte;
@ -2862,8 +2805,7 @@ INT_PTR WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh)
PROPSHEET_CollectSheetInfoA(lppsh, psInfo); PROPSHEET_CollectSheetInfoA(lppsh, psInfo);
psInfo->proppage = (PropPageInfo*) Alloc(sizeof(PropPageInfo) * psInfo->proppage = Alloc(sizeof(PropPageInfo) * lppsh->nPages);
lppsh->nPages);
pByte = (const BYTE*) psInfo->ppshheader.u3.ppsp; pByte = (const BYTE*) psInfo->ppshheader.u3.ppsp;
for (n = i = 0; i < lppsh->nPages; i++, n++) for (n = i = 0; i < lppsh->nPages; i++, n++)
@ -2896,8 +2838,7 @@ INT_PTR WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh)
*/ */
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh) INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
{ {
PropSheetInfo* psInfo = (PropSheetInfo*) GlobalAlloc(GPTR, PropSheetInfo* psInfo = GlobalAlloc(GPTR, sizeof(PropSheetInfo));
sizeof(PropSheetInfo));
UINT i, n; UINT i, n;
const BYTE* pByte; const BYTE* pByte;
@ -2905,8 +2846,7 @@ INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
PROPSHEET_CollectSheetInfoW(lppsh, psInfo); PROPSHEET_CollectSheetInfoW(lppsh, psInfo);
psInfo->proppage = (PropPageInfo*) Alloc(sizeof(PropPageInfo) * psInfo->proppage = Alloc(sizeof(PropPageInfo) * lppsh->nPages);
lppsh->nPages);
pByte = (const BYTE*) psInfo->ppshheader.u3.ppsp; pByte = (const BYTE*) psInfo->ppshheader.u3.ppsp;
for (n = i = 0; i < lppsh->nPages; i++, n++) for (n = i = 0; i < lppsh->nPages; i++, n++)
@ -3137,7 +3077,7 @@ BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage)
*/ */
static BOOL PROPSHEET_IsDialogMessage(HWND hwnd, LPMSG lpMsg) static BOOL PROPSHEET_IsDialogMessage(HWND hwnd, LPMSG lpMsg)
{ {
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwnd, PropSheetInfoStr); PropSheetInfo* psInfo = GetPropW(hwnd, PropSheetInfoStr);
TRACE("\n"); TRACE("\n");
if (!psInfo || (hwnd != lpMsg->hwnd && !IsChild(hwnd, lpMsg->hwnd))) if (!psInfo || (hwnd != lpMsg->hwnd && !IsChild(hwnd, lpMsg->hwnd)))
@ -3203,8 +3143,7 @@ static BOOL PROPSHEET_DoCommand(HWND hwnd, WORD wID)
if (wID == IDOK) if (wID == IDOK)
{ {
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwnd, PropSheetInfo* psInfo = GetPropW(hwnd, PropSheetInfoStr);
PropSheetInfoStr);
/* don't overwrite ID_PSRESTARTWINDOWS or ID_PSREBOOTSYSTEM */ /* don't overwrite ID_PSRESTARTWINDOWS or ID_PSREBOOTSYSTEM */
if (psInfo->result == 0) if (psInfo->result == 0)
@ -3253,7 +3192,7 @@ static BOOL PROPSHEET_DoCommand(HWND hwnd, WORD wID)
*/ */
static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam) static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
{ {
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwnd, PropSheetInfoStr); PropSheetInfo* psInfo = GetPropW(hwnd, PropSheetInfoStr);
PAINTSTRUCT ps; PAINTSTRUCT ps;
HDC hdc, hdcSrc; HDC hdc, hdcSrc;
BITMAP bm; BITMAP bm;
@ -3447,7 +3386,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_INITDIALOG: case WM_INITDIALOG:
{ {
PropSheetInfo* psInfo = (PropSheetInfo*) lParam; PropSheetInfo* psInfo = (PropSheetInfo*) lParam;
WCHAR* strCaption = (WCHAR*)Alloc(MAX_CAPTION_LENGTH*sizeof(WCHAR)); WCHAR* strCaption = Alloc(MAX_CAPTION_LENGTH*sizeof(WCHAR));
HWND hwndTabCtrl = GetDlgItem(hwnd, IDC_TABCONTROL); HWND hwndTabCtrl = GetDlgItem(hwnd, IDC_TABCONTROL);
int idx; int idx;
LOGFONTW logFont; LOGFONTW logFont;
@ -3540,8 +3479,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (psInfo->useCallback) if (psInfo->useCallback)
(*(psInfo->ppshheader.pfnCallback))(hwnd, (*(psInfo->ppshheader.pfnCallback))(hwnd, PSCB_INITIALIZED, 0);
PSCB_INITIALIZED, (LPARAM)0);
idx = psInfo->active_page; idx = psInfo->active_page;
psInfo->active_page = -1; psInfo->active_page = -1;
@ -3574,7 +3512,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_COMMAND: case WM_COMMAND:
if (!PROPSHEET_DoCommand(hwnd, LOWORD(wParam))) if (!PROPSHEET_DoCommand(hwnd, LOWORD(wParam)))
{ {
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwnd, PropSheetInfoStr); PropSheetInfo* psInfo = GetPropW(hwnd, PropSheetInfoStr);
if (!psInfo) if (!psInfo)
return FALSE; return FALSE;
@ -3614,8 +3552,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case PSM_GETCURRENTPAGEHWND: case PSM_GETCURRENTPAGEHWND:
{ {
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwnd, PropSheetInfo* psInfo = GetPropW(hwnd, PropSheetInfoStr);
PropSheetInfoStr);
HWND hwndPage = 0; HWND hwndPage = 0;
if (!psInfo) if (!psInfo)
@ -3679,8 +3616,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case PSM_RESTARTWINDOWS: case PSM_RESTARTWINDOWS:
{ {
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwnd, PropSheetInfo* psInfo = GetPropW(hwnd, PropSheetInfoStr);
PropSheetInfoStr);
if (!psInfo) if (!psInfo)
return FALSE; return FALSE;
@ -3694,8 +3630,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case PSM_REBOOTSYSTEM: case PSM_REBOOTSYSTEM:
{ {
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwnd, PropSheetInfo* psInfo = GetPropW(hwnd, PropSheetInfoStr);
PropSheetInfoStr);
if (!psInfo) if (!psInfo)
return FALSE; return FALSE;

View file

@ -253,7 +253,7 @@ typedef struct
#define REBAR_GetInfoPtr(wndPtr) ((REBAR_INFO *)GetWindowLongPtrW (hwnd, 0)) #define REBAR_GetInfoPtr(wndPtr) ((REBAR_INFO *)GetWindowLongPtrW (hwnd, 0))
static LRESULT REBAR_NotifyFormat(REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam); static LRESULT REBAR_NotifyFormat(REBAR_INFO *infoPtr, LPARAM lParam);
static void REBAR_AutoSize(REBAR_INFO *infoPtr, BOOL needsLayout); static void REBAR_AutoSize(REBAR_INFO *infoPtr, BOOL needsLayout);
/* "constant values" retrieved when DLL was initialized */ /* "constant values" retrieved when DLL was initialized */
@ -484,7 +484,7 @@ REBAR_DrawChevron (HDC hdc, INT left, INT top, INT colorRef)
MoveToEx (hdc, x, y, NULL); MoveToEx (hdc, x, y, NULL);
LineTo (hdc, x+3, y++); x++; LineTo (hdc, x+3, y++); x++;
MoveToEx (hdc, x, y, NULL); MoveToEx (hdc, x, y, NULL);
LineTo (hdc, x+1, y++); LineTo (hdc, x+1, y);
SelectObject( hdc, hOldPen ); SelectObject( hdc, hOldPen );
DeleteObject( hPen ); DeleteObject( hPen );
} }
@ -1643,13 +1643,13 @@ REBAR_ValidateBand (const REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
lpBand->cxMinBand += CHEVRON_WIDTH; lpBand->cxMinBand += CHEVRON_WIDTH;
} }
static BOOL static UINT
REBAR_CommonSetupBand(HWND hwnd, const REBARBANDINFOW *lprbbi, REBAR_BAND *lpBand) REBAR_CommonSetupBand(HWND hwnd, const REBARBANDINFOW *lprbbi, REBAR_BAND *lpBand)
/* Function: This routine copies the supplied values from */ /* Function: This routine copies the supplied values from */
/* user input (lprbbi) to the internal band structure. */ /* user input (lprbbi) to the internal band structure. */
/* It returns true if something changed and false if not. */ /* It returns the mask of what changed. */
{ {
BOOL bChanged = FALSE; UINT uChanged = 0x0;
lpBand->fMask |= lprbbi->fMask; lpBand->fMask |= lprbbi->fMask;
@ -1657,7 +1657,7 @@ REBAR_CommonSetupBand(HWND hwnd, const REBARBANDINFOW *lprbbi, REBAR_BAND *lpBan
(lpBand->fStyle != lprbbi->fStyle ) ) (lpBand->fStyle != lprbbi->fStyle ) )
{ {
lpBand->fStyle = lprbbi->fStyle; lpBand->fStyle = lprbbi->fStyle;
bChanged = TRUE; uChanged |= RBBIM_STYLE;
} }
if( (lprbbi->fMask & RBBIM_COLORS) && if( (lprbbi->fMask & RBBIM_COLORS) &&
@ -1666,14 +1666,14 @@ REBAR_CommonSetupBand(HWND hwnd, const REBARBANDINFOW *lprbbi, REBAR_BAND *lpBan
{ {
lpBand->clrFore = lprbbi->clrFore; lpBand->clrFore = lprbbi->clrFore;
lpBand->clrBack = lprbbi->clrBack; lpBand->clrBack = lprbbi->clrBack;
bChanged = TRUE; uChanged |= RBBIM_COLORS;
} }
if( (lprbbi->fMask & RBBIM_IMAGE) && if( (lprbbi->fMask & RBBIM_IMAGE) &&
( lpBand->iImage != lprbbi->iImage ) ) ( lpBand->iImage != lprbbi->iImage ) )
{ {
lpBand->iImage = lprbbi->iImage; lpBand->iImage = lprbbi->iImage;
bChanged = TRUE; uChanged |= RBBIM_IMAGE;
} }
if( (lprbbi->fMask & RBBIM_CHILD) && if( (lprbbi->fMask & RBBIM_CHILD) &&
@ -1693,13 +1693,13 @@ REBAR_CommonSetupBand(HWND hwnd, const REBARBANDINFOW *lprbbi, REBAR_BAND *lpBan
lpBand->hwndChild = 0; lpBand->hwndChild = 0;
lpBand->hwndPrevParent = 0; lpBand->hwndPrevParent = 0;
} }
bChanged = TRUE; uChanged |= RBBIM_CHILD;
} }
if( (lprbbi->fMask & RBBIM_CHILDSIZE) && if( (lprbbi->fMask & RBBIM_CHILDSIZE) &&
( (lpBand->cxMinChild != lprbbi->cxMinChild) || ( (lpBand->cxMinChild != lprbbi->cxMinChild) ||
(lpBand->cyMinChild != lprbbi->cyMinChild ) || (lpBand->cyMinChild != lprbbi->cyMinChild ) ||
( (lprbbi->cbSize >= sizeof (REBARBANDINFOA)) && ( (lprbbi->cbSize >= sizeof (REBARBANDINFOA) && (lpBand->fStyle & RBBS_VARIABLEHEIGHT)) &&
( (lpBand->cyChild != lprbbi->cyChild ) || ( (lpBand->cyChild != lprbbi->cyChild ) ||
(lpBand->cyMaxChild != lprbbi->cyMaxChild ) || (lpBand->cyMaxChild != lprbbi->cyMaxChild ) ||
(lpBand->cyIntegral != lprbbi->cyIntegral ) ) ) || (lpBand->cyIntegral != lprbbi->cyIntegral ) ) ) ||
@ -1722,28 +1722,28 @@ REBAR_CommonSetupBand(HWND hwnd, const REBARBANDINFOW *lprbbi, REBAR_BAND *lpBan
lpBand->cyMaxChild = 0x7fffffff; lpBand->cyMaxChild = 0x7fffffff;
lpBand->cyIntegral = 0; lpBand->cyIntegral = 0;
} }
bChanged = TRUE; uChanged |= RBBIM_CHILDSIZE;
} }
if( (lprbbi->fMask & RBBIM_SIZE) && if( (lprbbi->fMask & RBBIM_SIZE) &&
(lpBand->cx != lprbbi->cx ) ) (lpBand->cx != lprbbi->cx ) )
{ {
lpBand->cx = lprbbi->cx; lpBand->cx = lprbbi->cx;
bChanged = TRUE; uChanged |= RBBIM_SIZE;
} }
if( (lprbbi->fMask & RBBIM_BACKGROUND) && if( (lprbbi->fMask & RBBIM_BACKGROUND) &&
( lpBand->hbmBack != lprbbi->hbmBack ) ) ( lpBand->hbmBack != lprbbi->hbmBack ) )
{ {
lpBand->hbmBack = lprbbi->hbmBack; lpBand->hbmBack = lprbbi->hbmBack;
bChanged = TRUE; uChanged |= RBBIM_BACKGROUND;
} }
if( (lprbbi->fMask & RBBIM_ID) && if( (lprbbi->fMask & RBBIM_ID) &&
(lpBand->wID != lprbbi->wID ) ) (lpBand->wID != lprbbi->wID ) )
{ {
lpBand->wID = lprbbi->wID; lpBand->wID = lprbbi->wID;
bChanged = TRUE; uChanged |= RBBIM_ID;
} }
/* check for additional data */ /* check for additional data */
@ -1752,14 +1752,14 @@ REBAR_CommonSetupBand(HWND hwnd, const REBARBANDINFOW *lprbbi, REBAR_BAND *lpBan
( lpBand->cxIdeal != lprbbi->cxIdeal ) ) ( lpBand->cxIdeal != lprbbi->cxIdeal ) )
{ {
lpBand->cxIdeal = lprbbi->cxIdeal; lpBand->cxIdeal = lprbbi->cxIdeal;
bChanged = TRUE; uChanged |= RBBIM_IDEALSIZE;
} }
if( (lprbbi->fMask & RBBIM_LPARAM) && if( (lprbbi->fMask & RBBIM_LPARAM) &&
(lpBand->lParam != lprbbi->lParam ) ) (lpBand->lParam != lprbbi->lParam ) )
{ {
lpBand->lParam = lprbbi->lParam; lpBand->lParam = lprbbi->lParam;
bChanged = TRUE; uChanged |= RBBIM_LPARAM;
} }
if( (lprbbi->fMask & RBBIM_HEADERSIZE) && if( (lprbbi->fMask & RBBIM_HEADERSIZE) &&
@ -1767,15 +1767,15 @@ REBAR_CommonSetupBand(HWND hwnd, const REBARBANDINFOW *lprbbi, REBAR_BAND *lpBan
{ {
lpBand->cxHeader = lprbbi->cxHeader; lpBand->cxHeader = lprbbi->cxHeader;
lpBand->fStyle |= RBBS_UNDOC_FIXEDHEADER; lpBand->fStyle |= RBBS_UNDOC_FIXEDHEADER;
bChanged = TRUE; uChanged |= RBBIM_HEADERSIZE;
} }
} }
return bChanged; return uChanged;
} }
static LRESULT static LRESULT
REBAR_InternalEraseBkGnd (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, const RECT *clip) REBAR_InternalEraseBkGnd (const REBAR_INFO *infoPtr, WPARAM wParam, const RECT *clip)
/* Function: This erases the background rectangle by drawing */ /* Function: This erases the background rectangle by drawing */
/* each band with its background color (or the default) and */ /* each band with its background color (or the default) and */
/* draws each bands right separator if necessary. The row */ /* draws each bands right separator if necessary. The row */
@ -2035,7 +2035,7 @@ REBAR_HandleLRDrag (REBAR_INFO *infoPtr, const POINT *ptsmove)
static LRESULT static LRESULT
REBAR_DeleteBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_DeleteBand (REBAR_INFO *infoPtr, WPARAM wParam)
{ {
UINT uBand = (UINT)wParam; UINT uBand = (UINT)wParam;
REBAR_BAND *lpBand; REBAR_BAND *lpBand;
@ -2202,7 +2202,7 @@ REBAR_GetBandInfoT(const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL
static LRESULT static LRESULT
REBAR_GetBarHeight (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_GetBarHeight (const REBAR_INFO *infoPtr)
{ {
INT nHeight; INT nHeight;
@ -2215,7 +2215,7 @@ REBAR_GetBarHeight (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
REBAR_GetBarInfo (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_GetBarInfo (const REBAR_INFO *infoPtr, LPARAM lParam)
{ {
LPREBARINFO lpInfo = (LPREBARINFO)lParam; LPREBARINFO lpInfo = (LPREBARINFO)lParam;
@ -2295,7 +2295,7 @@ REBAR_GetRowCount (const REBAR_INFO *infoPtr)
static LRESULT static LRESULT
REBAR_GetRowHeight (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_GetRowHeight (const REBAR_INFO *infoPtr, WPARAM wParam)
{ {
INT iRow = (INT)wParam; INT iRow = (INT)wParam;
int j = 0, ret = 0; int j = 0, ret = 0;
@ -2351,7 +2351,7 @@ REBAR_GetVersion (const REBAR_INFO *infoPtr)
static LRESULT static LRESULT
REBAR_HitTest (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_HitTest (const REBAR_INFO *infoPtr, LPARAM lParam)
{ {
LPRBHITTESTINFO lprbht = (LPRBHITTESTINFO)lParam; LPRBHITTESTINFO lprbht = (LPRBHITTESTINFO)lParam;
@ -2365,7 +2365,7 @@ REBAR_HitTest (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
REBAR_IdToIndex (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_IdToIndex (const REBAR_INFO *infoPtr, WPARAM wParam)
{ {
UINT i; UINT i;
@ -2422,6 +2422,14 @@ REBAR_InsertBandT(REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL bUnico
lpBand->iImage = -1; lpBand->iImage = -1;
REBAR_CommonSetupBand(infoPtr->hwndSelf, lprbbi, lpBand); REBAR_CommonSetupBand(infoPtr->hwndSelf, lprbbi, lpBand);
/* Make sure the defaults for these are correct */
if (lprbbi->cbSize < sizeof (REBARBANDINFOA) || !(lpBand->fStyle & RBBS_VARIABLEHEIGHT)) {
lpBand->cyChild = lpBand->cyMinChild;
lpBand->cyMaxChild = 0x7fffffff;
lpBand->cyIntegral = 0;
}
if ((lprbbi->fMask & RBBIM_TEXT) && (lprbbi->lpText)) { if ((lprbbi->fMask & RBBIM_TEXT) && (lprbbi->lpText)) {
if (bUnicode) if (bUnicode)
Str_SetPtrW(&lpBand->lpText, lprbbi->lpText); Str_SetPtrW(&lpBand->lpText, lprbbi->lpText);
@ -2499,7 +2507,7 @@ REBAR_MaximizeBand (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
REBAR_MinimizeBand (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_MinimizeBand (const REBAR_INFO *infoPtr, WPARAM wParam)
{ {
REBAR_BAND *lpBand; REBAR_BAND *lpBand;
UINT uBand = (UINT) wParam; UINT uBand = (UINT) wParam;
@ -2587,8 +2595,7 @@ REBAR_MoveBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
} }
/* allocate new space and copy rest of bands into it */ /* allocate new space and copy rest of bands into it */
infoPtr->bands = infoPtr->bands = Alloc ((infoPtr->uNumBands)*sizeof(REBAR_BAND));
(REBAR_BAND *)Alloc ((infoPtr->uNumBands)*sizeof(REBAR_BAND));
/* pre insert copy */ /* pre insert copy */
if (uTo > 0) { if (uTo > 0) {
@ -2635,7 +2642,7 @@ REBAR_SetBandInfoT(REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL bUnic
{ {
LPREBARBANDINFOW lprbbi = (LPREBARBANDINFOW)lParam; LPREBARBANDINFOW lprbbi = (LPREBARBANDINFOW)lParam;
REBAR_BAND *lpBand; REBAR_BAND *lpBand;
BOOL bChanged; UINT uChanged;
if (lprbbi == NULL) if (lprbbi == NULL)
return FALSE; return FALSE;
@ -2650,7 +2657,7 @@ REBAR_SetBandInfoT(REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL bUnic
/* set band information */ /* set band information */
lpBand = &infoPtr->bands[(UINT)wParam]; lpBand = &infoPtr->bands[(UINT)wParam];
bChanged = REBAR_CommonSetupBand (infoPtr->hwndSelf, lprbbi, lpBand); uChanged = REBAR_CommonSetupBand (infoPtr->hwndSelf, lprbbi, lpBand);
if (lprbbi->fMask & RBBIM_TEXT) { if (lprbbi->fMask & RBBIM_TEXT) {
LPWSTR wstr = NULL; LPWSTR wstr = NULL;
if (bUnicode) if (bUnicode)
@ -2661,7 +2668,7 @@ REBAR_SetBandInfoT(REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL bUnic
if (REBAR_strdifW(wstr, lpBand->lpText)) { if (REBAR_strdifW(wstr, lpBand->lpText)) {
Free(lpBand->lpText); Free(lpBand->lpText);
lpBand->lpText = wstr; lpBand->lpText = wstr;
bChanged = TRUE; uChanged |= RBBIM_TEXT;
} }
else else
Free(wstr); Free(wstr);
@ -2671,7 +2678,7 @@ REBAR_SetBandInfoT(REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL bUnic
REBAR_DumpBand (infoPtr); REBAR_DumpBand (infoPtr);
if (bChanged && (lprbbi->fMask & (RBBIM_CHILDSIZE | RBBIM_SIZE | RBBIM_STYLE | RBBIM_IMAGE))) { if (uChanged & (RBBIM_CHILDSIZE | RBBIM_SIZE | RBBIM_STYLE | RBBIM_IMAGE)) {
REBAR_Layout(infoPtr); REBAR_Layout(infoPtr);
InvalidateRect(infoPtr->hwndSelf, 0, 1); InvalidateRect(infoPtr->hwndSelf, 0, 1);
} }
@ -2681,7 +2688,7 @@ REBAR_SetBandInfoT(REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL bUnic
static LRESULT static LRESULT
REBAR_SetBarInfo (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_SetBarInfo (REBAR_INFO *infoPtr, LPARAM lParam)
{ {
LPREBARINFO lpInfo = (LPREBARINFO)lParam; LPREBARINFO lpInfo = (LPREBARINFO)lParam;
REBAR_BAND *lpBand; REBAR_BAND *lpBand;
@ -2722,7 +2729,7 @@ REBAR_SetBarInfo (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
REBAR_SetBkColor (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_SetBkColor (REBAR_INFO *infoPtr, LPARAM lParam)
{ {
COLORREF clrTemp; COLORREF clrTemp;
@ -2740,7 +2747,7 @@ REBAR_SetBkColor (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
REBAR_SetParent (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_SetParent (REBAR_INFO *infoPtr, WPARAM wParam)
{ {
HWND hwndTemp = infoPtr->hwndNotify; HWND hwndTemp = infoPtr->hwndNotify;
@ -2751,7 +2758,7 @@ REBAR_SetParent (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
REBAR_SetTextColor (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_SetTextColor (REBAR_INFO *infoPtr, LPARAM lParam)
{ {
COLORREF clrTemp; COLORREF clrTemp;
@ -2829,7 +2836,7 @@ REBAR_ShowBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
REBAR_SizeToRect (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_SizeToRect (REBAR_INFO *infoPtr, LPARAM lParam)
{ {
LPRECT lpRect = (LPRECT)lParam; LPRECT lpRect = (LPRECT)lParam;
@ -2844,7 +2851,7 @@ REBAR_SizeToRect (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
REBAR_Create (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_Create (REBAR_INFO *infoPtr, LPARAM lParam)
{ {
LPCREATESTRUCTW cs = (LPCREATESTRUCTW) lParam; LPCREATESTRUCTW cs = (LPCREATESTRUCTW) lParam;
RECT wnrc1, clrc1; RECT wnrc1, clrc1;
@ -2870,7 +2877,7 @@ REBAR_Create (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
REBAR_Destroy (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_Destroy (REBAR_INFO *infoPtr)
{ {
REBAR_BAND *lpBand; REBAR_BAND *lpBand;
UINT i; UINT i;
@ -2911,18 +2918,18 @@ REBAR_Destroy (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, WPARAM wParam)
{ {
RECT cliprect; RECT cliprect;
if (GetClipBox ( (HDC)wParam, &cliprect)) if (GetClipBox ( (HDC)wParam, &cliprect))
return REBAR_InternalEraseBkGnd (infoPtr, wParam, lParam, &cliprect); return REBAR_InternalEraseBkGnd (infoPtr, wParam, &cliprect);
return 0; return 0;
} }
static LRESULT static LRESULT
REBAR_GetFont (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_GetFont (const REBAR_INFO *infoPtr)
{ {
return (LRESULT)infoPtr->hFont; return (LRESULT)infoPtr->hFont;
} }
@ -2960,7 +2967,7 @@ REBAR_PushChevron(const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
} }
static LRESULT static LRESULT
REBAR_LButtonDown (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_LButtonDown (REBAR_INFO *infoPtr, LPARAM lParam)
{ {
REBAR_BAND *lpBand; REBAR_BAND *lpBand;
UINT htFlags; UINT htFlags;
@ -2996,7 +3003,7 @@ REBAR_LButtonDown (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
} }
static LRESULT static LRESULT
REBAR_LButtonUp (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_LButtonUp (REBAR_INFO *infoPtr)
{ {
if (infoPtr->iGrabbedBand >= 0) if (infoPtr->iGrabbedBand >= 0)
{ {
@ -3025,7 +3032,7 @@ REBAR_LButtonUp (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
} }
static LRESULT static LRESULT
REBAR_MouseLeave (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_MouseLeave (REBAR_INFO *infoPtr)
{ {
if (infoPtr->ichevronhotBand >= 0) if (infoPtr->ichevronhotBand >= 0)
{ {
@ -3043,7 +3050,7 @@ REBAR_MouseLeave (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
} }
static LRESULT static LRESULT
REBAR_MouseMove (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_MouseMove (REBAR_INFO *infoPtr, LPARAM lParam)
{ {
REBAR_BAND *lpChevronBand; REBAR_BAND *lpChevronBand;
POINT ptMove; POINT ptMove;
@ -3133,7 +3140,7 @@ REBAR_MouseMove (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
static inline LRESULT static inline LRESULT
REBAR_NCCalcSize (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_NCCalcSize (const REBAR_INFO *infoPtr, LPARAM lParam)
{ {
HTHEME theme; HTHEME theme;
RECT *rect = (RECT *)lParam; RECT *rect = (RECT *)lParam;
@ -3155,7 +3162,7 @@ REBAR_NCCalcSize (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
REBAR_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam) REBAR_NCCreate (HWND hwnd, LPARAM lParam)
{ {
LPCREATESTRUCTW cs = (LPCREATESTRUCTW) lParam; LPCREATESTRUCTW cs = (LPCREATESTRUCTW) lParam;
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd); REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
@ -3177,7 +3184,7 @@ REBAR_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam)
} }
/* allocate memory for info structure */ /* allocate memory for info structure */
infoPtr = (REBAR_INFO *)Alloc (sizeof(REBAR_INFO)); infoPtr = Alloc (sizeof(REBAR_INFO));
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
/* initialize info structure - initial values are 0 */ /* initialize info structure - initial values are 0 */
@ -3198,7 +3205,7 @@ REBAR_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->hFont = GetStockObject (SYSTEM_FONT); infoPtr->hFont = GetStockObject (SYSTEM_FONT);
/* issue WM_NOTIFYFORMAT to get unicode status of parent */ /* issue WM_NOTIFYFORMAT to get unicode status of parent */
REBAR_NotifyFormat(infoPtr, 0, NF_REQUERY); REBAR_NotifyFormat(infoPtr, NF_REQUERY);
/* Stow away the original style */ /* Stow away the original style */
infoPtr->orgStyle = cs->style; infoPtr->orgStyle = cs->style;
@ -3248,7 +3255,7 @@ REBAR_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
REBAR_NCHitTest (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_NCHitTest (const REBAR_INFO *infoPtr, LPARAM lParam)
{ {
NMMOUSE nmmouse; NMMOUSE nmmouse;
POINT clpt; POINT clpt;
@ -3283,7 +3290,7 @@ REBAR_NCHitTest (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
REBAR_NCPaint (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_NCPaint (const REBAR_INFO *infoPtr)
{ {
RECT rcWindow; RECT rcWindow;
HDC hdc; HDC hdc;
@ -3320,7 +3327,7 @@ REBAR_NCPaint (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
REBAR_NotifyFormat (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_NotifyFormat (REBAR_INFO *infoPtr, LPARAM lParam)
{ {
INT i; INT i;
@ -3339,7 +3346,7 @@ REBAR_NotifyFormat (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
REBAR_Paint (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_Paint (const REBAR_INFO *infoPtr, WPARAM wParam)
{ {
HDC hdc = (HDC)wParam; HDC hdc = (HDC)wParam;
@ -3352,7 +3359,7 @@ REBAR_Paint (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
TRACE("painting (%s)\n", wine_dbgstr_rect(&ps.rcPaint)); TRACE("painting (%s)\n", wine_dbgstr_rect(&ps.rcPaint));
if (ps.fErase) { if (ps.fErase) {
/* Erase area of paint if requested */ /* Erase area of paint if requested */
REBAR_InternalEraseBkGnd (infoPtr, wParam, lParam, &ps.rcPaint); REBAR_InternalEraseBkGnd (infoPtr, wParam, &ps.rcPaint);
} }
REBAR_Refresh (infoPtr, hdc); REBAR_Refresh (infoPtr, hdc);
EndPaint (infoPtr->hwndSelf, &ps); EndPaint (infoPtr->hwndSelf, &ps);
@ -3363,7 +3370,7 @@ REBAR_Paint (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
REBAR_SetCursor (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_SetCursor (const REBAR_INFO *infoPtr, LPARAM lParam)
{ {
POINT pt; POINT pt;
UINT flags; UINT flags;
@ -3390,7 +3397,7 @@ REBAR_SetCursor (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
REBAR_SetFont (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_SetFont (REBAR_INFO *infoPtr, WPARAM wParam)
{ {
REBAR_BAND *lpBand; REBAR_BAND *lpBand;
UINT i; UINT i;
@ -3409,7 +3416,7 @@ REBAR_SetFont (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
static inline LRESULT static inline LRESULT
REBAR_SetRedraw (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_SetRedraw (REBAR_INFO *infoPtr, WPARAM wParam)
/***************************************************** /*****************************************************
* *
* Function; * Function;
@ -3462,7 +3469,7 @@ REBAR_Size (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
REBAR_StyleChanged (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) REBAR_StyleChanged (REBAR_INFO *infoPtr, LPARAM lParam)
{ {
STYLESTRUCT *ss = (STYLESTRUCT *)lParam; STYLESTRUCT *ss = (STYLESTRUCT *)lParam;
@ -3519,7 +3526,7 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* case RB_BEGINDRAG: */ /* case RB_BEGINDRAG: */
case RB_DELETEBAND: case RB_DELETEBAND:
return REBAR_DeleteBand (infoPtr, wParam, lParam); return REBAR_DeleteBand (infoPtr, wParam);
/* case RB_DRAGMOVE: */ /* case RB_DRAGMOVE: */
/* case RB_ENDDRAG: */ /* case RB_ENDDRAG: */
@ -3538,10 +3545,10 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return REBAR_GetBandInfoT(infoPtr, wParam, lParam, TRUE); return REBAR_GetBandInfoT(infoPtr, wParam, lParam, TRUE);
case RB_GETBARHEIGHT: case RB_GETBARHEIGHT:
return REBAR_GetBarHeight (infoPtr, wParam, lParam); return REBAR_GetBarHeight (infoPtr);
case RB_GETBARINFO: case RB_GETBARINFO:
return REBAR_GetBarInfo (infoPtr, wParam, lParam); return REBAR_GetBarInfo (infoPtr, lParam);
case RB_GETBKCOLOR: case RB_GETBKCOLOR:
return REBAR_GetBkColor (infoPtr); return REBAR_GetBkColor (infoPtr);
@ -3559,7 +3566,7 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return REBAR_GetRowCount (infoPtr); return REBAR_GetRowCount (infoPtr);
case RB_GETROWHEIGHT: case RB_GETROWHEIGHT:
return REBAR_GetRowHeight (infoPtr, wParam, lParam); return REBAR_GetRowHeight (infoPtr, wParam);
case RB_GETTEXTCOLOR: case RB_GETTEXTCOLOR:
return REBAR_GetTextColor (infoPtr); return REBAR_GetTextColor (infoPtr);
@ -3574,10 +3581,10 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return REBAR_GetVersion (infoPtr); return REBAR_GetVersion (infoPtr);
case RB_HITTEST: case RB_HITTEST:
return REBAR_HitTest (infoPtr, wParam, lParam); return REBAR_HitTest (infoPtr, lParam);
case RB_IDTOINDEX: case RB_IDTOINDEX:
return REBAR_IdToIndex (infoPtr, wParam, lParam); return REBAR_IdToIndex (infoPtr, wParam);
case RB_INSERTBANDA: case RB_INSERTBANDA:
return REBAR_InsertBandT(infoPtr, wParam, lParam, FALSE); return REBAR_InsertBandT(infoPtr, wParam, lParam, FALSE);
@ -3589,7 +3596,7 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return REBAR_MaximizeBand (infoPtr, wParam, lParam); return REBAR_MaximizeBand (infoPtr, wParam, lParam);
case RB_MINIMIZEBAND: case RB_MINIMIZEBAND:
return REBAR_MinimizeBand (infoPtr, wParam, lParam); return REBAR_MinimizeBand (infoPtr, wParam);
case RB_MOVEBAND: case RB_MOVEBAND:
return REBAR_MoveBand (infoPtr, wParam, lParam); return REBAR_MoveBand (infoPtr, wParam, lParam);
@ -3604,20 +3611,20 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return REBAR_SetBandInfoT(infoPtr, wParam, lParam, TRUE); return REBAR_SetBandInfoT(infoPtr, wParam, lParam, TRUE);
case RB_SETBARINFO: case RB_SETBARINFO:
return REBAR_SetBarInfo (infoPtr, wParam, lParam); return REBAR_SetBarInfo (infoPtr, lParam);
case RB_SETBKCOLOR: case RB_SETBKCOLOR:
return REBAR_SetBkColor (infoPtr, wParam, lParam); return REBAR_SetBkColor (infoPtr, lParam);
/* case RB_SETCOLORSCHEME: */ /* case RB_SETCOLORSCHEME: */
/* case RB_SETPALETTE: */ /* case RB_SETPALETTE: */
/* return REBAR_GetPalette (infoPtr, wParam, lParam); */ /* return REBAR_GetPalette (infoPtr, wParam, lParam); */
case RB_SETPARENT: case RB_SETPARENT:
return REBAR_SetParent (infoPtr, wParam, lParam); return REBAR_SetParent (infoPtr, wParam);
case RB_SETTEXTCOLOR: case RB_SETTEXTCOLOR:
return REBAR_SetTextColor (infoPtr, wParam, lParam); return REBAR_SetTextColor (infoPtr, lParam);
/* case RB_SETTOOLTIPS: */ /* case RB_SETTOOLTIPS: */
@ -3631,7 +3638,7 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return REBAR_ShowBand (infoPtr, wParam, lParam); return REBAR_ShowBand (infoPtr, wParam, lParam);
case RB_SIZETORECT: case RB_SIZETORECT:
return REBAR_SizeToRect (infoPtr, wParam, lParam); return REBAR_SizeToRect (infoPtr, lParam);
/* Messages passed to parent */ /* Messages passed to parent */
@ -3644,51 +3651,51 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* case WM_CHARTOITEM: supported according to ControlSpy */ /* case WM_CHARTOITEM: supported according to ControlSpy */
case WM_CREATE: case WM_CREATE:
return REBAR_Create (infoPtr, wParam, lParam); return REBAR_Create (infoPtr, lParam);
case WM_DESTROY: case WM_DESTROY:
return REBAR_Destroy (infoPtr, wParam, lParam); return REBAR_Destroy (infoPtr);
case WM_ERASEBKGND: case WM_ERASEBKGND:
return REBAR_EraseBkGnd (infoPtr, wParam, lParam); return REBAR_EraseBkGnd (infoPtr, wParam);
case WM_GETFONT: case WM_GETFONT:
return REBAR_GetFont (infoPtr, wParam, lParam); return REBAR_GetFont (infoPtr);
/* case WM_LBUTTONDBLCLK: supported according to ControlSpy */ /* case WM_LBUTTONDBLCLK: supported according to ControlSpy */
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
return REBAR_LButtonDown (infoPtr, wParam, lParam); return REBAR_LButtonDown (infoPtr, lParam);
case WM_LBUTTONUP: case WM_LBUTTONUP:
return REBAR_LButtonUp (infoPtr, wParam, lParam); return REBAR_LButtonUp (infoPtr);
/* case WM_MEASUREITEM: supported according to ControlSpy */ /* case WM_MEASUREITEM: supported according to ControlSpy */
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
return REBAR_MouseMove (infoPtr, wParam, lParam); return REBAR_MouseMove (infoPtr, lParam);
case WM_MOUSELEAVE: case WM_MOUSELEAVE:
return REBAR_MouseLeave (infoPtr, wParam, lParam); return REBAR_MouseLeave (infoPtr);
case WM_NCCALCSIZE: case WM_NCCALCSIZE:
return REBAR_NCCalcSize (infoPtr, wParam, lParam); return REBAR_NCCalcSize (infoPtr, lParam);
case WM_NCCREATE: case WM_NCCREATE:
return REBAR_NCCreate (hwnd, wParam, lParam); return REBAR_NCCreate (hwnd, lParam);
case WM_NCHITTEST: case WM_NCHITTEST:
return REBAR_NCHitTest (infoPtr, wParam, lParam); return REBAR_NCHitTest (infoPtr, lParam);
case WM_NCPAINT: case WM_NCPAINT:
return REBAR_NCPaint (infoPtr, wParam, lParam); return REBAR_NCPaint (infoPtr);
case WM_NOTIFYFORMAT: case WM_NOTIFYFORMAT:
return REBAR_NotifyFormat (infoPtr, wParam, lParam); return REBAR_NotifyFormat (infoPtr, lParam);
case WM_PRINTCLIENT: case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
return REBAR_Paint (infoPtr, wParam, lParam); return REBAR_Paint (infoPtr, wParam);
/* case WM_PALETTECHANGED: supported according to ControlSpy */ /* case WM_PALETTECHANGED: supported according to ControlSpy */
/* case WM_QUERYNEWPALETTE:supported according to ControlSpy */ /* case WM_QUERYNEWPALETTE:supported according to ControlSpy */
@ -3696,19 +3703,19 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* case WM_RBUTTONUP: supported according to ControlSpy */ /* case WM_RBUTTONUP: supported according to ControlSpy */
case WM_SETCURSOR: case WM_SETCURSOR:
return REBAR_SetCursor (infoPtr, wParam, lParam); return REBAR_SetCursor (infoPtr, lParam);
case WM_SETFONT: case WM_SETFONT:
return REBAR_SetFont (infoPtr, wParam, lParam); return REBAR_SetFont (infoPtr, wParam);
case WM_SETREDRAW: case WM_SETREDRAW:
return REBAR_SetRedraw (infoPtr, wParam, lParam); return REBAR_SetRedraw (infoPtr, wParam);
case WM_SIZE: case WM_SIZE:
return REBAR_Size (infoPtr, wParam, lParam); return REBAR_Size (infoPtr, wParam, lParam);
case WM_STYLECHANGED: case WM_STYLECHANGED:
return REBAR_StyleChanged (infoPtr, wParam, lParam); return REBAR_StyleChanged (infoPtr, lParam);
case WM_THEMECHANGED: case WM_THEMECHANGED:
return theme_changed (infoPtr); return theme_changed (infoPtr);
@ -3725,7 +3732,7 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return REBAR_WindowPosChanged (infoPtr, wParam, lParam); return REBAR_WindowPosChanged (infoPtr, wParam, lParam);
default: default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP)) if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n", ERR("unknown msg %04x wp=%08lx lp=%08lx\n",
uMsg, wParam, lParam); uMsg, wParam, lParam);
return DefWindowProcW (hwnd, uMsg, wParam, lParam); return DefWindowProcW (hwnd, uMsg, wParam, lParam);

View file

@ -30,9 +30,9 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#define WINE_FILEDESCRIPTION_STR "Wine Common Controls" #define WINE_FILEDESCRIPTION_STR "Wine Common Controls"
#define WINE_FILENAME_STR "comctl32.dll" #define WINE_FILENAME_STR "comctl32.dll"
#define WINE_FILEVERSION COMCTL32_VERSION, COMCTL32_VERSION_MINOR, 4704, 1100 #define WINE_FILEVERSION COMCTL32_VERSION, COMCTL32_VERSION_MINOR, 4704, 1100
#define WINE_FILEVERSIONSTR "5.81" #define WINE_FILEVERSION_STR "5.81"
#define WINE_PRODUCTVERSION WINE_FILEVERSION #define WINE_PRODUCTVERSION WINE_FILEVERSION
#define WINE_PRODUCTVERSION_STR WINE_FILEVERSIONSTR #define WINE_PRODUCTVERSION_STR WINE_FILEVERSION_STR
#include "wine/wine_common_ver.rc" #include "wine/wine_common_ver.rc"
@ -91,7 +91,6 @@ IDI_TT_ERROR_SM ICON LOADONCALL DISCARDABLE idi_tt_error_sm.ico
*/ */
#include "comctl_Bg.rc" #include "comctl_Bg.rc"
#include "comctl_Cn.rc"
#include "comctl_Cs.rc" #include "comctl_Cs.rc"
#include "comctl_De.rc" #include "comctl_De.rc"
#include "comctl_El.rc" #include "comctl_El.rc"
@ -114,3 +113,4 @@ IDI_TT_ERROR_SM ICON LOADONCALL DISCARDABLE idi_tt_error_sm.ico
#include "comctl_Th.rc" #include "comctl_Th.rc"
#include "comctl_Tr.rc" #include "comctl_Tr.rc"
#include "comctl_Uk.rc" #include "comctl_Uk.rc"
#include "comctl_Zh.rc"

View file

@ -72,13 +72,13 @@ typedef struct
HWND Notify; HWND Notify;
WORD numParts; WORD numParts;
UINT height; UINT height;
UINT minHeight; /* at least MIN_PANE_HEIGHT, can be increased by SB_SETMINHEIGHT */
BOOL simple; BOOL simple;
HWND hwndToolTip; HWND hwndToolTip;
HFONT hFont; HFONT hFont;
HFONT hDefaultFont; HFONT hDefaultFont;
COLORREF clrBk; /* background color */ COLORREF clrBk; /* background color */
BOOL bUnicode; /* unicode flag */ BOOL bUnicode; /* notify format. TRUE if notifies in Unicode */
BOOL NtfUnicode; /* notify format */
STATUSWINDOWPART part0; /* simple window */ STATUSWINDOWPART part0; /* simple window */
STATUSWINDOWPART* parts; STATUSWINDOWPART* parts;
INT horizontalBorder; INT horizontalBorder;
@ -95,18 +95,52 @@ typedef struct
#define HORZ_BORDER 0 #define HORZ_BORDER 0
#define VERT_BORDER 2 #define VERT_BORDER 2
#define HORZ_GAP 2 #define HORZ_GAP 2
#define MIN_PANE_HEIGHT 18
static const WCHAR themeClass[] = { 'S','t','a','t','u','s',0 }; static const WCHAR themeClass[] = { 'S','t','a','t','u','s',0 };
/* prototype */ /* prototype */
static void static void
STATUSBAR_SetPartBounds (STATUS_INFO *infoPtr); STATUSBAR_SetPartBounds (STATUS_INFO *infoPtr);
static LRESULT
STATUSBAR_NotifyFormat (STATUS_INFO *infoPtr, HWND from, INT cmd);
static inline LPCSTR debugstr_t(LPCWSTR text, BOOL isW) static inline LPCSTR debugstr_t(LPCWSTR text, BOOL isW)
{ {
return isW ? debugstr_w(text) : debugstr_a((LPCSTR)text); return isW ? debugstr_w(text) : debugstr_a((LPCSTR)text);
} }
static UINT
STATUSBAR_ComputeHeight(STATUS_INFO *infoPtr)
{
HTHEME theme;
UINT height;
TEXTMETRICW tm;
int margin;
COMCTL32_GetFontMetrics(infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont, &tm);
margin = (tm.tmInternalLeading ? tm.tmInternalLeading : 2);
height = max(tm.tmHeight + margin + 2*GetSystemMetrics(SM_CYBORDER), infoPtr->minHeight) + infoPtr->verticalBorder;
if ((theme = GetWindowTheme(infoPtr->Self)))
{
/* Determine bar height from theme such that the content area is
* textHeight pixels large */
HDC hdc = GetDC(infoPtr->Self);
RECT r;
memset (&r, 0, sizeof (r));
r.bottom = max(infoPtr->minHeight, tm.tmHeight);
if (SUCCEEDED(GetThemeBackgroundExtent(theme, hdc, SP_PANE, 0, &r, &r)))
{
height = r.bottom - r.top;
}
ReleaseDC(infoPtr->Self, hdc);
}
TRACE(" textHeight=%d+%d, final height=%d\n", tm.tmHeight, tm.tmInternalLeading, height);
return height;
}
static void static void
STATUSBAR_DrawSizeGrip (HTHEME theme, HDC hdc, LPRECT lpRect) STATUSBAR_DrawSizeGrip (HTHEME theme, HDC hdc, LPRECT lpRect)
{ {
@ -218,15 +252,15 @@ static void
STATUSBAR_RefreshPart (const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPART *part, int itemID) STATUSBAR_RefreshPart (const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPART *part, int itemID)
{ {
HBRUSH hbrBk; HBRUSH hbrBk;
HFONT hOldFont;
HTHEME theme; HTHEME theme;
TRACE("item %d\n", itemID); TRACE("item %d\n", itemID);
if (!IsWindowVisible (infoPtr->Self))
return;
if (part->bound.right < part->bound.left) return; if (part->bound.right < part->bound.left) return;
if (!RectVisible(hdc, &part->bound))
return;
if ((theme = GetWindowTheme (infoPtr->Self))) if ((theme = GetWindowTheme (infoPtr->Self)))
{ {
RECT cr; RECT cr;
@ -244,18 +278,7 @@ STATUSBAR_RefreshPart (const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPA
DeleteObject (hbrBk); DeleteObject (hbrBk);
} }
hOldFont = SelectObject (hdc, infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont);
STATUSBAR_DrawPart (infoPtr, hdc, part, itemID); STATUSBAR_DrawPart (infoPtr, hdc, part, itemID);
SelectObject (hdc, hOldFont);
if (GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP) {
RECT rect;
GetClientRect (infoPtr->Self, &rect);
STATUSBAR_DrawSizeGrip (theme, hdc, &rect);
}
} }
@ -626,40 +649,9 @@ STATUSBAR_SetIcon (STATUS_INFO *infoPtr, INT nPart, HICON hIcon)
static BOOL static BOOL
STATUSBAR_SetMinHeight (STATUS_INFO *infoPtr, INT height) STATUSBAR_SetMinHeight (STATUS_INFO *infoPtr, INT height)
{ {
infoPtr->minHeight = max(height, MIN_PANE_HEIGHT);
TRACE("(height=%d)\n", height); infoPtr->height = STATUSBAR_ComputeHeight(infoPtr);
if (IsWindowVisible (infoPtr->Self)) { /* like native, don't resize the control */
INT width, x, y;
RECT parent_rect;
HTHEME theme;
infoPtr->height = height + infoPtr->verticalBorder;
if ((theme = GetWindowTheme (infoPtr->Self)))
{
/* Determine bar height from theme such that the content area is
* 'height' pixels large */
HDC hdc = GetDC (infoPtr->Self);
RECT r;
memset (&r, 0, sizeof (r));
r.bottom = height;
if (SUCCEEDED(GetThemeBackgroundExtent (theme, hdc, SP_PANE, 0, &r, &r)))
{
infoPtr->height = r.bottom - r.top;
}
ReleaseDC (infoPtr->Self, hdc);
}
if (GetClientRect (infoPtr->Notify, &parent_rect))
{
width = parent_rect.right - parent_rect.left;
x = parent_rect.left;
y = parent_rect.bottom - infoPtr->height;
MoveWindow (infoPtr->Self, x, y, width, infoPtr->height, TRUE);
STATUSBAR_SetPartBounds (infoPtr);
}
}
return TRUE; return TRUE;
} }
@ -912,11 +904,10 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate)
NONCLIENTMETRICSW nclm; NONCLIENTMETRICSW nclm;
DWORD dwStyle; DWORD dwStyle;
RECT rect; RECT rect;
int i, width, len, textHeight = 0; int len;
HDC hdc;
TRACE("\n"); TRACE("\n");
infoPtr = (STATUS_INFO*)Alloc (sizeof(STATUS_INFO)); infoPtr = Alloc (sizeof(STATUS_INFO));
if (!infoPtr) goto create_fail; if (!infoPtr) goto create_fail;
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
@ -930,19 +921,17 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate)
infoPtr->horizontalBorder = HORZ_BORDER; infoPtr->horizontalBorder = HORZ_BORDER;
infoPtr->verticalBorder = VERT_BORDER; infoPtr->verticalBorder = VERT_BORDER;
infoPtr->horizontalGap = HORZ_GAP; infoPtr->horizontalGap = HORZ_GAP;
infoPtr->minHeight = MIN_PANE_HEIGHT;
i = SendMessageW(infoPtr->Notify, WM_NOTIFYFORMAT, (WPARAM)hwnd, NF_QUERY); STATUSBAR_NotifyFormat(infoPtr, infoPtr->Notify, NF_REQUERY);
infoPtr->NtfUnicode = (i == NFR_UNICODE);
GetClientRect (hwnd, &rect);
InvalidateRect (hwnd, &rect, 0);
UpdateWindow(hwnd);
ZeroMemory (&nclm, sizeof(nclm)); ZeroMemory (&nclm, sizeof(nclm));
nclm.cbSize = sizeof(nclm); nclm.cbSize = sizeof(nclm);
SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, nclm.cbSize, &nclm, 0); SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, nclm.cbSize, &nclm, 0);
infoPtr->hDefaultFont = CreateFontIndirectW (&nclm.lfStatusFont); infoPtr->hDefaultFont = CreateFontIndirectW (&nclm.lfStatusFont);
GetClientRect (hwnd, &rect);
/* initialize simple case */ /* initialize simple case */
infoPtr->part0.bound = rect; infoPtr->part0.bound = rect;
infoPtr->part0.text = 0; infoPtr->part0.text = 0;
@ -961,42 +950,19 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate)
OpenThemeData (hwnd, themeClass); OpenThemeData (hwnd, themeClass);
if (IsWindowUnicode (hwnd)) { if (lpCreate->lpszName && (len = strlenW ((LPCWSTR)lpCreate->lpszName)))
infoPtr->bUnicode = TRUE; {
if (lpCreate->lpszName &&
(len = strlenW ((LPCWSTR)lpCreate->lpszName))) {
infoPtr->parts[0].text = Alloc ((len + 1)*sizeof(WCHAR)); infoPtr->parts[0].text = Alloc ((len + 1)*sizeof(WCHAR));
if (!infoPtr->parts[0].text) goto create_fail; if (!infoPtr->parts[0].text) goto create_fail;
strcpyW (infoPtr->parts[0].text, (LPCWSTR)lpCreate->lpszName); strcpyW (infoPtr->parts[0].text, (LPCWSTR)lpCreate->lpszName);
} }
}
else {
if (lpCreate->lpszName &&
(len = strlen((LPCSTR)lpCreate->lpszName))) {
DWORD lenW = MultiByteToWideChar( CP_ACP, 0, (LPCSTR)lpCreate->lpszName, -1, NULL, 0 );
infoPtr->parts[0].text = Alloc (lenW*sizeof(WCHAR));
if (!infoPtr->parts[0].text) goto create_fail;
MultiByteToWideChar( CP_ACP, 0, (LPCSTR)lpCreate->lpszName, -1,
infoPtr->parts[0].text, lenW );
}
}
dwStyle = GetWindowLongW (hwnd, GWL_STYLE); dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
/* native seems to clear WS_BORDER, too */ /* native seems to clear WS_BORDER, too */
dwStyle &= ~WS_BORDER; dwStyle &= ~WS_BORDER;
SetWindowLongW (hwnd, GWL_STYLE, dwStyle); SetWindowLongW (hwnd, GWL_STYLE, dwStyle);
if ((hdc = GetDC (hwnd))) { infoPtr->height = STATUSBAR_ComputeHeight(infoPtr);
TEXTMETRICW tm;
HFONT hOldFont;
hOldFont = SelectObject (hdc, infoPtr->hDefaultFont);
GetTextMetricsW (hdc, &tm);
textHeight = tm.tmHeight;
SelectObject (hdc, hOldFont);
ReleaseDC (hwnd, hdc);
}
TRACE(" textHeight=%d\n", textHeight);
if (dwStyle & SBT_TOOLTIPS) { if (dwStyle & SBT_TOOLTIPS) {
infoPtr->hwndToolTip = infoPtr->hwndToolTip =
@ -1017,32 +983,6 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate)
} }
} }
if (!(dwStyle & CCS_NORESIZE)) { /* don't resize wnd if it doesn't want it ! */
HTHEME theme;
GetClientRect (infoPtr->Notify, &rect);
width = rect.right - rect.left;
infoPtr->height = textHeight + 4 + infoPtr->verticalBorder;
if ((theme = GetWindowTheme (hwnd)))
{
/* Determine bar height from theme such that the content area is
* textHeight pixels large */
HDC hdc = GetDC (hwnd);
RECT r;
memset (&r, 0, sizeof (r));
r.bottom = textHeight;
if (SUCCEEDED(GetThemeBackgroundExtent (theme, hdc, SP_PANE, 0, &r, &r)))
{
infoPtr->height = r.bottom - r.top;
}
ReleaseDC (hwnd, hdc);
}
SetWindowPos(hwnd, 0, lpCreate->x, lpCreate->y - 1,
width, infoPtr->height, SWP_NOZORDER);
STATUSBAR_SetPartBounds (infoPtr);
}
return 0; return 0;
create_fail: create_fail:
@ -1062,17 +1002,11 @@ STATUSBAR_WMGetText (const STATUS_INFO *infoPtr, INT size, LPWSTR buf)
TRACE("\n"); TRACE("\n");
if (!(infoPtr->parts[0].text)) if (!(infoPtr->parts[0].text))
return 0; return 0;
if (infoPtr->bUnicode)
len = strlenW (infoPtr->parts[0].text); len = strlenW (infoPtr->parts[0].text);
else
len = WideCharToMultiByte( CP_ACP, 0, infoPtr->parts[0].text, -1, NULL, 0, NULL, NULL )-1;
if (size > len) { if (size > len) {
if (infoPtr->bUnicode)
strcpyW (buf, infoPtr->parts[0].text); strcpyW (buf, infoPtr->parts[0].text);
else
WideCharToMultiByte( CP_ACP, 0, infoPtr->parts[0].text, -1,
(LPSTR)buf, len+1, NULL, NULL );
return len; return len;
} }
@ -1124,6 +1058,9 @@ STATUSBAR_WMSetFont (STATUS_INFO *infoPtr, HFONT font, BOOL redraw)
{ {
infoPtr->hFont = font; infoPtr->hFont = font;
TRACE("%p\n", infoPtr->hFont); TRACE("%p\n", infoPtr->hFont);
infoPtr->height = STATUSBAR_ComputeHeight(infoPtr);
SendMessageW(infoPtr->Self, WM_SIZE, 0, 0); /* update size */
if (redraw) if (redraw)
InvalidateRect(infoPtr->Self, NULL, FALSE); InvalidateRect(infoPtr->Self, NULL, FALSE);
@ -1145,21 +1082,12 @@ STATUSBAR_WMSetText (const STATUS_INFO *infoPtr, LPCSTR text)
/* duplicate string */ /* duplicate string */
Free (part->text); Free (part->text);
part->text = 0; part->text = 0;
if (infoPtr->bUnicode) {
if (text && (len = strlenW((LPCWSTR)text))) { if (text && (len = strlenW((LPCWSTR)text))) {
part->text = Alloc ((len+1)*sizeof(WCHAR)); part->text = Alloc ((len+1)*sizeof(WCHAR));
if (!part->text) return FALSE; if (!part->text) return FALSE;
strcpyW (part->text, (LPCWSTR)text); strcpyW (part->text, (LPCWSTR)text);
} }
}
else {
if (text && (len = lstrlenA(text))) {
DWORD lenW = MultiByteToWideChar( CP_ACP, 0, text, -1, NULL, 0 );
part->text = Alloc (lenW*sizeof(WCHAR));
if (!part->text) return FALSE;
MultiByteToWideChar( CP_ACP, 0, text, -1, part->text, lenW );
}
}
InvalidateRect(infoPtr->Self, &part->bound, FALSE); InvalidateRect(infoPtr->Self, &part->bound, FALSE);
@ -1211,9 +1139,9 @@ STATUSBAR_NotifyFormat (STATUS_INFO *infoPtr, HWND from, INT cmd)
{ {
if (cmd == NF_REQUERY) { if (cmd == NF_REQUERY) {
INT i = SendMessageW(from, WM_NOTIFYFORMAT, (WPARAM)infoPtr->Self, NF_QUERY); INT i = SendMessageW(from, WM_NOTIFYFORMAT, (WPARAM)infoPtr->Self, NF_QUERY);
infoPtr->NtfUnicode = (i == NFR_UNICODE); infoPtr->bUnicode = (i == NFR_UNICODE);
} }
return infoPtr->NtfUnicode ? NFR_UNICODE : NFR_ANSI; return infoPtr->bUnicode ? NFR_UNICODE : NFR_ANSI;
} }
@ -1378,7 +1306,7 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return theme_changed (infoPtr); return theme_changed (infoPtr);
default: default:
if ((msg >= WM_USER) && (msg < WM_APP)) if ((msg >= WM_USER) && (msg < WM_APP) && !COMCTL32_IsReflectedMessage(msg))
ERR("unknown msg %04x wp=%04lx lp=%08lx\n", ERR("unknown msg %04x wp=%04lx lp=%08lx\n",
msg, wParam, lParam); msg, wParam, lParam);
return DefWindowProcW (hwnd, msg, wParam, lParam); return DefWindowProcW (hwnd, msg, wParam, lParam);

View file

@ -136,7 +136,7 @@ static PDOC_ITEM SYSLINK_AppendDocItem (SYSLINK_INFO *infoPtr, LPCWSTR Text, UIN
{ {
PDOC_ITEM Item; PDOC_ITEM Item;
textlen = min(textlen, lstrlenW(Text)); textlen = min(textlen, strlenW(Text));
Item = Alloc(FIELD_OFFSET(DOC_ITEM, Text[textlen + 1])); Item = Alloc(FIELD_OFFSET(DOC_ITEM, Text[textlen + 1]));
if(Item == NULL) if(Item == NULL)
{ {
@ -286,8 +286,6 @@ CheckParameter:
ValidLink = TRUE; ValidLink = TRUE;
taglen++; taglen++;
} }
else
tmp++;
} }
} }
@ -1750,7 +1748,7 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
default: default:
HandleDefaultMessage: HandleDefaultMessage:
if ((message >= WM_USER) && (message < WM_APP)) if ((message >= WM_USER) && (message < WM_APP) && !COMCTL32_IsReflectedMessage(message))
{ {
ERR("unknown msg %04x wp=%04lx lp=%08lx\n", message, wParam, lParam ); ERR("unknown msg %04x wp=%04lx lp=%08lx\n", message, wParam, lParam );
} }

View file

@ -142,7 +142,6 @@ typedef struct
#define BUTTON_SPACINGY 3 #define BUTTON_SPACINGY 3
#define FLAT_BTN_SPACINGX 8 #define FLAT_BTN_SPACINGX 8
#define DEFAULT_MIN_TAB_WIDTH 54 #define DEFAULT_MIN_TAB_WIDTH 54
#define DEFAULT_TAB_WIDTH_FIXED 96
#define DEFAULT_PADDING_X 6 #define DEFAULT_PADDING_X 6
#define EXTRA_ICON_PADDING 3 #define EXTRA_ICON_PADDING 3
@ -460,7 +459,7 @@ static BOOL TAB_InternalGetItemRect(
static inline BOOL static inline BOOL
TAB_GetItemRect(const TAB_INFO *infoPtr, WPARAM wParam, LPARAM lParam) TAB_GetItemRect(const TAB_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{ {
return TAB_InternalGetItemRect(infoPtr, (INT)wParam, (LPRECT)lParam, (LPRECT)NULL); return TAB_InternalGetItemRect(infoPtr, wParam, (LPRECT)lParam, NULL);
} }
/****************************************************************************** /******************************************************************************
@ -864,6 +863,8 @@ static LRESULT TAB_AdjustRect(const TAB_INFO *infoPtr, WPARAM fLarger, LPRECT pr
TRACE ("hwnd=%p fLarger=%ld (%s)\n", infoPtr->hwnd, fLarger, TRACE ("hwnd=%p fLarger=%ld (%s)\n", infoPtr->hwnd, fLarger,
wine_dbgstr_rect(prc)); wine_dbgstr_rect(prc));
if (!prc) return -1;
if(lStyle & TCS_VERTICAL) if(lStyle & TCS_VERTICAL)
{ {
iRightBottom = &(prc->right); iRightBottom = &(prc->right);
@ -2661,6 +2662,9 @@ static inline LRESULT TAB_SetMinTabWidth (TAB_INFO *infoPtr, INT cx)
TRACE("(%p,%d)\n", infoPtr, cx); TRACE("(%p,%d)\n", infoPtr, cx);
if (infoPtr->tabMinWidth < 0)
oldcx = DEFAULT_MIN_TAB_WIDTH;
else
oldcx = infoPtr->tabMinWidth; oldcx = infoPtr->tabMinWidth;
infoPtr->tabMinWidth = cx; infoPtr->tabMinWidth = cx;
TAB_SetItemBounds(infoPtr); TAB_SetItemBounds(infoPtr);
@ -2940,7 +2944,7 @@ static LRESULT TAB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
HFONT hOldFont; HFONT hOldFont;
DWORD dwStyle; DWORD dwStyle;
infoPtr = (TAB_INFO *)Alloc (sizeof(TAB_INFO)); infoPtr = Alloc (sizeof(TAB_INFO));
SetWindowLongPtrW(hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW(hwnd, 0, (DWORD_PTR)infoPtr);
@ -3019,7 +3023,7 @@ static LRESULT TAB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* Initialize the width of a tab. */ /* Initialize the width of a tab. */
if (dwStyle & TCS_FIXEDWIDTH) if (dwStyle & TCS_FIXEDWIDTH)
infoPtr->tabWidth = DEFAULT_TAB_WIDTH_FIXED; infoPtr->tabWidth = GetDeviceCaps(hdc, LOGPIXELSX);
infoPtr->tabMinWidth = -1; infoPtr->tabMinWidth = -1;
@ -3269,7 +3273,7 @@ TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TAB_NCCalcSize(hwnd, wParam, lParam); return TAB_NCCalcSize(hwnd, wParam, lParam);
default: default:
if (uMsg >= WM_USER && uMsg < WM_APP) if (uMsg >= WM_USER && uMsg < WM_APP && !COMCTL32_IsReflectedMessage(uMsg))
WARN("unknown msg %04x wp=%08lx lp=%08lx\n", WARN("unknown msg %04x wp=%08lx lp=%08lx\n",
uMsg, wParam, lParam); uMsg, wParam, lParam);
break; break;

View file

@ -34,6 +34,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(theming);
typedef LRESULT (CALLBACK* THEMING_SUBCLASSPROC)(HWND, UINT, WPARAM, LPARAM, typedef LRESULT (CALLBACK* THEMING_SUBCLASSPROC)(HWND, UINT, WPARAM, LPARAM,
ULONG_PTR); ULONG_PTR);
extern LRESULT CALLBACK THEMING_ButtonSubclassProc (HWND, UINT, WPARAM, LPARAM,
ULONG_PTR);
extern LRESULT CALLBACK THEMING_ComboSubclassProc (HWND, UINT, WPARAM, LPARAM, extern LRESULT CALLBACK THEMING_ComboSubclassProc (HWND, UINT, WPARAM, LPARAM,
ULONG_PTR); ULONG_PTR);
extern LRESULT CALLBACK THEMING_DialogSubclassProc (HWND, UINT, WPARAM, LPARAM, extern LRESULT CALLBACK THEMING_DialogSubclassProc (HWND, UINT, WPARAM, LPARAM,
@ -53,6 +55,7 @@ static const struct ThemingSubclass
} subclasses[] = { } subclasses[] = {
/* Note: list must be sorted by class name */ /* Note: list must be sorted by class name */
{dialogClass, THEMING_DialogSubclassProc}, {dialogClass, THEMING_DialogSubclassProc},
{WC_BUTTONW, THEMING_ButtonSubclassProc},
{WC_COMBOBOXW, THEMING_ComboSubclassProc}, {WC_COMBOBOXW, THEMING_ComboSubclassProc},
{comboLboxClass, THEMING_ListBoxSubclassProc}, {comboLboxClass, THEMING_ListBoxSubclassProc},
{WC_EDITW, THEMING_EditSubclassProc}, {WC_EDITW, THEMING_EditSubclassProc},
@ -91,13 +94,15 @@ MAKE_SUBCLASS_PROC(1)
MAKE_SUBCLASS_PROC(2) MAKE_SUBCLASS_PROC(2)
MAKE_SUBCLASS_PROC(3) MAKE_SUBCLASS_PROC(3)
MAKE_SUBCLASS_PROC(4) MAKE_SUBCLASS_PROC(4)
MAKE_SUBCLASS_PROC(5)
static const WNDPROC subclassProcs[NUM_SUBCLASSES] = { static const WNDPROC subclassProcs[NUM_SUBCLASSES] = {
subclass_proc0, subclass_proc0,
subclass_proc1, subclass_proc1,
subclass_proc2, subclass_proc2,
subclass_proc3, subclass_proc3,
subclass_proc4 subclass_proc4,
subclass_proc5
}; };
/*********************************************************************** /***********************************************************************
@ -108,7 +113,7 @@ static const WNDPROC subclassProcs[NUM_SUBCLASSES] = {
*/ */
void THEMING_Initialize (void) void THEMING_Initialize (void)
{ {
int i; unsigned int i;
static const WCHAR subclassPropName[] = static const WCHAR subclassPropName[] =
{ 'C','C','3','2','T','h','e','m','i','n','g','S','u','b','C','l',0 }; { 'C','C','3','2','T','h','e','m','i','n','g','S','u','b','C','l',0 };
static const WCHAR refDataPropName[] = static const WCHAR refDataPropName[] =
@ -156,7 +161,7 @@ void THEMING_Initialize (void)
*/ */
void THEMING_Uninitialize (void) void THEMING_Uninitialize (void)
{ {
int i; unsigned int i;
if (!atSubclassProp) return; /* not initialized */ if (!atSubclassProp) return; /* not initialized */

View file

@ -495,7 +495,7 @@ TOOLBAR_DrawFlatSeparator (const RECT *lpRect, HDC hdc, const TOOLBAR_INFO *info
* FIXME: It is possible that the height of each line is really SM_CYBORDER. * FIXME: It is possible that the height of each line is really SM_CYBORDER.
*/ */
static void static void
TOOLBAR_DrawDDFlatSeparator (const RECT *lpRect, HDC hdc, const TBUTTON_INFO *btnPtr, TOOLBAR_DrawDDFlatSeparator (const RECT *lpRect, HDC hdc,
const TOOLBAR_INFO *infoPtr) const TOOLBAR_INFO *infoPtr)
{ {
RECT myrect; RECT myrect;
@ -542,7 +542,7 @@ TOOLBAR_DrawArrow (HDC hdc, INT left, INT top, COLORREF clr)
MoveToEx (hdc, x, y, NULL); MoveToEx (hdc, x, y, NULL);
LineTo (hdc, x+3, y++); x++; LineTo (hdc, x+3, y++); x++;
MoveToEx (hdc, x, y, NULL); MoveToEx (hdc, x, y, NULL);
LineTo (hdc, x+1, y++); LineTo (hdc, x+1, y);
SelectObject( hdc, hOldPen ); SelectObject( hdc, hOldPen );
DeleteObject( hPen ); DeleteObject( hPen );
} }
@ -848,7 +848,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCustDr
/* when drawing the vertical bar... */ /* when drawing the vertical bar... */
if ((dwStyle & TBSTYLE_FLAT) /* && (btnPtr->iBitmap == 0) */) { if ((dwStyle & TBSTYLE_FLAT) /* && (btnPtr->iBitmap == 0) */) {
if (btnPtr->fsStyle & BTNS_DROPDOWN) if (btnPtr->fsStyle & BTNS_DROPDOWN)
TOOLBAR_DrawDDFlatSeparator (&rc, hdc, btnPtr, infoPtr); TOOLBAR_DrawDDFlatSeparator (&rc, hdc, infoPtr);
else else
TOOLBAR_DrawFlatSeparator (&rc, hdc, infoPtr); TOOLBAR_DrawFlatSeparator (&rc, hdc, infoPtr);
} }
@ -912,7 +912,6 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCustDr
rcText.right -= GetSystemMetrics(SM_CXEDGE); rcText.right -= GetSystemMetrics(SM_CXEDGE);
if (dwStyle & TBSTYLE_LIST) if (dwStyle & TBSTYLE_LIST)
{ {
if (TOOLBAR_IsValidBitmapIndex(infoPtr,btnPtr->iBitmap))
rcText.left += infoPtr->nBitmapWidth + infoPtr->iListGap + 2; rcText.left += infoPtr->nBitmapWidth + infoPtr->iListGap + 2;
} }
else else
@ -1152,7 +1151,7 @@ TOOLBAR_Refresh (HWND hwnd, HDC hdc, const PAINTSTRUCT *ps)
tbcd.nmcd.dwDrawStage = CDDS_POSTPAINT; tbcd.nmcd.dwDrawStage = CDDS_POSTPAINT;
tbcd.nmcd.hdc = hdc; tbcd.nmcd.hdc = hdc;
tbcd.nmcd.rc = ps->rcPaint; tbcd.nmcd.rc = ps->rcPaint;
ntfret = TOOLBAR_SendNotify(&tbcd.nmcd.hdr, infoPtr, NM_CUSTOMDRAW); TOOLBAR_SendNotify(&tbcd.nmcd.hdr, infoPtr, NM_CUSTOMDRAW);
} }
} }
@ -1330,7 +1329,7 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle )
cx = (btnPtr[i].iBitmap > 0) ? cx = (btnPtr[i].iBitmap > 0) ?
btnPtr[i].iBitmap : SEPARATOR_WIDTH; btnPtr[i].iBitmap : SEPARATOR_WIDTH;
else else
cx = infoPtr->nButtonWidth; cx = (btnPtr[i].cx) ? btnPtr[i].cx : infoPtr->nButtonWidth;
/* Two or more adjacent separators form a separator group. */ /* Two or more adjacent separators form a separator group. */
/* The first separator in a group should be wrapped to the */ /* The first separator in a group should be wrapped to the */
@ -1427,7 +1426,6 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle )
TRACE("wrap point 5 btn %d style %02x, x=%d, cx=%d\n", TRACE("wrap point 5 btn %d style %02x, x=%d, cx=%d\n",
i, btnPtr[i].fsStyle, x, cx); i, btnPtr[i].fsStyle, x, cx);
btnPtr[i].fsState |= TBSTATE_WRAP; btnPtr[i].fsState |= TBSTATE_WRAP;
bFound = TRUE;
x = infoPtr->nIndent; x = infoPtr->nIndent;
if (btnPtr[i].fsStyle & BTNS_SEP ) if (btnPtr[i].fsStyle & BTNS_SEP )
bButtonWrap = FALSE; bButtonWrap = FALSE;
@ -1574,15 +1572,11 @@ static inline SIZE TOOLBAR_MeasureButton(const TOOLBAR_INFO *infoPtr, SIZE sizeS
sizeButton.cy += infoPtr->szPadding.cy; sizeButton.cy += infoPtr->szPadding.cy;
/* calculate button width */ /* calculate button width */
if (bHasBitmap)
{
sizeButton.cx = 2*GetSystemMetrics(SM_CXEDGE) + sizeButton.cx = 2*GetSystemMetrics(SM_CXEDGE) +
infoPtr->nBitmapWidth + infoPtr->iListGap; infoPtr->nBitmapWidth + infoPtr->iListGap;
if (sizeString.cx > 0) if (sizeString.cx > 0)
sizeButton.cx += sizeString.cx + infoPtr->szPadding.cx; sizeButton.cx += sizeString.cx + infoPtr->szPadding.cx;
}
else
sizeButton.cx = sizeString.cx + infoPtr->szPadding.cx;
} }
else else
{ {
@ -1598,8 +1592,8 @@ static inline SIZE TOOLBAR_MeasureButton(const TOOLBAR_INFO *infoPtr, SIZE sizeS
{ {
sizeButton.cy = sizeString.cy + infoPtr->szPadding.cy + sizeButton.cy = sizeString.cy + infoPtr->szPadding.cy +
NONLIST_NOTEXT_OFFSET; NONLIST_NOTEXT_OFFSET;
sizeButton.cx = 2*GetSystemMetrics(SM_CXEDGE) + sizeButton.cx = infoPtr->szPadding.cx +
infoPtr->szPadding.cx + sizeString.cx; max(2*GetSystemMetrics(SM_CXEDGE) + sizeString.cx, infoPtr->nBitmapWidth);
} }
} }
return sizeButton; return sizeButton;
@ -2085,7 +2079,7 @@ static void TOOLBAR_Cust_AddButton(const CUSTDLG_INFO *custInfo, HWND hwnd, INT
PCUSTOMBUTTON btnNew; PCUSTOMBUTTON btnNew;
/* duplicate 'separator' button */ /* duplicate 'separator' button */
btnNew = (PCUSTOMBUTTON)Alloc(sizeof(CUSTOMBUTTON)); btnNew = Alloc(sizeof(CUSTOMBUTTON));
*btnNew = *btnInfo; *btnNew = *btnInfo;
btnInfo = btnNew; btnInfo = btnNew;
} }
@ -2308,7 +2302,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* add items to 'toolbar buttons' list and check if removable */ /* add items to 'toolbar buttons' list and check if removable */
for (i = 0; i < custInfo->tbInfo->nNumButtons; i++) for (i = 0; i < custInfo->tbInfo->nNumButtons; i++)
{ {
btnInfo = (PCUSTOMBUTTON)Alloc(sizeof(CUSTOMBUTTON)); btnInfo = Alloc(sizeof(CUSTOMBUTTON));
memset (&btnInfo->btn, 0, sizeof(TBBUTTON)); memset (&btnInfo->btn, 0, sizeof(TBBUTTON));
btnInfo->btn.fsStyle = BTNS_SEP; btnInfo->btn.fsStyle = BTNS_SEP;
btnInfo->bVirtual = FALSE; btnInfo->bVirtual = FALSE;
@ -2324,7 +2318,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
SendDlgItemMessageW (hwnd, IDC_TOOLBARBTN_LBOX, LB_SETITEMHEIGHT, 0, infoPtr->nBitmapHeight + 8); SendDlgItemMessageW (hwnd, IDC_TOOLBARBTN_LBOX, LB_SETITEMHEIGHT, 0, infoPtr->nBitmapHeight + 8);
/* insert separator button into 'available buttons' list */ /* insert separator button into 'available buttons' list */
btnInfo = (PCUSTOMBUTTON)Alloc(sizeof(CUSTOMBUTTON)); btnInfo = Alloc(sizeof(CUSTOMBUTTON));
memset (&btnInfo->btn, 0, sizeof(TBBUTTON)); memset (&btnInfo->btn, 0, sizeof(TBBUTTON));
btnInfo->btn.fsStyle = BTNS_SEP; btnInfo->btn.fsStyle = BTNS_SEP;
btnInfo->bVirtual = FALSE; btnInfo->bVirtual = FALSE;
@ -2359,7 +2353,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
index = TOOLBAR_GetButtonIndex (custInfo->tbInfo, nmtb.tbButton.idCommand, FALSE); index = TOOLBAR_GetButtonIndex (custInfo->tbInfo, nmtb.tbButton.idCommand, FALSE);
if (index == -1) if (index == -1)
{ {
btnInfo = (PCUSTOMBUTTON)Alloc(sizeof(CUSTOMBUTTON)); btnInfo = Alloc(sizeof(CUSTOMBUTTON));
btnInfo->bVirtual = FALSE; btnInfo->bVirtual = FALSE;
btnInfo->bRemovable = TRUE; btnInfo->bRemovable = TRUE;
} }
@ -2392,7 +2386,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
SendDlgItemMessageW (hwnd, IDC_AVAILBTN_LBOX, LB_SETCURSEL, 0, 0); SendDlgItemMessageW (hwnd, IDC_AVAILBTN_LBOX, LB_SETCURSEL, 0, 0);
/* append 'virtual' separator button to the 'toolbar buttons' list */ /* append 'virtual' separator button to the 'toolbar buttons' list */
btnInfo = (PCUSTOMBUTTON)Alloc(sizeof(CUSTOMBUTTON)); btnInfo = Alloc(sizeof(CUSTOMBUTTON));
memset (&btnInfo->btn, 0, sizeof(TBBUTTON)); memset (&btnInfo->btn, 0, sizeof(TBBUTTON));
btnInfo->btn.fsStyle = BTNS_SEP; btnInfo->btn.fsStyle = BTNS_SEP;
btnInfo->bVirtual = TRUE; btnInfo->bVirtual = TRUE;
@ -2665,7 +2659,7 @@ TOOLBAR_AddBitmapToImageList(TOOLBAR_INFO *infoPtr, HIMAGELIST himlDef, const TB
TRACE("adding hInst=%p nID=%d nButtons=%d\n", bitmap->hInst, bitmap->nID, bitmap->nButtons); TRACE("adding hInst=%p nID=%d nButtons=%d\n", bitmap->hInst, bitmap->nID, bitmap->nButtons);
/* Add bitmaps to the default image list */ /* Add bitmaps to the default image list */
if (bitmap->hInst == NULL) /* a handle was passed */ if (bitmap->hInst == NULL) /* a handle was passed */
hbmLoad = (HBITMAP)CopyImage(ULongToHandle(bitmap->nID), IMAGE_BITMAP, 0, 0, 0); hbmLoad = CopyImage(ULongToHandle(bitmap->nID), IMAGE_BITMAP, 0, 0, 0);
else else
hbmLoad = CreateMappedBitmap(bitmap->hInst, bitmap->nID, 0, NULL, 0); hbmLoad = CreateMappedBitmap(bitmap->hInst, bitmap->nID, 0, NULL, 0);
@ -3066,7 +3060,7 @@ TOOLBAR_AutoSize (HWND hwnd)
static LRESULT static LRESULT
TOOLBAR_ButtonCount (HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLBAR_ButtonCount (HWND hwnd)
{ {
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
@ -3075,7 +3069,7 @@ TOOLBAR_ButtonCount (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
TOOLBAR_ButtonStructSize (HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLBAR_ButtonStructSize (HWND hwnd, WPARAM wParam)
{ {
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
@ -3157,7 +3151,7 @@ TOOLBAR_CheckButton (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
TOOLBAR_CommandToIndex (HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLBAR_CommandToIndex (HWND hwnd, WPARAM wParam)
{ {
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
@ -3203,7 +3197,7 @@ TOOLBAR_Customize (HWND hwnd)
static LRESULT static LRESULT
TOOLBAR_DeleteButton (HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLBAR_DeleteButton (HWND hwnd, WPARAM wParam)
{ {
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
INT nIndex = (INT)wParam; INT nIndex = (INT)wParam;
@ -3302,7 +3296,7 @@ TOOLBAR_GetAnchorHighlight (HWND hwnd)
static LRESULT static LRESULT
TOOLBAR_GetBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLBAR_GetBitmap (HWND hwnd, WPARAM wParam)
{ {
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
INT nIndex; INT nIndex;
@ -3316,7 +3310,7 @@ TOOLBAR_GetBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
static inline LRESULT static inline LRESULT
TOOLBAR_GetBitmapFlags (HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLBAR_GetBitmapFlags (HWND hwnd)
{ {
return (GetDeviceCaps (0, LOGPIXELSX) >= 120) ? TBBF_LARGE : 0; return (GetDeviceCaps (0, LOGPIXELSX) >= 120) ? TBBF_LARGE : 0;
} }
@ -3518,7 +3512,7 @@ TOOLBAR_GetDefImageList (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
TOOLBAR_GetInsertMark (HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLBAR_GetInsertMark (HWND hwnd, LPARAM lParam)
{ {
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBINSERTMARK *lptbim = (TBINSERTMARK*)lParam; TBINSERTMARK *lptbim = (TBINSERTMARK*)lParam;
@ -3532,7 +3526,7 @@ TOOLBAR_GetInsertMark (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
TOOLBAR_GetInsertMarkColor (HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLBAR_GetInsertMarkColor (HWND hwnd)
{ {
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
@ -3570,7 +3564,7 @@ TOOLBAR_GetItemRect (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
TOOLBAR_GetMaxSize (HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLBAR_GetMaxSize (HWND hwnd, LPARAM lParam)
{ {
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
LPSIZE lpSize = (LPSIZE)lParam; LPSIZE lpSize = (LPSIZE)lParam;
@ -3629,7 +3623,7 @@ TOOLBAR_GetRect (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
TOOLBAR_GetRows (HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLBAR_GetRows (HWND hwnd)
{ {
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
@ -3638,7 +3632,7 @@ TOOLBAR_GetRows (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
TOOLBAR_GetState (HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLBAR_GetState (HWND hwnd, WPARAM wParam)
{ {
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
INT nIndex; INT nIndex;
@ -3652,14 +3646,14 @@ TOOLBAR_GetState (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
TOOLBAR_GetStyle (HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLBAR_GetStyle (HWND hwnd)
{ {
return GetWindowLongW(hwnd, GWL_STYLE); return GetWindowLongW(hwnd, GWL_STYLE);
} }
static LRESULT static LRESULT
TOOLBAR_GetTextRows (HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLBAR_GetTextRows (HWND hwnd)
{ {
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
@ -3668,7 +3662,7 @@ TOOLBAR_GetTextRows (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
TOOLBAR_GetToolTips (HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLBAR_GetToolTips (HWND hwnd)
{ {
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
@ -3679,7 +3673,7 @@ TOOLBAR_GetToolTips (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
TOOLBAR_GetUnicodeFormat (HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLBAR_GetUnicodeFormat (HWND hwnd)
{ {
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
@ -4293,7 +4287,7 @@ TOOLBAR_Restore(TOOLBAR_INFO *infoPtr, const TBSAVEPARAMSW *lpSave)
* delete */ * delete */
for (i = infoPtr->nNumButtons - 1; i >= 0; i--) for (i = infoPtr->nNumButtons - 1; i >= 0; i--)
if (infoPtr->buttons[i].iBitmap == -1) if (infoPtr->buttons[i].iBitmap == -1)
TOOLBAR_DeleteButton(infoPtr->hwndSelf, i, 0); TOOLBAR_DeleteButton(infoPtr->hwndSelf, i);
/* only indicate success if at least one button survived */ /* only indicate success if at least one button survived */
if (infoPtr->nNumButtons > 0) ret = TRUE; if (infoPtr->nNumButtons > 0) ret = TRUE;
@ -4374,26 +4368,38 @@ TOOLBAR_SetBitmapSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
{ {
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
HIMAGELIST himlDef = GETDEFIMAGELIST(infoPtr, 0); HIMAGELIST himlDef = GETDEFIMAGELIST(infoPtr, 0);
short width = (short)LOWORD(lParam);
short height = (short)HIWORD(lParam);
TRACE("hwnd=%p, wParam=%ld, lParam=%ld\n", hwnd, wParam, lParam); TRACE("hwnd=%p, wParam=%ld, lParam=%ld\n", hwnd, wParam, lParam);
if (wParam != 0) if (wParam != 0)
FIXME("wParam is %ld. Perhaps image list index?\n", wParam); FIXME("wParam is %ld. Perhaps image list index?\n", wParam);
if (LOWORD(lParam) == 0) /* 0 width or height is changed to 1 */
lParam = MAKELPARAM(1, HIWORD(lParam)); if (width == 0)
width = 1;
if (HIWORD(lParam)==0) if (height == 0)
lParam = MAKELPARAM(LOWORD(lParam), 1); height = 1;
if (infoPtr->nNumButtons > 0) if (infoPtr->nNumButtons > 0)
WARN("%d buttons, undoc increase to bitmap size : %d-%d -> %d-%d\n", TRACE("%d buttons, undoc change to bitmap size : %d-%d -> %d-%d\n",
infoPtr->nNumButtons, infoPtr->nNumButtons,
infoPtr->nBitmapWidth, infoPtr->nBitmapHeight, infoPtr->nBitmapWidth, infoPtr->nBitmapHeight, width, height);
LOWORD(lParam), HIWORD(lParam));
infoPtr->nBitmapWidth = (INT)LOWORD(lParam); if (width < -1 || height < -1)
infoPtr->nBitmapHeight = (INT)HIWORD(lParam); {
/* Windows destroys the imagelist and seems to actually use negative
* values to compute button sizes */
FIXME("Negative bitmap sizes not supported (%d, %d)\n", width, height);
return FALSE;
}
/* width or height of -1 means no change */
if (width != -1)
infoPtr->nBitmapWidth = width;
if (height != -1)
infoPtr->nBitmapHeight = height;
if ((himlDef == infoPtr->himlInt) && if ((himlDef == infoPtr->himlInt) &&
(ImageList_GetImageCount(infoPtr->himlInt) == 0)) (ImageList_GetImageCount(infoPtr->himlInt) == 0))
@ -5165,7 +5171,7 @@ TOOLBAR_SetVersion (HWND hwnd, INT iVersion)
infoPtr->iVersion = iVersion; infoPtr->iVersion = iVersion;
if (infoPtr->iVersion >= 5) if (infoPtr->iVersion >= 5)
TOOLBAR_SetUnicodeFormat(hwnd, (WPARAM)TRUE, (LPARAM)0); TOOLBAR_SetUnicodeFormat(hwnd, TRUE, 0);
return iOldVersion; return iOldVersion;
} }
@ -5236,12 +5242,11 @@ static LRESULT TOOLBAR_Unkwn45D(HWND hwnd, WPARAM wParam, LPARAM lParam)
} }
/* UNDOCUMENTED MESSAGE: This is an extended version of the /* This is an extended version of the TB_SETHOTITEM message. It allows the
* TB_SETHOTITEM message. It allows the caller to specify a reason why the * caller to specify a reason why the hot item changed (rather than just the
* hot item changed (rather than just the HICF_OTHER that TB_SETHOTITEM * HICF_OTHER that TB_SETHOTITEM sends). */
* sends). */
static LRESULT static LRESULT
TOOLBAR_Unkwn45E (HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLBAR_SetHotItem2 (HWND hwnd, WPARAM wParam, LPARAM lParam)
{ {
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(hwnd); TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(hwnd);
INT nOldHotItem = infoPtr->nHotItem; INT nOldHotItem = infoPtr->nHotItem;
@ -5262,18 +5267,15 @@ TOOLBAR_Unkwn45E (HWND hwnd, WPARAM wParam, LPARAM lParam)
return (nOldHotItem < 0) ? -1 : (LRESULT)nOldHotItem; return (nOldHotItem < 0) ? -1 : (LRESULT)nOldHotItem;
} }
/* UNDOCUMENTED MESSAGE: This sets the toolbar global iListGap parameter /* Sets the toolbar global iListGap parameter which controls the amount of
* which controls the amount of spacing between the image and the text * spacing between the image and the text of buttons for TBSTYLE_LIST
* of buttons for TBSTYLE_LIST toolbars. */ * toolbars. */
static LRESULT TOOLBAR_Unkwn460(HWND hwnd, WPARAM wParam, LPARAM lParam) static LRESULT TOOLBAR_SetListGap(HWND hwnd, WPARAM wParam, LPARAM lParam)
{ {
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(hwnd); TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(hwnd);
TRACE("hwnd=%p iListGap=%ld\n", hwnd, wParam); TRACE("hwnd=%p iListGap=%ld\n", hwnd, wParam);
if (lParam != 0)
FIXME("lParam = 0x%08lx. Please report\n", lParam);
infoPtr->iListGap = (INT)wParam; infoPtr->iListGap = (INT)wParam;
InvalidateRect(hwnd, NULL, TRUE); InvalidateRect(hwnd, NULL, TRUE);
@ -5281,9 +5283,9 @@ static LRESULT TOOLBAR_Unkwn460(HWND hwnd, WPARAM wParam, LPARAM lParam)
return 0; return 0;
} }
/* UNDOCUMENTED MESSAGE: This returns the number of maximum number /* Returns the number of maximum number of image lists associated with the
* of image lists associated with the various states. */ * various states. */
static LRESULT TOOLBAR_Unkwn462(HWND hwnd, WPARAM wParam, LPARAM lParam) static LRESULT TOOLBAR_GetImageListCount(HWND hwnd, WPARAM wParam, LPARAM lParam)
{ {
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(hwnd); TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(hwnd);
@ -5293,7 +5295,7 @@ static LRESULT TOOLBAR_Unkwn462(HWND hwnd, WPARAM wParam, LPARAM lParam)
} }
static LRESULT static LRESULT
TOOLBAR_Unkwn463 (HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLBAR_GetIdealSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
{ {
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
LPSIZE lpsize = (LPSIZE)lParam; LPSIZE lpsize = (LPSIZE)lParam;
@ -5308,7 +5310,7 @@ TOOLBAR_Unkwn463 (HWND hwnd, WPARAM wParam, LPARAM lParam)
* lParam pointer to SIZE structure * lParam pointer to SIZE structure
* *
*/ */
TRACE("[0463] wParam %ld, lParam 0x%08lx -> 0x%08x 0x%08x\n", TRACE("wParam %ld, lParam 0x%08lx -> 0x%08x 0x%08x\n",
wParam, lParam, lpsize->cx, lpsize->cy); wParam, lParam, lpsize->cx, lpsize->cy);
switch(wParam) { switch(wParam) {
@ -5335,11 +5337,10 @@ TOOLBAR_Unkwn463 (HWND hwnd, WPARAM wParam, LPARAM lParam)
lpsize->cy = infoPtr->rcBound.bottom - infoPtr->rcBound.top; lpsize->cy = infoPtr->rcBound.bottom - infoPtr->rcBound.top;
break; break;
default: default:
ERR("Unknown wParam %ld for Toolbar message [0463]. Please report\n", FIXME("Unknown wParam %ld\n", wParam);
wParam);
return 0; return 0;
} }
TRACE("[0463] set to -> 0x%08x 0x%08x\n", TRACE("set to -> 0x%08x 0x%08x\n",
lpsize->cx, lpsize->cy); lpsize->cx, lpsize->cy);
return 1; return 1;
} }
@ -5820,7 +5821,7 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (pt.x < (btnPtr->rect.left + (btnPtr->rect.right - btnPtr->rect.left)/2)) if (pt.x < (btnPtr->rect.left + (btnPtr->rect.right - btnPtr->rect.left)/2))
{ {
if ((nButton > 0) && (infoPtr->buttons[nButton-1].fsStyle & BTNS_SEP)) if ((nButton > 0) && (infoPtr->buttons[nButton-1].fsStyle & BTNS_SEP))
TOOLBAR_DeleteButton(hwnd, nButton - 1, 0); TOOLBAR_DeleteButton(hwnd, nButton - 1);
} }
else /* else insert a separator before the dragged button */ else /* else insert a separator before the dragged button */
{ {
@ -5847,7 +5848,7 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
else else
{ {
TRACE("button %d dragged out of toolbar\n", infoPtr->nButtonDrag); TRACE("button %d dragged out of toolbar\n", infoPtr->nButtonDrag);
TOOLBAR_DeleteButton(hwnd, (WPARAM)infoPtr->nButtonDrag, 0); TOOLBAR_DeleteButton(hwnd, (WPARAM)infoPtr->nButtonDrag);
} }
/* button under cursor changed so need to re-set hot item */ /* button under cursor changed so need to re-set hot item */
@ -6145,7 +6146,7 @@ TOOLBAR_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam)
DWORD styleadd = 0; DWORD styleadd = 0;
/* allocate memory for info structure */ /* allocate memory for info structure */
infoPtr = (TOOLBAR_INFO *)Alloc (sizeof(TOOLBAR_INFO)); infoPtr = Alloc (sizeof(TOOLBAR_INFO));
SetWindowLongPtrW (hwnd, 0, (LONG_PTR)infoPtr); SetWindowLongPtrW (hwnd, 0, (LONG_PTR)infoPtr);
/* paranoid!! */ /* paranoid!! */
@ -6670,10 +6671,10 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TOOLBAR_AutoSize (hwnd); return TOOLBAR_AutoSize (hwnd);
case TB_BUTTONCOUNT: case TB_BUTTONCOUNT:
return TOOLBAR_ButtonCount (hwnd, wParam, lParam); return TOOLBAR_ButtonCount (hwnd);
case TB_BUTTONSTRUCTSIZE: case TB_BUTTONSTRUCTSIZE:
return TOOLBAR_ButtonStructSize (hwnd, wParam, lParam); return TOOLBAR_ButtonStructSize (hwnd, wParam);
case TB_CHANGEBITMAP: case TB_CHANGEBITMAP:
return TOOLBAR_ChangeBitmap (hwnd, wParam, lParam); return TOOLBAR_ChangeBitmap (hwnd, wParam, lParam);
@ -6682,13 +6683,13 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TOOLBAR_CheckButton (hwnd, wParam, lParam); return TOOLBAR_CheckButton (hwnd, wParam, lParam);
case TB_COMMANDTOINDEX: case TB_COMMANDTOINDEX:
return TOOLBAR_CommandToIndex (hwnd, wParam, lParam); return TOOLBAR_CommandToIndex (hwnd, wParam);
case TB_CUSTOMIZE: case TB_CUSTOMIZE:
return TOOLBAR_Customize (hwnd); return TOOLBAR_Customize (hwnd);
case TB_DELETEBUTTON: case TB_DELETEBUTTON:
return TOOLBAR_DeleteButton (hwnd, wParam, lParam); return TOOLBAR_DeleteButton (hwnd, wParam);
case TB_ENABLEBUTTON: case TB_ENABLEBUTTON:
return TOOLBAR_EnableButton (hwnd, wParam, lParam); return TOOLBAR_EnableButton (hwnd, wParam, lParam);
@ -6697,10 +6698,10 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TOOLBAR_GetAnchorHighlight (hwnd); return TOOLBAR_GetAnchorHighlight (hwnd);
case TB_GETBITMAP: case TB_GETBITMAP:
return TOOLBAR_GetBitmap (hwnd, wParam, lParam); return TOOLBAR_GetBitmap (hwnd, wParam);
case TB_GETBITMAPFLAGS: case TB_GETBITMAPFLAGS:
return TOOLBAR_GetBitmapFlags (hwnd, wParam, lParam); return TOOLBAR_GetBitmapFlags (hwnd);
case TB_GETBUTTON: case TB_GETBUTTON:
return TOOLBAR_GetButton (hwnd, wParam, lParam); return TOOLBAR_GetButton (hwnd, wParam, lParam);
@ -6736,16 +6737,16 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TOOLBAR_GetDefImageList (hwnd, wParam, lParam); return TOOLBAR_GetDefImageList (hwnd, wParam, lParam);
case TB_GETINSERTMARK: case TB_GETINSERTMARK:
return TOOLBAR_GetInsertMark (hwnd, wParam, lParam); return TOOLBAR_GetInsertMark (hwnd, lParam);
case TB_GETINSERTMARKCOLOR: case TB_GETINSERTMARKCOLOR:
return TOOLBAR_GetInsertMarkColor (hwnd, wParam, lParam); return TOOLBAR_GetInsertMarkColor (hwnd);
case TB_GETITEMRECT: case TB_GETITEMRECT:
return TOOLBAR_GetItemRect (hwnd, wParam, lParam); return TOOLBAR_GetItemRect (hwnd, wParam, lParam);
case TB_GETMAXSIZE: case TB_GETMAXSIZE:
return TOOLBAR_GetMaxSize (hwnd, wParam, lParam); return TOOLBAR_GetMaxSize (hwnd, lParam);
/* case TB_GETOBJECT: */ /* 4.71 */ /* case TB_GETOBJECT: */ /* 4.71 */
@ -6756,10 +6757,10 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TOOLBAR_GetRect (hwnd, wParam, lParam); return TOOLBAR_GetRect (hwnd, wParam, lParam);
case TB_GETROWS: case TB_GETROWS:
return TOOLBAR_GetRows (hwnd, wParam, lParam); return TOOLBAR_GetRows (hwnd);
case TB_GETSTATE: case TB_GETSTATE:
return TOOLBAR_GetState (hwnd, wParam, lParam); return TOOLBAR_GetState (hwnd, wParam);
case TB_GETSTRINGA: case TB_GETSTRINGA:
return TOOLBAR_GetStringA (hwnd, wParam, lParam); return TOOLBAR_GetStringA (hwnd, wParam, lParam);
@ -6768,16 +6769,16 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TOOLBAR_GetStringW (hwnd, wParam, lParam); return TOOLBAR_GetStringW (hwnd, wParam, lParam);
case TB_GETSTYLE: case TB_GETSTYLE:
return TOOLBAR_GetStyle (hwnd, wParam, lParam); return TOOLBAR_GetStyle (hwnd);
case TB_GETTEXTROWS: case TB_GETTEXTROWS:
return TOOLBAR_GetTextRows (hwnd, wParam, lParam); return TOOLBAR_GetTextRows (hwnd);
case TB_GETTOOLTIPS: case TB_GETTOOLTIPS:
return TOOLBAR_GetToolTips (hwnd, wParam, lParam); return TOOLBAR_GetToolTips (hwnd);
case TB_GETUNICODEFORMAT: case TB_GETUNICODEFORMAT:
return TOOLBAR_GetUnicodeFormat (hwnd, wParam, lParam); return TOOLBAR_GetUnicodeFormat (hwnd);
case TB_HIDEBUTTON: case TB_HIDEBUTTON:
return TOOLBAR_HideButton (hwnd, wParam, lParam); return TOOLBAR_HideButton (hwnd, wParam, lParam);
@ -6914,17 +6915,17 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case TB_UNKWN45D: case TB_UNKWN45D:
return TOOLBAR_Unkwn45D(hwnd, wParam, lParam); return TOOLBAR_Unkwn45D(hwnd, wParam, lParam);
case TB_UNKWN45E: case TB_SETHOTITEM2:
return TOOLBAR_Unkwn45E (hwnd, wParam, lParam); return TOOLBAR_SetHotItem2 (hwnd, wParam, lParam);
case TB_UNKWN460: case TB_SETLISTGAP:
return TOOLBAR_Unkwn460(hwnd, wParam, lParam); return TOOLBAR_SetListGap(hwnd, wParam, lParam);
case TB_UNKWN462: case TB_GETIMAGELISTCOUNT:
return TOOLBAR_Unkwn462(hwnd, wParam, lParam); return TOOLBAR_GetImageListCount(hwnd, wParam, lParam);
case TB_UNKWN463: case TB_GETIDEALSIZE:
return TOOLBAR_Unkwn463 (hwnd, wParam, lParam); return TOOLBAR_GetIdealSize (hwnd, wParam, lParam);
case TB_UNKWN464: case TB_UNKWN464:
return TOOLBAR_Unkwn464(hwnd, wParam, lParam); return TOOLBAR_Unkwn464(hwnd, wParam, lParam);
@ -7046,7 +7047,7 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return DefWindowProcW (hwnd, uMsg, wParam, lParam); return DefWindowProcW (hwnd, uMsg, wParam, lParam);
default: default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP)) if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n", ERR("unknown msg %04x wp=%08lx lp=%08lx\n",
uMsg, wParam, lParam); uMsg, wParam, lParam);
return DefWindowProcW (hwnd, uMsg, wParam, lParam); return DefWindowProcW (hwnd, uMsg, wParam, lParam);
@ -7091,7 +7092,7 @@ static HIMAGELIST TOOLBAR_InsertImageList(PIMLENTRY **pies, INT *cies, HIMAGELIS
{ {
PIMLENTRY *pnies; PIMLENTRY *pnies;
c = (PIMLENTRY) Alloc(sizeof(IMLENTRY)); c = Alloc(sizeof(IMLENTRY));
c->id = id; c->id = id;
pnies = Alloc((*cies + 1) * sizeof(PIMLENTRY)); pnies = Alloc((*cies + 1) * sizeof(PIMLENTRY));

View file

@ -368,7 +368,7 @@ static void TOOLTIPS_GetDispInfoA(HWND hwnd, TOOLTIPS_INFO *infoPtr, TTTOOL_INFO
ttnmdi.hdr.hwndFrom = hwnd; ttnmdi.hdr.hwndFrom = hwnd;
ttnmdi.hdr.idFrom = toolPtr->uId; ttnmdi.hdr.idFrom = toolPtr->uId;
ttnmdi.hdr.code = TTN_GETDISPINFOA; /* == TTN_NEEDTEXTA */ ttnmdi.hdr.code = TTN_GETDISPINFOA; /* == TTN_NEEDTEXTA */
ttnmdi.lpszText = (LPSTR)&ttnmdi.szText; ttnmdi.lpszText = (LPSTR)ttnmdi.szText;
ttnmdi.uFlags = toolPtr->uFlags; ttnmdi.uFlags = toolPtr->uFlags;
ttnmdi.lParam = toolPtr->lParam; ttnmdi.lParam = toolPtr->lParam;
@ -424,7 +424,7 @@ static void TOOLTIPS_GetDispInfoW(HWND hwnd, TOOLTIPS_INFO *infoPtr, TTTOOL_INFO
ttnmdi.hdr.hwndFrom = hwnd; ttnmdi.hdr.hwndFrom = hwnd;
ttnmdi.hdr.idFrom = toolPtr->uId; ttnmdi.hdr.idFrom = toolPtr->uId;
ttnmdi.hdr.code = TTN_GETDISPINFOW; /* == TTN_NEEDTEXTW */ ttnmdi.hdr.code = TTN_GETDISPINFOW; /* == TTN_NEEDTEXTW */
ttnmdi.lpszText = (LPWSTR)&ttnmdi.szText; ttnmdi.lpszText = (LPWSTR)ttnmdi.szText;
ttnmdi.uFlags = toolPtr->uFlags; ttnmdi.uFlags = toolPtr->uFlags;
ttnmdi.lParam = toolPtr->lParam; ttnmdi.lParam = toolPtr->lParam;
@ -1574,6 +1574,9 @@ TOOLTIPS_GetTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
nTool = TOOLTIPS_GetToolFromInfoW (infoPtr, lpToolInfo); nTool = TOOLTIPS_GetToolFromInfoW (infoPtr, lpToolInfo);
if (nTool == -1) return 0; if (nTool == -1) return 0;
if (infoPtr->tools[nTool].lpszText == NULL)
return 0;
strcpyW (lpToolInfo->lpszText, infoPtr->tools[nTool].lpszText); strcpyW (lpToolInfo->lpszText, infoPtr->tools[nTool].lpszText);
return 0; return 0;
@ -2348,7 +2351,7 @@ TOOLTIPS_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
TOOLTIPS_INFO *infoPtr; TOOLTIPS_INFO *infoPtr;
/* allocate memory for info structure */ /* allocate memory for info structure */
infoPtr = (TOOLTIPS_INFO *)Alloc (sizeof(TOOLTIPS_INFO)); infoPtr = Alloc (sizeof(TOOLTIPS_INFO));
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
/* initialize info structure */ /* initialize info structure */
@ -2486,34 +2489,7 @@ static LRESULT
TOOLTIPS_NotifyFormat (HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLTIPS_NotifyFormat (HWND hwnd, WPARAM wParam, LPARAM lParam)
{ {
FIXME ("hwnd=%p wParam=%lx lParam=%lx\n", hwnd, wParam, lParam); FIXME ("hwnd=%p wParam=%lx lParam=%lx\n", hwnd, wParam, lParam);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
TTTOOL_INFO *toolPtr = infoPtr->tools;
INT nResult;
if (lParam == NF_QUERY)
{
if (toolPtr->bNotifyUnicode)
{
return NFR_UNICODE;
} else {
return NFR_ANSI;
}
}
else if (lParam == NF_REQUERY)
{
nResult = (INT) SendMessageW (toolPtr->hwnd, WM_NOTIFYFORMAT,
(WPARAM)hwnd, (LPARAM)NF_QUERY);
if (nResult == NFR_ANSI) {
toolPtr->bNotifyUnicode = FALSE;
TRACE(" -- WM_NOTIFYFORMAT returns: NFR_ANSI\n");
} else if (nResult == NFR_UNICODE) {
toolPtr->bNotifyUnicode = TRUE;
TRACE(" -- WM_NOTIFYFORMAT returns: NFR_UNICODE\n");
} else {
TRACE (" -- WM_NOTIFYFORMAT returns: error!\n");
}
return nResult;
}
return 0; return 0;
} }
@ -2870,7 +2846,7 @@ TOOLTIPS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TOOLTIPS_WinIniChange (hwnd, wParam, lParam); return TOOLTIPS_WinIniChange (hwnd, wParam, lParam);
default: default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP)) if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n", ERR("unknown msg %04x wp=%08lx lp=%08lx\n",
uMsg, wParam, lParam); uMsg, wParam, lParam);
return DefWindowProcW (hwnd, uMsg, wParam, lParam); return DefWindowProcW (hwnd, uMsg, wParam, lParam);

View file

@ -146,12 +146,12 @@ notify_with_scroll (const TRACKBAR_INFO *infoPtr, UINT code)
static void TRACKBAR_RecalculateTics (TRACKBAR_INFO *infoPtr) static void TRACKBAR_RecalculateTics (TRACKBAR_INFO *infoPtr)
{ {
int i, tic, nrTics; int tic;
unsigned nrTics, i;
if (infoPtr->uTicFreq && infoPtr->lRangeMax >= infoPtr->lRangeMin) if (infoPtr->uTicFreq && infoPtr->lRangeMax >= infoPtr->lRangeMin)
nrTics=(infoPtr->lRangeMax - infoPtr->lRangeMin)/infoPtr->uTicFreq; nrTics=(infoPtr->lRangeMax - infoPtr->lRangeMin)/infoPtr->uTicFreq;
else { else {
nrTics = 0;
Free (infoPtr->tics); Free (infoPtr->tics);
infoPtr->tics = NULL; infoPtr->tics = NULL;
infoPtr->uNumTics = 0; infoPtr->uNumTics = 0;
@ -1147,7 +1147,7 @@ TRACKBAR_SetPos (TRACKBAR_INFO *infoPtr, BOOL fPosition, LONG lPosition)
infoPtr->lPos = infoPtr->lRangeMax; infoPtr->lPos = infoPtr->lRangeMax;
infoPtr->flags |= TB_THUMBPOSCHANGED; infoPtr->flags |= TB_THUMBPOSCHANGED;
if (fPosition) TRACKBAR_InvalidateThumbMove(infoPtr, oldPos, lPosition); if (fPosition && oldPos != lPosition) TRACKBAR_InvalidateThumbMove(infoPtr, oldPos, lPosition);
return 0; return 0;
} }
@ -1396,7 +1396,7 @@ TRACKBAR_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
TRACKBAR_INFO *infoPtr; TRACKBAR_INFO *infoPtr;
DWORD dwStyle; DWORD dwStyle;
infoPtr = (TRACKBAR_INFO *)Alloc (sizeof(TRACKBAR_INFO)); infoPtr = Alloc (sizeof(TRACKBAR_INFO));
if (!infoPtr) return -1; if (!infoPtr) return -1;
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
@ -1452,6 +1452,9 @@ TRACKBAR_Destroy (TRACKBAR_INFO *infoPtr)
if (infoPtr->hwndToolTip) if (infoPtr->hwndToolTip)
DestroyWindow (infoPtr->hwndToolTip); DestroyWindow (infoPtr->hwndToolTip);
Free (infoPtr->tics);
infoPtr->tics = NULL;
SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0); SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0);
CloseThemeData (GetWindowTheme (infoPtr->hwndSelf)); CloseThemeData (GetWindowTheme (infoPtr->hwndSelf));
Free (infoPtr); Free (infoPtr);
@ -1461,7 +1464,7 @@ TRACKBAR_Destroy (TRACKBAR_INFO *infoPtr)
static LRESULT static LRESULT
TRACKBAR_KillFocus (TRACKBAR_INFO *infoPtr, HWND hwndGetFocus) TRACKBAR_KillFocus (TRACKBAR_INFO *infoPtr)
{ {
TRACE("\n"); TRACE("\n");
infoPtr->bFocussed = FALSE; infoPtr->bFocussed = FALSE;
@ -1471,7 +1474,7 @@ TRACKBAR_KillFocus (TRACKBAR_INFO *infoPtr, HWND hwndGetFocus)
} }
static LRESULT static LRESULT
TRACKBAR_LButtonDown (TRACKBAR_INFO *infoPtr, DWORD fwKeys, INT x, INT y) TRACKBAR_LButtonDown (TRACKBAR_INFO *infoPtr, INT x, INT y)
{ {
POINT clickPoint; POINT clickPoint;
@ -1500,7 +1503,7 @@ TRACKBAR_LButtonDown (TRACKBAR_INFO *infoPtr, DWORD fwKeys, INT x, INT y)
static LRESULT static LRESULT
TRACKBAR_LButtonUp (TRACKBAR_INFO *infoPtr, DWORD fwKeys, INT x, INT y) TRACKBAR_LButtonUp (TRACKBAR_INFO *infoPtr)
{ {
if (infoPtr->flags & TB_DRAG_MODE) { if (infoPtr->flags & TB_DRAG_MODE) {
notify_with_scroll (infoPtr, TB_THUMBPOSITION | (infoPtr->lPos<<16)); notify_with_scroll (infoPtr, TB_THUMBPOSITION | (infoPtr->lPos<<16));
@ -1548,7 +1551,7 @@ TRACKBAR_Paint (TRACKBAR_INFO *infoPtr, HDC hdc)
static LRESULT static LRESULT
TRACKBAR_SetFocus (TRACKBAR_INFO *infoPtr, HWND hwndLoseFocus) TRACKBAR_SetFocus (TRACKBAR_INFO *infoPtr)
{ {
TRACE("\n"); TRACE("\n");
infoPtr->bFocussed = TRUE; infoPtr->bFocussed = TRUE;
@ -1559,7 +1562,7 @@ TRACKBAR_SetFocus (TRACKBAR_INFO *infoPtr, HWND hwndLoseFocus)
static LRESULT static LRESULT
TRACKBAR_Size (TRACKBAR_INFO *infoPtr, DWORD fwSizeType, INT nWidth, INT nHeight) TRACKBAR_Size (TRACKBAR_INFO *infoPtr)
{ {
TRACKBAR_InitializeThumb (infoPtr); TRACKBAR_InitializeThumb (infoPtr);
TRACKBAR_AlignBuddies (infoPtr); TRACKBAR_AlignBuddies (infoPtr);
@ -1569,7 +1572,7 @@ TRACKBAR_Size (TRACKBAR_INFO *infoPtr, DWORD fwSizeType, INT nWidth, INT nHeight
static LRESULT static LRESULT
TRACKBAR_Timer (TRACKBAR_INFO *infoPtr, INT wTimerID, const TIMERPROC *tmrpc) TRACKBAR_Timer (TRACKBAR_INFO *infoPtr)
{ {
if (infoPtr->flags & TB_AUTO_PAGE) { if (infoPtr->flags & TB_AUTO_PAGE) {
POINT pt; POINT pt;
@ -1586,13 +1589,13 @@ static LRESULT theme_changed (const TRACKBAR_INFO* infoPtr)
{ {
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
CloseThemeData (theme); CloseThemeData (theme);
theme = OpenThemeData (infoPtr->hwndSelf, themeClass); OpenThemeData (infoPtr->hwndSelf, themeClass);
return 0; return 0;
} }
static LRESULT static LRESULT
TRACKBAR_MouseMove (TRACKBAR_INFO *infoPtr, DWORD fwKeys, INT x, INT y) TRACKBAR_MouseMove (TRACKBAR_INFO *infoPtr, INT x, INT y)
{ {
DWORD dwStyle = GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE); DWORD dwStyle = GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE);
INT clickPlace = (dwStyle & TBS_VERT) ? y : x; INT clickPlace = (dwStyle & TBS_VERT) ? y : x;
@ -1656,7 +1659,7 @@ TRACKBAR_MouseMove (TRACKBAR_INFO *infoPtr, DWORD fwKeys, INT x, INT y)
} }
static BOOL static BOOL
TRACKBAR_KeyDown (TRACKBAR_INFO *infoPtr, INT nVirtKey, DWORD lKeyData) TRACKBAR_KeyDown (TRACKBAR_INFO *infoPtr, INT nVirtKey)
{ {
DWORD style = GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE); DWORD style = GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE);
BOOL downIsLeft = style & TBS_DOWNISLEFT; BOOL downIsLeft = style & TBS_DOWNISLEFT;
@ -1712,7 +1715,7 @@ TRACKBAR_KeyDown (TRACKBAR_INFO *infoPtr, INT nVirtKey, DWORD lKeyData)
static inline BOOL static inline BOOL
TRACKBAR_KeyUp (const TRACKBAR_INFO *infoPtr, INT nVirtKey, DWORD lKeyData) TRACKBAR_KeyUp (const TRACKBAR_INFO *infoPtr, INT nVirtKey)
{ {
switch (nVirtKey) { switch (nVirtKey) {
case VK_LEFT: case VK_LEFT:
@ -1865,19 +1868,19 @@ TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return DLGC_WANTARROWS; return DLGC_WANTARROWS;
case WM_KEYDOWN: case WM_KEYDOWN:
return TRACKBAR_KeyDown (infoPtr, (INT)wParam, (DWORD)lParam); return TRACKBAR_KeyDown (infoPtr, (INT)wParam);
case WM_KEYUP: case WM_KEYUP:
return TRACKBAR_KeyUp (infoPtr, (INT)wParam, (DWORD)lParam); return TRACKBAR_KeyUp (infoPtr, (INT)wParam);
case WM_KILLFOCUS: case WM_KILLFOCUS:
return TRACKBAR_KillFocus (infoPtr, (HWND)wParam); return TRACKBAR_KillFocus (infoPtr);
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
return TRACKBAR_LButtonDown (infoPtr, wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam)); return TRACKBAR_LButtonDown (infoPtr, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
case WM_LBUTTONUP: case WM_LBUTTONUP:
return TRACKBAR_LButtonUp (infoPtr, wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam)); return TRACKBAR_LButtonUp (infoPtr);
case WM_MOUSELEAVE: case WM_MOUSELEAVE:
infoPtr->flags &= ~TB_THUMB_HOT; infoPtr->flags &= ~TB_THUMB_HOT;
@ -1885,29 +1888,29 @@ TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return 0; return 0;
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
return TRACKBAR_MouseMove (infoPtr, wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam)); return TRACKBAR_MouseMove (infoPtr, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
case WM_PRINTCLIENT: case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
return TRACKBAR_Paint (infoPtr, (HDC)wParam); return TRACKBAR_Paint (infoPtr, (HDC)wParam);
case WM_SETFOCUS: case WM_SETFOCUS:
return TRACKBAR_SetFocus (infoPtr, (HWND)wParam); return TRACKBAR_SetFocus (infoPtr);
case WM_SIZE: case WM_SIZE:
return TRACKBAR_Size (infoPtr, wParam, LOWORD(lParam), HIWORD(lParam)); return TRACKBAR_Size (infoPtr);
case WM_THEMECHANGED: case WM_THEMECHANGED:
return theme_changed (infoPtr); return theme_changed (infoPtr);
case WM_TIMER: case WM_TIMER:
return TRACKBAR_Timer (infoPtr, (INT)wParam, (TIMERPROC *)lParam); return TRACKBAR_Timer (infoPtr);
case WM_WININICHANGE: case WM_WININICHANGE:
return TRACKBAR_InitializeThumb (infoPtr); return TRACKBAR_InitializeThumb (infoPtr);
default: default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP)) if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam); ERR("unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam);
return DefWindowProcW (hwnd, uMsg, wParam, lParam); return DefWindowProcW (hwnd, uMsg, wParam, lParam);
} }

View file

@ -23,8 +23,7 @@
* *
* Note that TREEVIEW_INFO * and HTREEITEM are the same thing. * Note that TREEVIEW_INFO * and HTREEITEM are the same thing.
* *
* Note2: All items always! have valid (allocated) pszText field. * Note2: If item's text == LPSTR_TEXTCALLBACKA we allocate buffer
* If item's text == LPSTR_TEXTCALLBACKA we allocate buffer
* of size TEXT_CALLBACK_SIZE in DoSetItem. * of size TEXT_CALLBACK_SIZE in DoSetItem.
* We use callbackMask to keep track of fields to be updated. * We use callbackMask to keep track of fields to be updated.
* *
@ -752,7 +751,7 @@ TREEVIEW_UpdateDispInfo(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
(LPSTR)callback.item.pszText, -1, (LPSTR)callback.item.pszText, -1,
NULL, 0); NULL, 0);
buflen = max((len)*sizeof(WCHAR), TEXT_CALLBACK_SIZE); buflen = max((len)*sizeof(WCHAR), TEXT_CALLBACK_SIZE);
newText = (LPWSTR)ReAlloc(wineItem->pszText, buflen); newText = ReAlloc(wineItem->pszText, buflen);
TRACE("returned str %s, len=%d, buflen=%d\n", TRACE("returned str %s, len=%d, buflen=%d\n",
debugstr_a((LPSTR)callback.item.pszText), len, buflen); debugstr_a((LPSTR)callback.item.pszText), len, buflen);
@ -794,7 +793,7 @@ TREEVIEW_UpdateDispInfo(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
(LPSTR)callback.item.pszText, -1, (LPSTR)callback.item.pszText, -1,
NULL, 0); NULL, 0);
buflen = max((len)*sizeof(WCHAR), TEXT_CALLBACK_SIZE); buflen = max((len)*sizeof(WCHAR), TEXT_CALLBACK_SIZE);
newText = (LPWSTR)Alloc(buflen); newText = Alloc(buflen);
TRACE("same buffer str %s, len=%d, buflen=%d\n", TRACE("same buffer str %s, len=%d, buflen=%d\n",
debugstr_a((LPSTR)callback.item.pszText), len, buflen); debugstr_a((LPSTR)callback.item.pszText), len, buflen);
@ -859,7 +858,7 @@ TREEVIEW_ComputeItemInternalMetrics(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM
> TVS_LINESATROOT); > TVS_LINESATROOT);
#endif #endif
item->linesOffset = infoPtr->uIndent * (item->iLevel + lar - 1) item->linesOffset = infoPtr->uIndent * (lar ? item->iLevel : item->iLevel - 1)
- infoPtr->scrollX; - infoPtr->scrollX;
item->stateOffset = item->linesOffset + infoPtr->uIndent; item->stateOffset = item->linesOffset + infoPtr->uIndent;
item->imageOffset = item->stateOffset item->imageOffset = item->stateOffset
@ -1221,7 +1220,7 @@ TREEVIEW_InsertItemT(TREEVIEW_INFO *infoPtr, const TVINSERTSTRUCTW *ptdi, BOOL i
if (!TREEVIEW_ValidItem(infoPtr, parentItem)) if (!TREEVIEW_ValidItem(infoPtr, parentItem))
{ {
WARN("invalid parent %p\n", parentItem); WARN("invalid parent %p\n", parentItem);
return (LRESULT)(HTREEITEM)NULL; return 0;
} }
} }
@ -1252,13 +1251,13 @@ TREEVIEW_InsertItemT(TREEVIEW_INFO *infoPtr, const TVINSERTSTRUCTW *ptdi, BOOL i
newItem = TREEVIEW_AllocateItem(infoPtr); newItem = TREEVIEW_AllocateItem(infoPtr);
if (newItem == NULL) if (newItem == NULL)
return (LRESULT)(HTREEITEM)NULL; return 0;
newItem->parent = parentItem; newItem->parent = parentItem;
newItem->iIntegral = 1; newItem->iIntegral = 1;
if (!TREEVIEW_DoSetItemT(infoPtr, newItem, tvItem, isW)) if (!TREEVIEW_DoSetItemT(infoPtr, newItem, tvItem, isW))
return (LRESULT)(HTREEITEM)NULL; return 0;
/* After this point, nothing can fail. (Except for TVI_SORT.) */ /* After this point, nothing can fail. (Except for TVI_SORT.) */
@ -1585,7 +1584,7 @@ TREEVIEW_DeleteItem(TREEVIEW_INFO *infoPtr, HTREEITEM wineItem)
/* Get/Set Messages *********************************************************/ /* Get/Set Messages *********************************************************/
static LRESULT static LRESULT
TREEVIEW_SetRedraw(TREEVIEW_INFO* infoPtr, WPARAM wParam, LPARAM lParam) TREEVIEW_SetRedraw(TREEVIEW_INFO* infoPtr, WPARAM wParam)
{ {
if(wParam) if(wParam)
infoPtr->bRedraw = TRUE; infoPtr->bRedraw = TRUE;
@ -2083,7 +2082,12 @@ TREEVIEW_GetItemT(const TREEVIEW_INFO *infoPtr, LPTVITEMEXW tvItem, BOOL isW)
if (tvItem->mask & TVIF_TEXT) if (tvItem->mask & TVIF_TEXT)
{ {
if (isW) if (wineItem->pszText == NULL)
{
if (tvItem->cchTextMax > 0)
tvItem->pszText[0] = '\0';
}
else if (isW)
{ {
if (wineItem->pszText == LPSTR_TEXTCALLBACKW) if (wineItem->pszText == LPSTR_TEXTCALLBACKW)
{ {
@ -2826,6 +2830,8 @@ TREEVIEW_Refresh(TREEVIEW_INFO *infoPtr, HDC hdc, const RECT *rc)
} }
} }
TREEVIEW_UpdateScrollBars(infoPtr);
if (infoPtr->cdmode & CDRF_NOTIFYPOSTPAINT) if (infoPtr->cdmode & CDRF_NOTIFYPOSTPAINT)
infoPtr->cdmode = infoPtr->cdmode =
TREEVIEW_SendCustomDrawNotify(infoPtr, CDDS_POSTPAINT, hdc, rect); TREEVIEW_SendCustomDrawNotify(infoPtr, CDDS_POSTPAINT, hdc, rect);
@ -2908,7 +2914,7 @@ TREEVIEW_SortOnName(TREEVIEW_ITEM *first, TREEVIEW_ITEM *second,
/* Returns the number of physical children belonging to item. */ /* Returns the number of physical children belonging to item. */
static INT static INT
TREEVIEW_CountChildren(const TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item) TREEVIEW_CountChildren(const TREEVIEW_ITEM *item)
{ {
INT cChildren = 0; INT cChildren = 0;
HTREEITEM hti; HTREEITEM hti;
@ -2922,7 +2928,7 @@ TREEVIEW_CountChildren(const TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item)
/* Returns a DPA containing a pointer to each physical child of item in /* Returns a DPA containing a pointer to each physical child of item in
* sibling order. If item has no children, an empty DPA is returned. */ * sibling order. If item has no children, an empty DPA is returned. */
static HDPA static HDPA
TREEVIEW_BuildChildDPA(const TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item) TREEVIEW_BuildChildDPA(const TREEVIEW_ITEM *item)
{ {
HTREEITEM child = item->firstChild; HTREEITEM child = item->firstChild;
@ -2953,7 +2959,7 @@ TREEVIEW_BuildChildDPA(const TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item)
*/ */
static LRESULT static LRESULT
TREEVIEW_Sort(TREEVIEW_INFO *infoPtr, BOOL fRecurse, HTREEITEM parent, TREEVIEW_Sort(TREEVIEW_INFO *infoPtr, HTREEITEM parent,
LPTVSORTCB pSort) LPTVSORTCB pSort)
{ {
INT cChildren; INT cChildren;
@ -2982,7 +2988,7 @@ TREEVIEW_Sort(TREEVIEW_INFO *infoPtr, BOOL fRecurse, HTREEITEM parent,
lpCompare = (LPARAM)infoPtr; lpCompare = (LPARAM)infoPtr;
} }
cChildren = TREEVIEW_CountChildren(infoPtr, parent); cChildren = TREEVIEW_CountChildren(parent);
/* Make sure there is something to sort */ /* Make sure there is something to sort */
if (cChildren > 1) if (cChildren > 1)
@ -2993,7 +2999,7 @@ TREEVIEW_Sort(TREEVIEW_INFO *infoPtr, BOOL fRecurse, HTREEITEM parent,
HTREEITEM nextItem = 0; HTREEITEM nextItem = 0;
HTREEITEM prevItem = 0; HTREEITEM prevItem = 0;
HDPA sortList = TREEVIEW_BuildChildDPA(infoPtr, parent); HDPA sortList = TREEVIEW_BuildChildDPA(parent);
if (sortList == NULL) if (sortList == NULL)
return FALSE; return FALSE;
@ -3004,8 +3010,8 @@ TREEVIEW_Sort(TREEVIEW_INFO *infoPtr, BOOL fRecurse, HTREEITEM parent,
/* The order of DPA entries has been changed, so fixup the /* The order of DPA entries has been changed, so fixup the
* nextSibling and prevSibling pointers. */ * nextSibling and prevSibling pointers. */
item = (HTREEITEM)DPA_GetPtr(sortList, count++); item = DPA_GetPtr(sortList, count++);
while ((nextItem = (HTREEITEM)DPA_GetPtr(sortList, count++)) != NULL) while ((nextItem = DPA_GetPtr(sortList, count++)) != NULL)
{ {
/* link the two current item together */ /* link the two current item together */
item->nextSibling = nextItem; item->nextSibling = nextItem;
@ -3074,9 +3080,9 @@ TREEVIEW_Sort(TREEVIEW_INFO *infoPtr, BOOL fRecurse, HTREEITEM parent,
* and sort the children of the TV item specified in lParam * and sort the children of the TV item specified in lParam
*/ */
static LRESULT static LRESULT
TREEVIEW_SortChildrenCB(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPTVSORTCB pSort) TREEVIEW_SortChildrenCB(TREEVIEW_INFO *infoPtr, LPTVSORTCB pSort)
{ {
return TREEVIEW_Sort(infoPtr, wParam, pSort->hParent, pSort); return TREEVIEW_Sort(infoPtr, pSort->hParent, pSort);
} }
@ -3084,9 +3090,9 @@ TREEVIEW_SortChildrenCB(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPTVSORTCB pSort)
* Sort the children of the TV item specified in lParam. * Sort the children of the TV item specified in lParam.
*/ */
static LRESULT static LRESULT
TREEVIEW_SortChildren(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam) TREEVIEW_SortChildren(TREEVIEW_INFO *infoPtr, LPARAM lParam)
{ {
return TREEVIEW_Sort(infoPtr, (BOOL)wParam, (HTREEITEM)lParam, NULL); return TREEVIEW_Sort(infoPtr, (HTREEITEM)lParam, NULL);
} }
@ -3292,7 +3298,7 @@ TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
scrollDist = nextItem->rect.top - orgNextTop; scrollDist = nextItem->rect.top - orgNextTop;
scrollRect.top = orgNextTop; scrollRect.top = orgNextTop;
ScrollWindowEx (infoPtr->hwnd, 0, scrollDist, &scrollRect, &scrollRect, ScrollWindowEx (infoPtr->hwnd, 0, scrollDist, &scrollRect, NULL,
NULL, NULL, SW_ERASE | SW_INVALIDATE); NULL, NULL, SW_ERASE | SW_INVALIDATE);
TREEVIEW_Invalidate (infoPtr, wineItem); TREEVIEW_Invalidate (infoPtr, wineItem);
} else { } else {
@ -3455,14 +3461,14 @@ TREEVIEW_HitTest(const TREEVIEW_INFO *infoPtr, LPTVHITTESTINFO lpht)
if (status) if (status)
{ {
lpht->flags = status; lpht->flags = status;
return (LRESULT)(HTREEITEM)NULL; return 0;
} }
wineItem = TREEVIEW_HitTestPoint(infoPtr, lpht->pt); wineItem = TREEVIEW_HitTestPoint(infoPtr, lpht->pt);
if (!wineItem) if (!wineItem)
{ {
lpht->flags = TVHT_NOWHERE; lpht->flags = TVHT_NOWHERE;
return (LRESULT)(HTREEITEM)NULL; return 0;
} }
if (x >= wineItem->textOffset + wineItem->textWidth) if (x >= wineItem->textOffset + wineItem->textWidth)
@ -3660,8 +3666,11 @@ TREEVIEW_EditLabel(TREEVIEW_INFO *infoPtr, HTREEITEM hItem)
} }
/* Get string length in pixels */ /* Get string length in pixels */
if (editItem->pszText)
GetTextExtentPoint32W(hdc, editItem->pszText, strlenW(editItem->pszText), GetTextExtentPoint32W(hdc, editItem->pszText, strlenW(editItem->pszText),
&sz); &sz);
else
GetTextExtentPoint32A(hdc, "", 0, &sz);
/* Add Extra spacing for the next character */ /* Add Extra spacing for the next character */
GetTextMetricsW(hdc, &textMetric); GetTextMetricsW(hdc, &textMetric);
@ -3710,7 +3719,10 @@ TREEVIEW_EditLabel(TREEVIEW_INFO *infoPtr, HTREEITEM hItem)
} }
infoPtr->selectedItem = hItem; infoPtr->selectedItem = hItem;
if (editItem->pszText)
SetWindowTextW(hwndEdit, editItem->pszText); SetWindowTextW(hwndEdit, editItem->pszText);
SetFocus(hwndEdit); SetFocus(hwndEdit);
SendMessageW(hwndEdit, EM_SETSEL, 0, -1); SendMessageW(hwndEdit, EM_SETSEL, 0, -1);
ShowWindow(hwndEdit, SW_SHOW); ShowWindow(hwndEdit, SW_SHOW);
@ -4158,7 +4170,7 @@ TREEVIEW_RButtonUp(const TREEVIEW_INFO *infoPtr, const POINT *pPt)
static LRESULT static LRESULT
TREEVIEW_CreateDragImage(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam) TREEVIEW_CreateDragImage(TREEVIEW_INFO *infoPtr, LPARAM lParam)
{ {
TREEVIEW_ITEM *dragItem = (HTREEITEM)lParam; TREEVIEW_ITEM *dragItem = (HTREEITEM)lParam;
INT cx, cy; INT cx, cy;
@ -4184,10 +4196,14 @@ TREEVIEW_CreateDragImage(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
hdc = CreateCompatibleDC(htopdc); hdc = CreateCompatibleDC(htopdc);
hOldFont = SelectObject(hdc, infoPtr->hFont); hOldFont = SelectObject(hdc, infoPtr->hFont);
if (dragItem->pszText)
GetTextExtentPoint32W(hdc, dragItem->pszText, strlenW(dragItem->pszText), GetTextExtentPoint32W(hdc, dragItem->pszText, strlenW(dragItem->pszText),
&size); &size);
TRACE("%d %d %s %d\n", size.cx, size.cy, debugstr_w(dragItem->pszText), else
strlenW(dragItem->pszText)); GetTextExtentPoint32A(hdc, "", 0, &size);
TRACE("%d %d %s\n", size.cx, size.cy, debugstr_w(dragItem->pszText));
hbmp = CreateCompatibleBitmap(htopdc, size.cx, size.cy); hbmp = CreateCompatibleBitmap(htopdc, size.cx, size.cy);
hOldbmp = SelectObject(hdc, hbmp); hOldbmp = SelectObject(hdc, hbmp);
@ -4208,8 +4224,11 @@ TREEVIEW_CreateDragImage(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
/* draw item text */ /* draw item text */
SetRect(&rc, cx, 0, size.cx, size.cy); SetRect(&rc, cx, 0, size.cx, size.cy);
if (dragItem->pszText)
DrawTextW(hdc, dragItem->pszText, strlenW(dragItem->pszText), &rc, DrawTextW(hdc, dragItem->pszText, strlenW(dragItem->pszText), &rc,
DT_LEFT); DT_LEFT);
SelectObject(hdc, hOldFont); SelectObject(hdc, hOldFont);
SelectObject(hdc, hOldbmp); SelectObject(hdc, hOldbmp);
@ -4877,7 +4896,7 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
TRACE("wnd %p, style %x\n", hwnd, GetWindowLongW(hwnd, GWL_STYLE)); TRACE("wnd %p, style %x\n", hwnd, GetWindowLongW(hwnd, GWL_STYLE));
infoPtr = (TREEVIEW_INFO *)Alloc(sizeof(TREEVIEW_INFO)); infoPtr = Alloc(sizeof(TREEVIEW_INFO));
if (infoPtr == NULL) if (infoPtr == NULL)
{ {
@ -5000,7 +5019,7 @@ TREEVIEW_Destroy(TREEVIEW_INFO *infoPtr)
CloseThemeData (GetWindowTheme (infoPtr->hwnd)); CloseThemeData (GetWindowTheme (infoPtr->hwnd));
/* Deassociate treeview from the window before doing anything drastic. */ /* Deassociate treeview from the window before doing anything drastic. */
SetWindowLongPtrW(infoPtr->hwnd, 0, (DWORD_PTR)NULL); SetWindowLongPtrW(infoPtr->hwnd, 0, 0);
DeleteObject(infoPtr->hDefaultFont); DeleteObject(infoPtr->hDefaultFont);
@ -5186,7 +5205,7 @@ TREEVIEW_MouseLeave (TREEVIEW_INFO * infoPtr)
} }
static LRESULT static LRESULT
TREEVIEW_MouseMove (TREEVIEW_INFO * infoPtr, WPARAM wParam, LPARAM lParam) TREEVIEW_MouseMove (TREEVIEW_INFO * infoPtr, LPARAM lParam)
{ {
POINT pt; POINT pt;
TRACKMOUSEEVENT trackinfo; TRACKMOUSEEVENT trackinfo;
@ -5451,7 +5470,7 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
switch (uMsg) switch (uMsg)
{ {
case TVM_CREATEDRAGIMAGE: case TVM_CREATEDRAGIMAGE:
return TREEVIEW_CreateDragImage(infoPtr, wParam, lParam); return TREEVIEW_CreateDragImage(infoPtr, lParam);
case TVM_DELETEITEM: case TVM_DELETEITEM:
return TREEVIEW_DeleteItem(infoPtr, (HTREEITEM)lParam); return TREEVIEW_DeleteItem(infoPtr, (HTREEITEM)lParam);
@ -5585,10 +5604,10 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TREEVIEW_SetUnicodeFormat(infoPtr, (BOOL)wParam); return TREEVIEW_SetUnicodeFormat(infoPtr, (BOOL)wParam);
case TVM_SORTCHILDREN: case TVM_SORTCHILDREN:
return TREEVIEW_SortChildren(infoPtr, wParam, lParam); return TREEVIEW_SortChildren(infoPtr, lParam);
case TVM_SORTCHILDRENCB: case TVM_SORTCHILDRENCB:
return TREEVIEW_SortChildrenCB(infoPtr, wParam, (LPTVSORTCB)lParam); return TREEVIEW_SortChildrenCB(infoPtr, (LPTVSORTCB)lParam);
case WM_CHAR: case WM_CHAR:
return TREEVIEW_ProcessLetterKeys( hwnd, wParam, lParam ); return TREEVIEW_ProcessLetterKeys( hwnd, wParam, lParam );
@ -5632,7 +5651,7 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
if (infoPtr->dwStyle & TVS_TRACKSELECT) if (infoPtr->dwStyle & TVS_TRACKSELECT)
return TREEVIEW_MouseMove(infoPtr, wParam, lParam); return TREEVIEW_MouseMove(infoPtr, lParam);
else else
return 0; return 0;
@ -5669,7 +5688,7 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TREEVIEW_SetFont(infoPtr, (HFONT)wParam, (BOOL)lParam); return TREEVIEW_SetFont(infoPtr, (HFONT)wParam, (BOOL)lParam);
case WM_SETREDRAW: case WM_SETREDRAW:
return TREEVIEW_SetRedraw(infoPtr, wParam, lParam); return TREEVIEW_SetRedraw(infoPtr, wParam);
case WM_SIZE: case WM_SIZE:
return TREEVIEW_Size(infoPtr, wParam, lParam); return TREEVIEW_Size(infoPtr, wParam, lParam);
@ -5703,7 +5722,7 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
default: default:
/* This mostly catches MFC and Delphi messages. :( */ /* This mostly catches MFC and Delphi messages. :( */
if ((uMsg >= WM_USER) && (uMsg < WM_APP)) if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
TRACE("Unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam); TRACE("Unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam);
def: def:
return DefWindowProcW(hwnd, uMsg, wParam, lParam); return DefWindowProcW(hwnd, uMsg, wParam, lParam);

View file

@ -817,7 +817,6 @@ static void UPDOWN_HandleMouseEvent (UPDOWN_INFO *infoPtr, UINT msg, INT x, INT
static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
UPDOWN_INFO *infoPtr = UPDOWN_GetInfoPtr (hwnd); UPDOWN_INFO *infoPtr = UPDOWN_GetInfoPtr (hwnd);
int temp;
static const WCHAR themeClass[] = {'S','p','i','n',0}; static const WCHAR themeClass[] = {'S','p','i','n',0};
HTHEME theme; HTHEME theme;
@ -829,7 +828,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
switch(message) switch(message)
{ {
case WM_CREATE: case WM_CREATE:
infoPtr = (UPDOWN_INFO*)Alloc (sizeof(UPDOWN_INFO)); infoPtr = Alloc (sizeof(UPDOWN_INFO));
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
/* initialize the info struct */ /* initialize the info struct */
@ -903,6 +902,8 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
/* if initial timer, kill it and start the repeat timer */ /* if initial timer, kill it and start the repeat timer */
if(wParam == TIMER_AUTOREPEAT) { if(wParam == TIMER_AUTOREPEAT) {
int temp;
KillTimer(hwnd, TIMER_AUTOREPEAT); KillTimer(hwnd, TIMER_AUTOREPEAT);
/* if no accel info given, used default timer */ /* if no accel info given, used default timer */
if(infoPtr->AccelCount==0 || infoPtr->AccelVect==0) { if(infoPtr->AccelCount==0 || infoPtr->AccelVect==0) {
@ -917,6 +918,8 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
/* now, if the mouse is above us, do the thing...*/ /* now, if the mouse is above us, do the thing...*/
if(infoPtr->Flags & FLAG_MOUSEIN) { if(infoPtr->Flags & FLAG_MOUSEIN) {
int temp;
temp = infoPtr->AccelIndex == -1 ? 1 : infoPtr->AccelVect[infoPtr->AccelIndex].nInc; temp = infoPtr->AccelIndex == -1 ? 1 : infoPtr->AccelVect[infoPtr->AccelIndex].nInc;
UPDOWN_DoAction(infoPtr, temp, infoPtr->Flags & FLAG_ARROW); UPDOWN_DoAction(infoPtr, temp, infoPtr->Flags & FLAG_ARROW);
@ -972,13 +975,16 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
case UDM_GETACCEL: case UDM_GETACCEL:
if (wParam==0 && lParam==0) return infoPtr->AccelCount; if (wParam==0 && lParam==0) return infoPtr->AccelCount;
if (wParam && lParam) { if (wParam && lParam) {
temp = min(infoPtr->AccelCount, wParam); int temp = min(infoPtr->AccelCount, wParam);
memcpy((void *)lParam, infoPtr->AccelVect, temp*sizeof(UDACCEL)); memcpy((void *)lParam, infoPtr->AccelVect, temp*sizeof(UDACCEL));
return temp; return temp;
} }
return 0; return 0;
case UDM_SETACCEL: case UDM_SETACCEL:
{
unsigned temp;
TRACE("UDM_SETACCEL\n"); TRACE("UDM_SETACCEL\n");
if(infoPtr->AccelVect) { if(infoPtr->AccelVect) {
@ -996,14 +1002,14 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
TRACE("%d: nSec %u nInc %u\n", temp, infoPtr->AccelVect[temp].nSec, infoPtr->AccelVect[temp].nInc); TRACE("%d: nSec %u nInc %u\n", temp, infoPtr->AccelVect[temp].nSec, infoPtr->AccelVect[temp].nInc);
return TRUE; return TRUE;
}
case UDM_GETBASE: case UDM_GETBASE:
return infoPtr->Base; return infoPtr->Base;
case UDM_SETBASE: case UDM_SETBASE:
TRACE("UpDown Ctrl new base(%ld), hwnd=%p\n", wParam, hwnd); TRACE("UpDown Ctrl new base(%ld), hwnd=%p\n", wParam, hwnd);
if (wParam==10 || wParam==16) { if (wParam==10 || wParam==16) {
temp = infoPtr->Base; WPARAM temp = infoPtr->Base;
infoPtr->Base = wParam; infoPtr->Base = wParam;
return temp; return temp;
} }
@ -1016,11 +1022,14 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
return (LRESULT)UPDOWN_SetBuddy (infoPtr, (HWND)wParam); return (LRESULT)UPDOWN_SetBuddy (infoPtr, (HWND)wParam);
case UDM_GETPOS: case UDM_GETPOS:
temp = UPDOWN_GetBuddyInt (infoPtr); {
int temp = UPDOWN_GetBuddyInt (infoPtr);
return MAKELONG(infoPtr->CurVal, temp ? 0 : 1); return MAKELONG(infoPtr->CurVal, temp ? 0 : 1);
}
case UDM_SETPOS: case UDM_SETPOS:
temp = (short)LOWORD(lParam); {
int temp = (short)LOWORD(lParam);
TRACE("UpDown Ctrl new value(%d), hwnd=%p\n", temp, hwnd); TRACE("UpDown Ctrl new value(%d), hwnd=%p\n", temp, hwnd);
if(!UPDOWN_InBounds(infoPtr, temp)) { if(!UPDOWN_InBounds(infoPtr, temp)) {
if(temp < infoPtr->MinVal) temp = infoPtr->MinVal; if(temp < infoPtr->MinVal) temp = infoPtr->MinVal;
@ -1030,7 +1039,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
infoPtr->CurVal = temp; infoPtr->CurVal = temp;
UPDOWN_SetBuddyInt (infoPtr); UPDOWN_SetBuddyInt (infoPtr);
return wParam; /* return prev value */ return wParam; /* return prev value */
}
case UDM_GETRANGE: case UDM_GETRANGE:
return MAKELONG(infoPtr->MaxVal, infoPtr->MinVal); return MAKELONG(infoPtr->MaxVal, infoPtr->MinVal);
@ -1062,6 +1071,9 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
return infoPtr->CurVal; return infoPtr->CurVal;
case UDM_SETPOS32: case UDM_SETPOS32:
{
int temp;
if(!UPDOWN_InBounds(infoPtr, (int)lParam)) { if(!UPDOWN_InBounds(infoPtr, (int)lParam)) {
if((int)lParam < infoPtr->MinVal) lParam = infoPtr->MinVal; if((int)lParam < infoPtr->MinVal) lParam = infoPtr->MinVal;
if((int)lParam > infoPtr->MaxVal) lParam = infoPtr->MaxVal; if((int)lParam > infoPtr->MaxVal) lParam = infoPtr->MaxVal;
@ -1070,19 +1082,20 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
infoPtr->CurVal = (int)lParam; /* set the new value */ infoPtr->CurVal = (int)lParam; /* set the new value */
UPDOWN_SetBuddyInt (infoPtr); UPDOWN_SetBuddyInt (infoPtr);
return temp; /* return prev value */ return temp; /* return prev value */
}
case UDM_GETUNICODEFORMAT: case UDM_GETUNICODEFORMAT:
/* we lie a bit here, we're always using Unicode internally */ /* we lie a bit here, we're always using Unicode internally */
return infoPtr->UnicodeFormat; return infoPtr->UnicodeFormat;
case UDM_SETUNICODEFORMAT: case UDM_SETUNICODEFORMAT:
{
/* do we really need to honour this flag? */ /* do we really need to honour this flag? */
temp = infoPtr->UnicodeFormat; int temp = infoPtr->UnicodeFormat;
infoPtr->UnicodeFormat = (BOOL)wParam; infoPtr->UnicodeFormat = (BOOL)wParam;
return temp; return temp;
}
default: default:
if ((message >= WM_USER) && (message < WM_APP)) if ((message >= WM_USER) && (message < WM_APP) && !COMCTL32_IsReflectedMessage(message))
ERR("unknown msg %04x wp=%04lx lp=%08lx\n", message, wParam, lParam); ERR("unknown msg %04x wp=%04lx lp=%08lx\n", message, wParam, lParam);
return DefWindowProcW (hwnd, message, wParam, lParam); return DefWindowProcW (hwnd, message, wParam, lParam);
} }