ReactOS 0.4.16-dev-295-g4aee028
commctrl.c File Reference
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
#include "commctrl.h"
#include "winerror.h"
#include "winreg.h"
#include "shlwapi.h"
#include "comctl32.h"
#include "wine/debug.h"
Include dependency graph for commctrl.c:

Go to the source code of this file.

Macros

#define NO_SHLWAPI_STREAM
 
#define VERSION   "6.0.2600.2982!"
 
#define OCM__BASE   (WM_USER+0x1c00)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (commctrl)
 
static LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static void unregister_versioned_classes (void)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 
VOID WINAPI MenuHelp (UINT uMsg, WPARAM wParam, LPARAM lParam, HMENU hMainMenu, HINSTANCE hInst, HWND hwndStatus, UINT *lpwIDs)
 
BOOL WINAPI ShowHideMenuCtl (HWND hwnd, UINT_PTR uFlags, LPINT lpInfo)
 
VOID WINAPI GetEffectiveClientRect (HWND hwnd, LPRECT lpRect, const INT *lpInfo)
 
void WINAPI DrawStatusTextW (HDC hdc, LPCRECT lprc, LPCWSTR text, UINT style)
 
void WINAPI DrawStatusTextA (HDC hdc, LPCRECT lprc, LPCSTR text, UINT style)
 
HWND WINAPI CreateStatusWindowA (LONG style, LPCSTR text, HWND parent, UINT wid)
 
HWND WINAPI CreateStatusWindowW (LONG style, LPCWSTR text, HWND parent, UINT wid)
 
HWND WINAPI CreateUpDownControl (DWORD style, INT x, INT y, INT cx, INT cy, HWND parent, INT id, HINSTANCE inst, HWND buddy, INT maxVal, INT minVal, INT curVal)
 
VOID WINAPI InitCommonControls (void)
 
BOOL WINAPI InitCommonControlsEx (const INITCOMMONCONTROLSEX *lpInitCtrls)
 
HWND WINAPI CreateToolbarEx (HWND hwnd, DWORD style, UINT wID, INT nBitmaps, HINSTANCE hBMInst, UINT_PTR wBMID, LPCTBBUTTON lpButtons, INT iNumButtons, INT dxButton, INT dyButton, INT dxBitmap, INT dyBitmap, UINT uStructSize)
 
HBITMAP WINAPI CreateMappedBitmap (HINSTANCE hInstance, INT_PTR idBitmap, UINT wFlags, LPCOLORMAP lpColorMap, INT iNumMaps)
 
HWND WINAPI CreateToolbar (HWND hwnd, DWORD style, UINT wID, INT nBitmaps, HINSTANCE hBMInst, UINT wBMID, LPCTBBUTTON lpButtons, INT iNumButtons)
 
HRESULT WINAPI DllGetVersion (DLLVERSIONINFO *pdvi)
 
HRESULT WINAPI DllInstall (BOOL bInstall, LPCWSTR cmdline)
 
BOOL WINAPI _TrackMouseEvent (TRACKMOUSEEVENT *ptme)
 
LANGID WINAPI GetMUILanguage (VOID)
 
VOID WINAPI InitMUILanguage (LANGID uiLang)
 
BOOL WINAPI SetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uIDSubclass, DWORD_PTR dwRef)
 
BOOL WINAPI GetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uID, DWORD_PTR *pdwRef)
 
BOOL WINAPI RemoveWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uID)
 
LRESULT WINAPI DefSubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
HWND COMCTL32_CreateToolTip (HWND hwndOwner)
 
VOID COMCTL32_RefreshSysColors (void)
 
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_GetFontMetrics (HFONT hFont, TEXTMETRICW *ptm)
 
BOOL COMCTL32_IsReflectedMessage (UINT uMsg)
 
BOOL WINAPI MirrorIcon (HICON *phicon1, HICON *phicon2)
 
static BOOL IsDelimiter (WCHAR c)
 
static int CALLBACK PathWordBreakProc (LPCWSTR lpch, int ichCurrent, int cch, int code)
 
LRESULT WINAPI SetPathWordBreakProc (HWND hwnd, BOOL bSet)
 
int WINAPI DrawShadowText (HDC hdc, LPCWSTR pszText, UINT cch, RECT *prc, DWORD dwFlags, COLORREF crText, COLORREF crShadow, int ixOffset, int iyOffset)
 
HRESULT WINAPI LoadIconWithScaleDown (HINSTANCE hinst, const WCHAR *name, int cx, int cy, HICON *icon)
 
HRESULT WINAPI LoadIconMetric (HINSTANCE hinst, const WCHAR *name, int size, HICON *icon)
 

Variables

static LPWSTR COMCTL32_wSubclass = NULL
 
HMODULE COMCTL32_hModule = 0
 
static LANGID COMCTL32_uiLang = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL)
 
HBRUSH COMCTL32_hPattern55AABrush = NULL
 
COMCTL32_SysColor comctl32_color
 
static HBITMAP COMCTL32_hPattern55AABitmap = NULL
 
static const WORD wPattern55AA []
 
static const WCHAR strCC32SubclassInfo []
 

Macro Definition Documentation

◆ NO_SHLWAPI_STREAM

#define NO_SHLWAPI_STREAM

Definition at line 68 of file commctrl.c.

◆ OCM__BASE

#define OCM__BASE   (WM_USER+0x1c00)

Definition at line 1740 of file commctrl.c.

◆ VERSION

#define VERSION   "6.0.2600.2982!"

Function Documentation

◆ _TrackMouseEvent()

BOOL WINAPI _TrackMouseEvent ( TRACKMOUSEEVENT ptme)

Definition at line 1214 of file commctrl.c.

1215{
1216 return TrackMouseEvent (ptme);
1217}
BOOL WINAPI TrackMouseEvent(_Inout_ LPTRACKMOUSEEVENT)

Referenced by init_functions(), LISTVIEW_MouseMove(), REBAR_MouseMove(), TOOLBAR_MouseMove(), TREEVIEW_MouseMove(), and FlatButton::WndProc().

◆ COMCTL32_CreateToolTip()

HWND COMCTL32_CreateToolTip ( HWND  hwndOwner)

Definition at line 1551 of file commctrl.c.

1552{
1553 HWND hwndToolTip;
1554
1555 hwndToolTip = CreateWindowExW(0, TOOLTIPS_CLASSW, NULL, WS_POPUP,
1557 CW_USEDEFAULT, CW_USEDEFAULT, hwndOwner,
1558 0, 0, 0);
1559
1560 /* Send NM_TOOLTIPSCREATED notification */
1561 if (hwndToolTip)
1562 {
1563 NMTOOLTIPSCREATED nmttc;
1564 /* true owner can be different if hwndOwner is a child window */
1565 HWND hwndTrueOwner = GetWindow(hwndToolTip, GW_OWNER);
1566 nmttc.hdr.hwndFrom = hwndTrueOwner;
1567 nmttc.hdr.idFrom = GetWindowLongPtrW(hwndTrueOwner, GWLP_ID);
1568 nmttc.hdr.code = NM_TOOLTIPSCREATED;
1569 nmttc.hwndToolTips = hwndToolTip;
1570
1571 SendMessageW(GetParent(hwndTrueOwner), WM_NOTIFY,
1572 GetWindowLongPtrW(hwndTrueOwner, GWLP_ID), (LPARAM)&nmttc);
1573 }
1574
1575 return hwndToolTip;
1576}
#define NULL
Definition: types.h:112
#define WS_POPUP
Definition: pedump.c:616
#define TOOLTIPS_CLASSW
Definition: commctrl.h:1707
#define NM_TOOLTIPSCREATED
Definition: commctrl.h:144
#define WM_NOTIFY
Definition: richedit.h:61
UINT_PTR idFrom
Definition: winuser.h:3161
UINT code
Definition: winuser.h:3162
HWND hwndFrom
Definition: winuser.h:3160
LONG_PTR LPARAM
Definition: windef.h:208
#define GW_OWNER
Definition: winuser.h:769
#define GetWindowLongPtrW
Definition: winuser.h:4832
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define CW_USEDEFAULT
Definition: winuser.h:225
HWND WINAPI GetParent(_In_ HWND)
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
#define GWLP_ID
Definition: winuser.h:863
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by LISTVIEW_WindowProc(), and TREEVIEW_StyleChanged().

◆ COMCTL32_DrawInsertMark()

void COMCTL32_DrawInsertMark ( HDC  hDC,
const RECT lpRect,
COLORREF  clrInsertMark,
BOOL  bHorizontal 
)

Definition at line 1633 of file commctrl.c.

1634{
1635 HPEN hPen = CreatePen(PS_SOLID, 1, clrInsertMark);
1636 HPEN hOldPen;
1637 static const DWORD adwPolyPoints[] = {4,4,4};
1638 LONG lCentre = (bHorizontal ?
1639 lpRect->top + (lpRect->bottom - lpRect->top)/2 :
1640 lpRect->left + (lpRect->right - lpRect->left)/2);
1641 LONG l1 = (bHorizontal ? lpRect->left : lpRect->top);
1642 LONG l2 = (bHorizontal ? lpRect->right : lpRect->bottom);
1643 const POINT aptInsertMark[] =
1644 {
1645 /* top (V) or left (H) arrow */
1646 {lCentre , l1 + 2},
1647 {lCentre - 2, l1 },
1648 {lCentre + 3, l1 },
1649 {lCentre + 1, l1 + 2},
1650 /* middle line */
1651 {lCentre , l2 - 2},
1652 {lCentre , l1 - 1},
1653 {lCentre + 1, l1 - 1},
1654 {lCentre + 1, l2 - 2},
1655 /* bottom (V) or right (H) arrow */
1656 {lCentre , l2 - 3},
1657 {lCentre - 2, l2 - 1},
1658 {lCentre + 3, l2 - 1},
1659 {lCentre + 1, l2 - 3},
1660 };
1661 hOldPen = SelectObject(hDC, hPen);
1662 PolyPolyline(hDC, aptInsertMark, adwPolyPoints, ARRAY_SIZE(adwPolyPoints));
1663 SelectObject(hDC, hOldPen);
1664 DeleteObject(hPen);
1665}
static HDC hDC
Definition: 3dtext.c:33
#define ARRAY_SIZE(A)
Definition: main.h:20
unsigned long DWORD
Definition: ntddk_ex.h:95
pKey DeleteObject()
long LONG
Definition: pedump.c:60
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
#define PS_SOLID
Definition: wingdi.h:586
BOOL WINAPI PolyPolyline(_In_ HDC hdc, _In_ const POINT *apt, _In_reads_(csz) const DWORD *asz, _In_ DWORD csz)

Referenced by TOOLBAR_Refresh().

◆ COMCTL32_EnsureBitmapSize()

void COMCTL32_EnsureBitmapSize ( HBITMAP pBitmap,
int  cxMinWidth,
int  cyMinHeight,
COLORREF  crBackground 
)

Definition at line 1685 of file commctrl.c.

1686{
1687 int cxNew, cyNew;
1688 BITMAP bmp;
1689 HBITMAP hNewBitmap;
1690 HBITMAP hNewDCBitmap, hOldDCBitmap;
1691 HBRUSH hNewDCBrush;
1692 HDC hdcNew, hdcOld;
1693
1694 if (!GetObjectW(*pBitmap, sizeof(BITMAP), &bmp))
1695 return;
1696 cxNew = (cxMinWidth > bmp.bmWidth ? cxMinWidth : bmp.bmWidth);
1697 cyNew = (cyMinHeight > bmp.bmHeight ? cyMinHeight : bmp.bmHeight);
1698 if (cxNew == bmp.bmWidth && cyNew == bmp.bmHeight)
1699 return;
1700
1701 hdcNew = CreateCompatibleDC(NULL);
1702 hNewBitmap = CreateBitmap(cxNew, cyNew, bmp.bmPlanes, bmp.bmBitsPixel, NULL);
1703 hNewDCBitmap = SelectObject(hdcNew, hNewBitmap);
1704 hNewDCBrush = SelectObject(hdcNew, CreateSolidBrush(crBackground));
1705
1706 hdcOld = CreateCompatibleDC(NULL);
1707 hOldDCBitmap = SelectObject(hdcOld, *pBitmap);
1708
1709 BitBlt(hdcNew, 0, 0, bmp.bmWidth, bmp.bmHeight, hdcOld, 0, 0, SRCCOPY);
1710 if (bmp.bmWidth < cxMinWidth)
1711 PatBlt(hdcNew, bmp.bmWidth, 0, cxNew, bmp.bmHeight, PATCOPY);
1712 if (bmp.bmHeight < cyMinHeight)
1713 PatBlt(hdcNew, 0, bmp.bmHeight, bmp.bmWidth, cyNew, PATCOPY);
1714 if (bmp.bmWidth < cxMinWidth && bmp.bmHeight < cyMinHeight)
1715 PatBlt(hdcNew, bmp.bmWidth, bmp.bmHeight, cxNew, cyNew, PATCOPY);
1716
1717 SelectObject(hdcNew, hNewDCBitmap);
1718 DeleteObject(SelectObject(hdcNew, hNewDCBrush));
1719 DeleteDC(hdcNew);
1720 SelectObject(hdcOld, hOldDCBitmap);
1721 DeleteDC(hdcOld);
1722
1723 DeleteObject(*pBitmap);
1724 *pBitmap = hNewBitmap;
1725 return;
1726}
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:57
BITMAP bmp
Definition: alphablend.c:62
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
Definition: bl.h:1331
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define SRCCOPY
Definition: wingdi.h:333
#define PATCOPY
Definition: wingdi.h:335
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
BOOL WINAPI DeleteDC(_In_ HDC)

Referenced by TOOLBAR_AddBitmapToImageList().

◆ COMCTL32_GetFontMetrics()

void COMCTL32_GetFontMetrics ( HFONT  hFont,
TEXTMETRICW ptm 
)

Definition at line 1728 of file commctrl.c.

1729{
1730 HDC hdc = GetDC(NULL);
1731 HFONT hOldFont;
1732
1733 hOldFont = SelectObject(hdc, hFont);
1734 GetTextMetricsW(hdc, ptm);
1735 SelectObject(hdc, hOldFont);
1736 ReleaseDC(NULL, hdc);
1737}
HFONT hFont
Definition: main.c:53
HDC hdc
Definition: main.c:9
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)

Referenced by STATUSBAR_ComputeHeight().

◆ COMCTL32_IsReflectedMessage()

BOOL COMCTL32_IsReflectedMessage ( UINT  uMsg)

Definition at line 1755 of file commctrl.c.

1756{
1757 switch (uMsg)
1758 {
1759 case OCM__BASE + WM_COMMAND:
1767 case OCM__BASE + WM_DRAWITEM:
1769 case OCM__BASE + WM_DELETEITEM:
1770 case OCM__BASE + WM_VKEYTOITEM:
1771 case OCM__BASE + WM_CHARTOITEM:
1773 case OCM__BASE + WM_HSCROLL:
1774 case OCM__BASE + WM_VSCROLL:
1776 case OCM__BASE + WM_NOTIFY:
1777 return TRUE;
1778 default:
1779 return FALSE;
1780 }
1781}
#define OCM__BASE
Definition: commctrl.c:1740
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1775
#define WM_HSCROLL
Definition: winuser.h:1746
#define WM_CHARTOITEM
Definition: winuser.h:1652
#define WM_VSCROLL
Definition: winuser.h:1747
#define WM_COMMAND
Definition: winuser.h:1743
#define WM_CTLCOLORSCROLLBAR
Definition: winuser.h:1774
#define WM_DELETEITEM
Definition: winuser.h:1650
#define WM_CTLCOLORMSGBOX
Definition: winuser.h:1769
#define WM_DRAWITEM
Definition: winuser.h:1648
#define WM_CTLCOLORBTN
Definition: winuser.h:1772
#define WM_MEASUREITEM
Definition: winuser.h:1649
#define WM_CTLCOLORLISTBOX
Definition: winuser.h:1771
#define WM_COMPAREITEM
Definition: winuser.h:1658
#define WM_PARENTNOTIFY
Definition: winuser.h:1806
#define WM_CTLCOLOREDIT
Definition: winuser.h:1770
#define WM_CTLCOLORDLG
Definition: winuser.h:1773
#define WM_VKEYTOITEM
Definition: winuser.h:1651

Referenced by ANIMATE_WindowProc(), COMBOEX_WindowProc(), DATETIME_WindowProc(), FlatSB_WindowProc(), HEADER_WindowProc(), HOTKEY_WindowProc(), IPADDRESS_WindowProc(), LISTVIEW_WindowProc(), MONTHCAL_WindowProc(), NATIVEFONT_WindowProc(), ProgressWindowProc(), REBAR_WindowProc(), StatusWindowProc(), SysLinkWindowProc(), TAB_WindowProc(), ToolbarWindowProc(), TOOLTIPS_WindowProc(), TRACKBAR_WindowProc(), TREEVIEW_WindowProc(), and UpDownWindowProc().

◆ COMCTL32_RefreshSysColors()

VOID COMCTL32_RefreshSysColors ( void  )

Definition at line 1593 of file commctrl.c.

1594{
1612}
COMCTL32_SysColor comctl32_color
Definition: commctrl.c:82
COLORREF clrHighlightText
Definition: comctl32.h:176
COLORREF clrBtnShadow
Definition: comctl32.h:172
COLORREF clrBtnText
Definition: comctl32.h:173
COLORREF clrBtnFace
Definition: comctl32.h:174
COLORREF clrInfoText
Definition: comctl32.h:187
COLORREF clrWindow
Definition: comctl32.h:182
COLORREF clr3dFace
Definition: comctl32.h:181
COLORREF clrActiveCaption
Definition: comctl32.h:185
COLORREF clrBtnHighlight
Definition: comctl32.h:171
COLORREF clr3dShadow
Definition: comctl32.h:179
COLORREF clrGrayText
Definition: comctl32.h:184
COLORREF clr3dDkShadow
Definition: comctl32.h:180
COLORREF clrInfoBk
Definition: comctl32.h:186
COLORREF clrHotTrackingColor
Definition: comctl32.h:177
COLORREF clrWindowText
Definition: comctl32.h:183
COLORREF clr3dHilight
Definition: comctl32.h:178
COLORREF clrHighlight
Definition: comctl32.h:175
DWORD WINAPI GetSysColor(_In_ int)
#define COLOR_BTNTEXT
Definition: winuser.h:936
#define COLOR_INFOBK
Definition: winuser.h:945
#define COLOR_GRAYTEXT
Definition: winuser.h:935
#define COLOR_WINDOW
Definition: winuser.h:921
#define COLOR_WINDOWTEXT
Definition: winuser.h:924
#define COLOR_HIGHLIGHT
Definition: winuser.h:929
#define COLOR_ACTIVECAPTION
Definition: winuser.h:918
#define COLOR_3DDKSHADOW
Definition: winuser.h:942
#define COLOR_3DSHADOW
Definition: winuser.h:934
#define COLOR_INFOTEXT
Definition: winuser.h:944
#define COLOR_HOTLIGHT
Definition: winuser.h:946
#define COLOR_HIGHLIGHTTEXT
Definition: winuser.h:930
#define COLOR_BTNSHADOW
Definition: winuser.h:933
#define COLOR_3DHILIGHT
Definition: winuser.h:940
#define COLOR_BTNHIGHLIGHT
Definition: winuser.h:938
#define COLOR_BTNFACE
Definition: winuser.h:931
#define COLOR_3DFACE
Definition: winuser.h:932

Referenced by COMBOEX_WindowProc(), DllMain(), HEADER_WindowProc(), IPADDRESS_WindowProc(), LISTVIEW_WindowProc(), MONTHCAL_WindowProc(), PROPSHEET_DialogProc(), REBAR_WindowProc(), STATIC_WindowProc(), StatusWindowProc(), SysLinkWindowProc(), TAB_WindowProc(), TOOLBAR_SysColorChange(), TOOLTIPS_WindowProc(), and TREEVIEW_WindowProc().

◆ COMCTL32_SubclassProc()

static LRESULT WINAPI COMCTL32_SubclassProc ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1452 of file commctrl.c.

1453{
1456 LRESULT ret;
1457
1458 TRACE ("(%p, 0x%08x, 0x%08lx, 0x%08lx)\n", hWnd, uMsg, wParam, lParam);
1459
1461 if (!stack) {
1462 ERR ("Our sub classing stack got erased for %p!! Nothing we can do\n", hWnd);
1463 return 0;
1464 }
1465
1466 /* Save our old stackpos to properly handle nested messages */
1467 proc = stack->stackpos;
1468 stack->stackpos = stack->SubclassProcs;
1469 stack->running++;
1471 stack->running--;
1472 stack->stackpos = proc;
1473
1474 if (!stack->SubclassProcs && !stack->running) {
1475 TRACE("Last Subclass removed, cleaning up\n");
1476 /* clean up our heap and reset the original window procedure */
1477 if (IsWindowUnicode (hWnd))
1479 else
1481 Free (stack);
1483 }
1484 return ret;
1485}
HWND hWnd
Definition: settings.c:17
#define ERR(fmt,...)
Definition: precomp.h:57
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static LPWSTR COMCTL32_wSubclass
Definition: commctrl.c:78
LRESULT WINAPI DefSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: commctrl.c:1503
static HANDLE proc()
Definition: pdb.c:34
#define TRACE(s)
Definition: solgame.cpp:4
Definition: format.c:80
#define GWLP_WNDPROC
Definition: treelist.c:66
uint32_t DWORD_PTR
Definition: typedefs.h:65
int ret
LONG_PTR LRESULT
Definition: windef.h:209
#define SetWindowLongPtrA
Definition: winuser.h:5357
HANDLE WINAPI RemovePropW(_In_ HWND, _In_ LPCWSTR)
BOOL WINAPI IsWindowUnicode(_In_ HWND)
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
#define SetWindowLongPtrW
Definition: winuser.h:5358
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:815

Referenced by SetWindowSubclass().

◆ CreateMappedBitmap()

HBITMAP WINAPI CreateMappedBitmap ( HINSTANCE  hInstance,
INT_PTR  idBitmap,
UINT  wFlags,
LPCOLORMAP  lpColorMap,
INT  iNumMaps 
)

Definition at line 1005 of file commctrl.c.

1007{
1008 HGLOBAL hglb;
1009 HRSRC hRsrc;
1010 const BITMAPINFOHEADER *lpBitmap;
1011 LPBITMAPINFOHEADER lpBitmapInfo;
1012 UINT nSize, nColorTableSize, iColor;
1013 RGBQUAD *pColorTable;
1014 INT i, iMaps, nWidth, nHeight;
1015 HDC hdcScreen;
1016 HBITMAP hbm;
1017 LPCOLORMAP sysColorMap;
1018 COLORREF cRef;
1019 COLORMAP internalColorMap[4] =
1020 {{0x000000, 0}, {0x808080, 0}, {0xC0C0C0, 0}, {0xFFFFFF, 0}};
1021
1022 /* initialize pointer to colortable and default color table */
1023 if (lpColorMap) {
1024 iMaps = iNumMaps;
1025 sysColorMap = lpColorMap;
1026 }
1027 else {
1028 internalColorMap[0].to = GetSysColor (COLOR_BTNTEXT);
1029 internalColorMap[1].to = GetSysColor (COLOR_BTNSHADOW);
1030 internalColorMap[2].to = GetSysColor (COLOR_BTNFACE);
1031 internalColorMap[3].to = GetSysColor (COLOR_BTNHIGHLIGHT);
1032 iMaps = 4;
1033 sysColorMap = internalColorMap;
1034 }
1035
1036 hRsrc = FindResourceW (hInstance, (LPWSTR)idBitmap, (LPWSTR)RT_BITMAP);
1037 if (hRsrc == 0)
1038 return 0;
1039 hglb = LoadResource (hInstance, hRsrc);
1040 if (hglb == 0)
1041 return 0;
1042 lpBitmap = LockResource (hglb);
1043 if (lpBitmap == NULL)
1044 return 0;
1045
1046 if (lpBitmap->biSize >= sizeof(BITMAPINFOHEADER) && lpBitmap->biClrUsed)
1047 nColorTableSize = lpBitmap->biClrUsed;
1048 else if (lpBitmap->biBitCount <= 8)
1049 nColorTableSize = (1 << lpBitmap->biBitCount);
1050 else
1051 nColorTableSize = 0;
1052 nSize = lpBitmap->biSize;
1053 if (nSize == sizeof(BITMAPINFOHEADER) && lpBitmap->biCompression == BI_BITFIELDS)
1054 nSize += 3 * sizeof(DWORD);
1055 nSize += nColorTableSize * sizeof(RGBQUAD);
1056 lpBitmapInfo = GlobalAlloc (GMEM_FIXED, nSize);
1057 if (lpBitmapInfo == NULL)
1058 return 0;
1059 RtlMoveMemory (lpBitmapInfo, lpBitmap, nSize);
1060
1061 pColorTable = (RGBQUAD*)(((LPBYTE)lpBitmapInfo) + lpBitmapInfo->biSize);
1062
1063 for (iColor = 0; iColor < nColorTableSize; iColor++) {
1064 for (i = 0; i < iMaps; i++) {
1065 cRef = RGB(pColorTable[iColor].rgbRed,
1066 pColorTable[iColor].rgbGreen,
1067 pColorTable[iColor].rgbBlue);
1068 if ( cRef == sysColorMap[i].from) {
1069#if 0
1070 if (wFlags & CBS_MASKED) {
1071 if (sysColorMap[i].to != COLOR_BTNTEXT)
1072 pColorTable[iColor] = RGB(255, 255, 255);
1073 }
1074 else
1075#endif
1076 pColorTable[iColor].rgbBlue = GetBValue(sysColorMap[i].to);
1077 pColorTable[iColor].rgbGreen = GetGValue(sysColorMap[i].to);
1078 pColorTable[iColor].rgbRed = GetRValue(sysColorMap[i].to);
1079 break;
1080 }
1081 }
1082 }
1083 nWidth = lpBitmapInfo->biWidth;
1084 nHeight = lpBitmapInfo->biHeight;
1085 hdcScreen = GetDC (NULL);
1086 hbm = CreateCompatibleBitmap (hdcScreen, nWidth, nHeight);
1087 if (hbm) {
1088 HDC hdcDst = CreateCompatibleDC (hdcScreen);
1089 HBITMAP hbmOld = SelectObject (hdcDst, hbm);
1090 const BYTE *lpBits = (const BYTE *)lpBitmap + nSize;
1091 StretchDIBits (hdcDst, 0, 0, nWidth, nHeight, 0, 0, nWidth, nHeight,
1092 lpBits, (LPBITMAPINFO)lpBitmapInfo, DIB_RGB_COLORS,
1093 SRCCOPY);
1094 SelectObject (hdcDst, hbmOld);
1095 DeleteDC (hdcDst);
1096 }
1097 ReleaseDC (NULL, hdcScreen);
1098 GlobalFree (lpBitmapInfo);
1099 FreeResource (hglb);
1100
1101 return hbm;
1102}
HINSTANCE hInstance
Definition: charmap.c:19
BOOL WINAPI FreeResource(HGLOBAL handle)
Definition: res.c:559
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
#define RGB(r, g, b)
Definition: precomp.h:71
#define GetBValue(quad)
Definition: precomp.h:75
#define GetGValue(quad)
Definition: precomp.h:74
ULONG RGBQUAD
Definition: precomp.h:59
#define GetRValue(quad)
Definition: precomp.h:73
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
#define BI_BITFIELDS
Definition: mmreg.h:507
unsigned int UINT
Definition: ndis.h:50
_In_ HBITMAP hbm
Definition: ntgdi.h:2776
#define RT_BITMAP
Definition: pedump.c:364
CardRegion * from
Definition: spigame.cpp:19
DWORD biCompression
Definition: amvideo.idl:35
COLORREF to
Definition: commctrl.h:965
unsigned char * LPBYTE
Definition: typedefs.h:53
int32_t INT
Definition: typedefs.h:58
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264
#define GMEM_FIXED
Definition: winbase.h:319
*nSize LPSTR _Inout_ LPDWORD nSize
Definition: winbase.h:2109
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531
DWORD COLORREF
Definition: windef.h:300
#define DIB_RGB_COLORS
Definition: wingdi.h:367
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
int WINAPI StretchDIBits(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ const VOID *, _In_ const BITMAPINFO *, _In_ UINT, _In_ DWORD)
static HDC hdcDst
Definition: xlate.c:32
_In_ ULONG iColor
Definition: xlateobj.h:17
WCHAR * LPWSTR
Definition: xmlstorage.h:184
unsigned char BYTE
Definition: xxhash.c:193

Referenced by PROPSHEET_LoadWizardBitmaps(), and TOOLBAR_AddBitmapToImageList().

◆ CreateStatusWindowA()

HWND WINAPI CreateStatusWindowA ( LONG  style,
LPCSTR  text,
HWND  parent,
UINT  wid 
)

Definition at line 776 of file commctrl.c.

777{
781 parent, (HMENU)(DWORD_PTR)wid, 0, 0);
782}
Arabic default style
Definition: afstyles.h:94
const WCHAR * text
Definition: package.c:1794
r parent
Definition: btrfs.c:3010
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
#define STATUSCLASSNAMEA
Definition: commctrl.h:1942
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4318

◆ CreateStatusWindowW()

HWND WINAPI CreateStatusWindowW ( LONG  style,
LPCWSTR  text,
HWND  parent,
UINT  wid 
)

Definition at line 802 of file commctrl.c.

803{
807 parent, (HMENU)(DWORD_PTR)wid, 0, 0);
808}
#define STATUSCLASSNAMEW
Definition: commctrl.h:1941
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4319

Referenced by Control_WndProc_Create(), iewnd_OnCreate(), InitInstance(), and OnCreate().

◆ CreateToolbar()

HWND WINAPI CreateToolbar ( HWND  hwnd,
DWORD  style,
UINT  wID,
INT  nBitmaps,
HINSTANCE  hBMInst,
UINT  wBMID,
LPCTBBUTTON  lpButtons,
INT  iNumButtons 
)

Definition at line 1129 of file commctrl.c.

1132{
1133 return CreateToolbarEx (hwnd, style | CCS_NODIVIDER, wID, nBitmaps,
1134 hBMInst, wBMID, lpButtons,
1135 iNumButtons, 0, 0, 0, 0, CCSIZEOF_STRUCT(TBBUTTON, dwData));
1136}
HWND WINAPI CreateToolbarEx(HWND hwnd, DWORD style, UINT wID, INT nBitmaps, HINSTANCE hBMInst, UINT_PTR wBMID, LPCTBBUTTON lpButtons, INT iNumButtons, INT dxButton, INT dyButton, INT dxBitmap, INT dyBitmap, UINT uStructSize)
Definition: commctrl.c:936
static HANDLE ULONG_PTR dwData
Definition: file.c:35
#define CCS_NODIVIDER
Definition: commctrl.h:2253
#define CCSIZEOF_STRUCT(structname, member)
Definition: commctrl.h:153
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

◆ CreateToolbarEx()

HWND WINAPI CreateToolbarEx ( HWND  hwnd,
DWORD  style,
UINT  wID,
INT  nBitmaps,
HINSTANCE  hBMInst,
UINT_PTR  wBMID,
LPCTBBUTTON  lpButtons,
INT  iNumButtons,
INT  dxButton,
INT  dyButton,
INT  dxBitmap,
INT  dyBitmap,
UINT  uStructSize 
)

Definition at line 936 of file commctrl.c.

940{
941 HWND hwndTB;
942
943 hwndTB =
946 if(hwndTB) {
947 TBADDBITMAP tbab;
948
949 SendMessageW (hwndTB, TB_BUTTONSTRUCTSIZE, uStructSize, 0);
950
951 /* set bitmap and button size */
952 /*If CreateToolbarEx receives 0, windows sets default values*/
953 if (dxBitmap < 0)
954 dxBitmap = 16;
955 if (dyBitmap < 0)
956 dyBitmap = 16;
957 if (dxBitmap == 0 || dyBitmap == 0)
958 dxBitmap = dyBitmap = 16;
959 SendMessageW(hwndTB, TB_SETBITMAPSIZE, 0, MAKELPARAM(dxBitmap, dyBitmap));
960
961 if (dxButton < 0)
962 dxButton = dxBitmap;
963 if (dyButton < 0)
964 dyButton = dyBitmap;
965 /* TB_SETBUTTONSIZE -> TB_SETBITMAPSIZE bug introduced for Windows compatibility */
966 if (dxButton != 0 && dyButton != 0)
967 SendMessageW(hwndTB, TB_SETBITMAPSIZE, 0, MAKELPARAM(dxButton, dyButton));
968
969
970 /* add bitmaps */
971 if (nBitmaps > 0 || hBMInst == HINST_COMMCTRL)
972 {
973 tbab.hInst = hBMInst;
974 tbab.nID = wBMID;
975
976 SendMessageW (hwndTB, TB_ADDBITMAP, nBitmaps, (LPARAM)&tbab);
977 }
978 /* add buttons */
979 if(iNumButtons > 0)
980 SendMessageW (hwndTB, TB_ADDBUTTONSW, iNumButtons, (LPARAM)lpButtons);
981 }
982
983 return hwndTB;
984}
HMODULE COMCTL32_hModule
Definition: commctrl.c:79
#define WS_CHILD
Definition: pedump.c:617
#define HINST_COMMCTRL
Definition: commctrl.h:1063
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1134
#define TOOLBARCLASSNAMEW
Definition: commctrl.h:943
#define TB_SETBITMAPSIZE
Definition: commctrl.h:1136
#define TB_ADDBUTTONSW
Definition: commctrl.h:1266
#define TB_ADDBITMAP
Definition: commctrl.h:1056
UINT_PTR nID
Definition: commctrl.h:1060
HINSTANCE hInst
Definition: commctrl.h:1059
#define MAKELPARAM(l, h)
Definition: winuser.h:4011

Referenced by QuickLaunchBar::Create(), CreateToolbar(), TaskBar::Init(), init_functions(), InitInstance(), MainFrameBase::MainFrameBase(), MDIMainFrame::MDIMainFrame(), and OnCreate().

◆ CreateUpDownControl()

HWND WINAPI CreateUpDownControl ( DWORD  style,
INT  x,
INT  y,
INT  cx,
INT  cy,
HWND  parent,
INT  id,
HINSTANCE  inst,
HWND  buddy,
INT  maxVal,
INT  minVal,
INT  curVal 
)

Definition at line 836 of file commctrl.c.

839{
840 HWND hUD =
842 parent, (HMENU)(DWORD_PTR)id, inst, 0);
843 if (hUD) {
844 SendMessageW (hUD, UDM_SETBUDDY, (WPARAM)buddy, 0);
845 SendMessageW (hUD, UDM_SETRANGE, 0, MAKELONG(maxVal, minVal));
846 SendMessageW (hUD, UDM_SETPOS, 0, MAKELONG(curVal, 0));
847 }
848
849 return hUD;
850}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define UPDOWN_CLASSW
Definition: commctrl.h:2124
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
#define UDM_SETPOS
Definition: commctrl.h:2148
_Out_opt_ int * cx
Definition: commctrl.h:585
#define UDM_SETRANGE
Definition: commctrl.h:2146
#define UDM_SETBUDDY
Definition: commctrl.h:2150
#define MAKELONG(a, b)
Definition: typedefs.h:249
UINT_PTR WPARAM
Definition: windef.h:207

Referenced by DATETIME_StyleChanged(), init_functions(), PRINTDLG_WMInitDialog(), and PRINTDLG_WMInitDialogW().

◆ DefSubclassProc()

LRESULT WINAPI DefSubclassProc ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 1503 of file commctrl.c.

1504{
1506 LRESULT ret;
1507
1508 TRACE ("(%p, 0x%08x, 0x%08lx, 0x%08lx)\n", hWnd, uMsg, wParam, lParam);
1509
1510 /* retrieve our little stack from the Properties */
1512 if (!stack) {
1513 ERR ("Our sub classing stack got erased for %p!! Nothing we can do\n", hWnd);
1514 return 0;
1515 }
1516
1517 /* If we are at the end of stack then we have to call the original
1518 * window procedure */
1519 if (!stack->stackpos) {
1520 if (IsWindowUnicode (hWnd))
1521 ret = CallWindowProcW (stack->origproc, hWnd, uMsg, wParam, lParam);
1522 else
1523 ret = CallWindowProcA (stack->origproc, hWnd, uMsg, wParam, lParam);
1524 } else {
1525 const SUBCLASSPROCS *proc = stack->stackpos;
1526 stack->stackpos = stack->stackpos->next;
1527 /* call the Subclass procedure from the stack */
1528 ret = proc->subproc (hWnd, uMsg, wParam, lParam,
1529 proc->id, proc->ref);
1530 }
1531
1532 return ret;
1533}
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by COMBOEX_ComboWndProc(), COMCTL32_SubclassProc(), CredDialogPasswordSubclassProc(), DragList_SubclassWindowProc(), CAutoComplete::EditWndProc(), init_function_pointers(), init_functions(), ListViewSubclassProc(), CAutoComplete::OnEditChar(), CAutoComplete::OnEditKeyDown(), PROPSHEET_WizardSubclassProc(), subclass_proc(), TOOLTIPS_SubclassProc(), and UPDOWN_Buddy_SubclassProc().

◆ DllGetVersion()

HRESULT WINAPI DllGetVersion ( DLLVERSIONINFO pdvi)

Definition at line 1155 of file commctrl.c.

1156{
1157 if (pdvi->cbSize != sizeof(DLLVERSIONINFO)) {
1158 WARN("wrong DLLVERSIONINFO size from app\n");
1159 return E_INVALIDARG;
1160 }
1161
1164 pdvi->dwBuildNumber = 2919;
1165 pdvi->dwPlatformID = 6304;
1166
1167 TRACE("%u.%u.%u.%u\n",
1168 pdvi->dwMajorVersion, pdvi->dwMinorVersion,
1169 pdvi->dwBuildNumber, pdvi->dwPlatformID);
1170
1171 return S_OK;
1172}
#define WARN(fmt,...)
Definition: precomp.h:61
#define COMCTL32_VERSION_MINOR
Definition: comctl32.h:205
#define E_INVALIDARG
Definition: ddrawi.h:101
#define COMCTL32_VERSION
Definition: resource.h:72
#define S_OK
Definition: intsafe.h:52
DWORD dwMajorVersion
Definition: shlwapi.h:1983
DWORD dwBuildNumber
Definition: shlwapi.h:1985
DWORD dwMinorVersion
Definition: shlwapi.h:1984
DWORD dwPlatformID
Definition: shlwapi.h:1986

◆ DllInstall()

HRESULT WINAPI DllInstall ( BOOL  bInstall,
LPCWSTR  cmdline 
)

Definition at line 1183 of file commctrl.c.

1184{
1185 TRACE("(%u, %s): stub\n", bInstall, debugstr_w(cmdline));
1186 return S_OK;
1187}
#define debugstr_w
Definition: kernel32.h:32
TCHAR * cmdline
Definition: stretchblt.cpp:32

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  fdwReason,
LPVOID  lpvReserved 
)

Definition at line 341 of file commctrl.c.

342{
343 TRACE("%p,%x,%p\n", hinstDLL, fdwReason, lpvReserved);
344
345 switch (fdwReason) {
348
349 COMCTL32_hModule = hinstDLL;
350
351 /* add global subclassing atom (used by 'tooltip' and 'updown') */
353 TRACE("Subclassing atom added: %p\n", COMCTL32_wSubclass);
354
355 /* create local pattern brush */
358
359 /* Get all the colors at DLL load */
361
362#ifndef __REACTOS__
363 /* like comctl32 5.82+ register all the common control classes */
379 TAB_Register ();
385
389 EDIT_Register ();
392
393 /* subclass user32 controls */
395#else
396 InitializeClasses();
397#endif
398
399 break;
400
402 if (lpvReserved) break;
403#ifndef __REACTOS__
404 /* clean up subclassing */
406
407 /* unregister all common control classes */
429
431
432#else
433 UninitializeClasses();
434#endif
435 /* delete local pattern brush */
438
439 /* delete global subclassing atom */
441 TRACE("Subclassing atom deleted: %p\n", COMCTL32_wSubclass);
442 break;
443 }
444
445 return TRUE;
446}
void COMBOEX_Unregister(void)
Definition: comboex.c:2185
void COMBOEX_Register(void)
Definition: comboex.c:2168
void REBAR_Register(void) DECLSPEC_HIDDEN
Definition: rebar.c:3837
void TOOLTIPS_Unregister(void) DECLSPEC_HIDDEN
Definition: tooltips.c:2401
void EDIT_Register(void) DECLSPEC_HIDDEN
Definition: edit.c:5279
void PAGER_Register(void) DECLSPEC_HIDDEN
Definition: pager.c:1563
void HOTKEY_Unregister(void) DECLSPEC_HIDDEN
Definition: hotkey.c:559
void HEADER_Register(void) DECLSPEC_HIDDEN
Definition: header.c:2287
void IPADDRESS_Register(void) DECLSPEC_HIDDEN
Definition: ipaddress.c:662
void STATUS_Unregister(void) DECLSPEC_HIDDEN
Definition: status.c:1360
void FLATSB_Register(void) DECLSPEC_HIDDEN
Definition: flatsb.c:267
void TREEVIEW_Unregister(void) DECLSPEC_HIDDEN
Definition: treeview.c:5961
void SYSLINK_Register(void) DECLSPEC_HIDDEN
Definition: syslink.c:1747
void PROGRESS_Register(void) DECLSPEC_HIDDEN
Definition: progress.c:748
void STATIC_Register(void) DECLSPEC_HIDDEN
Definition: static.c:803
void THEMING_Uninitialize(void) DECLSPEC_HIDDEN
Definition: theming.c:191
void SYSLINK_Unregister(void) DECLSPEC_HIDDEN
Definition: syslink.c:1768
void TOOLBAR_Unregister(void) DECLSPEC_HIDDEN
Definition: toolbar.c:7299
void REBAR_Unregister(void) DECLSPEC_HIDDEN
Definition: rebar.c:3862
void TAB_Register(void) DECLSPEC_HIDDEN
Definition: tab.c:3480
void LISTBOX_Register(void) DECLSPEC_HIDDEN
Definition: listbox.c:3160
void MONTHCAL_Register(void) DECLSPEC_HIDDEN
Definition: monthcal.c:3034
void HOTKEY_Register(void) DECLSPEC_HIDDEN
Definition: hotkey.c:541
void TOOLTIPS_Register(void) DECLSPEC_HIDDEN
Definition: tooltips.c:2375
void STATUS_Register(void) DECLSPEC_HIDDEN
Definition: status.c:1336
void UPDOWN_Register(void) DECLSPEC_HIDDEN
Definition: updown.c:1177
void HEADER_Unregister(void) DECLSPEC_HIDDEN
Definition: header.c:2304
void PROGRESS_Unregister(void) DECLSPEC_HIDDEN
Definition: progress.c:769
void UPDOWN_Unregister(void) DECLSPEC_HIDDEN
Definition: updown.c:1199
void THEMING_Initialize(void) DECLSPEC_HIDDEN
Definition: theming.c:108
void TRACKBAR_Register(void) DECLSPEC_HIDDEN
Definition: trackbar.c:2068
void FLATSB_Unregister(void) DECLSPEC_HIDDEN
Definition: flatsb.c:285
void DATETIME_Unregister(void) DECLSPEC_HIDDEN
Definition: datetime.c:1737
void IPADDRESS_Unregister(void) DECLSPEC_HIDDEN
Definition: ipaddress.c:679
void DATETIME_Register(void) DECLSPEC_HIDDEN
Definition: datetime.c:1719
void TOOLBAR_Register(void) DECLSPEC_HIDDEN
Definition: toolbar.c:7281
void MONTHCAL_Unregister(void) DECLSPEC_HIDDEN
Definition: monthcal.c:3052
void COMBOLBOX_Register(void) DECLSPEC_HIDDEN
Definition: listbox.c:3175
void LISTVIEW_Unregister(void) DECLSPEC_HIDDEN
Definition: listview.c:12046
void PAGER_Unregister(void) DECLSPEC_HIDDEN
Definition: pager.c:1581
void NATIVEFONT_Unregister(void) DECLSPEC_HIDDEN
Definition: nativefont.c:131
void NATIVEFONT_Register(void) DECLSPEC_HIDDEN
Definition: nativefont.c:113
void LISTVIEW_Register(void) DECLSPEC_HIDDEN
Definition: listview.c:12021
void TREEVIEW_Register(void) DECLSPEC_HIDDEN
Definition: treeview.c:5940
void TAB_Unregister(void) DECLSPEC_HIDDEN
Definition: tab.c:3498
void TRACKBAR_Unregister(void) DECLSPEC_HIDDEN
Definition: trackbar.c:2085
static const WORD wPattern55AA[]
Definition: commctrl.c:86
static HBITMAP COMCTL32_hPattern55AABitmap
Definition: commctrl.c:84
VOID COMCTL32_RefreshSysColors(void)
Definition: commctrl.c:1593
static const WCHAR strCC32SubclassInfo[]
Definition: commctrl.c:92
static void unregister_versioned_classes(void)
Definition: commctrl.c:305
HBRUSH COMCTL32_hPattern55AABrush
Definition: commctrl.c:81
void ANIMATE_Register(void)
Definition: animate.c:965
void ANIMATE_Unregister(void)
Definition: animate.c:982
void BUTTON_Register(void)
Definition: button.c:2223
void COMBO_Register(void)
Definition: combo.c:2116
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
ATOM WINAPI GlobalDeleteAtom(ATOM nAtom)
Definition: atom.c:454
ATOM WINAPI GlobalAddAtomW(LPCWSTR lpString)
Definition: atom.c:444
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
static IN DWORD IN LPVOID lpvReserved
#define LOWORD(l)
Definition: pedump.c:82
HBRUSH WINAPI CreatePatternBrush(_In_ HBITMAP)

◆ DrawShadowText()

int WINAPI DrawShadowText ( HDC  hdc,
LPCWSTR  pszText,
UINT  cch,
RECT prc,
DWORD  dwFlags,
COLORREF  crText,
COLORREF  crShadow,
int  ixOffset,
int  iyOffset 
)

Definition at line 1852 of file commctrl.c.

1854{
1855 COLORREF crOldText;
1856 RECT rcText;
1857 INT iRet, x, y, x2, y2;
1858 BYTE *pBits;
1859 HBITMAP hbm, hbmOld;
1860 BITMAPINFO bi;
1861 HDC hdcMem;
1862 HFONT hOldFont;
1863 BLENDFUNCTION bf;
1864
1865 /* Create 32 bit DIB section for the shadow */
1866 ZeroMemory(&bi, sizeof(bi));
1867 bi.bmiHeader.biSize = sizeof(bi.bmiHeader);
1868 bi.bmiHeader.biWidth = prc->right - prc->left + 4;
1869 bi.bmiHeader.biHeight = prc->bottom - prc->top + 5; // bottom-up DIB
1870 bi.bmiHeader.biPlanes = 1;
1871 bi.bmiHeader.biBitCount = 32;
1873 hbm = CreateDIBSection(hdc, &bi, DIB_RGB_COLORS, (PVOID*)&pBits, NULL, 0);
1874 if(!hbm)
1875 {
1876 ERR("CreateDIBSection failed\n");
1877 return 0;
1878 }
1879
1880 /* Create memory device context for new DIB section and select it */
1882 if(!hdcMem)
1883 {
1884 ERR("CreateCompatibleDC failed\n");
1886 return 0;
1887 }
1888
1889 hbmOld = (HBITMAP)SelectObject(hdcMem, hbm);
1890
1891 /* Draw text on our helper bitmap */
1893 SetTextColor(hdcMem, RGB(16, 16, 16));
1894 SetBkColor(hdcMem, RGB(0, 0, 0));
1896 SetRect(&rcText, 0, 0, prc->right - prc->left, prc->bottom - prc->top);
1897 DrawTextW(hdcMem, pszText, cch, &rcText, dwFlags);
1898 SelectObject(hdcMem, hOldFont);
1899
1900 /* Flush GDI so data pointed by pBits is valid */
1901 GdiFlush();
1902
1903 /* Set alpha of pixels (forget about colors for now. They will be changed in next loop).
1904 We copy text image 4*5 times and each time alpha is added */
1905 for (x = 0; x < bi.bmiHeader.biWidth; ++x)
1906 for (y = 0; y < bi.bmiHeader.biHeight; ++y)
1907 {
1908 BYTE *pDest = &pBits[(y * bi.bmiHeader.biWidth + x) * 4];
1909 UINT Alpha = 0;
1910
1911 for (x2 = x - 4 + 1; x2 <= x; ++x2)
1912 for (y2 = y; y2 < y + 5; ++y2)
1913 {
1914 if (x2 >= 0 && x2 < bi.bmiHeader.biWidth && y2 >= 0 && y2 < bi.bmiHeader.biHeight)
1915 {
1916 BYTE *pSrc = &pBits[(y2 * bi.bmiHeader.biWidth + x2) * 4];
1917 Alpha += pSrc[0];
1918 }
1919 }
1920
1921 if (Alpha > 255)
1922 Alpha = 255;
1923 pDest[3] = Alpha;
1924 }
1925
1926 /* Now set the color of each pixel to shadow color * alpha (see GdiAlphaBlend) */
1927 for (x = 0; x < bi.bmiHeader.biWidth; ++x)
1928 for (y = 0; y < bi.bmiHeader.biHeight; ++y)
1929 {
1930 BYTE *pDest = &pBits[(y * bi.bmiHeader.biWidth + x) * 4];
1931 pDest[0] = GetBValue(crShadow) * pDest[3] / 255;
1932 pDest[1] = GetGValue(crShadow) * pDest[3] / 255;
1933 pDest[2] = GetRValue(crShadow) * pDest[3] / 255;
1934 }
1935
1936 /* Fix ixOffset of the shadow (tested on Win) */
1937 ixOffset -= 3;
1938 iyOffset -= 3;
1939
1940 /* Alpha blend helper image to destination DC */
1941 bf.BlendOp = AC_SRC_OVER;
1942 bf.BlendFlags = 0;
1943 bf.SourceConstantAlpha = 255;
1945 GdiAlphaBlend(hdc, prc->left + ixOffset, prc->top + iyOffset, bi.bmiHeader.biWidth, bi.bmiHeader.biHeight, hdcMem, 0, 0, bi.bmiHeader.biWidth, bi.bmiHeader.biHeight, bf);
1946
1947 /* Delete the helper bitmap */
1948 SelectObject(hdcMem, hbmOld);
1951
1952 /* Finally draw the text over shadow */
1953 crOldText = SetTextColor(hdc, crText);
1955 iRet = DrawTextW(hdc, pszText, cch, prc, dwFlags);
1956 SetTextColor(hdc, crOldText);
1957
1958 return iRet;
1959}
#define BI_RGB
Definition: precomp.h:56
BOOL WINAPI GdiAlphaBlend(HDC hdcDst, int xDst, int yDst, int widthDst, int heightDst, HDC hdcSrc, int xSrc, int ySrc, int widthSrc, int heightSrc, BLENDFUNCTION blendFunction)
#define AC_SRC_ALPHA
Definition: alphablend.c:9
static DWORD DWORD void LPSTR DWORD cch
Definition: str.c:202
_Out_ LPRECT prc
Definition: ntgdi.h:1658
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
#define OBJ_FONT
Definition: objidl.idl:1414
BYTE BlendOp
Definition: wingdi.h:2759
BYTE BlendFlags
Definition: wingdi.h:2760
BYTE AlphaFormat
Definition: wingdi.h:2762
BYTE SourceConstantAlpha
Definition: wingdi.h:2761
USHORT biBitCount
Definition: precomp.h:46
ULONG biCompression
Definition: precomp.h:47
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1476
HDC hdcMem
Definition: welcome.c:104
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
Definition: bitmap.c:245
#define ZeroMemory
Definition: winbase.h:1737
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3710
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3711
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:999
#define AC_SRC_OVER
Definition: wingdi.h:1369
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
Definition: dc.c:428
BOOL WINAPI GdiFlush(void)
Definition: misc.c:44
#define TRANSPARENT
Definition: wingdi.h:950
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:918
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)

Referenced by LISTVIEW_DrawItemPart(), CAppsListView::OnEraseBackground(), and CDownloaderProgress::OnPaint().

◆ DrawStatusTextA()

void WINAPI DrawStatusTextA ( HDC  hdc,
LPCRECT  lprc,
LPCSTR  text,
UINT  style 
)

Definition at line 742 of file commctrl.c.

743{
744 INT len;
745 LPWSTR textW = NULL;
746
747 if ( text ) {
748 if ( (len = MultiByteToWideChar( CP_ACP, 0, text, -1, NULL, 0 )) ) {
749 if ( (textW = Alloc( len * sizeof(WCHAR) )) )
751 }
752 }
754 Free( textW );
755}
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
void WINAPI DrawStatusTextW(HDC hdc, LPCRECT lprc, LPCWSTR text, UINT style)
Definition: commctrl.c:677
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
GLenum GLsizei len
Definition: glext.h:6722
static const WCHAR textW[]
Definition: itemdlg.c:1559
_In_ int _Inout_ LPRECT lprc
Definition: winuser.h:4469
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ DrawStatusTextW()

void WINAPI DrawStatusTextW ( HDC  hdc,
LPCRECT  lprc,
LPCWSTR  text,
UINT  style 
)

Definition at line 677 of file commctrl.c.

678{
679 RECT r = *lprc;
681 COLORREF oldbkcolor;
682
683 if (style & SBT_POPOUT)
685 else if (style & SBT_NOBORDERS)
686 border = 0;
687
688 oldbkcolor = SetBkColor (hdc, comctl32_color.clrBtnFace);
690
691 /* now draw text */
692 if (text) {
693 int oldbkmode = SetBkMode (hdc, TRANSPARENT);
694 COLORREF oldtextcolor;
696 int strCnt = 0;
697
698 oldtextcolor = SetTextColor (hdc, comctl32_color.clrBtnText);
699 if (style & SBT_RTLREADING)
700 FIXME("Unsupported RTL style!\n");
701 r.left += 3;
702 do {
703 if (*text == '\t') {
704 if (strCnt) {
706 strCnt = 0;
707 }
708 if (align==DT_RIGHT) {
709 break;
710 }
712 } else {
713 strCnt++;
714 }
715 } while(*text++);
716
717 if (strCnt) DrawTextW (hdc, text - strCnt, -1, &r, align|DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX);
718 SetBkMode (hdc, oldbkmode);
719 SetTextColor (hdc, oldtextcolor);
720 }
721
722 SetBkColor (hdc, oldbkcolor);
723}
#define FIXME(fmt,...)
Definition: precomp.h:53
int align(int length, int align)
Definition: dsound8.c:36
GLint GLint GLsizei GLsizei GLsizei GLint border
Definition: gl.h:1546
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define SBT_NOBORDERS
Definition: commctrl.h:1976
#define SBT_POPOUT
Definition: commctrl.h:1977
#define SBT_RTLREADING
Definition: commctrl.h:1978
#define DT_NOPREFIX
Definition: winuser.h:537
#define BDR_SUNKENOUTER
Definition: winuser.h:443
#define DT_CENTER
Definition: winuser.h:527
#define DT_SINGLELINE
Definition: winuser.h:540
#define BF_ADJUST
Definition: winuser.h:470
#define BF_MIDDLE
Definition: winuser.h:468
#define DT_LEFT
Definition: winuser.h:534
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
#define DT_VCENTER
Definition: winuser.h:543
#define BDR_RAISEDOUTER
Definition: winuser.h:442
#define DT_RIGHT
Definition: winuser.h:538
#define BF_RECT
Definition: winuser.h:462

Referenced by DrawStatusTextA(), and STATUSBAR_DrawPart().

◆ GetEffectiveClientRect()

VOID WINAPI GetEffectiveClientRect ( HWND  hwnd,
LPRECT  lpRect,
const INT lpInfo 
)

Definition at line 629 of file commctrl.c.

630{
631 RECT rcCtrl;
632 const INT *lpRun;
633 HWND hwndCtrl;
634
635 TRACE("(%p %p %p)\n",
636 hwnd, lpRect, lpInfo);
637
638 GetClientRect (hwnd, lpRect);
639 lpRun = lpInfo;
640
641 do {
642 lpRun += 2;
643 if (*lpRun == 0)
644 return;
645 lpRun++;
646 hwndCtrl = GetDlgItem (hwnd, *lpRun);
647 if (GetWindowLongW (hwndCtrl, GWL_STYLE) & WS_VISIBLE) {
648 TRACE("control id 0x%x\n", *lpRun);
649 GetWindowRect (hwndCtrl, &rcCtrl);
650 MapWindowPoints (NULL, hwnd, (LPPOINT)&rcCtrl, 2);
651 SubtractRect (lpRect, lpRect, &rcCtrl);
652 }
653 lpRun++;
654 } while (*lpRun);
655}
#define WS_VISIBLE
Definition: pedump.c:620
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define GWL_STYLE
Definition: winuser.h:855
BOOL WINAPI SubtractRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)

Referenced by CShellBrowser::GetBorderDW(), and CShellBrowser::OnSize().

◆ GetMUILanguage()

LANGID WINAPI GetMUILanguage ( VOID  )

Definition at line 1227 of file commctrl.c.

1228{
1229 return COMCTL32_uiLang;
1230}
static LANGID COMCTL32_uiLang
Definition: commctrl.c:80

◆ GetWindowSubclass()

BOOL WINAPI GetWindowSubclass ( HWND  hWnd,
SUBCLASSPROC  pfnSubclass,
UINT_PTR  uID,
DWORD_PTR pdwRef 
)

Definition at line 1355 of file commctrl.c.

1357{
1358 const SUBCLASS_INFO *stack;
1359 const SUBCLASSPROCS *proc;
1360
1361 TRACE ("(%p, %p, %lx, %p)\n", hWnd, pfnSubclass, uID, pdwRef);
1362
1363 /* See if we have been called for this window */
1365 if (!stack)
1366 return FALSE;
1367
1368 proc = stack->SubclassProcs;
1369 while (proc) {
1370 if ((proc->id == uID) &&
1371 (proc->subproc == pfnSubclass)) {
1372 *pdwRef = proc->ref;
1373 return TRUE;
1374 }
1375 proc = proc->next;
1376 }
1377
1378 return FALSE;
1379}
_In_ SUBCLASSPROC pfnSubclass
Definition: commctrl.h:5061

Referenced by DrawInsert().

◆ InitCommonControls()

◆ InitCommonControlsEx()

◆ InitMUILanguage()

VOID WINAPI InitMUILanguage ( LANGID  uiLang)

Definition at line 1241 of file commctrl.c.

1242{
1243 COMCTL32_uiLang = uiLang;
1244}

◆ IsDelimiter()

static BOOL IsDelimiter ( WCHAR  c)
inlinestatic

Definition at line 1802 of file commctrl.c.

1803{
1804 switch(c)
1805 {
1806 case '/':
1807 case '\\':
1808 case '.':
1809 case ' ':
1810 return TRUE;
1811 }
1812 return FALSE;
1813}
const GLubyte * c
Definition: glext.h:8905

Referenced by PathWordBreakProc().

◆ LoadIconMetric()

HRESULT WINAPI LoadIconMetric ( HINSTANCE  hinst,
const WCHAR name,
int  size,
HICON icon 
)

Definition at line 1984 of file commctrl.c.

1985{
1986 int cx, cy;
1987
1988 TRACE("(%p, %s, %d, %p)\n", hinst, debugstr_w(name), size, icon);
1989
1990 if (size == LIM_SMALL)
1991 {
1994 }
1995 else if (size == LIM_LARGE)
1996 {
1999 }
2000 else
2001 {
2002 *icon = NULL;
2003 return E_INVALIDARG;
2004 }
2005
2006 return LoadIconWithScaleDown(hinst, name, cx, cy, icon);
2007}
HRESULT WINAPI LoadIconWithScaleDown(HINSTANCE hinst, const WCHAR *name, int cx, int cy, HICON *icon)
Definition: commctrl.c:1964
GLsizeiptr size
Definition: glext.h:5919
static HINSTANCE hinst
Definition: edit.c:551
@ LIM_LARGE
Definition: commctrl.h:5254
@ LIM_SMALL
Definition: commctrl.h:5253
Definition: name.c:39
#define SM_CYSMICON
Definition: winuser.h:1016
#define SM_CXSMICON
Definition: winuser.h:1015
#define SM_CYICON
Definition: winuser.h:976
#define SM_CXICON
Definition: winuser.h:975
int WINAPI GetSystemMetrics(_In_ int)

◆ LoadIconWithScaleDown()

HRESULT WINAPI LoadIconWithScaleDown ( HINSTANCE  hinst,
const WCHAR name,
int  cx,
int  cy,
HICON icon 
)

Definition at line 1964 of file commctrl.c.

1965{
1966 TRACE("(%p, %s, %d, %d, %p)\n", hinst, debugstr_w(name), cx, cy, icon);
1967
1968 *icon = NULL;
1969
1970 if (!name)
1971 return E_INVALIDARG;
1972
1973 *icon = LoadImageW(hinst, name, IMAGE_ICON, cx, cy,
1975 if (!*icon)
1977
1978 return S_OK;
1979}
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define LR_LOADFROMFILE
Definition: winuser.h:1095
#define IMAGE_ICON
Definition: winuser.h:212
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2255

Referenced by LoadIconMetric().

◆ MenuHelp()

VOID WINAPI MenuHelp ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
HMENU  hMainMenu,
HINSTANCE  hInst,
HWND  hwndStatus,
UINT lpwIDs 
)

Definition at line 480 of file commctrl.c.

482{
483 UINT uMenuID = 0;
484
485 if (!IsWindow (hwndStatus))
486 return;
487
488 switch (uMsg) {
489 case WM_MENUSELECT:
490 TRACE("WM_MENUSELECT wParam=0x%lX lParam=0x%lX\n",
491 wParam, lParam);
492
493 if ((HIWORD(wParam) == 0xFFFF) && (lParam == 0)) {
494 /* menu was closed */
495 TRACE("menu was closed!\n");
497 }
498 else {
499 /* menu item was selected */
500 if (HIWORD(wParam) & MF_POPUP)
501 uMenuID = *(lpwIDs+1);
502 else
503 uMenuID = (UINT)LOWORD(wParam);
504 TRACE("uMenuID = %u\n", uMenuID);
505
506 if (uMenuID) {
507 WCHAR szText[256];
508
509 if (!LoadStringW (hInst, uMenuID, szText, ARRAY_SIZE(szText)))
510 szText[0] = '\0';
511
513 255 | SBT_NOBORDERS, (LPARAM)szText);
515 }
516 }
517 break;
518
519 case WM_COMMAND :
520 TRACE("WM_COMMAND wParam=0x%lX lParam=0x%lX\n",
521 wParam, lParam);
522 /* WM_COMMAND is not invalid since it is documented
523 * in the windows api reference. So don't output
524 * any FIXME for WM_COMMAND
525 */
526 WARN("We don't care about the WM_COMMAND\n");
527 break;
528
529 default:
530 FIXME("Invalid Message 0x%x!\n", uMsg);
531 break;
532 }
533}
HINSTANCE hInst
Definition: dxdiag.c:13
#define SB_SIMPLE
Definition: commctrl.h:1963
#define SB_SETTEXTW
Definition: commctrl.h:1947
HWND hwndStatus
Definition: solitaire.cpp:14
#define HIWORD(l)
Definition: typedefs.h:247
BOOL WINAPI IsWindow(_In_opt_ HWND)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define MF_POPUP
Definition: winuser.h:136
#define WM_MENUSELECT
Definition: winuser.h:1750

◆ MirrorIcon()

BOOL WINAPI MirrorIcon ( HICON phicon1,
HICON phicon2 
)

Definition at line 1796 of file commctrl.c.

1797{
1798 FIXME("(%p, %p): stub\n", phicon1, phicon2);
1799 return FALSE;
1800}

◆ PathWordBreakProc()

static int CALLBACK PathWordBreakProc ( LPCWSTR  lpch,
int  ichCurrent,
int  cch,
int  code 
)
static

Definition at line 1815 of file commctrl.c.

1816{
1817 if (code == WB_ISDELIMITER)
1818 return IsDelimiter(lpch[ichCurrent]);
1819 else
1820 {
1821 int dir = (code == WB_LEFT) ? -1 : 1;
1822 for(; 0 <= ichCurrent && ichCurrent < cch; ichCurrent += dir)
1823 if (IsDelimiter(lpch[ichCurrent])) return ichCurrent;
1824 }
1825 return ichCurrent;
1826}
unsigned int dir
Definition: maze.c:112
static BOOL IsDelimiter(WCHAR c)
Definition: commctrl.c:1802
Definition: inflate.c:139
#define WB_ISDELIMITER
Definition: winuser.h:549
#define WB_LEFT
Definition: winuser.h:550

Referenced by SetPathWordBreakProc().

◆ RemoveWindowSubclass()

BOOL WINAPI RemoveWindowSubclass ( HWND  hWnd,
SUBCLASSPROC  pfnSubclass,
UINT_PTR  uID 
)

Definition at line 1397 of file commctrl.c.

1398{
1400 LPSUBCLASSPROCS prevproc = NULL;
1402 BOOL ret = FALSE;
1403
1404 TRACE ("(%p, %p, %lx)\n", hWnd, pfnSubclass, uID);
1405
1406 /* Find the Subclass to remove */
1408 if (!stack)
1409 return FALSE;
1410
1411 proc = stack->SubclassProcs;
1412 while (proc) {
1413 if ((proc->id == uID) &&
1414 (proc->subproc == pfnSubclass)) {
1415
1416 if (!prevproc)
1417 stack->SubclassProcs = proc->next;
1418 else
1419 prevproc->next = proc->next;
1420
1421 if (stack->stackpos == proc)
1422 stack->stackpos = stack->stackpos->next;
1423
1424 Free (proc);
1425 ret = TRUE;
1426 break;
1427 }
1428 prevproc = proc;
1429 proc = proc->next;
1430 }
1431
1432 if (!stack->SubclassProcs && !stack->running) {
1433 TRACE("Last Subclass removed, cleaning up\n");
1434 /* clean up our heap and reset the original window procedure */
1435 if (IsWindowUnicode (hWnd))
1437 else
1439 Free (stack);
1441 }
1442
1443 return ret;
1444}
unsigned int BOOL
Definition: ntddk_ex.h:94
struct _SUBCLASSPROCS * next
Definition: comctl32.h:213

Referenced by COMBOEX_ComboWndProc(), CredDialogPasswordSubclassProc(), DragList_SubclassWindowProc(), CAutoComplete::EditWndProc(), init_function_pointers(), init_functions(), ListViewSubclassProc(), PROPSHEET_CleanUp(), PROPSHEET_RemovePage(), TOOLTIPS_SubclassProc(), and UPDOWN_Buddy_SubclassProc().

◆ SetPathWordBreakProc()

LRESULT WINAPI SetPathWordBreakProc ( HWND  hwnd,
BOOL  bSet 
)

Definition at line 1841 of file commctrl.c.

1842{
1844 (LPARAM)(bSet ? PathWordBreakProc : NULL));
1845}
static int CALLBACK PathWordBreakProc(LPCWSTR lpch, int ichCurrent, int cch, int code)
Definition: commctrl.c:1815
#define EM_SETWORDBREAKPROC
Definition: winuser.h:2023

Referenced by COMBOEX_SetExtendedStyle().

◆ SetWindowSubclass()

BOOL WINAPI SetWindowSubclass ( HWND  hWnd,
SUBCLASSPROC  pfnSubclass,
UINT_PTR  uIDSubclass,
DWORD_PTR  dwRef 
)

Definition at line 1268 of file commctrl.c.

1270{
1273
1274 TRACE ("(%p, %p, %lx, %lx)\n", hWnd, pfnSubclass, uIDSubclass, dwRef);
1275
1276 if (!hWnd || !pfnSubclass)
1277 return FALSE;
1278
1279 /* Since the window procedure that we set here has two additional arguments,
1280 * we can't simply set it as the new window procedure of the window. So we
1281 * set our own window procedure and then calculate the other two arguments
1282 * from there. */
1283
1284 /* See if we have been called for this window */
1286 if (!stack) {
1287 /* allocate stack */
1288 stack = Alloc (sizeof(SUBCLASS_INFO));
1289 if (!stack) {
1290 ERR ("Failed to allocate our Subclassing stack\n");
1291 return FALSE;
1292 }
1294
1295 /* set window procedure to our own and save the current one */
1296 if (IsWindowUnicode (hWnd))
1299 else
1302 }
1303 else {
1304 /* Check to see if we have called this function with the same uIDSubClass
1305 * and pfnSubclass */
1306 proc = stack->SubclassProcs;
1307 while (proc) {
1308 if ((proc->id == uIDSubclass) &&
1309 (proc->subproc == pfnSubclass)) {
1310 proc->ref = dwRef;
1311 return TRUE;
1312 }
1313 proc = proc->next;
1314 }
1315 }
1316
1317 proc = Alloc(sizeof(SUBCLASSPROCS));
1318 if (!proc) {
1319 ERR ("Failed to allocate subclass entry in stack\n");
1320 if (IsWindowUnicode (hWnd))
1322 else
1324 Free (stack);
1326 return FALSE;
1327 }
1328
1329 proc->subproc = pfnSubclass;
1330 proc->ref = dwRef;
1331 proc->id = uIDSubclass;
1332 proc->next = stack->SubclassProcs;
1333 stack->SubclassProcs = proc;
1334
1335 return TRUE;
1336}
static LRESULT WINAPI COMCTL32_SubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: commctrl.c:1452
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2909

Referenced by COMBOEX_Create(), CredDialogInit(), EditVariableDlgProc(), CAutoComplete::Init(), init_function_pointers(), init_functions(), MakeDragList(), PROPSHEET_CreatePage(), Test_MessagesNonThemed(), Test_MessagesThemed(), TOOLTIPS_AddToolT(), TOOLTIPS_ResetSubclass(), UPDOWN_ResetSubclass(), and UPDOWN_SetBuddy().

◆ ShowHideMenuCtl()

BOOL WINAPI ShowHideMenuCtl ( HWND  hwnd,
UINT_PTR  uFlags,
LPINT  lpInfo 
)

Definition at line 567 of file commctrl.c.

568{
569 LPINT lpMenuId;
570
571 TRACE("%p, %lx, %p\n", hwnd, uFlags, lpInfo);
572
573 if (lpInfo == NULL)
574 return FALSE;
575
576 if (!(lpInfo[0]) || !(lpInfo[1]))
577 return FALSE;
578
579 /* search for control */
580 lpMenuId = &lpInfo[2];
581 while (*lpMenuId != uFlags)
582 lpMenuId += 2;
583
585 /* uncheck menu item */
586 CheckMenuItem ((HMENU)(DWORD_PTR)lpInfo[0], *lpMenuId, MF_BYCOMMAND | MF_UNCHECKED);
587
588 /* hide control */
589 lpMenuId++;
590 SetWindowPos (GetDlgItem (hwnd, *lpMenuId), 0, 0, 0, 0, 0,
592 }
593 else {
594 /* check menu item */
595 CheckMenuItem ((HMENU)(DWORD_PTR)lpInfo[0], *lpMenuId, MF_BYCOMMAND | MF_CHECKED);
596
597 /* show control */
598 lpMenuId++;
599 SetWindowPos (GetDlgItem (hwnd, *lpMenuId), 0, 0, 0, 0, 0,
601 }
602
603 return TRUE;
604}
UINT uFlags
Definition: api.c:59
int * LPINT
Definition: windef.h:178
#define MF_BYCOMMAND
Definition: winuser.h:202
UINT WINAPI GetMenuState(_In_ HMENU, _In_ UINT, _In_ UINT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define MF_CHECKED
Definition: winuser.h:132
#define MF_UNCHECKED
Definition: winuser.h:204
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define SWP_SHOWWINDOW
Definition: winuser.h:1251
#define MFS_CHECKED
Definition: winuser.h:750
#define SWP_HIDEWINDOW
Definition: winuser.h:1244

◆ unregister_versioned_classes()

static void unregister_versioned_classes ( void  )
static

Definition at line 305 of file commctrl.c.

306{
307#define VERSION "6.0.2600.2982!"
308 static const char *classes[] =
309 {
312 VERSION "ComboLBox",
316 };
317 int i;
318
319 for (i = 0; i < ARRAY_SIZE(classes); i++)
320 UnregisterClassA(classes[i], NULL);
321
322#undef VERSION
323}
#define VERSION
#define WC_COMBOBOXA
Definition: commctrl.h:4721
#define WC_STATICA
Definition: commctrl.h:4684
#define WC_EDITA
Definition: commctrl.h:4691
#define WC_LISTBOXA
Definition: commctrl.h:4715
#define WC_BUTTONA
Definition: commctrl.h:4627
BOOL WINAPI UnregisterClassA(_In_ LPCSTR, HINSTANCE)

Referenced by DllMain().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( commctrl  )

Variable Documentation

◆ comctl32_color

◆ COMCTL32_hModule

◆ COMCTL32_hPattern55AABitmap

HBITMAP COMCTL32_hPattern55AABitmap = NULL
static

Definition at line 84 of file commctrl.c.

Referenced by DllMain().

◆ COMCTL32_hPattern55AABrush

HBRUSH COMCTL32_hPattern55AABrush = NULL

Definition at line 81 of file commctrl.c.

Referenced by DllMain(), TAB_EraseTabInterior(), TOOLBAR_DrawButton(), and TRACKBAR_DrawThumb().

◆ COMCTL32_uiLang

LANGID COMCTL32_uiLang = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL)
static

Definition at line 80 of file commctrl.c.

Referenced by GetMUILanguage(), and InitMUILanguage().

◆ COMCTL32_wSubclass

LPWSTR COMCTL32_wSubclass = NULL
static

◆ strCC32SubclassInfo

const WCHAR strCC32SubclassInfo[]
static
Initial value:
= {
'C','C','3','2','S','u','b','c','l','a','s','s','I','n','f','o',0
}

Definition at line 92 of file commctrl.c.

Referenced by DllMain().

◆ wPattern55AA

const WORD wPattern55AA[]
static
Initial value:
=
{
0x5555, 0xaaaa, 0x5555, 0xaaaa,
0x5555, 0xaaaa, 0x5555, 0xaaaa
}

Definition at line 86 of file commctrl.c.

Referenced by DllMain(), and UserInitialize().