comctl32: Remove comments about native behavior, that's not a valid source of information.

This commit is contained in:
Alexandre Julliard 2013-05-29 15:43:27 +02:00
parent 735e69f94e
commit 7624da76a8
4 changed files with 1 additions and 248 deletions

View File

@ -1003,24 +1003,14 @@ static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs)
/* (allow space for the icons). */
infoPtr->hwndCombo = CreateWindowW (WC_COMBOBOXW, NIL,
/* following line added to match native */
WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VSCROLL |
CBS_NOINTEGRALHEIGHT | CBS_DROPDOWNLIST |
/* was base and is necessary */
WS_CHILD | WS_VISIBLE | CBS_OWNERDRAWFIXED |
GetWindowLongW (hwnd, GWL_STYLE),
cs->y, cs->x, cs->cx, cs->cy, hwnd,
(HMENU) GetWindowLongPtrW (hwnd, GWLP_ID),
(HINSTANCE)GetWindowLongPtrW (hwnd, GWLP_HINSTANCE), NULL);
/*
* native does the following at this point according to trace:
* GetWindowThreadProcessId(hwndCombo,0)
* GetCurrentThreadId()
* GetWindowThreadProcessId(hwndCombo, &???)
* GetCurrentProcessId()
*/
SetWindowSubclass(infoPtr->hwndCombo, COMBOEX_ComboWndProc, COMBO_SUBCLASSID,
(DWORD_PTR)hwnd);
infoPtr->font = (HFONT)SendMessageW (infoPtr->hwndCombo, WM_GETFONT, 0, 0);
@ -1037,12 +1027,6 @@ static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs)
(HMENU) GetWindowLongPtrW (hwnd, GWLP_ID),
(HINSTANCE)GetWindowLongPtrW (hwnd, GWLP_HINSTANCE), NULL);
/* native does the following at this point according to trace:
* GetWindowThreadProcessId(hwndEdit,0)
* GetCurrentThreadId()
* GetWindowThreadProcessId(hwndEdit, &???)
* GetCurrentProcessId()
*/
SetWindowSubclass(infoPtr->hwndEdit, COMBOEX_EditWndProc, EDIT_SUBCLASSID,
(DWORD_PTR)hwnd);
@ -1117,19 +1101,6 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam)
return SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf);
case CBN_CLOSEUP:
SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf);
/*
* from native trace of first dropdown after typing in URL in IE4
* CB_GETCURSEL(Combo)
* GetWindowText(Edit)
* CB_GETCURSEL(Combo)
* CB_GETCOUNT(Combo)
* CB_GETITEMDATA(Combo, n)
* WM_NOTIFY(parent, CBEN_ENDEDITA|W)
* CB_GETCURSEL(Combo)
* CB_SETCURSEL(COMBOEX, n)
* SetFocus(Combo)
* the rest is supposition
*/
ShowWindow (infoPtr->hwndEdit, SW_SHOW);
InvalidateRect (infoPtr->hwndCombo, 0, TRUE);
if (infoPtr->hwndEdit) InvalidateRect (infoPtr->hwndEdit, 0, TRUE);
@ -1215,17 +1186,6 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam)
return SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf);
case CBN_KILLFOCUS:
/*
* from native trace:
*
* pass to parent
* WM_GETTEXT(Edit, 104)
* CB_GETCURSEL(Combo) rets -1
* WM_NOTIFY(CBEN_ENDEDITA) with CBENF_KILLFOCUS
* CB_GETCURSEL(Combo)
* InvalidateRect(Combo, 0, 0)
* return 0
*/
SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf);
if (infoPtr->flags & WCBE_ACTEDIT) {
GetWindowTextW (infoPtr->hwndEdit, wintext, 260);
@ -1724,9 +1684,6 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
case WM_ERASEBKGND:
/*
* The following was determined by traces of the native
*/
hDC = (HDC) wParam;
obkc = SetBkColor (hDC, comctl32_color.clrWindow);
GetClientRect (hwnd, &rect);
@ -1742,23 +1699,6 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
switch ((INT)wParam)
{
case VK_ESCAPE:
/* native version seems to do following for COMBOEX */
/*
* GetWindowTextW(Edit,&?, 0x104) x
* CB_GETCURSEL to Combo rets -1 x
* WM_NOTIFY to COMBOEX parent (rebar) x
* (CBEN_ENDEDIT{A|W}
* fChanged = FALSE x
* inewSelection = -1 x
* txt="www.hoho" x
* iWhy = 3 x
* CB_GETCURSEL to Combo rets -1 x
* InvalidateRect(Combo, 0) x
* WM_SETTEXT to Edit x
* EM_SETSEL to Edit (0,0) x
* EM_SETSEL to Edit (0,-1) x
* RedrawWindow(Combo, 0, 0, 5) x
*/
TRACE("special code for VK_ESCAPE\n");
GetWindowTextW (infoPtr->hwndEdit, edit_text, 260);
@ -1783,27 +1723,6 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
break;
case VK_RETURN:
/* native version seems to do following for COMBOEX */
/*
* GetWindowTextW(Edit,&?, 0x104) x
* CB_GETCURSEL to Combo rets -1 x
* CB_GETCOUNT to Combo rets 0
* if >0 loop
* CB_GETITEMDATA to match
* *** above 3 lines simulated by FindItem x
* WM_NOTIFY to COMBOEX parent (rebar) x
* (CBEN_ENDEDIT{A|W} x
* fChanged = TRUE (-1) x
* iNewSelection = -1 or selected x
* txt= x
* iWhy = 2 (CBENF_RETURN) x
* CB_GETCURSEL to Combo rets -1 x
* if -1 send CB_SETCURSEL to Combo -1 x
* InvalidateRect(Combo, 0, 0) x
* SetFocus(Edit) x
* CallWindowProc(406615a8, Edit, 0x100, 0xd, 0x1c0001)
*/
TRACE("special code for VK_RETURN\n");
GetWindowTextW (infoPtr->hwndEdit, edit_text, 260);
@ -1923,9 +1842,6 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
case WM_ERASEBKGND:
/*
* The following was determined by traces of the native
*/
hDC = (HDC) wParam;
obkc = SetBkColor (hDC, comctl32_color.clrWindow);
GetClientRect (hwnd, &rect);
@ -1994,18 +1910,6 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
return 0;
case EN_KILLFOCUS:
/*
* Native does:
*
* GetFocus() retns AA
* GetWindowTextW(Edit)
* CB_GETCURSEL(Combo) (got -1)
* WM_NOTIFY(CBEN_ENDEDITA) with CBENF_KILLFOCUS
* CB_GETCURSEL(Combo) (got -1)
* InvalidateRect(Combo, 0, 0)
* WM_KILLFOCUS(Combo, AA)
* return 0;
*/
focusedhwnd = GetFocus();
if (infoPtr->flags & WCBE_ACTEDIT) {
GetWindowTextW (infoPtr->hwndEdit, edit_text, 260);
@ -2025,21 +1929,6 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
return 0;
case EN_SETFOCUS: {
/*
* For EN_SETFOCUS this issues the same calls and messages
* as the native seems to do.
*
* for some cases however native does the following:
* (noticed after SetFocus during LBUTTONDOWN on
* on dropdown arrow)
* WM_GETTEXTLENGTH (Edit);
* WM_GETTEXT (Edit, len+1, str);
* EM_SETSEL (Edit, 0, 0);
* WM_GETTEXTLENGTH (Edit);
* WM_GETTEXT (Edit, len+1, str);
* EM_SETSEL (Edit, 0, len);
* WM_NOTIFY (parent, CBEN_BEGINEDIT)
*/
NMHDR hdr;
SendMessageW (infoPtr->hwndEdit, EM_SETSEL, 0, 0);
@ -2051,10 +1940,6 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
}
case EN_CHANGE: {
/*
* For EN_CHANGE this issues the same calls and messages
* as the native seems to do.
*/
LPCWSTR lastwrk;
cmp_func_t cmptext = get_cmp_func(infoPtr);
@ -2090,37 +1975,6 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
}
case LBN_SELCHANGE:
/*
* Therefore from traces there is no additional code here
*/
/*
* Using native COMCTL32 gets the following:
* 1 == SHDOCVW.DLL issues call/message
* 2 == COMCTL32.DLL issues call/message
* 3 == WINE issues call/message
*
*
* for LBN_SELCHANGE:
* 1 CB_GETCURSEL(ComboEx)
* 1 CB_GETDROPPEDSTATE(ComboEx)
* 1 CallWindowProc( *2* for WM_COMMAND(LBN_SELCHANGE)
* 2 CallWindowProc( *3* for WM_COMMAND(LBN_SELCHANGE)
** call CBRollUp( xxx, TRUE for LBN_SELCHANGE, TRUE)
* 3 WM_COMMAND(ComboEx, CBN_SELENDOK)
* WM_USER+49(ComboLB, 1,0) <=============!!!!!!!!!!!
* 3 ShowWindow(ComboLB, SW_HIDE)
* 3 RedrawWindow(Combo, RDW_UPDATENOW)
* 3 WM_COMMAND(ComboEX, CBN_CLOSEUP)
** end of CBRollUp
* 3 WM_COMMAND(ComboEx, CBN_SELCHANGE) (echo to parent)
* ? LB_GETCURSEL <==|
* ? LB_GETTEXTLEN |
* ? LB_GETTEXT | Needs to be added to
* ? WM_CTLCOLOREDIT(ComboEx) | Combo processing
* ? LB_GETITEMDATA |
* ? WM_DRAWITEM(ComboEx) <==|
*/
default:
break;
}/* fall through */

View File

@ -132,13 +132,6 @@
*
* Functions:
* -- LVGroupComparE
*
* Known differences in message stream from native control (not known if
* these differences cause problems):
* LVM_INSERTITEM issues LVM_SETITEMSTATE and LVM_SETITEM in certain cases.
* LVM_SETITEM does not always issue LVN_ITEMCHANGING/LVN_ITEMCHANGED.
* WM_CREATE does not issue WM_QUERYUISTATE and associated registry
* processing for "USEDOUBLECLICKTIME".
*/
#include "config.h"
@ -7905,17 +7898,6 @@ static BOOL LISTVIEW_RedrawItems(const LISTVIEW_INFO *infoPtr, INT nFirst, INT n
* nearest number of pixels that are a whole line. Ex: if line height
* is 16 and an 8 is passed, the list will be scrolled by 16. If a 7
* is passed, then the scroll will be 0. (per MSDN 7/2002)
*
* For: (per experimentation with native control and CSpy ListView)
* LV_VIEW_ICON scrolling in any direction is allowed
* LV_VIEW_SMALLICON scrolling in any direction is allowed
* LV_VIEW_LIST dx=1 = 1 column (horizontal only)
* but will only scroll 1 column per message
* no matter what the value.
* dy must be 0 or FALSE returned.
* LV_VIEW_DETAILS dx=1 = 1 pixel
* dy= see above
*
*/
static BOOL LISTVIEW_Scroll(LISTVIEW_INFO *infoPtr, INT dx, INT dy)
{

View File

@ -1052,14 +1052,6 @@ REBAR_MoveChildWindows (const REBAR_INFO *infoPtr, UINT start, UINT endplus)
lpBand->rcChild = rbcz.rcChild; /* *** ??? */
}
/* native (IE4 in "Favorites" frame **1) does:
* SetRect (&rc, -1, -1, -1, -1)
* EqualRect (&rc,band->rc???)
* if ret==0
* CopyRect (band->rc????, &rc)
* set flag outside of loop
*/
GetClassNameW (lpBand->hwndChild, szClassName, sizeof(szClassName)/sizeof(szClassName[0]));
if (!lstrcmpW (szClassName, strComboBox) ||
!lstrcmpW (szClassName, WC_COMBOBOXEXW)) {
@ -1111,15 +1103,6 @@ REBAR_MoveChildWindows (const REBAR_INFO *infoPtr, UINT start, UINT endplus)
if (infoPtr->DoRedraw)
UpdateWindow (infoPtr->hwndSelf);
/* native (from **1 above) does:
* UpdateWindow(rebar)
* REBAR_ForceResize
* RBN_HEIGHTCHANGE if necessary
* if ret from any EqualRect was 0
* Goto "BeginDeferWindowPos"
*/
}
/* Returns the next visible band (the first visible band in [i+1; infoPtr->uNumBands) )
@ -3314,29 +3297,6 @@ REBAR_NCCreate (HWND hwnd, const CREATESTRUCTW *cs)
infoPtr->hFont = infoPtr->hDefaultFont = tfont;
}
/* native does:
GetSysColor (numerous);
GetSysColorBrush (numerous) (see WM_SYSCOLORCHANGE);
*GetStockObject (SYSTEM_FONT);
*SetWindowLong (hwnd, 0, info ptr);
*WM_NOTIFYFORMAT;
*SetWindowLong (hwnd, GWL_STYLE, style+0x10000001);
WS_VISIBLE = 0x10000000;
CCS_TOP = 0x00000001;
*SystemParametersInfo (SPI_GETNONCLIENTMETRICS...);
*CreateFontIndirect (lfCaptionFont from above);
GetDC ();
SelectObject (hdc, fontabove);
GetTextMetrics (hdc, ); guessing is tmHeight
SelectObject (hdc, oldfont);
ReleaseDC ();
GetWindowRect ();
MapWindowPoints (0, parent, rectabove, 2);
GetWindowRect ();
GetClientRect ();
ClientToScreen (clientrect);
SetWindowPos (hwnd, 0, 0, 0, 0, 0, SWP_NOZORDER);
*/
return TRUE;
}

View File

@ -945,11 +945,6 @@ TOOLBAR_DrawButton (const TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HDC hdc,
tbcd.clrHighlightHotTrack = 0;
tbcd.nStringBkMode = TRANSPARENT;
tbcd.nHLStringBkMode = OPAQUE;
/* MSDN says that this is the text rectangle.
* But (why always a but) tracing of v5.7 of native shows
* that this is really a *relative* rectangle based on the
* the nmcd.rc. Also the left and top are always 0 ignoring
* any bitmap that might be present. */
tbcd.rcText.left = 0;
tbcd.rcText.top = 0;
tbcd.rcText.right = rcText.right - rc.left;
@ -5118,7 +5113,6 @@ TOOLBAR_GetIdealSize (const TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
switch(wParam) {
case 0:
if (lpsize->cx == -1) {
/* **** this is wrong, native measures each button and sets it */
lpsize->cx = infoPtr->rcBound.right - infoPtr->rcBound.left;
}
else if(HIWORD(lpsize->cx)) {
@ -5481,8 +5475,7 @@ TOOLBAR_LButtonDown (TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
btnPtr->bDropDownPressed = FALSE;
InvalidateRect(infoPtr->hwndSelf, &btnPtr->rect, TRUE);
/* find and set hot item
* NOTE: native doesn't do this, but that is a bug */
/* find and set hot item */
GetCursorPos(&pt);
ScreenToClient(infoPtr->hwndSelf, &pt);
nHit = TOOLBAR_InternalHitTest(infoPtr, &pt, &button);
@ -5663,9 +5656,6 @@ TOOLBAR_LButtonUp (TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_SendNotify (&hdr, infoPtr,
NM_RELEASEDCAPTURE);
/* native issues TBN_ENDDRAG here, if _LBUTTONDOWN issued the
* TBN_BEGINDRAG
*/
memset(&nmtb, 0, sizeof(nmtb));
nmtb.iItem = btnPtr->idCommand;
TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr,
@ -5957,39 +5947,6 @@ TOOLBAR_NCCreate (HWND hwnd, WPARAM wParam, const CREATESTRUCTW *lpcs)
SetWindowLongPtrW (hwnd, GWLP_HINSTANCE, (LONG_PTR)hInst);
}
/* native control does:
* Get a lot of colors and brushes
* WM_NOTIFYFORMAT
* SystemParametersInfoW(0x1f, 0x3c, adr1, 0)
* CreateFontIndirectW(adr1)
* CreateBitmap(0x27, 0x24, 1, 1, 0)
* hdc = GetDC(toolbar)
* GetSystemMetrics(0x48)
* fnt2=CreateFontW(0xe, 0, 0, 0, 0x190, 0, 0, 0, 0, 2,
* 0, 0, 0, 0, "MARLETT")
* oldfnt = SelectObject(hdc, fnt2)
* GetCharWidthW(hdc, 0x36, 0x36, adr2)
* GetTextMetricsW(hdc, adr3)
* SelectObject(hdc, oldfnt)
* DeleteObject(fnt2)
* ReleaseDC(hdc)
* InvalidateRect(toolbar, 0, 1)
* SetWindowLongW(toolbar, 0, addr)
* SetWindowLongW(toolbar, -16, xxx) **sometimes**
* WM_STYLECHANGING
* CallWinEx old new
* ie 1 0x56000a4c 0x46000a4c 0x56008a4d
* ie 2 0x4600094c 0x4600094c 0x4600894d
* ie 3 0x56000b4c 0x46000b4c 0x56008b4d
* rebar 0x50008844 0x40008844 0x50008845
* pager 0x50000844 0x40000844 0x50008845
* IC35mgr 0x5400084e **nochange**
* on entry to _NCCREATE 0x5400084e
* rowlist 0x5400004e **nochange**
* on entry to _NCCREATE 0x5400004e
*
*/
/* I think the code below is a bug, but it is the way that the native
* controls seem to work. The effect is that if the user of TBSTYLE_FLAT
* forgets to specify TBSTYLE_TRANSPARENT but does specify either