comctl32: Invalid format returned by NF_QUERY defaults to ANSI in treeview.
This commit is contained in:
parent
fcb9c5fadb
commit
55ff254986
|
@ -956,6 +956,10 @@ static void test_get_set_unicodeformat(void)
|
|||
hTree = create_treeview_control(0);
|
||||
fill_tree(hTree);
|
||||
|
||||
/* Check that an invalid format returned by NF_QUERY defaults to ANSI */
|
||||
bPreviousSetting = (BOOL)SendMessage( hTree, TVM_GETUNICODEFORMAT, 0, 0 );
|
||||
ok(bPreviousSetting == 0, "Format should be ANSI.\n");
|
||||
|
||||
flush_sequences(sequences, NUM_MSG_SEQUENCES);
|
||||
|
||||
/* Set to Unicode */
|
||||
|
@ -1007,10 +1011,17 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam,
|
|||
}
|
||||
|
||||
switch(message) {
|
||||
case WM_NOTIFYFORMAT:
|
||||
{
|
||||
/* Make NF_QUERY return an invalid format to show that it defaults to ANSI */
|
||||
if (lParam == NF_QUERY) return 0;
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_NOTIFY:
|
||||
{
|
||||
NMHDR *pHdr = (NMHDR *)lParam;
|
||||
|
||||
|
||||
ok(pHdr->code != NM_TOOLTIPSCREATED, "Treeview should not send NM_TOOLTIPSCREATED\n");
|
||||
if (pHdr->idFrom == 100)
|
||||
{
|
||||
|
|
|
@ -848,7 +848,9 @@ static INT TREEVIEW_NotifyFormat (TREEVIEW_INFO *infoPtr, HWND hwndFrom, UINT nC
|
|||
format = SendMessageW(hwndFrom, WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwnd, NF_QUERY);
|
||||
TRACE("format=%d\n", format);
|
||||
|
||||
if (format != NFR_ANSI && format != NFR_UNICODE) return 0;
|
||||
/* Invalid format returned by NF_QUERY defaults to ANSI*/
|
||||
if (format != NFR_ANSI && format != NFR_UNICODE)
|
||||
format = NFR_ANSI;
|
||||
|
||||
infoPtr->bNtfUnicode = (format == NFR_UNICODE);
|
||||
|
||||
|
@ -5067,10 +5069,7 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
|
|||
infoPtr->hwndNotify = lpcs->hwndParent;
|
||||
infoPtr->hwndToolTip = 0;
|
||||
|
||||
infoPtr->bNtfUnicode = IsWindowUnicode (hwnd);
|
||||
|
||||
/* Determine what type of notify should be issued */
|
||||
/* sets infoPtr->bNtfUnicode */
|
||||
/* Determine what type of notify should be issued (sets infoPtr->bNtfUnicode) */
|
||||
TREEVIEW_NotifyFormat(infoPtr, infoPtr->hwndNotify, NF_REQUERY);
|
||||
|
||||
if (!(infoPtr->dwStyle & TVS_NOTOOLTIPS))
|
||||
|
|
Loading…
Reference in New Issue