comctl32: Use user32 control names from public header constants instead of defining over and over again.

This commit is contained in:
Nikolay Sivov 2009-10-08 01:04:08 +04:00 committed by Alexandre Julliard
parent c8f35a136d
commit f37130c83b
6 changed files with 9 additions and 18 deletions

View File

@ -968,8 +968,6 @@ static INT COMBOEX_SetItemHeight (COMBOEX_INFO const *infoPtr, INT index, UINT h
static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs)
{
static const WCHAR COMBOBOX[] = { 'C', 'o', 'm', 'b', 'o', 'B', 'o', 'x', 0 };
static const WCHAR EDIT[] = { 'E', 'D', 'I', 'T', 0 };
static const WCHAR NIL[] = { 0 };
COMBOEX_INFO *infoPtr;
LOGFONTW mylogfont;
@ -1011,7 +1009,7 @@ static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs)
/* We also need to place the edit control at the proper location */
/* (allow space for the icons). */
infoPtr->hwndCombo = CreateWindowW (COMBOBOX, NIL,
infoPtr->hwndCombo = CreateWindowW (WC_COMBOBOXW, NIL,
/* following line added to match native */
WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VSCROLL |
CBS_NOINTEGRALHEIGHT | CBS_DROPDOWNLIST |
@ -1045,7 +1043,7 @@ static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs)
* It is created only for CBS_DROPDOWN style
*/
if ((cs->style & CBS_DROPDOWNLIST) == CBS_DROPDOWN) {
infoPtr->hwndEdit = CreateWindowExW (0, EDIT, NIL,
infoPtr->hwndEdit = CreateWindowExW (0, WC_EDITW, NIL,
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | ES_AUTOHSCROLL,
0, 0, 0, 0, /* will set later */
infoPtr->hwndCombo,

View File

@ -189,7 +189,6 @@ static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc)
static LRESULT IPADDRESS_Create (HWND hwnd, const CREATESTRUCTA *lpCreate)
{
static const WCHAR EDIT[] = { 'E', 'd', 'i', 't', 0 };
IPADDRESS_INFO *infoPtr;
RECT rcClient, edit;
int i, fieldsize;
@ -230,7 +229,7 @@ static LRESULT IPADDRESS_Create (HWND hwnd, const CREATESTRUCTA *lpCreate)
edit.left = rcClient.left + i*fieldsize + 6;
edit.right = rcClient.left + (i+1)*fieldsize - 2;
part->EditHwnd =
CreateWindowW (EDIT, NULL, WS_CHILD | WS_VISIBLE | ES_CENTER,
CreateWindowW (WC_EDITW, NULL, WS_CHILD | WS_VISIBLE | ES_CENTER,
edit.left, edit.top, edit.right - edit.left,
edit.bottom - edit.top, hwnd, (HMENU) 1,
(HINSTANCE)GetWindowLongPtrW(hwnd, GWLP_HINSTANCE), NULL);

View File

@ -11309,7 +11309,6 @@ static LRESULT CALLBACK EditLblWndProcA(HWND hwnd, UINT uMsg, WPARAM wParam, LPA
*/
static HWND CreateEditLabelT(LISTVIEW_INFO *infoPtr, LPCWSTR text, DWORD style, BOOL isW)
{
WCHAR editName[5] = { 'E', 'd', 'i', 't', '\0' };
HWND hedit;
HINSTANCE hinst = (HINSTANCE)GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_HINSTANCE);
@ -11319,9 +11318,9 @@ static HWND CreateEditLabelT(LISTVIEW_INFO *infoPtr, LPCWSTR text, DWORD style,
/* Window will be resized and positioned after LVN_BEGINLABELEDIT */
if (isW)
hedit = CreateWindowW(editName, text, style, 0, 0, 0, 0, infoPtr->hwndSelf, 0, hinst, 0);
hedit = CreateWindowW(WC_EDITW, text, style, 0, 0, 0, 0, infoPtr->hwndSelf, 0, hinst, 0);
else
hedit = CreateWindowA("Edit", (LPCSTR)text, style, 0, 0, 0, 0, infoPtr->hwndSelf, 0, hinst, 0);
hedit = CreateWindowA(WC_EDITA, (LPCSTR)text, style, 0, 0, 0, 0, infoPtr->hwndSelf, 0, hinst, 0);
if (!hedit) return 0;

View File

@ -1681,10 +1681,8 @@ MONTHCAL_RButtonUp(MONTHCAL_INFO *infoPtr, LPARAM lParam)
/* creates updown control and edit box */
static void MONTHCAL_EditYear(MONTHCAL_INFO *infoPtr)
{
static const WCHAR EditW[] = { 'E','D','I','T',0 };
infoPtr->hWndYearEdit =
CreateWindowExW(0, EditW, 0, WS_VISIBLE | WS_CHILD | ES_READONLY,
CreateWindowExW(0, WC_EDITW, 0, WS_VISIBLE | WS_CHILD | ES_READONLY,
infoPtr->titleyear.left + 3, infoPtr->titlebtnnext.top,
infoPtr->titleyear.right - infoPtr->titleyear.left + 4,
infoPtr->textHeight, infoPtr->hwndSelf,

View File

@ -3674,7 +3674,6 @@ TREEVIEW_EditLabel(TREEVIEW_INFO *infoPtr, HTREEITEM hItem)
HDC hdc;
HFONT hOldFont=0;
TEXTMETRICW textMetric;
static const WCHAR EditW[] = {'E','d','i','t',0};
TRACE("%p %p\n", hwnd, hItem);
if (!TREEVIEW_ValidItem(infoPtr, hItem))
@ -3721,7 +3720,7 @@ TREEVIEW_EditLabel(TREEVIEW_INFO *infoPtr, HTREEITEM hItem)
infoPtr->editItem = hItem;
hwndEdit = CreateWindowExW(WS_EX_LEFT,
EditW,
WC_EDITW,
0,
WS_CHILD | WS_BORDER | ES_AUTOHSCROLL |
WS_CLIPSIBLINGS | ES_WANTRETURN |

View File

@ -557,8 +557,6 @@ UPDOWN_Buddy_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
*/
static HWND UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud)
{
static const WCHAR editW[] = { 'E', 'd', 'i', 't', 0 };
static const WCHAR listboxW[] = { 'L', 'i', 's', 't', 'b', 'o', 'x', 0 };
RECT budRect; /* new coord for the buddy */
int x, width; /* new x position and width for the up-down */
WNDPROC baseWndProc;
@ -586,9 +584,9 @@ static HWND UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud)
/* Store buddy window class type */
infoPtr->BuddyType = BUDDY_TYPE_UNKNOWN;
if (GetClassNameW(bud, buddyClass, COUNT_OF(buddyClass))) {
if (lstrcmpiW(buddyClass, editW) == 0)
if (lstrcmpiW(buddyClass, WC_EDITW) == 0)
infoPtr->BuddyType = BUDDY_TYPE_EDIT;
else if (lstrcmpiW(buddyClass, listboxW) == 0)
else if (lstrcmpiW(buddyClass, WC_LISTBOXW) == 0)
infoPtr->BuddyType = BUDDY_TYPE_LISTBOX;
}