ReactOS  0.4.13-dev-464-g6b95727
button.c File Reference
#include <windows.h>
#include <commctrl.h>
#include "wine/test.h"
#include "v6util.h"
#include "msg.h"
Include dependency graph for button.c:

Go to the source code of this file.

Classes

struct  wndclass_redirect_data
 

Macros

#define IS_WNDPROC_HANDLE(x)   (((ULONG_PTR)(x) >> 16) == (~0u >> 16))
 
#define ID_BUTTON   0x000e
 
#define COMBINED_SEQ_INDEX   0
 
#define NUM_MSG_SEQUENCES   1
 
#define MAKEFUNC_ORD(f, ord)   (p##f = (void*)GetProcAddress(hmod, (LPSTR)(ord)))
 
#define X(f)   p##f = (void *)GetProcAddress(hmod, #f);
 

Functions

static BOOL (WINAPI *pSetWindowSubclass)(HWND
 
static LRESULT (WINAPI *pDefSubclassProc)(HWND
 
static HIMAGELIST (WINAPI *pImageList_Create)(int
 
static int (WINAPI *pImageList_Add)(HIMAGELIST
 
static WCHARget_versioned_classname (const WCHAR *name)
 
static void init_functions (void)
 
static void flush_events (void)
 
static BOOL ignore_message (UINT message)
 
static LRESULT CALLBACK button_subclass_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, UINT_PTR id, DWORD_PTR ref_data)
 
static LRESULT WINAPI test_parent_wndproc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static HWND create_button (DWORD style, HWND parent)
 
static void test_button_messages (void)
 
static void test_button_class (void)
 
static void test_note (void)
 
static void test_bm_get_set_image (void)
 
static void register_parent_class (void)
 
static void test_button_data (void)
 
static void test_get_set_imagelist (void)
 
static void test_get_set_textmargin (void)
 
static void test_state (void)
 
static void test_bcm_get_ideal_size (void)
 
 START_TEST (button)
 

Variables

static SUBCLASSPROC
 
static UINT_PTR
 
static DWORD_PTR
 
static UINT
 
static WPARAM
 
static LPARAM
 
static int
 
static HBITMAP
 
static struct msg_sequencesequences [NUM_MSG_SEQUENCES]
 
static const struct message setfocus_seq []
 
static const struct message killfocus_seq []
 
static const struct message setfocus_static_seq []
 
static const struct message setfocus_groupbox_seq []
 
static const struct message killfocus_static_seq []
 
static const struct message setfocus_ownerdraw_seq []
 
static const struct message killfocus_ownerdraw_seq []
 
static const struct message lbuttondown_seq []
 
static const struct message lbuttonup_seq []
 
static const struct message setfont_seq []
 
static const struct message setstyle_seq []
 
static const struct message setstyle_static_seq []
 
static const struct message setstyle_user_seq []
 
static const struct message setstyle_ownerdraw_seq []
 
static const struct message setstate_seq []
 
static const struct message setstate_static_seq []
 
static const struct message setstate_user_seq []
 
static const struct message setstate_ownerdraw_seq []
 
static const struct message clearstate_seq []
 
static const struct message clearstate_ownerdraw_seq []
 
static const struct message setcheck_ignored_seq []
 
static const struct message setcheck_static_seq []
 
static const struct message setcheck_radio_seq []
 
static const struct message setcheck_radio_redraw_seq []
 

Macro Definition Documentation

◆ COMBINED_SEQ_INDEX

#define COMBINED_SEQ_INDEX   0

Definition at line 50 of file button.c.

◆ ID_BUTTON

#define ID_BUTTON   0x000e

Definition at line 48 of file button.c.

◆ IS_WNDPROC_HANDLE

#define IS_WNDPROC_HANDLE (   x)    (((ULONG_PTR)(x) >> 16) == (~0u >> 16))

Definition at line 38 of file button.c.

◆ MAKEFUNC_ORD

#define MAKEFUNC_ORD (   f,
  ord 
)    (p##f = (void*)GetProcAddress(hmod, (LPSTR)(ord)))

◆ NUM_MSG_SEQUENCES

#define NUM_MSG_SEQUENCES   1

Definition at line 51 of file button.c.

◆ X

#define X (   f)    p##f = (void *)GetProcAddress(hmod, #f);

Function Documentation

◆ BOOL()

static BOOL ( WINAPI pSetWindowSubclass)
static

◆ button_subclass_proc()

static LRESULT CALLBACK button_subclass_proc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam,
UINT_PTR  id,
DWORD_PTR  ref_data 
)
static

Definition at line 128 of file button.c.

129 {
130  static LONG defwndproc_counter = 0;
131  struct message msg = { 0 };
132  LRESULT ret;
133 
134  if (ignore_message( message )) return pDefSubclassProc(hwnd, message, wParam, lParam);
135 
136  switch (message)
137  {
138  case WM_SYNCPAINT:
139  break;
140  case BM_SETSTATE:
141  if (GetCapture())
142  ok(GetCapture() == hwnd, "GetCapture() = %p\n", GetCapture());
143  /* fall through */
144  default:
145  msg.message = message;
146  msg.flags = sent|wparam|lparam;
147  if (defwndproc_counter) msg.flags |= defwinproc;
148  msg.wParam = wParam;
149  msg.lParam = lParam;
151  }
152 
153  if (message == WM_NCDESTROY)
154  pRemoveWindowSubclass(hwnd, button_subclass_proc, 0);
155 
156  defwndproc_counter++;
157  ret = pDefSubclassProc(hwnd, message, wParam, lParam);
158  defwndproc_counter--;
159 
160  return ret;
161 }
#define WM_SYNCPAINT
Definition: winuser.h:1672
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define BM_SETSTATE
Definition: winuser.h:1884
Definition: tftpd.h:59
Definition: msg.h:39
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glext.h:5579
WPARAM wParam
Definition: combotst.c:138
long LONG
Definition: pedump.c:60
#define COMBINED_SEQ_INDEX
Definition: button.c:50
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
HWND WINAPI GetCapture(void)
Definition: message.c:2879
#define ok(value,...)
static BOOL ignore_message(UINT message)
Definition: button.c:114
static LRESULT CALLBACK button_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, UINT_PTR id, DWORD_PTR ref_data)
Definition: button.c:128
#define WM_NCDESTROY
Definition: winuser.h:1666
int ret
Definition: msg.h:34
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: button.c:53
#define add_message(msg)
Definition: msg.c:2142
#define msg(x)
Definition: auth_time.c:54
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by create_button().

◆ create_button()

static HWND create_button ( DWORD  style,
HWND  parent 
)
static

Definition at line 464 of file button.c.

465 {
466  HMENU menuid = 0;
467  HWND hwnd;
468 
469  if (parent)
470  {
472  menuid = (HMENU)ID_BUTTON;
473  }
474  hwnd = CreateWindowExA(0, WC_BUTTONA, "test", style, 0, 0, 50, 14, parent, menuid, 0, NULL);
475  ok(hwnd != NULL, "failed to create a button, 0x%08x, %p\n", style, parent);
476  pSetWindowSubclass(hwnd, button_subclass_proc, 0, 0);
477  return hwnd;
478 }
#define BS_NOTIFY
Definition: winuser.h:268
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define WS_CHILD
Definition: pedump.c:617
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
#define WC_BUTTONA
Definition: commctrl.h:4594
static LRESULT CALLBACK button_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, UINT_PTR id, DWORD_PTR ref_data)
Definition: button.c:128
r parent
Definition: btrfs.c:2708
#define ID_BUTTON
Definition: button.c:48
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR 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)
Arabic default style
Definition: afstyles.h:93
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60

Referenced by test_button_class(), test_button_data(), test_button_messages(), test_get_set_imagelist(), test_get_set_textmargin(), test_note(), and test_state().

◆ flush_events()

static void flush_events ( void  )
static

Definition at line 99 of file button.c.

100 {
101  MSG msg;
102  int diff = 200;
103  int min_timeout = 100;
104  DWORD time = GetTickCount() + diff;
105 
106  while (diff > 0)
107  {
108  if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min_timeout, QS_ALLINPUT ) == WAIT_TIMEOUT) break;
109  while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
110  diff = time - GetTickCount();
111  }
112 }
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:445
__u16 time
Definition: mkdosfs.c:366
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WAIT_TIMEOUT
Definition: dderror.h:14
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
#define QS_ALLINPUT
Definition: winuser.h:874
#define msg(x)
Definition: auth_time.c:54
#define PM_REMOVE
Definition: winuser.h:1182

Referenced by test_button_messages().

◆ get_versioned_classname()

static WCHAR* get_versioned_classname ( const WCHAR name)
static

Definition at line 66 of file button.c.

67 {
68  struct wndclass_redirect_data *wnddata;
69  ACTCTX_SECTION_KEYED_DATA data;
70  BOOL ret;
71 
72  memset(&data, 0, sizeof(data));
73  data.cbSize = sizeof(data);
74  ret = FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, name, &data);
75  ok(ret, "Failed to find class redirection section, error %u\n", GetLastError());
76  wnddata = (struct wndclass_redirect_data*)data.lpData;
77  return (WCHAR*)((BYTE*)wnddata + wnddata->name_offset);
78 }
return
Definition: dirsup.c:529
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
BOOL WINAPI FindActCtxSectionStringW(DWORD dwFlags, const GUID *lpExtGuid, ULONG ulId, LPCWSTR lpSearchStr, PACTCTX_SECTION_KEYED_DATA pInfo)
Definition: actctx.c:156
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
unsigned char BYTE
Definition: mem.h:68
Definition: name.c:36
#define memset(x, y, z)
Definition: compat.h:39

Referenced by test_button_class().

◆ HIMAGELIST()

static HIMAGELIST ( WINAPI pImageList_Create)
static

Referenced by Test_Imagelist().

◆ ignore_message()

static BOOL ignore_message ( UINT  message)
static

Definition at line 114 of file button.c.

115 {
116  /* these are always ignored */
117  return (message >= 0xc000 ||
118  message == WM_GETICON ||
119  message == WM_GETOBJECT ||
120  message == WM_TIMECHANGE ||
121  message == WM_DISPLAYCHANGE ||
125  message == WM_GETTEXT);
126 }
#define WM_GETTEXTLENGTH
Definition: winuser.h:1601
Definition: tftpd.h:59
#define WM_GETTEXT
Definition: winuser.h:1600
#define WM_DEVICECHANGE
Definition: winuser.h:1787
#define WM_DWMNCRENDERINGCHANGED
Definition: winuser.h:1846
#define WM_TIMECHANGE
Definition: winuser.h:1616

Referenced by button_subclass_proc(), and test_parent_wndproc().

◆ init_functions()

static void init_functions ( void  )
static

Definition at line 80 of file button.c.

81 {
82  HMODULE hmod = GetModuleHandleA("comctl32.dll");
83  ok(hmod != NULL, "got %p\n", hmod);
84 
85 #define MAKEFUNC_ORD(f, ord) (p##f = (void*)GetProcAddress(hmod, (LPSTR)(ord)))
89 #undef MAKEFUNC_ORD
90 
91 #define X(f) p##f = (void *)GetProcAddress(hmod, #f);
95 #undef X
96 }
INT WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
Definition: imagelist.c:445
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:925
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:801
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
LRESULT WINAPI DefSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: commctrl.c:1496
BOOL WINAPI SetWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uIDSubclass, DWORD_PTR dwRef)
Definition: commctrl.c:1261
#define MAKEFUNC_ORD(f, ord)
#define X(f)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:819
static PEXPLICIT_ACCESSW *static HMODULE hmod
Definition: security.c:141
BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uID)
Definition: commctrl.c:1390

Referenced by START_TEST().

◆ int()

static int ( WINAPI pImageList_Add)
static

◆ LRESULT()

static LRESULT ( WINAPI pDefSubclassProc)
static

◆ register_parent_class()

static void register_parent_class ( void  )
static

Definition at line 1214 of file button.c.

1215 {
1216  WNDCLASSA cls;
1217 
1218  cls.style = 0;
1220  cls.cbClsExtra = 0;
1221  cls.cbWndExtra = 0;
1222  cls.hInstance = GetModuleHandleA(0);
1223  cls.hIcon = 0;
1224  cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
1226  cls.lpszMenuName = NULL;
1227  cls.lpszClassName = "TestParentClass";
1228  RegisterClassA(&cls);
1229 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
int cbClsExtra
Definition: winuser.h:3118
LPCSTR lpszMenuName
Definition: winuser.h:3124
#define WHITE_BRUSH
Definition: wingdi.h:901
HBRUSH hbrBackground
Definition: winuser.h:3123
static LRESULT WINAPI test_parent_wndproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: button.c:163
int cbWndExtra
Definition: winuser.h:3119
HCURSOR hCursor
Definition: winuser.h:3122
smooth NULL
Definition: ftsmooth.c:416
const char * LPCSTR
Definition: xmlstorage.h:183
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:819
LPCSTR lpszClassName
Definition: winuser.h:3125
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
UINT style
Definition: winuser.h:3116
HINSTANCE hInstance
Definition: winuser.h:3120
WNDPROC lpfnWndProc
Definition: winuser.h:3117
#define IDC_ARROW
Definition: winuser.h:682
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
HICON hIcon
Definition: winuser.h:3121

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( button  )

Definition at line 1729 of file button.c.

1730 {
1731  ULONG_PTR ctx_cookie;
1732  HANDLE hCtx;
1733 
1734  if (!load_v6_module(&ctx_cookie, &hCtx))
1735  return;
1736 
1738 
1739  init_functions();
1741 
1744  test_note();
1745  test_button_data();
1749  test_state();
1751 
1752  unload_v6_module(ctx_cookie, hCtx);
1753 }
static void test_button_data(void)
Definition: button.c:1231
static void test_get_set_textmargin(void)
Definition: button.c:1369
static void unload_v6_module(ULONG_PTR cookie, HANDLE hCtx)
Definition: v6util.h:63
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define NUM_MSG_SEQUENCES
Definition: button.c:51
static void test_bm_get_set_image(void)
Definition: button.c:981
static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx)
Definition: v6util.h:71
static void init_msg_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:391
static void test_state(void)
Definition: button.c:1414
static void test_get_set_imagelist(void)
Definition: button.c:1289
static void test_note(void)
Definition: button.c:825
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: button.c:53
static void init_functions(void)
Definition: button.c:80
static void register_parent_class(void)
Definition: button.c:1214
static void test_bcm_get_ideal_size(void)
Definition: button.c:1430
static void test_button_messages(void)
Definition: button.c:480
static void test_button_class(void)
Definition: button.c:768

◆ test_bcm_get_ideal_size()

static void test_bcm_get_ideal_size ( void  )
static

Definition at line 1430 of file button.c.

1431 {
1432  static const char *button_text2 = "WWWW\nWWWW";
1433  static const char *button_text = "WWWW";
1434  static const DWORD imagelist_aligns[] = {BUTTON_IMAGELIST_ALIGN_LEFT, BUTTON_IMAGELIST_ALIGN_RIGHT,
1437  static const DWORD aligns[] = {0, BS_TOP, BS_LEFT, BS_RIGHT, BS_BOTTOM,
1439  DWORD default_style = WS_TABSTOP | WS_POPUP | WS_VISIBLE;
1440  const LONG client_width = 400, client_height = 200;
1441  LONG image_width, height, line_count, text_width;
1442  HFONT hfont, prev_font;
1443  DWORD style, type;
1444  BOOL ret;
1445  HWND hwnd;
1446  HDC hdc;
1447  LOGFONTA lf;
1448  TEXTMETRICA tm;
1449  SIZE size;
1450  HBITMAP hmask, hbmp;
1451  ICONINFO icon_info;
1452  HICON hicon;
1453  HIMAGELIST himl;
1454  BUTTON_IMAGELIST biml = {0};
1455  RECT rect;
1456  INT i, j;
1457 
1458  /* Check for NULL pointer handling */
1459  hwnd = CreateWindowA(WC_BUTTONA, button_text, BS_PUSHBUTTON | default_style, 0, 0, client_width, client_height,
1460  NULL, NULL, 0, NULL);
1462  ok(!ret, "Expect BCM_GETIDEALSIZE message to return false.\n");
1463 
1464  /* Set font so that the test is consistent on Wine and Windows */
1465  ZeroMemory(&lf, sizeof(lf));
1466  lf.lfWeight = FW_NORMAL;
1467  lf.lfHeight = 20;
1468  lstrcpyA(lf.lfFaceName, "Tahoma");
1469  hfont = CreateFontIndirectA(&lf);
1470  ok(hfont != NULL, "Failed to create test font.\n");
1471 
1472  /* Get tmHeight */
1473  hdc = GetDC(hwnd);
1474  prev_font = SelectObject(hdc, hfont);
1475  GetTextMetricsA(hdc, &tm);
1476  SelectObject(hdc, prev_font);
1477  DrawTextA(hdc, button_text, -1, &rect, DT_CALCRECT);
1478  text_width = rect.right - rect.left;
1479  ReleaseDC(hwnd, hdc);
1481 
1482  /* XP and 2003 doesn't support command links, getting ideal size with button having only text returns client size on these platforms. */
1483  hwnd = CreateWindowA(WC_BUTTONA, button_text, BS_DEFCOMMANDLINK | default_style, 0, 0, client_width, client_height, NULL,
1484  NULL, 0, NULL);
1485  ok(hwnd != NULL, "Expect hwnd not NULL\n");
1487  ZeroMemory(&size, sizeof(size));
1489  ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n");
1490  if (size.cx == client_width && size.cy == client_height)
1491  {
1492  /* on XP and 2003, buttons with image are not supported */
1493  win_skip("Skipping further tests on XP and 2003\n");
1494  return;
1495  }
1496 
1497  /* Tests for image placements */
1498  /* Prepare bitmap */
1499  image_width = 48;
1500  height = 48;
1501  hdc = GetDC(0);
1504 
1505  /* Only bitmap for push button, ideal size should be enough for image and text */
1506  hwnd = CreateWindowA(WC_BUTTONA, button_text, BS_DEFPUSHBUTTON | BS_BITMAP | default_style, 0, 0, client_width,
1507  client_height, NULL, NULL, 0, NULL);
1508  ok(hwnd != NULL, "Expect hwnd not NULL\n");
1511  ZeroMemory(&size, sizeof(size));
1513  ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n");
1514  /* Ideal size contains text rect even show bitmap only */
1515  ok((size.cx >= image_width + text_width && size.cy >= max(height, tm.tmHeight)),
1516  "Expect ideal cx %d >= %d and ideal cy %d >= %d\n", size.cx, image_width + text_width,
1517  size.cy, max(height, tm.tmHeight));
1519 
1520  /* Image alignments when button has bitmap and text*/
1521  for (i = 0; i < ARRAY_SIZE(aligns); i++)
1522  for (j = 0; j < ARRAY_SIZE(aligns); j++)
1523  {
1524  style = BS_DEFPUSHBUTTON | default_style | aligns[i] | aligns[j];
1525  hwnd = CreateWindowA(WC_BUTTONA, button_text, style, 0, 0, client_width, client_height, NULL, NULL, 0, NULL);
1526  ok(hwnd != NULL, "Expect hwnd not NULL\n");
1529  ZeroMemory(&size, sizeof(size));
1531  ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n");
1532  if (!(style & (BS_CENTER | BS_VCENTER)) || ((style & BS_CENTER) && (style & BS_CENTER) != BS_CENTER)
1533  || !(style & BS_VCENTER) || (style & BS_VCENTER) == BS_VCENTER)
1534  ok((size.cx >= image_width + text_width && size.cy >= max(height, tm.tmHeight)),
1535  "Style: 0x%08x expect ideal cx %d >= %d and ideal cy %d >= %d\n", style, size.cx,
1536  image_width + text_width, size.cy, max(height, tm.tmHeight));
1537  else
1538  ok((size.cx >= max(text_width, height) && size.cy >= height + tm.tmHeight),
1539  "Style: 0x%08x expect ideal cx %d >= %d and ideal cy %d >= %d\n", style, size.cx,
1540  max(text_width, height), size.cy, height + tm.tmHeight);
1542  }
1543 
1544  /* Image list alignments */
1545  himl = pImageList_Create(image_width, height, ILC_COLOR, 1, 1);
1546  pImageList_Add(himl, hbmp, 0);
1547  biml.himl = himl;
1548  for (i = 0; i < ARRAY_SIZE(imagelist_aligns); i++)
1549  {
1550  biml.uAlign = imagelist_aligns[i];
1551  hwnd = CreateWindowA(WC_BUTTONA, button_text, BS_DEFPUSHBUTTON | default_style, 0, 0, client_width,
1552  client_height, NULL, NULL, 0, NULL);
1553  ok(hwnd != NULL, "Expect hwnd not NULL\n");
1556  ZeroMemory(&size, sizeof(size));
1558  ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n");
1560  ok((size.cx >= max(text_width, height) && size.cy >= height + tm.tmHeight),
1561  "Align:%d expect ideal cx %d >= %d and ideal cy %d >= %d\n", biml.uAlign, size.cx,
1562  max(text_width, height), size.cy, height + tm.tmHeight);
1564  ok((size.cx >= image_width + text_width && size.cy >= max(height, tm.tmHeight)),
1565  "Align:%d expect ideal cx %d >= %d and ideal cy %d >= %d\n", biml.uAlign, size.cx,
1566  image_width + text_width, size.cy, max(height, tm.tmHeight));
1567  else
1568  ok(size.cx >= image_width && size.cy >= height, "Align:%d expect ideal cx %d >= %d and ideal cy %d >= %d\n",
1569  biml.uAlign, size.cx, image_width, size.cy, height);
1571  }
1572 
1573  /* Icon as image */
1574  /* Create icon from bitmap */
1575  ZeroMemory(&icon_info, sizeof(icon_info));
1576  icon_info.fIcon = TRUE;
1577  icon_info.hbmMask = hmask;
1578  icon_info.hbmColor = hbmp;
1579  hicon = CreateIconIndirect(&icon_info);
1580 
1581  /* Only icon, ideal size should be enough for image and text */
1582  hwnd = CreateWindowA(WC_BUTTONA, button_text, BS_DEFPUSHBUTTON | BS_ICON | default_style, 0, 0, client_width,
1583  client_height, NULL, NULL, 0, NULL);
1584  ok(hwnd != NULL, "Expect hwnd not NULL\n");
1587  ZeroMemory(&size, sizeof(size));
1589  ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n");
1590  /* Ideal size contains text rect even show icons only */
1591  ok((size.cx >= image_width + text_width && size.cy >= max(height, tm.tmHeight)),
1592  "Expect ideal cx %d >= %d and ideal cy %d >= %d\n", size.cx, image_width + text_width, size.cy,
1593  max(height, tm.tmHeight));
1595 
1596  /* Show icon and text */
1597  hwnd = CreateWindowA(WC_BUTTONA, button_text, BS_DEFPUSHBUTTON | default_style, 0, 0, client_width,
1598  client_height, NULL, NULL, 0, NULL);
1599  ok(hwnd != NULL, "Expect hwnd not NULL\n");
1602  ZeroMemory(&size, sizeof(size));
1604  ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n");
1605  ok((size.cx >= image_width + text_width && size.cy >= max(height, tm.tmHeight)),
1606  "Expect ideal cx %d >= %d and ideal cy %d >= %d\n", size.cx, image_width + text_width, size.cy,
1607  max(height, tm.tmHeight));
1609 
1610  /* Checkbox */
1611  /* Both bitmap and text for checkbox, ideal size is only enough for text because it doesn't support image(but not image list)*/
1612  hwnd = CreateWindowA(WC_BUTTONA, button_text, BS_AUTOCHECKBOX | default_style, 0, 0, client_width, client_height,
1613  NULL, NULL, 0, NULL);
1614  ok(hwnd != NULL, "Expect hwnd not NULL\n");
1617  ZeroMemory(&size, sizeof(size));
1619  ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n");
1620  ok((size.cx <= image_width + text_width && size.cx >= text_width && size.cy <= max(height, tm.tmHeight)
1621  && size.cy >= tm.tmHeight),
1622  "Expect ideal cx %d within range (%d, %d ) and ideal cy %d within range (%d, %d )\n", size.cx,
1623  text_width, image_width + text_width, size.cy, tm.tmHeight, max(height, tm.tmHeight));
1625 
1626  /* Both image list and text for checkbox, ideal size should have enough for image list and text */
1628  hwnd = CreateWindowA(WC_BUTTONA, button_text, BS_AUTOCHECKBOX | BS_BITMAP | default_style, 0, 0, client_width,
1629  client_height, NULL, NULL, 0, NULL);
1630  ok(hwnd != NULL, "Expect hwnd not NULL\n");
1633  ZeroMemory(&size, sizeof(size));
1635  ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n");
1636  ok((size.cx >= image_width + text_width && size.cy >= max(height, tm.tmHeight)),
1637  "Expect ideal cx %d >= %d and ideal cy %d >= %d\n", size.cx, image_width + text_width, size.cy,
1638  max(height, tm.tmHeight));
1640 
1641  /* Only bitmap for checkbox, ideal size should have enough for image and text */
1642  hwnd = CreateWindowA(WC_BUTTONA, button_text, BS_AUTOCHECKBOX | BS_BITMAP | default_style, 0, 0, client_width,
1643  client_height, NULL, NULL, 0, NULL);
1644  ok(hwnd != NULL, "Expect hwnd not NULL\n");
1647  ZeroMemory(&size, sizeof(size));
1649  ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n");
1650  ok((size.cx >= image_width + text_width && size.cy >= max(height, tm.tmHeight)),
1651  "Expect ideal cx %d >= %d and ideal cy %d >= %d\n", size.cx, image_width + text_width, size.cy,
1652  max(height, tm.tmHeight));
1654 
1655  /* Test button with only text */
1656  /* No text */
1658  {
1659  style = type | default_style;
1660  hwnd = CreateWindowA(WC_BUTTONA, "", style, 0, 0, client_width, client_height, NULL, NULL, 0, NULL);
1661  ok(hwnd != NULL, "Expect hwnd not NULL\n");
1663 
1664  ZeroMemory(&size, sizeof(size));
1666  ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n");
1667 
1669  {
1670  todo_wine ok((size.cx == 0 && size.cy > 0), "Style 0x%08x expect ideal cx %d >= %d and ideal cy %d >= %d\n",
1671  style, size.cx, 0, size.cy, 0);
1672  }
1673  else
1674  {
1675  ok(size.cx == client_width && size.cy == client_height,
1676  "Style 0x%08x expect size.cx == %d and size.cy == %d, got size.cx: %d size.cy: %d\n", style,
1677  client_width, client_height, size.cx, size.cy);
1678  }
1680  }
1681 
1682  /* Single line and multiple lines text */
1683  for (line_count = 1; line_count <= 2; line_count++)
1684  {
1686  {
1687  style = line_count > 1 ? type | BS_MULTILINE : type;
1688  style |= default_style;
1689 
1690  hwnd = CreateWindowA(WC_BUTTONA, (line_count == 2 ? button_text2 : button_text), style, 0, 0, client_width,
1691  client_height, NULL, NULL, 0, NULL);
1692  ok(hwnd != NULL, "Expect hwnd not NULL\n");
1694  ZeroMemory(&size, sizeof(size));
1696  ok(ret, "Expect BCM_GETIDEALSIZE message to return true\n");
1697 
1698  if (type == BS_3STATE || type == BS_AUTO3STATE || type == BS_GROUPBOX || type == BS_PUSHBOX
1699  || type == BS_OWNERDRAW)
1700  {
1701  ok(size.cx == client_width && size.cy == client_height,
1702  "Style 0x%08x expect ideal size (%d,%d), got (%d,%d)\n", style, client_width, client_height, size.cx,
1703  size.cy);
1704  }
1705  else if (type == BS_COMMANDLINK || type == BS_DEFCOMMANDLINK)
1706  {
1707  todo_wine ok((size.cx == 0 && size.cy > 0),
1708  "Style 0x%08x expect ideal cx %d >= %d and ideal cy %d >= %d\n", style, size.cx, 0,
1709  size.cy, 0);
1710  }
1711  else
1712  {
1713  height = line_count == 2 ? 2 * tm.tmHeight : tm.tmHeight;
1714  ok(size.cx >= 0 && size.cy >= height, "Style 0x%08x expect ideal cx %d >= 0 and ideal cy %d >= %d\n",
1715  style, size.cx, size.cy, height);
1716  }
1718  }
1719  }
1720 
1721  pImageList_Destroy(himl);
1722  DestroyIcon(hicon);
1723  DeleteObject(hbmp);
1724  DeleteObject(hmask);
1725  ReleaseDC(0, hdc);
1727 }
HIMAGELIST himl
Definition: commctrl.h:4606
#define BS_3STATE
Definition: pedump.c:656
#define BS_LEFT
Definition: winuser.h:265
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define max(a, b)
Definition: svc.c:63
#define BS_OWNERDRAW
Definition: pedump.c:661
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
#define IMAGE_ICON
Definition: winuser.h:212
#define BS_DEFCOMMANDLINK
Definition: commctrl.h:4644
HDC WINAPI GetDC(_In_opt_ HWND)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
#define BS_RIGHT
Definition: winuser.h:274
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static HDC
Definition: imagelist.c:92
#define BS_DEFPUSHBUTTON
Definition: pedump.c:652
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define BUTTON_IMAGELIST_ALIGN_TOP
Definition: commctrl.h:4601
#define ZeroMemory
Definition: winbase.h:1635
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
UINT_PTR WPARAM
Definition: windef.h:207
#define BS_CENTER
Definition: winuser.h:260
#define WS_EX_RIGHT
Definition: winuser.h:400
HIMAGELIST himl
BOOL WINAPI DestroyWindow(_In_ HWND)
#define BM_SETIMAGE
Definition: winuser.h:1883
int32_t INT
Definition: typedefs.h:56
#define BS_GROUPBOX
Definition: pedump.c:658
& rect
Definition: startmenu.cpp:1413
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
#define DT_CALCRECT
Definition: winuser.h:526
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
LONG lfHeight
Definition: dimm.idl:42
#define BUTTON_IMAGELIST_ALIGN_CENTER
Definition: commctrl.h:4603
HBITMAP hbmMask
Definition: winuser.h:3079
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define ILC_COLOR
Definition: commctrl.h:337
#define ok(value,...)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4184
int image_width
LONG lfWeight
Definition: dimm.idl:46
smooth NULL
Definition: ftsmooth.c:416
#define WC_BUTTONA
Definition: commctrl.h:4594
#define BS_AUTOCHECKBOX
Definition: pedump.c:654
#define BS_AUTO3STATE
Definition: pedump.c:657
LONG_PTR LPARAM
Definition: windef.h:208
HBITMAP hbmColor
Definition: winuser.h:3080
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
Definition: text.c:200
static HFONT hfont
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 GLint GLint j
Definition: glfuncs.h:250
HBITMAP hbmp
BOOL fIcon
Definition: winuser.h:3076
#define BS_COMMANDLINK
Definition: commctrl.h:4643
GLsizeiptr size
Definition: glext.h:5919
#define BS_MULTILINE
Definition: winuser.h:267
HICON WINAPI CreateIconIndirect(_In_ PICONINFO)
Definition: cursoricon.c:2546
#define BS_TOP
Definition: winuser.h:277
unsigned long DWORD
Definition: ntddk_ex.h:95
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
int ret
#define BUTTON_IMAGELIST_ALIGN_LEFT
Definition: commctrl.h:4599
#define BS_ICON
Definition: winuser.h:264
#define todo_wine
Definition: test.h:154
HDC hdc
Definition: main.c:9
#define BS_BITMAP
Definition: winuser.h:258
#define WS_TABSTOP
Definition: pedump.c:634
Definition: time.h:76
#define BS_VCENTER
Definition: winuser.h:279
#define BS_PUSHBUTTON
Definition: pedump.c:651
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define BUTTON_IMAGELIST_ALIGN_BOTTOM
Definition: commctrl.h:4602
INT WINAPI DrawTextA(HDC hdc, LPCSTR str, INT count, LPRECT rect, UINT flags)
Definition: font.c:373
#define ARRAY_SIZE(a)
Definition: main.h:24
#define WS_POPUP
Definition: pedump.c:616
#define BS_BOTTOM
Definition: winuser.h:259
#define IMAGE_BITMAP
Definition: winuser.h:211
#define WM_SETFONT
Definition: winuser.h:1632
#define FW_NORMAL
Definition: wingdi.h:372
#define BUTTON_IMAGELIST_ALIGN_RIGHT
Definition: commctrl.h:4600
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55
#define BCM_GETIDEALSIZE
Definition: commctrl.h:4611
static HBITMAP
Definition: button.c:44
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620
#define BCM_SETIMAGELIST
Definition: commctrl.h:4614
#define BS_RIGHTBUTTON
Definition: winuser.h:275
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_bm_get_set_image()

static void test_bm_get_set_image ( void  )
static

Definition at line 981 of file button.c.

982 {
983  HWND hwnd;
984  HDC hdc;
985  HBITMAP hbmp1x1;
986  HBITMAP hbmp2x2;
987  HBITMAP hmask2x2;
988  ICONINFO icon_info2x2;
989  HICON hicon2x2;
990  HBITMAP hbmp;
991  HICON hicon;
992  ICONINFO icon_info;
993  BITMAP bm;
994  static const DWORD default_style = BS_PUSHBUTTON | WS_TABSTOP | WS_POPUP | WS_VISIBLE;
995 
996  hdc = GetDC(0);
997  hbmp1x1 = CreateCompatibleBitmap(hdc, 1, 1);
998  hbmp2x2 = CreateCompatibleBitmap(hdc, 2, 2);
999  ZeroMemory(&bm, sizeof(bm));
1000  ok(GetObjectW(hbmp1x1, sizeof(bm), &bm), "Expect GetObjectW() success\n");
1001  ok(bm.bmWidth == 1 && bm.bmHeight == 1, "Expect bitmap size: %d,%d, got: %d,%d\n", 1, 1,
1002  bm.bmWidth, bm.bmHeight);
1003  ZeroMemory(&bm, sizeof(bm));
1004  ok(GetObjectW(hbmp2x2, sizeof(bm), &bm), "Expect GetObjectW() success\n");
1005  ok(bm.bmWidth == 2 && bm.bmHeight == 2, "Expect bitmap size: %d,%d, got: %d,%d\n", 2, 2,
1006  bm.bmWidth, bm.bmHeight);
1007 
1008  hmask2x2 = CreateCompatibleBitmap(hdc, 2, 2);
1009  ZeroMemory(&icon_info2x2, sizeof(icon_info2x2));
1010  icon_info2x2.fIcon = TRUE;
1011  icon_info2x2.hbmMask = hmask2x2;
1012  icon_info2x2.hbmColor = hbmp2x2;
1013  hicon2x2 = CreateIconIndirect(&icon_info2x2);
1014  ok(hicon2x2 !=NULL, "Expect CreateIconIndirect() success\n");
1015 
1016  ZeroMemory(&icon_info, sizeof(icon_info));
1017  ok(GetIconInfo(hicon2x2, &icon_info), "Expect GetIconInfo() success\n");
1018  ZeroMemory(&bm, sizeof(bm));
1019  ok(GetObjectW(icon_info.hbmColor, sizeof(bm), &bm), "Expect GetObjectW() success\n");
1020  ok(bm.bmWidth == 2 && bm.bmHeight == 2, "Expect bitmap size: %d,%d, got: %d,%d\n", 2, 2,
1021  bm.bmWidth, bm.bmHeight);
1022  DeleteObject(icon_info.hbmColor);
1023  DeleteObject(icon_info.hbmMask);
1024 
1025  hwnd = CreateWindowA(WC_BUTTONA, "test", default_style | BS_BITMAP, 0, 0, 100, 100, 0, 0,
1026  0, 0);
1027  ok(hwnd != NULL, "Expect hwnd to be not NULL\n");
1028  /* Get image when image is not set */
1030  ok(hbmp == 0, "Expect hbmp == 0\n");
1031  /* Set image */
1033  ok(hbmp == 0, "Expect hbmp == 0\n");
1035  ok(hbmp != 0, "Expect hbmp != 0\n");
1036  /* Set null resets image */
1038  ok(hbmp != 0, "Expect hbmp != 0\n");
1040  ok(hbmp == 0, "Expect hbmp == 0\n");
1042 
1043  /* Set bitmap with BS_BITMAP */
1044  hwnd = CreateWindowA(WC_BUTTONA, "test", default_style | BS_BITMAP, 0, 0, 100, 100, 0, 0,
1045  0, 0);
1046  ok(hwnd != NULL, "Expect hwnd to be not NULL\n");
1048  ok(hbmp == 0, "Expect hbmp == 0\n");
1050  ok(hbmp != 0, "Expect hbmp != 0\n");
1051  ZeroMemory(&bm, sizeof(bm));
1052  ok(GetObjectW(hbmp, sizeof(bm), &bm), "Expect GetObjectW() success\n");
1053  ok(bm.bmWidth == 1 && bm.bmHeight == 1, "Expect bitmap size: %d,%d, got: %d,%d\n", 1, 1,
1054  bm.bmWidth, bm.bmHeight);
1056 
1057  /* Set bitmap without BS_BITMAP */
1058  hwnd = CreateWindowA(WC_BUTTONA, "test", default_style, 0, 0, 100, 100, 0, 0, 0, 0);
1059  ok(hwnd != NULL, "Expect hwnd to be not NULL\n");
1061  ok(hbmp == 0, "Expect hbmp == 0\n");
1063  if (hbmp == 0)
1064  {
1065  /* on xp or 2003*/
1066  win_skip("Show both image and text is not supported. Skip following tests.\n");
1068  goto done;
1069  }
1070  ok(hbmp != 0, "Expect hbmp != 0\n");
1071  ZeroMemory(&bm, sizeof(bm));
1072  ok(GetObjectW(hbmp, sizeof(bm), &bm), "Expect GetObjectW() success\n");
1073  ok(bm.bmWidth == 1 && bm.bmHeight == 1, "Expect bitmap size: %d,%d, got: %d,%d\n", 1, 1,
1074  bm.bmWidth, bm.bmHeight);
1076 
1077  /* Set icon with BS_ICON */
1078  hwnd = CreateWindowA(WC_BUTTONA, "test", default_style | BS_ICON, 0, 0, 100, 100, 0, 0, 0,
1079  0);
1080  ok(hwnd != NULL, "Expect hwnd to be not NULL\n");
1081  hicon = (HICON)SendMessageA(hwnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hicon2x2);
1082  ok(hicon == 0, "Expect hicon == 0\n");
1083  hicon = (HICON)SendMessageA(hwnd, BM_GETIMAGE, IMAGE_ICON, 0);
1084  ok(hicon != 0, "Expect hicon != 0\n");
1085  ZeroMemory(&icon_info, sizeof(icon_info));
1086  ok(GetIconInfo(hicon, &icon_info), "Expect GetIconInfo() success\n");
1087  ZeroMemory(&bm, sizeof(bm));
1088  ok(GetObjectW(icon_info.hbmColor, sizeof(bm), &bm), "Expect GetObjectW() success\n");
1089  ok(bm.bmWidth == 2 && bm.bmHeight == 2, "Expect bitmap size: %d,%d, got: %d,%d\n", 2, 2,
1090  bm.bmWidth, bm.bmHeight);
1091  DeleteObject(icon_info.hbmColor);
1092  DeleteObject(icon_info.hbmMask);
1094 
1095  /* Set icon without BS_ICON */
1096  hwnd = CreateWindowA(WC_BUTTONA, "test", default_style, 0, 0, 100, 100, 0, 0, 0, 0);
1097  ok(hwnd != NULL, "Expect hwnd to be not NULL\n");
1098  hicon = (HICON)SendMessageA(hwnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hicon2x2);
1099  ok(hicon == 0, "Expect hicon == 0\n");
1100  hicon = (HICON)SendMessageA(hwnd, BM_GETIMAGE, IMAGE_ICON, 0);
1101  ok(hicon != 0, "Expect hicon != 0\n");
1102  ZeroMemory(&icon_info, sizeof(icon_info));
1103  ok(GetIconInfo(hicon, &icon_info), "Expect GetIconInfo() success\n");
1104  ZeroMemory(&bm, sizeof(bm));
1105  ok(GetObjectW(icon_info.hbmColor, sizeof(bm), &bm), "Expect GetObjectW() success\n");
1106  ok(bm.bmWidth == 2 && bm.bmHeight == 2, "Expect bitmap size: %d,%d, got: %d,%d\n", 2, 2,
1107  bm.bmWidth, bm.bmHeight);
1108  DeleteObject(icon_info.hbmColor);
1109  DeleteObject(icon_info.hbmMask);
1111 
1112  /* Set icon with BS_BITMAP */
1113  hwnd = CreateWindowA(WC_BUTTONA, "test", default_style | BS_BITMAP, 0, 0, 100, 100, 0, 0,
1114  0, 0);
1115  ok(hwnd != NULL, "Expect hwnd to be not NULL\n");
1116  hicon = (HICON)SendMessageA(hwnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hicon2x2);
1117  ok(hicon == 0, "Expect hicon == 0\n");
1118  hicon = (HICON)SendMessageA(hwnd, BM_GETIMAGE, IMAGE_ICON, 0);
1119  ok(hicon != 0, "Expect hicon != 0\n");
1120  ZeroMemory(&icon_info, sizeof(icon_info));
1121  ok(GetIconInfo(hicon, &icon_info), "Expect GetIconInfo() success\n");
1122  ZeroMemory(&bm, sizeof(bm));
1123  ok(GetObjectW(icon_info.hbmColor, sizeof(bm), &bm), "Expect GetObjectW() success\n");
1124  ok(bm.bmWidth == 2 && bm.bmHeight == 2, "Expect bitmap size: %d,%d, got: %d,%d\n", 2, 2,
1125  bm.bmWidth, bm.bmHeight);
1126  DeleteObject(icon_info.hbmColor);
1127  DeleteObject(icon_info.hbmMask);
1129 
1130  /* Set bitmap with BS_ICON */
1131  hwnd = CreateWindowA(WC_BUTTONA, "test", default_style | BS_ICON, 0, 0, 100, 100, 0, 0, 0,
1132  0);
1133  ok(hwnd != NULL, "Expect hwnd to be not NULL\n");
1135  ok(hbmp == 0, "Expect hbmp == 0\n");
1137  ok(hbmp != 0, "Expect hbmp != 0\n");
1138  ZeroMemory(&bm, sizeof(bm));
1139  ok(GetObjectW(hbmp, sizeof(bm), &bm), "Expect GetObjectW() success\n");
1140  ok(bm.bmWidth == 1 && bm.bmHeight == 1, "Expect bitmap size: %d,%d, got: %d,%d\n", 1, 1,
1141  bm.bmWidth, bm.bmHeight);
1143 
1144  /* Set bitmap with BS_BITMAP and IMAGE_ICON*/
1145  hwnd = CreateWindowA(WC_BUTTONA, "test", default_style | BS_BITMAP, 0, 0, 100, 100, 0, 0,
1146  0, 0);
1147  ok(hwnd != NULL, "Expect hwnd to be not NULL\n");
1149  ok(hbmp == 0, "Expect hbmp == 0\n");
1151  ok(hbmp != 0, "Expect hbmp != 0\n");
1152  ZeroMemory(&bm, sizeof(bm));
1153  ok(GetObjectW(hbmp, sizeof(bm), &bm), "Expect GetObjectW() success\n");
1154  ok(bm.bmWidth == 1 && bm.bmHeight == 1, "Expect bitmap size: %d,%d, got: %d,%d\n", 1, 1,
1155  bm.bmWidth, bm.bmHeight);
1157 
1158  /* Set icon with BS_ICON and IMAGE_BITMAP */
1159  hwnd = CreateWindowA(WC_BUTTONA, "test", default_style | BS_ICON, 0, 0, 100, 100, 0, 0, 0,
1160  0);
1161  ok(hwnd != NULL, "Expect hwnd to be not NULL\n");
1162  hicon = (HICON)SendMessageA(hwnd, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hicon2x2);
1163  ok(hicon == 0, "Expect hicon == 0\n");
1165  ok(hicon != 0, "Expect hicon != 0\n");
1166  ZeroMemory(&icon_info, sizeof(icon_info));
1167  ok(GetIconInfo(hicon, &icon_info), "Expect GetIconInfo() success\n");
1168  ZeroMemory(&bm, sizeof(bm));
1169  ok(GetObjectW(icon_info.hbmColor, sizeof(BITMAP), &bm), "Expect GetObjectW() success\n");
1170  ok(bm.bmWidth == 2 && bm.bmHeight == 2, "Expect bitmap size: %d,%d, got: %d,%d\n", 2, 2,
1171  bm.bmWidth, bm.bmHeight);
1172  DeleteObject(icon_info.hbmColor);
1173  DeleteObject(icon_info.hbmMask);
1175 
1176  /* Set bitmap with BS_ICON and IMAGE_ICON */
1177  hwnd = CreateWindowA(WC_BUTTONA, "test", default_style | BS_ICON, 0, 0, 100, 100, 0, 0, 0, 0);
1178  ok(hwnd != NULL, "Expect hwnd to be not NULL\n");
1180  ok(hbmp == 0, "Expect hbmp == 0\n");
1182  ok(hbmp != 0, "Expect hbmp != 0\n");
1183  ZeroMemory(&bm, sizeof(bm));
1184  ok(GetObjectW(hbmp, sizeof(bm), &bm), "Expect GetObjectW() success\n");
1185  ok(bm.bmWidth == 1 && bm.bmHeight == 1, "Expect bitmap size: %d,%d, got: %d,%d\n", 1, 1,
1186  bm.bmWidth, bm.bmHeight);
1188 
1189  /* Set icon with BS_BITMAP and IMAGE_BITMAP */
1190  hwnd = CreateWindowA(WC_BUTTONA, "test", default_style | BS_BITMAP, 0, 0, 100, 100, 0, 0, 0, 0);
1191  ok(hwnd != NULL, "Expect hwnd to be not NULL\n");
1192  hicon = (HICON)SendMessageA(hwnd, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hicon2x2);
1193  ok(hicon == 0, "Expect hicon == 0\n");
1195  ok(hicon != 0, "Expect hicon != 0\n");
1196  ZeroMemory(&icon_info, sizeof(icon_info));
1197  ok(GetIconInfo(hicon, &icon_info), "Expect GetIconInfo() success\n");
1198  ZeroMemory(&bm, sizeof(bm));
1199  ok(GetObjectW(icon_info.hbmColor, sizeof(BITMAP), &bm), "Expect GetObjectW() success\n");
1200  ok(bm.bmWidth == 2 && bm.bmHeight == 2, "Expect bitmap size: %d,%d, got: %d,%d\n", 2, 2,
1201  bm.bmWidth, bm.bmHeight);
1202  DeleteObject(icon_info.hbmColor);
1203  DeleteObject(icon_info.hbmMask);
1205 
1206 done:
1207  DestroyIcon(hicon2x2);
1208  DeleteObject(hmask2x2);
1209  DeleteObject(hbmp2x2);
1210  DeleteObject(hbmp1x1);
1211  ReleaseDC(0, hdc);
1212 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
#define IMAGE_ICON
Definition: winuser.h:212
HDC WINAPI GetDC(_In_opt_ HWND)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static HDC
Definition: imagelist.c:92
#define ZeroMemory
Definition: winbase.h:1635
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define BM_GETIMAGE
Definition: winuser.h:1880
BOOL WINAPI DestroyWindow(_In_ HWND)
#define BM_SETIMAGE
Definition: winuser.h:1883
BOOL WINAPI GetIconInfo(_In_ HICON, _Out_ PICONINFO)
Definition: cursoricon.c:2014
HBITMAP hbmMask
Definition: winuser.h:3079
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define ok(value,...)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4184
smooth NULL
Definition: ftsmooth.c:416
#define WC_BUTTONA
Definition: commctrl.h:4594
LONG_PTR LPARAM
Definition: windef.h:208
HBITMAP hbmColor
Definition: winuser.h:3080
HBITMAP hbmp
BOOL fIcon
Definition: winuser.h:3076
HICON WINAPI CreateIconIndirect(_In_ PICONINFO)
Definition: cursoricon.c:2546
unsigned long DWORD
Definition: ntddk_ex.h:95
#define BS_ICON
Definition: winuser.h:264
HDC hdc
Definition: main.c:9
#define BS_BITMAP
Definition: winuser.h:258
#define WS_TABSTOP
Definition: pedump.c:634
#define BS_PUSHBUTTON
Definition: pedump.c:651
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
Definition: bl.h:1331
#define WS_POPUP
Definition: pedump.c:616
#define IMAGE_BITMAP
Definition: winuser.h:211
static HBITMAP
Definition: button.c:44
#define WS_VISIBLE
Definition: pedump.c:620
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_button_class()

static void test_button_class ( void  )
static

Definition at line 768 of file button.c.

769 {
770  static const WCHAR testW[] = {'t','e','s','t',0};
771  WNDCLASSEXW exW, ex2W;
772  WNDCLASSEXA exA;
773  char buffA[100];
774  WCHAR *nameW;
775  HWND hwnd;
776  BOOL ret;
777  int len;
778 
780  ok(ret, "got %d\n", ret);
781  ok(IS_WNDPROC_HANDLE(exA.lpfnWndProc), "got %p\n", exA.lpfnWndProc);
782  ok(exA.cbClsExtra == 0, "Unexpected class bytes %d.\n", exA.cbClsExtra);
783  ok(exA.cbWndExtra == sizeof(void *), "Unexpected window bytes %d.\n", exA.cbWndExtra);
784 
786  ok(ret, "got %d\n", ret);
787  ok(!IS_WNDPROC_HANDLE(exW.lpfnWndProc), "got %p\n", exW.lpfnWndProc);
788  ok(exW.cbClsExtra == 0, "Unexpected class bytes %d.\n", exW.cbClsExtra);
789  ok(exW.cbWndExtra == sizeof(void *), "Unexpected window bytes %d.\n", exW.cbWndExtra);
790 
791  /* check that versioned class is also accessible */
793  ok(lstrcmpW(nameW, WC_BUTTONW), "got %s\n", wine_dbgstr_w(nameW));
794 
795  ret = GetClassInfoExW(NULL, nameW, &ex2W);
796  ok(ret, "got %d\n", ret);
797  ok(ex2W.lpfnWndProc == exW.lpfnWndProc, "got %p, %p\n", exW.lpfnWndProc, ex2W.lpfnWndProc);
798 
799  /* Check reported class name */
801  len = GetClassNameA(hwnd, buffA, sizeof(buffA));
802  ok(len == strlen(buffA), "got %d\n", len);
803  ok(!strcmp(buffA, "Button"), "got %s\n", buffA);
804 
805  len = RealGetWindowClassA(hwnd, buffA, sizeof(buffA));
806  ok(len == strlen(buffA), "got %d\n", len);
807  ok(!strcmp(buffA, "Button"), "got %s\n", buffA);
809 
810  /* explicitly create with versioned class name */
811  hwnd = CreateWindowExW(0, nameW, testW, BS_CHECKBOX, 0, 0, 50, 14, NULL, 0, 0, NULL);
812  ok(hwnd != NULL, "failed to create a window %s\n", wine_dbgstr_w(nameW));
813 
814  len = GetClassNameA(hwnd, buffA, sizeof(buffA));
815  ok(len == strlen(buffA), "got %d\n", len);
816  ok(!strcmp(buffA, "Button"), "got %s\n", buffA);
817 
818  len = RealGetWindowClassA(hwnd, buffA, sizeof(buffA));
819  ok(len == strlen(buffA), "got %d\n", len);
820  ok(!strcmp(buffA, "Button"), "got %s\n", buffA);
821 
823 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI GetClassInfoExW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _Out_ LPWNDCLASSEXW)
int WINAPI GetClassNameA(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPSTR lpClassName, _In_ int nMaxCount)
int cbWndExtra
Definition: winuser.h:3173
WNDPROC lpfnWndProc
Definition: winuser.h:3156
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define IS_WNDPROC_HANDLE(x)
Definition: button.c:38
#define wine_dbgstr_w
Definition: kernel32.h:34
static HWND create_button(DWORD style, HWND parent)
Definition: button.c:464
BOOL WINAPI DestroyWindow(_In_ HWND)
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
UINT WINAPI RealGetWindowClassA(_In_ HWND hwnd, _Out_writes_to_(cchClassNameMax, return) LPSTR ptszClassName, _In_ UINT cchClassNameMax)
smooth NULL
Definition: ftsmooth.c:416
#define WC_BUTTONA
Definition: commctrl.h:4594
#define BS_CHECKBOX
Definition: pedump.c:653
int cbClsExtra
Definition: winuser.h:3172
static const WCHAR nameW[]
Definition: main.c:46
__wchar_t WCHAR
Definition: xmlstorage.h:180
int cbWndExtra
Definition: winuser.h:3158
int ret
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)
GLenum GLsizei len
Definition: glext.h:6722
WNDPROC lpfnWndProc
Definition: winuser.h:3171
BOOL WINAPI GetClassInfoExA(_In_opt_ HINSTANCE, _In_ LPCSTR, _Out_ LPWNDCLASSEXA)
int cbClsExtra
Definition: winuser.h:3157
#define WC_BUTTONW
Definition: commctrl.h:4595
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
static WCHAR * get_versioned_classname(const WCHAR *name)
Definition: button.c:66
static const WCHAR testW[]
Definition: jsregexp.c:44

Referenced by START_TEST().

◆ test_button_data()

static void test_button_data ( void  )
static

Definition at line 1231 of file button.c.

1232 {
1233  static const DWORD styles[] =
1234  {
1235  BS_PUSHBUTTON,
1237  BS_CHECKBOX,
1240  BS_3STATE,
1241  BS_AUTO3STATE,
1242  BS_GROUPBOX,
1243  BS_USERBUTTON,
1245  BS_OWNERDRAW,
1250  };
1251 
1252  struct button_desc
1253  {
1254  HWND self;
1255  HWND parent;
1256  LONG style;
1257  };
1258  unsigned int i;
1259  HWND parent;
1260 
1261  parent = CreateWindowExA(0, "TestParentClass", "Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
1262  100, 100, 200, 200, 0, 0, 0, NULL);
1263  ok(parent != 0, "Failed to create parent window\n");
1264 
1265  for (i = 0; i < ARRAY_SIZE(styles); i++)
1266  {
1267  struct button_desc *desc;
1268  HWND hwnd;
1269 
1270  hwnd = create_button(styles[i], parent);
1271  ok(hwnd != NULL, "Failed to create a button.\n");
1272 
1273  desc = (void *)GetWindowLongPtrA(hwnd, 0);
1274  ok(desc != NULL, "Expected window data.\n");
1275 
1276  if (desc)
1277  {
1278  ok(desc->self == hwnd, "Unexpected 'self' field.\n");
1279  ok(desc->parent == parent, "Unexpected 'parent' field.\n");
1280  ok(desc->style == (WS_CHILD | BS_NOTIFY | styles[i]), "Unexpected 'style' field.\n");
1281  }
1282 
1284  }
1285 
1287 }
#define BS_NOTIFY
Definition: winuser.h:268
#define BS_3STATE
Definition: pedump.c:656
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define BS_OWNERDRAW
Definition: pedump.c:661
#define BS_DEFCOMMANDLINK
Definition: commctrl.h:4644
#define BS_DEFSPLITBUTTON
Definition: commctrl.h:4642
#define BS_RADIOBUTTON
Definition: pedump.c:655
#define BS_DEFPUSHBUTTON
Definition: pedump.c:652
#define WS_CHILD
Definition: pedump.c:617
static HWND create_button(DWORD style, HWND parent)
Definition: button.c:464
BOOL WINAPI DestroyWindow(_In_ HWND)
#define BS_GROUPBOX
Definition: pedump.c:658
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
long LONG
Definition: pedump.c:60
#define ok(value,...)
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
smooth NULL
Definition: ftsmooth.c:416
#define BS_AUTOCHECKBOX
Definition: pedump.c:654
#define BS_CHECKBOX
Definition: pedump.c:653
#define BS_AUTO3STATE
Definition: pedump.c:657
#define GetWindowLongPtrA
Definition: winuser.h:4697
#define BS_COMMANDLINK
Definition: commctrl.h:4643
r parent
Definition: btrfs.c:2708
unsigned long DWORD
Definition: ntddk_ex.h:95
#define BS_SPLITBUTTON
Definition: commctrl.h:4641
#define BS_PUSHBUTTON
Definition: pedump.c:651
#define BS_AUTORADIOBUTTON
Definition: pedump.c:660
#define ARRAY_SIZE(a)
Definition: main.h:24
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR 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 WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define BS_USERBUTTON
Definition: pedump.c:659
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620

Referenced by START_TEST().

◆ test_button_messages()

static void test_button_messages ( void  )
static

Definition at line 480 of file button.c.

481 {
482  static const struct
483  {
484  DWORD style;
485  DWORD dlg_code;
486  const struct message *setfocus;
487  const struct message *killfocus;
488  const struct message *setstyle;
489  const struct message *setstate;
490  const struct message *clearstate;
491  const struct message *setcheck;
492  } button[] = {
538  };
539  LOGFONTA logfont = { 0 };
540  const struct message *seq;
541  HFONT zfont, hfont2;
542  unsigned int i;
543  HWND hwnd, parent;
544  DWORD dlg_code;
545  BOOL todo;
546 
547  /* selection with VK_SPACE should capture button window */
549  ok(hwnd != 0, "Failed to create button window\n");
550  ReleaseCapture();
551  SetFocus(hwnd);
553  ok(GetCapture() == hwnd, "Should be captured on VK_SPACE WM_KEYDOWN\n");
556 
557  parent = CreateWindowExA(0, "TestParentClass", "Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
558  100, 100, 200, 200, 0, 0, 0, NULL);
559  ok(parent != 0, "Failed to create parent window\n");
560 
561  logfont.lfHeight = -12;
562  logfont.lfWeight = FW_NORMAL;
563  strcpy(logfont.lfFaceName, "Tahoma");
564 
565  hfont2 = CreateFontIndirectA(&logfont);
566  ok(hfont2 != NULL, "Failed to create Tahoma font\n");
567 
568  for (i = 0; i < ARRAY_SIZE(button); i++)
569  {
570  HFONT prevfont, hfont;
571  MSG msg;
572  DWORD style, state;
573  HDC hdc;
574 
575  hwnd = create_button(button[i].style, parent);
576  ok(hwnd != NULL, "Failed to create a button.\n");
577 
579  style &= ~(WS_CHILD | BS_NOTIFY);
580  /* XP turns a BS_USERBUTTON into BS_PUSHBUTTON */
581  if (button[i].style == BS_USERBUTTON)
582  ok(style == BS_PUSHBUTTON, "expected style BS_PUSHBUTTON got %x\n", style);
583  else
584  ok(style == button[i].style, "expected style %x got %x\n", button[i].style, style);
585 
586  dlg_code = SendMessageA(hwnd, WM_GETDLGCODE, 0, 0);
587  if (button[i].style == BS_SPLITBUTTON ||
588  button[i].style == BS_DEFSPLITBUTTON ||
589  button[i].style == BS_COMMANDLINK ||
590  button[i].style == BS_DEFCOMMANDLINK)
591  {
592  ok(dlg_code == button[i].dlg_code || broken(dlg_code == DLGC_BUTTON) /* WinXP */, "%u: wrong dlg_code %08x\n", i, dlg_code);
593  }
594  else
595  ok(dlg_code == button[i].dlg_code, "%u: wrong dlg_code %08x\n", i, dlg_code);
596 
599  SetFocus(0);
600  flush_events();
601  SetFocus(0);
603 
604  todo = button[i].style != BS_OWNERDRAW;
605  ok(GetFocus() == 0, "expected focus 0, got %p\n", GetFocus());
606  SetFocus(hwnd);
607  SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
608  while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
609  ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].setfocus, "SetFocus(hwnd) on a button", todo);
610 
611  todo = button[i].style == BS_OWNERDRAW;
612  SetFocus(0);
613  SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
614  while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
615  ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].killfocus, "SetFocus(0) on a button", todo);
616  ok(GetFocus() == 0, "expected focus 0, got %p\n", GetFocus());
617 
619  SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
620  while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
621  todo = button[i].style == BS_OWNERDRAW;
622  ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].setstyle, "BM_SETSTYLE on a button", todo);
623 
626  /* XP doesn't turn a BS_USERBUTTON into BS_PUSHBUTTON here! */
627  ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style);
628 
630  ok(state == 0, "expected state 0, got %04x\n", state);
631 
633 
635  SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
636  while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
637  ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].setstate, "BM_SETSTATE/TRUE on a button", FALSE);
638 
640  ok(state == BST_PUSHED, "expected state 0x0004, got %04x\n", state);
641 
644  ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style);
645 
647 
649  SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
650  while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
651  ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].clearstate, "BM_SETSTATE/FALSE on a button", FALSE);
652 
654  ok(state == 0, "expected state 0, got %04x\n", state);
655 
658  ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style);
659 
661  ok(state == BST_UNCHECKED, "expected BST_UNCHECKED, got %04x\n", state);
662 
664 
665  if (button[i].style == BS_RADIOBUTTON ||
666  button[i].style == BS_AUTORADIOBUTTON)
667  {
668  seq = setcheck_radio_seq;
669  }
670  else
671  seq = setcheck_ignored_seq;
672 
674  SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
675  while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
676  ok_sequence(sequences, COMBINED_SEQ_INDEX, seq, "BM_SETCHECK on a button", FALSE);
677 
679  ok(state == BST_UNCHECKED, "expected BST_UNCHECKED, got %04x\n", state);
680 
683  ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style);
684 
686 
688  SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
689  while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
690  ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].setcheck, "BM_SETCHECK on a button", FALSE);
691 
693  if (button[i].style == BS_PUSHBUTTON ||
694  button[i].style == BS_DEFPUSHBUTTON ||
695  button[i].style == BS_GROUPBOX ||
696  button[i].style == BS_USERBUTTON ||
697  button[i].style == BS_OWNERDRAW ||
698  button[i].style == BS_SPLITBUTTON ||
699  button[i].style == BS_DEFSPLITBUTTON ||
700  button[i].style == BS_COMMANDLINK ||
701  button[i].style == BS_DEFCOMMANDLINK)
702  {
703  ok(state == BST_UNCHECKED, "expected check BST_UNCHECKED, got %04x\n", state);
704  }
705  else
706  ok(state == BST_CHECKED, "expected check BST_CHECKED, got %04x\n", state);
707 
710  if (button[i].style == BS_RADIOBUTTON ||
711  button[i].style == BS_AUTORADIOBUTTON)
712  ok(style == (button[i].style | WS_TABSTOP), "expected style %04x | WS_TABSTOP got %04x\n", button[i].style, style);
713  else
714  ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style);
715 
716  /* Test that original font is not selected back after painting */
718  ok(hfont == NULL, "Unexpected control font.\n");
719 
721 
722  hdc = CreateCompatibleDC(0);
723 
724  prevfont = SelectObject(hdc, hfont2);
726  ok(hfont2 != GetCurrentObject(hdc, OBJ_FONT) || broken(hfont2 == GetCurrentObject(hdc, OBJ_FONT)) /* WinXP */,
727  "button[%u]: unexpected font selected after WM_PRINTCLIENT\n", i);
728  SelectObject(hdc, prevfont);
729 
730  prevfont = SelectObject(hdc, hfont2);
732  ok(hfont2 != GetCurrentObject(hdc, OBJ_FONT) || broken(hfont2 == GetCurrentObject(hdc, OBJ_FONT)) /* WinXP */,
733  "button[%u]: unexpected font selected after WM_PAINT\n", i);
734  SelectObject(hdc, prevfont);
735 
736  DeleteDC(hdc);
737 
739  }
740 
741  DeleteObject(hfont2);
743 
745 
747  flush_events();
748 
750  SetFocus(0);
752 
754  ok_sequence(sequences, COMBINED_SEQ_INDEX, lbuttondown_seq, "WM_LBUTTONDOWN on a button", FALSE);
755 
757  ok_sequence(sequences, COMBINED_SEQ_INDEX, lbuttonup_seq, "WM_LBUTTONUP on a button", TRUE);
758 
760  zfont = GetStockObject(SYSTEM_FONT);
763  ok_sequence(sequences, COMBINED_SEQ_INDEX, setfont_seq, "WM_SETFONT on a button", FALSE);
764 
766 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define BS_NOTIFY
Definition: winuser.h:268
#define BS_3STATE
Definition: pedump.c:656
static const struct message setstate_user_seq[]
Definition: button.c:384
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static const struct message setstate_static_seq[]
Definition: button.c:374
#define BM_SETSTATE
Definition: winuser.h:1884
static const struct message setstate_seq[]
Definition: button.c:365
#define BS_OWNERDRAW
Definition: pedump.c:661
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
Definition: tftpd.h:59
#define TRUE
Definition: types.h:120
#define DLGC_UNDEFPUSHBUTTON
Definition: winuser.h:2570
static const struct message lbuttonup_seq[]
Definition: button.c:300
#define BS_DEFCOMMANDLINK
Definition: commctrl.h:4644
#define WM_GETDLGCODE
Definition: winuser.h:1671
#define WM_LBUTTONDOWN
Definition: winuser.h:1752
#define BS_DEFSPLITBUTTON
Definition: commctrl.h:4642
#define BS_RADIOBUTTON
Definition: pedump.c:655
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BM_GETSTATE
Definition: winuser.h:1881
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
static const struct message setstyle_static_seq[]
Definition: button.c:328
static HDC
Definition: imagelist.c:92
#define DLGC_RADIOBUTTON
Definition: winuser.h:2571
#define BS_DEFPUSHBUTTON
Definition: pedump.c:652
BOOL WINAPI UpdateWindow(_In_ HWND)
BOOL todo
Definition: filedlg.c:313
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
static const struct message setfocus_ownerdraw_seq[]
Definition: button.c:264
HWND WINAPI SetFocus(_In_opt_ HWND)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
UINT_PTR WPARAM
Definition: windef.h:207
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
static HWND create_button(DWORD style, HWND parent)
Definition: button.c:464
BOOL WINAPI DestroyWindow(_In_ HWND)
static const struct message setstyle_seq[]
Definition: button.c:315
#define BS_GROUPBOX
Definition: pedump.c:658
#define WM_PRINTCLIENT
Definition: richedit.h:70
#define NUM_MSG_SEQUENCES
Definition: button.c:51
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
static const struct message setstate_ownerdraw_seq[]
Definition: button.c:393
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
HWND WINAPI SetActiveWindow(_In_ HWND)
unsigned int BOOL
Definition: ntddk_ex.h:94
#define COMBINED_SEQ_INDEX
Definition: button.c:50
LONG lfHeight
Definition: dimm.idl:42
HWND WINAPI GetCapture(void)
Definition: message.c:2879
static const struct message setstyle_ownerdraw_seq[]
Definition: button.c:352
#define ok(value,...)
static const struct message setstyle_user_seq[]
Definition: button.c:340
LONG lfWeight
Definition: dimm.idl:46
smooth NULL
Definition: ftsmooth.c:416
#define WM_GETFONT
Definition: winuser.h:1633
#define BS_AUTOCHECKBOX
Definition: pedump.c:654
static const struct message setcheck_static_seq[]
Definition: button.c:434
static const struct message clearstate_seq[]
Definition: button.c:404
#define BS_CHECKBOX
Definition: pedump.c:653
#define BS_AUTO3STATE
Definition: pedump.c:657
#define SYSTEM_FONT
Definition: wingdi.h:910
#define WM_KEYDOWN
Definition: winuser.h:1691
static const struct message setcheck_ignored_seq[]
Definition: button.c:426
#define BM_GETCHECK
Definition: winuser.h:1879
#define SW_SHOW
Definition: winuser.h:769
static const struct message setfocus_seq[]
Definition: button.c:204
static HFONT hfont
static const struct message lbuttondown_seq[]
Definition: button.c:289
static const struct message killfocus_static_seq[]
Definition: button.c:253
#define DLGC_DEFPUSHBUTTON
Definition: winuser.h:2569
#define BM_SETCHECK
Definition: winuser.h:1882
#define BS_COMMANDLINK
Definition: commctrl.h:4643
r parent
Definition: btrfs.c:2708
#define BM_SETSTYLE
Definition: winuser.h:1885
#define BST_PUSHED
Definition: winuser.h:201
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
#define WM_KEYUP
Definition: winuser.h:1692
unsigned long DWORD
Definition: ntddk_ex.h:95
#define OBJ_FONT
Definition: objidl.idl:1414
#define WM_PAINT
Definition: winuser.h:1602
#define BS_SPLITBUTTON
Definition: commctrl.h:4641
static const struct message setcheck_radio_seq[]
Definition: button.c:444
HDC hdc
Definition: main.c:9
static const struct message setfont_seq[]
Definition: button.c:309
static int state
Definition: maze.c:121
static void flush_events(void)
Definition: button.c:99
#define WM_APP
Definition: eventvwr.h:70
#define WS_TABSTOP
Definition: pedump.c:634
#define BST_UNCHECKED
Definition: winuser.h:199
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: button.c:53
#define BS_PUSHBUTTON
Definition: pedump.c:651
#define broken(x)
Definition: _sntprintf.h:21
static const struct message setfocus_static_seq[]
Definition: button.c:227
#define GWL_STYLE
Definition: winuser.h:846
#define BS_AUTORADIOBUTTON
Definition: pedump.c:660
BOOL WINAPI DeleteDC(_In_ HDC)
#define ARRAY_SIZE(a)
Definition: main.h:24
#define DLGC_BUTTON
Definition: winuser.h:2574
#define WM_LBUTTONUP
Definition: winuser.h:1753
static const struct message killfocus_seq[]
Definition: button.c:216
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
static const struct message setcheck_radio_redraw_seq[]
Definition: button.c:453
#define WS_POPUP
Definition: pedump.c:616
#define VK_SPACE
Definition: winuser.h:2173
#define BS_BOTTOM
Definition: winuser.h:259
#define WM_SETFONT
Definition: winuser.h:1632
#define BST_CHECKED
Definition: winuser.h:197
#define FW_NORMAL
Definition: wingdi.h:372
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
HWND WINAPI GetFocus(void)
Definition: window.c:1875
#define msg(x)
Definition: auth_time.c:54
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2888
static const struct message setfocus_groupbox_seq[]
Definition: button.c:240
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR 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 WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define BS_USERBUTTON
Definition: pedump.c:659
#define PM_REMOVE
Definition: winuser.h:1182
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620
static const struct message killfocus_ownerdraw_seq[]
Definition: button.c:277
#define DLGC_WANTARROWS
Definition: winuser.h:2564
#define DLGC_STATIC
Definition: winuser.h:2573
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
Definition: dc.c:439
static const struct message clearstate_ownerdraw_seq[]
Definition: button.c:415

Referenced by START_TEST().

◆ test_get_set_imagelist()

static void test_get_set_imagelist ( void  )
static

Definition at line 1289 of file button.c.

1290 {
1291  HWND hwnd;
1292  HIMAGELIST himl;
1293  BUTTON_IMAGELIST biml = {0};
1294  HDC hdc;
1295  HBITMAP hbmp;
1296  INT width = 16;
1297  INT height = 16;
1298  INT index;
1299  DWORD type;
1300  BOOL ret;
1301 
1302  hdc = GetDC(0);
1304  ok(hbmp != NULL, "Expect hbmp not null\n");
1305 
1306  himl = pImageList_Create(width, height, ILC_COLOR, 1, 0);
1307  ok(himl != NULL, "Expect himl not null\n");
1308  index = pImageList_Add(himl, hbmp, NULL);
1309  ok(index == 0, "Expect index == 0\n");
1310  DeleteObject(hbmp);
1311  ReleaseDC(0, hdc);
1312 
1314  {
1316  ok(hwnd != NULL, "Expect hwnd not null\n");
1317 
1318  /* Get imagelist when imagelist is unset yet */
1319  ret = SendMessageA(hwnd, BCM_GETIMAGELIST, 0, (LPARAM)&biml);
1320  ok(ret, "Expect BCM_GETIMAGELIST return true\n");
1321  ok(biml.himl == 0 && IsRectEmpty(&biml.margin) && biml.uAlign == 0,
1322  "Expect BUTTON_IMAGELIST is empty\n");
1323 
1324  /* Set imagelist with himl null */
1325  biml.himl = 0;
1327  ret = SendMessageA(hwnd, BCM_SETIMAGELIST, 0, (LPARAM)&biml);
1328  ok(ret || broken(!ret), /* xp or 2003 */
1329  "Expect BCM_SETIMAGELIST return true\n");
1330 
1331  /* Set imagelist with uAlign invalid */
1332  biml.himl = himl;
1333  biml.uAlign = -1;
1334  ret = SendMessageA(hwnd, BCM_SETIMAGELIST, 0, (LPARAM)&biml);
1335  ok(ret, "Expect BCM_SETIMAGELIST return true\n");
1336 
1337  /* Successful get and set imagelist */
1338  biml.himl = himl;
1340  ret = SendMessageA(hwnd, BCM_SETIMAGELIST, 0, (LPARAM)&biml);
1341  ok(ret, "Expect BCM_SETIMAGELIST return true\n");
1342  ret = SendMessageA(hwnd, BCM_GETIMAGELIST, 0, (LPARAM)&biml);
1343  ok(ret, "Expect BCM_GETIMAGELIST return true\n");
1344  ok(biml.himl == himl, "Expect himl to be same\n");
1345  ok(biml.uAlign == BUTTON_IMAGELIST_ALIGN_CENTER, "Expect uAlign to be %x\n",
1347 
1348  /* BCM_SETIMAGELIST null pointer handling */
1350  ok(!ret, "Expect BCM_SETIMAGELIST return false\n");
1351  ret = SendMessageA(hwnd, BCM_GETIMAGELIST, 0, (LPARAM)&biml);
1352  ok(ret, "Expect BCM_GETIMAGELIST return true\n");
1353  ok(biml.himl == himl, "Expect himl to be same\n");
1354 
1355  /* BCM_GETIMAGELIST null pointer handling */
1356  biml.himl = himl;
1358  ret = SendMessageA(hwnd, BCM_SETIMAGELIST, 0, (LPARAM)&biml);
1359  ok(ret, "Expect BCM_SETIMAGELIST return true\n");
1361  ok(!ret, "Expect BCM_GETIMAGELIST return false\n");
1362 
1364  }
1365 
1366  pImageList_Destroy(himl);
1367 }
HIMAGELIST himl
Definition: commctrl.h:4606
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
GLint GLint GLsizei width
Definition: gl.h:1546
#define BS_DEFCOMMANDLINK
Definition: commctrl.h:4644
HDC WINAPI GetDC(_In_opt_ HWND)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static HDC
Definition: imagelist.c:92
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
static HWND create_button(DWORD style, HWND parent)
Definition: button.c:464
HIMAGELIST himl
BOOL WINAPI DestroyWindow(_In_ HWND)
int32_t INT
Definition: typedefs.h:56
unsigned int BOOL
Definition: ntddk_ex.h:94
#define BUTTON_IMAGELIST_ALIGN_CENTER
Definition: commctrl.h:4603
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define ILC_COLOR
Definition: commctrl.h:337
#define ok(value,...)
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
GLuint index
Definition: glext.h:6031
HBITMAP hbmp
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define index(s, c)
Definition: various.h:29
#define BCM_GETIMAGELIST
Definition: commctrl.h:4617
HDC hdc
Definition: main.c:9
#define BS_PUSHBUTTON
Definition: pedump.c:651
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define broken(x)
Definition: _sntprintf.h:21
static HBITMAP
Definition: button.c:44
#define BCM_SETIMAGELIST
Definition: commctrl.h:4614

Referenced by START_TEST().

◆ test_get_set_textmargin()

static void test_get_set_textmargin ( void  )
static

Definition at line 1369 of file button.c.

1370 {
1371  HWND hwnd;
1372  RECT margin_in;
1373  RECT margin_out;
1374  BOOL ret;
1375  DWORD type;
1376 
1377  SetRect(&margin_in, 2, 1, 3, 4);
1379  {
1381  ok(hwnd != NULL, "Expect hwnd not null\n");
1382 
1383  /* Get text margin when it is unset */
1384  ret = SendMessageA(hwnd, BCM_GETTEXTMARGIN, 0, (LPARAM)&margin_out);
1385  ok(ret, "Expect ret to be true\n");
1386  ok(IsRectEmpty(&margin_out), "Expect margin empty\n");
1387 
1388  /* Successful get and set text margin */
1389  ret = SendMessageA(hwnd, BCM_SETTEXTMARGIN, 0, (LPARAM)&margin_in);
1390  ok(ret, "Expect ret to be true\n");
1391  SetRectEmpty(&margin_out);
1392  ret = SendMessageA(hwnd, BCM_GETTEXTMARGIN, 0, (LPARAM)&margin_out);
1393  ok(ret, "Expect ret to be true\n");
1394  ok(EqualRect(&margin_in, &margin_out), "Expect margins to be equal\n");
1395 
1396  /* BCM_SETTEXTMARGIN null pointer handling */
1398  ok(!ret, "Expect ret to be false\n");
1399  SetRectEmpty(&margin_out);
1400  ret = SendMessageA(hwnd, BCM_GETTEXTMARGIN, 0, (LPARAM)&margin_out);
1401  ok(ret, "Expect ret to be true\n");
1402  ok(EqualRect(&margin_in, &margin_out), "Expect margins to be equal\n");
1403 
1404  /* BCM_GETTEXTMARGIN null pointer handling */
1405  ret = SendMessageA(hwnd, BCM_SETTEXTMARGIN, 0, (LPARAM)&margin_in);
1406  ok(ret, "Expect ret to be true\n");
1408  ok(!ret, "Expect ret to be true\n");
1409 
1411  }
1412 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define BS_DEFCOMMANDLINK
Definition: commctrl.h:4644
#define BCM_SETTEXTMARGIN
Definition: commctrl.h:4620
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BCM_GETTEXTMARGIN
Definition: commctrl.h:4622
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static HWND create_button(DWORD style, HWND parent)
Definition: button.c:464
BOOL WINAPI DestroyWindow(_In_ HWND)
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
#define BS_PUSHBUTTON
Definition: pedump.c:651
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)

Referenced by START_TEST().

◆ test_note()

static void test_note ( void  )
static

Definition at line 825 of file button.c.

826 {
827  HWND hwnd;
828  BOOL ret;
829  WCHAR test_w[] = {'t', 'e', 's', 't', 0};
830  WCHAR tes_w[] = {'t', 'e', 's', 0};
831  WCHAR deadbeef_w[] = {'d', 'e', 'a', 'd', 'b', 'e', 'e', 'f', 0};
832  WCHAR buffer_w[10];
833  DWORD size;
834  DWORD error;
835  INT type;
836 
838  ok(hwnd != NULL, "Expect hwnd not null\n");
839  SetLastError(0xdeadbeef);
840  size = ARRAY_SIZE(buffer_w);
841  ret = SendMessageA(hwnd, BCM_GETNOTE, (WPARAM)&size, (LPARAM)buffer_w);
842  error = GetLastError();
843  if (!ret && error == 0xdeadbeef)
844  {
845  win_skip("BCM_GETNOTE message is unavailable. Skipping note tests\n"); /* xp or 2003 */
847  return;
848  }
850 
852  {
854  {
856  ok(hwnd != NULL, "Expect hwnd not null\n");
857 
858  /* Get note when note hasn't been not set yet */
859  SetLastError(0xdeadbeef);
860  lstrcpyW(buffer_w, deadbeef_w);
861  size = ARRAY_SIZE(buffer_w);
862  ret = SendMessageA(hwnd, BCM_GETNOTE, (WPARAM)&size, (LPARAM)buffer_w);
863  error = GetLastError();
864  ok(!ret, "Expect BCM_GETNOTE return false\n");
865  ok(!lstrcmpW(buffer_w, deadbeef_w), "Expect note: %s, got: %s\n",
866  wine_dbgstr_w(deadbeef_w), wine_dbgstr_w(buffer_w));
867  ok(size == ARRAY_SIZE(buffer_w), "Got: %d\n", size);
868  ok(error == ERROR_INVALID_PARAMETER, "Expect last error: 0x%08x, got: 0x%08x\n",
870 
871  /* Get note length when note is not set */
873  ok(ret == 0, "Expect note length: %d, got: %d\n", 0, ret);
874 
875  /* Successful set note, get note and get note length */
876  SetLastError(0xdeadbeef);
878  ok(ret, "Expect BCM_SETNOTE return true\n");
879  error = GetLastError();
880  ok(error == NO_ERROR, "Expect last error: 0x%08x, got: 0x%08x\n", NO_ERROR, error);
881 
882  SetLastError(0xdeadbeef);
883  lstrcpyW(buffer_w, deadbeef_w);
884  size = ARRAY_SIZE(buffer_w);
885  ret = SendMessageA(hwnd, BCM_GETNOTE, (WPARAM)&size, (LPARAM)buffer_w);
886  ok(ret, "Expect BCM_GETNOTE return true\n");
887  ok(!lstrcmpW(buffer_w, test_w), "Expect note: %s, got: %s\n", wine_dbgstr_w(test_w),
888  wine_dbgstr_w(buffer_w));
889  ok(size == ARRAY_SIZE(buffer_w), "Got: %d\n", size);
890  error = GetLastError();
891  ok(error == NO_ERROR, "Expect last error: 0x%08x, got: 0x%08x\n", NO_ERROR, error);
892 
894  ok(ret == ARRAY_SIZE(test_w) - 1, "Got: %d\n", ret);
895 
896  /* Insufficient buffer, return partial string */
897  SetLastError(0xdeadbeef);
898  lstrcpyW(buffer_w, deadbeef_w);
899  size = ARRAY_SIZE(test_w) - 1;
900  ret = SendMessageA(hwnd, BCM_GETNOTE, (WPARAM)&size, (LPARAM)buffer_w);
901  ok(!ret, "Expect BCM_GETNOTE return false\n");
902  ok(!lstrcmpW(buffer_w, tes_w), "Expect note: %s, got: %s\n", wine_dbgstr_w(tes_w),
903  wine_dbgstr_w(buffer_w));
904  ok(size == ARRAY_SIZE(test_w), "Got: %d\n", size);
905  error = GetLastError();
906  ok(error == ERROR_INSUFFICIENT_BUFFER, "Expect last error: 0x%08x, got: 0x%08x\n",
908 
909  /* Set note with NULL buffer */
910  SetLastError(0xdeadbeef);
911  ret = SendMessageA(hwnd, BCM_SETNOTE, 0, 0);
912  ok(ret, "Expect BCM_SETNOTE return false\n");
913  error = GetLastError();
914  ok(error == NO_ERROR, "Expect last error: 0x%08x, got: 0x%08x\n", NO_ERROR, error);
915 
916  /* Check that set note with NULL buffer make note empty */
917  SetLastError(0xdeadbeef);
918  lstrcpyW(buffer_w, deadbeef_w);
919  size = ARRAY_SIZE(buffer_w);
920  ret = SendMessageA(hwnd, BCM_GETNOTE, (WPARAM)&size, (LPARAM)buffer_w);
921  ok(ret, "Expect BCM_GETNOTE return true\n");
922  ok(lstrlenW(buffer_w) == 0, "Expect note length 0\n");
923  ok(size == ARRAY_SIZE(buffer_w), "Got: %d\n", size);
924  error = GetLastError();
925  ok(error == NO_ERROR, "Expect last error: 0x%08x, got: 0x%08x\n", NO_ERROR, error);
927  ok(ret == 0, "Expect note length: %d, got: %d\n", 0, ret);
928 
929  /* Get note with NULL buffer */
930  SetLastError(0xdeadbeef);
931  size = ARRAY_SIZE(buffer_w);
933  ok(!ret, "Expect BCM_SETNOTE return false\n");
934  ok(size == ARRAY_SIZE(buffer_w), "Got: %d\n", size);
935  error = GetLastError();
936  ok(error == ERROR_INVALID_PARAMETER, "Expect last error: 0x%08x, got: 0x%08x\n",
938 
939  /* Get note with NULL size */
940  SetLastError(0xdeadbeef);
941  lstrcpyW(buffer_w, deadbeef_w);
942  ret = SendMessageA(hwnd, BCM_GETNOTE, 0, (LPARAM)buffer_w);
943  ok(!ret, "Expect BCM_SETNOTE return false\n");
944  ok(!lstrcmpW(buffer_w, deadbeef_w), "Expect note: %s, got: %s\n",
945  wine_dbgstr_w(deadbeef_w), wine_dbgstr_w(buffer_w));
946  error = GetLastError();
947  ok(error == ERROR_INVALID_PARAMETER, "Expect last error: 0x%08x, got: 0x%08x\n",
949 
950  /* Get note with zero size */
951  SetLastError(0xdeadbeef);
952  size = 0;
953  lstrcpyW(buffer_w, deadbeef_w);
954  ret = SendMessageA(hwnd, BCM_GETNOTE, (WPARAM)&size, (LPARAM)buffer_w);
955  ok(!ret, "Expect BCM_GETNOTE return false\n");
956  ok(!lstrcmpW(buffer_w, deadbeef_w), "Expect note: %s, got: %s\n",
957  wine_dbgstr_w(deadbeef_w), wine_dbgstr_w(buffer_w));
958  ok(size == 1, "Got: %d\n", size);
959  error = GetLastError();
960  ok(error == ERROR_INSUFFICIENT_BUFFER, "Expect last error: 0x%08x, got: 0x%08x\n",
962 
964  }
965  else
966  {
968  ok(hwnd != NULL, "Expect hwnd not null\n");
969  SetLastError(0xdeadbeef);
970  size = ARRAY_SIZE(buffer_w);
971  ret = SendMessageA(hwnd, BCM_GETNOTE, (WPARAM)&size, (LPARAM)buffer_w);
972  ok(!ret, "Expect BCM_GETNOTE return false\n");
973  error = GetLastError();
974  ok(error == ERROR_NOT_SUPPORTED, "Expect last error: 0x%08x, got: 0x%08x\n",
977  }
978  }
979 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define BS_DEFCOMMANDLINK
Definition: commctrl.h:4644
#define error(str)
Definition: mkdosfs.c:1605
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define wine_dbgstr_w
Definition: kernel32.h:34
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
UINT_PTR WPARAM
Definition: windef.h:207
static HWND create_button(DWORD style, HWND parent)
Definition: button.c:464
#define NO_ERROR
Definition: dderror.h:5
#define lstrlenW
Definition: compat.h:407
BOOL WINAPI DestroyWindow(_In_ HWND)
int32_t INT
Definition: typedefs.h:56
#define BCM_SETNOTE
Definition: commctrl.h:4628
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define BCM_GETNOTE
Definition: commctrl.h:4629
#define BS_COMMANDLINK
Definition: commctrl.h:4643
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:409
#define BCM_GETNOTELENGTH
Definition: commctrl.h:4630
int ret
#define BS_PUSHBUTTON
Definition: pedump.c:651
static WCHAR test_w[]
Definition: pager.c:33
#define lstrcpyW
Definition: compat.h:406
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ERROR_NOT_SUPPORTED
Definition: compat.h:90
#define win_skip
Definition: test.h:141
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

Referenced by START_TEST().

◆ test_parent_wndproc()

static LRESULT WINAPI test_parent_wndproc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 163 of file button.c.

164 {
165  static LONG defwndproc_counter = 0;
166  static LONG beginpaint_counter = 0;
167  struct message msg = { 0 };
168  LRESULT ret;
169 
170  if (ignore_message( message )) return 0;
171 
177  {
178  msg.message = message;
179  msg.flags = sent|parent|wparam|lparam;
180  if (defwndproc_counter) msg.flags |= defwinproc;
181  if (beginpaint_counter) msg.flags |= beginpaint;
182  msg.wParam = wParam;
183  msg.lParam = lParam;
185  }
186 
187  if (message == WM_PAINT)
188  {
189  PAINTSTRUCT ps;
190  beginpaint_counter++;
191  BeginPaint( hwnd, &ps );
192  beginpaint_counter--;
193  EndPaint( hwnd, &ps );
194  return 0;
195  }
196 
197  defwndproc_counter++;
199  defwndproc_counter--;
200 
201  return ret;
202 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
Definition: tftpd.h:59
Definition: msg.h:39
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glext.h:5579
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
WPARAM wParam
Definition: combotst.c:138
#define WM_ENABLE
Definition: winuser.h:1597
#define WM_PARENTNOTIFY
Definition: winuser.h:1779
long LONG
Definition: pedump.c:60
#define COMBINED_SEQ_INDEX
Definition: button.c:50
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
static BOOL ignore_message(UINT message)
Definition: button.c:114
#define WM_ENTERIDLE
Definition: winuser.h:1725
#define WM_KILLFOCUS
Definition: winuser.h:1596
r parent
Definition: btrfs.c:2708
#define WM_IME_SETCONTEXT
Definition: winuser.h:1805
#define WM_PAINT
Definition: winuser.h:1602
int ret
Definition: msg.h:34
#define WM_CANCELMODE
Definition: winuser.h:1617
#define WM_COMMAND
Definition: winuser.h:1716
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: button.c:53
#define add_message(msg)
Definition: msg.c:2142
#define WM_DRAWITEM
Definition: winuser.h:1627
#define msg(x)
Definition: auth_time.c:54
Definition: msg.h:40
#define WM_SETFOCUS
Definition: winuser.h:1595
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by register_parent_class().

◆ test_state()

static void test_state ( void  )
static

Definition at line 1414 of file button.c.

1415 {
1416  HWND hwnd;
1417  DWORD type;
1418  LONG state;
1419 
1420  /* Initial button state */
1422  {
1424  state = SendMessageA(hwnd, BM_GETSTATE, 0, 0);
1425  ok(state == BST_UNCHECKED, "Expect state 0x%08x, got 0x%08x\n", BST_UNCHECKED, state);
1427  }
1428 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define BS_DEFCOMMANDLINK
Definition: commctrl.h:4644
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BM_GETSTATE
Definition: winuser.h:1881
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static HWND create_button(DWORD style, HWND parent)
Definition: button.c:464
BOOL WINAPI DestroyWindow(_In_ HWND)
long LONG
Definition: pedump.c:60
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
static int state
Definition: maze.c:121
#define BST_UNCHECKED
Definition: winuser.h:199
#define BS_PUSHBUTTON
Definition: pedump.c:651

Referenced by START_TEST().

Variable Documentation

◆ clearstate_ownerdraw_seq

const struct message clearstate_ownerdraw_seq[]
static
Initial value:
=
{
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ WM_PAINT, sent },
{ 0 }
}
#define BM_SETSTATE
Definition: winuser.h:1884
Definition: msg.h:39
#define WM_NCPAINT
Definition: winuser.h:1669
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:41
r parent
Definition: btrfs.c:2708
#define WM_PAINT
Definition: winuser.h:1602
Definition: msg.h:34
#define WM_APP
Definition: eventvwr.h:70
#define ID_BUTTON
Definition: button.c:48
#define WM_DRAWITEM
Definition: winuser.h:1627
#define WM_ERASEBKGND
Definition: winuser.h:1607
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 415 of file button.c.

Referenced by test_button_messages().

◆ clearstate_seq

const struct message clearstate_seq[]
static
Initial value:
=
{
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ WM_PAINT, sent },
{ 0 }
}
#define BM_SETSTATE
Definition: winuser.h:1884
#define MAKEWPARAM(l, h)
Definition: winuser.h:3916
Definition: msg.h:39
#define BN_UNHILITE
Definition: winuser.h:1895
#define WM_NCPAINT
Definition: winuser.h:1669
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:41
r parent
Definition: btrfs.c:2708
#define WM_PAINT
Definition: winuser.h:1602
Definition: msg.h:34
#define WM_APP
Definition: eventvwr.h:70
#define WM_COMMAND
Definition: winuser.h:1716
#define ID_BUTTON
Definition: button.c:48
#define WM_ERASEBKGND
Definition: winuser.h:1607
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 404 of file button.c.

Referenced by test_button_messages().

◆ DWORD_PTR

Definition at line 40 of file button.c.

◆ HBITMAP

typedef HBITMAP

Definition at line 44 of file button.c.

Referenced by _tWinMain(), AboutDlgProc(), add_icon_to_control(), add_ruler_units(), Icon::add_to_imagelist(), AddContentTab(), QuickLaunchBar::AddShortcuts(), alpha_blend_hdc_pixels(), ANIMATE_PaintFrame(), ANIMATE_TransparentBlt(), ARGB2BMP(), BitBltFromClipboard(), BITMAP_CopyBitmap(), BITMAP_CopyImage(), BITMAP_LoadImageW(), BitmapFromIcon(), Bri_OnInitDialog(), BRUSH::BRUSH(), brush_fill_path(), buffer_size(), ButtonWndProc_common(), cache_put_bitmap(), cdtInit(), cert_mgr_advanced_dlg_proc(), cert_mgr_dlg_proc(), cert_properties_general_dlg_proc(), ClipboardReadBitmap(), ClockWndProc(), close_preview(), co_IntDestroyCaret(), co_IntDrawCaret(), ColorKeyedMaskBlt(), COMBO_Init(), COMCTL32_EnsureBitmapSize(), Cont_OnInitDialog(), ConvertBitmapTo32Bpp(), ConWndProc(), IDataObjectImpl::CopyMedium(), ImageModel::CopyPrevious(), Create24BppBitmap(), create_alpha_bitmap(), Icon::create_bitmap(), create_bitmap_from_icon(), create_dib(), create_gdi_logbrush(), create_hatch_bitmap(), create_menuitem_from_data(), create_render_dc(), create_small_bitmap_from_icon(), CreateBitmapIndirect(), CreateBrushIndirect(), CreateCheckImage(), CreateCheckMask(), CreateCompatibleBitmap(), CreateDIBitmap(), CreateDIBSection(), CreateDragImage(), ATL::CWindow::CreateGrayCaret(), ATL::CImage::CreateInternal(), CreateLayoutIcon(), CreateMappedBitmap(), CreateMDIMenuBitmap(), CreateRadioImage(), CreateRadioMask(), CShellLink::CreateShortcutIcon(), CreateSinkBmp(), ATL::CWindow::CreateSolidCaret(), CreateStarBitmap(), CreateStateImageList(), CreateTrayIcon(), CURSORICON_GetCursorDataFromBMI(), CURSORICON_GetCursorDataFromIconInfo(), DECLARE_INTERFACE_(), DefWndScreenshot(), delete_render_dc(), ATL::CImage::Detach(), device_load_logo(), DIB_CreateDIBSection(), RdpClientUI::Display_DrawGlyph(), DisplayDlgProc(), DlgProc(), DoBlt(), DoLoadPicture(), CDownloadManager::DownloadProgressProc(), draw_graphics(), DrawCheckedRect(), DrawProc(), DrawShadowText(), dup_bitmap(), EBRUSHOBJ_bRealizeBrush(), EBRUSHOBJ_psoMask(), EMFDRV_StretchBlt(), EngCreateBitmap(), EngCreateDeviceBitmap(), EngRealizeBrush(), EngSetPointerShape(), TaskBar::EnumWndProc(), expect_band_content_(), FileTypesDlg_OnItemChanging(), FloatToolbarCreateColorsGui(), FreeCurIconObject(), GdipCreateBitmapFromResource(), GdipCreateBitmapFromScan0(), GdipCreateFromHDC2(), GdipCreateHBITMAPFromBitmap(), GdipDrawImagePointsRect(), GdipGetDC(), Get16BitD3DFormat(), get_brush_bitmap_info(), get_data_from_bitmap(), get_graphics_device_bounds(), get_image_part_size(), GetClipboardDataDimensions(), GetDiaogTextureBrush(), GetRealColorDepth(), Ghost_OnCreate(), GraphCtrl_InvalidateCtrl(), GraphCtrl_Paint(), GreCreateBitmapEx(), GreCreateDIBitmapFromPackedDIB(), GreCreateDIBitmapInternal(), GreGetDIBitsInternal(), GuiCopyFromGraphicsBuffer(), HBITMAP_UserUnmarshal(), HEADER_CreateDragImage(), HelDdSurfLock(), HelDdSurfUnlock(), HEXEDIT_WM_PAINT(), HLPFILE_RtfAddTransparentBitmap(), COpenWithMenu::IconToBitmap(), ImageEditWndRepaint(), ImageList_AddAlphaIcon(), init_hierarchy_page(), InitBackgroundDialog(), InitImageList(), InitLogo(), InitResources(), insert_menu_item(), SelectionModel::InsertFromHBITMAP(), IntCreate32BppBitmap(), IntCreateCompatibleBitmap(), IntCreateDIBitmap(), IntDrawState(), IntExtTextOutW(), IntGdiCreateMaskFromRLE(), IntGetWindowBitmap(), IntGrayString(), IntPaintDesktop(), IntSetDIBits(), IntSetMenuItemInfo(), IntSynthesizeBitmap(), IntUpdateLayeredWindowI(), IsThemeBackgroundPartiallyTransparent(), ATL::CImage::Load(), LoadCardBitmapsFromLibrary(), LoadGLTextures(), LV_Init(), MainWndProc(), MDI_AugmentFrameMenu(), ME_DrawOLE(), ME_RTFReadPictGroup(), MENU_CalcItemSize(), MENU_DrawBitmapItem(), MENU_DrawMenuItem(), MENU_GetBitmapItemSize(), MENU_mnu2mnuii(), MFDRV_StretchBlt(), mi_paint_rect(), msi_load_picture(), msi_seltree_create_imagelist(), NT5_DrawBaseBackground(), NT5_DrawLogoffIcon(), NtGdiCreateBitmap(), NtGdiCreateCompatibleBitmap(), NtGdiCreateDIBBrush(), NtGdiCreateDIBitmapInternal(), NtGdiCreateDIBSection(), NtGdiCreatePatternBrushInternal(), NtGdiDdDDICreateDCFromMemory(), NtGdiGetObjectBitmapHandle(), NtGdiSelectBitmap(), NtGdiSetDIBitsToDeviceInternal(), NtGdiStretchDIBitsInternal(), NtUserCreateCaret(), OLEPictureImpl_LoadWICSource(), OLEPictureImpl_Render(), CMainWindow::OnCommand(), CToolBox::OnCreate(), OnCreate(), CTrayWindow::OnCreate(), OnDrawItem(), CMainWindow::OnDropFiles(), OnMainCreate(), CBrandBand::OnPaint(), OnPaint(), PaintBanner(), PaintCells(), PAINTING_DrawStateJam(), PlayEnhMetaFileRecord(), PlayMetaFileRecord(), PlotCharacter(), process_bmpcache(), process_bmpcache2(), process_memblt(), process_raw_bmpcache(), process_triblt(), PROPSHEET_Paint(), pstcache_load_bitmap(), TaskBar::Refresh(), render_format(), ImageModel::ResetToPrevious(), RosImageProc(), SelectionModel::ScaleContentsToFit(), ScreenSaverProc(), ScrollBarWndProc_common(), SecurityPageProc(), select_cert_dlg_proc(), set_menu_item_info(), SetBitmap(), CBaseBarSite::SetDeskBarSite(), SetMatrixMessage(), SetupControls(), CRootNode::SetupNode(), SIC_OverlayShortcutImage(), snapshot_GetData(), SnapWindow(), SpiSetWallpaper(), START_TEST(), STATIC_PaintBitmapfn(), STATIC_SetBitmap(), STATIC_WindowProc(), StaticWndProc_common(), stretch_blt_icon(), ImageModel::StretchSkew(), sw_SetContext(), swapchain_gdi_present(), test_32bit_ddb(), test_alpha_hdc(), test_AppendMenu(), test_bcm_get_ideal_size(), test_BitBlt(), Test_Bitmap(), test_bitmap(), test_bitmap_colors(), test_bitmap_font_glyph_index(), test_bitmap_formats(), test_bitmap_rendering(), test_bitmapinfoheadersize(), test_bm_get_set_image(), test_bmBits(), test_boundsrect(), test_brush_pens(), Test_BrushOrigin(), test_buffered_paint(), test_clipping(), test_CopyImage_Bitmap(), test_CopyImage_Check(), Test_CreateBitmap(), test_CreateBitmap(), Test_CreateBitmap_Params(), test_CreateBitmapFromHBITMAP(), Test_CreateBitmapIndirect(), test_CreateCompatibleDC(), test_createdibitmap(), Test_CreateDIBitmap1(), Test_CreateDIBitmap_CBM_CREATDIB(), Test_CreateDIBitmap_DIB_PAL_COLORS(), Test_CreateDIBitmap_Params(), Test_CreateDIBitmap_RLE8(), Test_CreateDIBPatternBrushPt_RLE8(), test_createhbitmap(), test_CreateIcon(), test_D3DKMTCreateDCFromMemory(), test_DC_bitmap(), test_dc_layout(), test_device_caps(), test_dib_formats(), test_DIB_PAL_COLORS(), Test_Dibsection(), test_dibsections(), test_DrawDib_sizeimage(), test_DrawIcon(), test_DrawIconEx(), test_DrawState(), test_emf_BitBlt(), test_FillRect(), test_fromhicon(), test_GdiAlphaBlend(), Test_GdiConvertBitmap(), test_GdiGradientFill(), test_GdipCreateBitmapFromHBITMAP(), test_GdipDrawImagePointsRectOnMemoryDC(), test_GdipFillRectanglesOnMemoryDCSolidBrush(), test_GdipFillRectanglesOnMemoryDCTextureBrush(), test_GdipGetVisibleClipBounds_memoryDC(), test_get16dibits(), test_get_set_imagelist(), Test_GetCurrentObject(), test_GetCurrentObject(), test_GetCursorFrameInfo(), Test_GetDIBColorTable(), Test_GetDIBits(), test_GetDIBits(), test_GetDIBits_BI_BITFIELDS(), test_GetDIBits_scanlines(), test_GetDIBits_selected_DDB(), test_GetDIBits_selected_DIB(), test_GetDIBits_top_down(), Test_GetDIBits_xBpp(), Test_GetPixel_1bpp(), Test_GetRandomRgn_RGN5(), Test_GetRandomRgn_SYSRGN(), test_GetSetDIBits_rtl(), test_handles(), test_hdc_caching(), test_himetric(), test_image_format(), test_InsertMenu(), test_item_auto_format(), test_layered_window(), test_LoadImage(), test_marshal_HBITMAP(), Test_MaskBlt_16bpp(), Test_MaskBlt_1bpp(), Test_MaskBlt_32bpp(), Test_MaskBlt_Brush(), test_memory_dc_clipping(), test_menu_bmp_and_string(), test_menu_iteminfo(), test_menualign(), test_mf_PatternBrush(), test_mono_bitmap(), test_mono_dibsection(), Test_NtGdiCreateBitmap_Params(), Test_NtGdiDoPalette_SetDIBColorTable(), test_palette_brush(), test_path_state(), test_pattern_brush(), test_printer_dc(), test_ps_alternate(), Test_Rectangle(), test_select_object(), Test_SelectDIBSection(), Test_SetDCPenColor(), Test_SetDIBits(), test_SetDIBits(), Test_SetDIBits_1bpp(), test_SetDIBits_RLE4(), test_SetDIBits_RLE8(), test_SetDIBitsToDevice(), test_SetDIBitsToDevice_RLE8(), Test_SetPixel_PAL(), test_simple_graphics(), Test_SrcMono(), test_StretchBlt(), test_StretchDIBits(), test_WICCreateBitmapFromSectionEx(), ThemeEndBufferedPaint(), ThemeStartBufferedPaint(), TOOLBAR_AddBitmapToImageList(), TOOLBAR_DrawMasked(), TOOLBAR_ReplaceBitmap(), TRACKBAR_Refresh(), TrayIcon_GetProcessorUsageIcon(), TREEVIEW_CreateDragImage(), TREEVIEW_InitCheckboxes(), ui_create_bitmap(), ui_create_cursor(), ui_create_glyph(), ui_destroy_glyph(), update_preview(), UserDrawIconEx(), UserInitialize(), UserInsertMenuItem(), UserLoadImage(), UXTHEME_DrawImageBackground(), UXTHEME_DrawImageGlyph(), UXTHEME_DrawThemePartToDib(), UXTHEME_GetImageBackBackgroundRegion(), UXTHEME_SelectImage(), UXTHEME_SizedBlt(), ViewDlg_CreateTreeImageList(), WDML_DataHandle2Global(), WDML_Global2DataHandle(), WinMain(), and WndProc().

◆ int

int

Definition at line 43 of file button.c.

◆ killfocus_ownerdraw_seq

const struct message killfocus_ownerdraw_seq[]
static
Initial value:
=
{
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ WM_PAINT, sent },
{ 0 }
}
#define WM_IME_NOTIFY
Definition: winuser.h:1806
#define MAKEWPARAM(l, h)
Definition: winuser.h:3916
Definition: msg.h:39
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:41
#define WM_KILLFOCUS
Definition: winuser.h:1596
r parent
Definition: btrfs.c:2708
#define WM_IME_SETCONTEXT
Definition: winuser.h:1805
#define BN_KILLFOCUS
Definition: winuser.h:1891
#define WM_PAINT
Definition: winuser.h:1602
Definition: msg.h:34
#define WM_APP
Definition: eventvwr.h:70
#define WM_COMMAND
Definition: winuser.h:1716
#define ID_BUTTON
Definition: button.c:48
#define WM_DRAWITEM
Definition: winuser.h:1627
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 277 of file button.c.

Referenced by test_button_messages().

◆ killfocus_seq

const struct message killfocus_seq[]
static
Initial value:
=
{
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ WM_PAINT, sent },
{ 0 }
}
#define WM_IME_NOTIFY
Definition: winuser.h:1806
#define MAKEWPARAM(l, h)
Definition: winuser.h:3916
Definition: msg.h:39
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:41
#define WM_KILLFOCUS
Definition: winuser.h:1596
r parent
Definition: btrfs.c:2708
#define WM_IME_SETCONTEXT
Definition: winuser.h:1805
#define BN_KILLFOCUS
Definition: winuser.h:1891
#define WM_PAINT
Definition: winuser.h:1602
Definition: msg.h:34
#define WM_APP
Definition: eventvwr.h:70
#define WM_COMMAND
Definition: winuser.h:1716
#define ID_BUTTON
Definition: button.c:48
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 216 of file button.c.

Referenced by test_button_messages().

◆ killfocus_static_seq

const struct message killfocus_static_seq[]
static
Initial value:
=
{
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ WM_PAINT, sent },
{ 0 }
}
#define WM_IME_NOTIFY
Definition: winuser.h:1806
#define MAKEWPARAM(l, h)
Definition: winuser.h:3916
Definition: msg.h:39
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:41
#define WM_KILLFOCUS
Definition: winuser.h:1596
r parent
Definition: btrfs.c:2708
#define WM_IME_SETCONTEXT
Definition: winuser.h:1805
#define BN_KILLFOCUS
Definition: winuser.h:1891
#define WM_PAINT
Definition: winuser.h:1602
Definition: msg.h:34
#define WM_APP
Definition: eventvwr.h:70
#define WM_COMMAND
Definition: winuser.h:1716
#define ID_BUTTON
Definition: button.c:48
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 253 of file button.c.

Referenced by test_button_messages().

◆ lbuttondown_seq

const struct message lbuttondown_seq[]
static
Initial value:
=
{
{ 0 }
}
#define BM_SETSTATE
Definition: winuser.h:1884
#define WM_IME_NOTIFY
Definition: winuser.h:1806
#define TRUE
Definition: types.h:120
#define WM_LBUTTONDOWN
Definition: winuser.h:1752
#define BM_GETSTATE
Definition: winuser.h:1881
Definition: msg.h:39
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:41
#define WM_IME_SETCONTEXT
Definition: winuser.h:1805
Definition: msg.h:34
#define WM_SETFOCUS
Definition: winuser.h:1595
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 289 of file button.c.

Referenced by test_button_messages().

◆ lbuttonup_seq

const struct message lbuttonup_seq[]
static
Initial value:
=
{
{ 0 }
}
#define BM_SETSTATE
Definition: winuser.h:1884
Definition: msg.h:39
#define WM_CAPTURECHANGED
Definition: winuser.h:1784
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:34
#define WM_COMMAND
Definition: winuser.h:1716
#define WM_LBUTTONUP
Definition: winuser.h:1753
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 300 of file button.c.

Referenced by test_button_messages().

◆ LPARAM

◆ sequences

◆ setcheck_ignored_seq

const struct message setcheck_ignored_seq[]
static
Initial value:
=
{
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ 0 }
}
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:41
#define BM_SETCHECK
Definition: winuser.h:1882
#define WM_PAINT
Definition: winuser.h:1602
Definition: msg.h:34
#define WM_APP
Definition: eventvwr.h:70
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 426 of file button.c.

Referenced by test_button_messages().

◆ setcheck_radio_redraw_seq

const struct message setcheck_radio_redraw_seq[]
static
Initial value:
=
{
{ WM_STYLECHANGING, sent|wparam|defwinproc, GWL_STYLE },
{ WM_STYLECHANGED, sent|wparam|defwinproc, GWL_STYLE },
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ WM_PAINT, sent },
{ 0 }
}
Definition: msg.h:39
#define WM_NCPAINT
Definition: winuser.h:1669
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:41
#define BM_SETCHECK
Definition: winuser.h:1882
#define WM_PAINT
Definition: winuser.h:1602
Definition: msg.h:34
#define WM_APP
Definition: eventvwr.h:70
#define GWL_STYLE
Definition: winuser.h:846
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 453 of file button.c.

Referenced by test_button_messages().

◆ setcheck_radio_seq

const struct message setcheck_radio_seq[]
static
Initial value:
=
{
{ WM_STYLECHANGING, sent|wparam|defwinproc, GWL_STYLE },
{ WM_STYLECHANGED, sent|wparam|defwinproc, GWL_STYLE },
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ 0 }
}
Definition: msg.h:39
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define BM_SETCHECK
Definition: winuser.h:1882
Definition: msg.h:34
#define WM_APP
Definition: eventvwr.h:70
#define GWL_STYLE
Definition: winuser.h:846
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 444 of file button.c.

Referenced by test_button_messages().

◆ setcheck_static_seq

const struct message setcheck_static_seq[]
static
Initial value:
=
{
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ WM_PAINT, sent },
{ 0 }
}
Definition: msg.h:39
#define WM_NCPAINT
Definition: winuser.h:1669
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:41
#define BM_SETCHECK
Definition: winuser.h:1882
#define WM_PAINT
Definition: winuser.h:1602
Definition: msg.h:34
#define WM_APP
Definition: eventvwr.h:70
#define WM_ERASEBKGND
Definition: winuser.h:1607
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 434 of file button.c.

Referenced by test_button_messages().

◆ setfocus_groupbox_seq

const struct message setfocus_groupbox_seq[]
static
Initial value:
=
{
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ WM_PAINT, sent },
{ 0 }
}
#define WM_IME_NOTIFY
Definition: winuser.h:1806
#define MAKEWPARAM(l, h)
Definition: winuser.h:3916
#define BM_GETSTATE
Definition: winuser.h:1881
Definition: msg.h:39
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:41
r parent
Definition: btrfs.c:2708
#define WM_IME_SETCONTEXT
Definition: winuser.h:1805
#define BN_CLICKED
Definition: winuser.h:1886
#define WM_PAINT
Definition: winuser.h:1602
Definition: msg.h:34
#define WM_APP
Definition: eventvwr.h:70
#define WM_COMMAND
Definition: winuser.h:1716
#define ID_BUTTON
Definition: button.c:48
#define BN_SETFOCUS
Definition: winuser.h:1894
#define WM_SETFOCUS
Definition: winuser.h:1595
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 240 of file button.c.

Referenced by test_button_messages().

◆ setfocus_ownerdraw_seq

const struct message setfocus_ownerdraw_seq[]
static
Initial value:
=
{
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ 0 }
}
#define WM_IME_NOTIFY
Definition: winuser.h:1806
#define MAKEWPARAM(l, h)
Definition: winuser.h:3916
#define BM_GETSTATE
Definition: winuser.h:1881
Definition: msg.h:39
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:41
r parent
Definition: btrfs.c:2708
#define WM_IME_SETCONTEXT
Definition: winuser.h:1805
Definition: msg.h:34
#define WM_APP
Definition: eventvwr.h:70
#define WM_COMMAND
Definition: winuser.h:1716
#define ID_BUTTON
Definition: button.c:48
#define BN_SETFOCUS
Definition: winuser.h:1894
#define WM_DRAWITEM
Definition: winuser.h:1627
#define WM_SETFOCUS
Definition: winuser.h:1595
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 264 of file button.c.

Referenced by test_button_messages().

◆ setfocus_seq

const struct message setfocus_seq[]
static
Initial value:
=
{
{ WM_PAINT, sent },
{ 0 }
}
#define WM_IME_NOTIFY
Definition: winuser.h:1806
#define MAKEWPARAM(l, h)
Definition: winuser.h:3916
#define BM_GETSTATE
Definition: winuser.h:1881
Definition: msg.h:39
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:41
r parent
Definition: btrfs.c:2708
#define WM_IME_SETCONTEXT
Definition: winuser.h:1805
#define WM_PAINT
Definition: winuser.h:1602
Definition: msg.h:34
#define WM_APP
Definition: eventvwr.h:70
#define WM_COMMAND
Definition: winuser.h:1716
#define ID_BUTTON
Definition: button.c:48
#define BN_SETFOCUS
Definition: winuser.h:1894
#define WM_SETFOCUS
Definition: winuser.h:1595
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 204 of file button.c.

Referenced by test_button_messages().

◆ setfocus_static_seq

const struct message setfocus_static_seq[]
static
Initial value:
=
{
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ WM_PAINT, sent },
{ 0 }
}
#define WM_IME_NOTIFY
Definition: winuser.h:1806
#define MAKEWPARAM(l, h)
Definition: winuser.h:3916
#define BM_GETSTATE
Definition: winuser.h:1881
Definition: msg.h:39
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:41
r parent
Definition: btrfs.c:2708
#define WM_IME_SETCONTEXT
Definition: winuser.h:1805
#define BN_CLICKED
Definition: winuser.h:1886
#define WM_PAINT
Definition: winuser.h:1602
Definition: msg.h:34
#define WM_APP
Definition: eventvwr.h:70
#define WM_COMMAND
Definition: winuser.h:1716
#define ID_BUTTON
Definition: button.c:48
#define BN_SETFOCUS
Definition: winuser.h:1894
#define WM_SETFOCUS
Definition: winuser.h:1595
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 227 of file button.c.

Referenced by test_button_messages().

◆ setfont_seq

const struct message setfont_seq[]
static
Initial value:
=
{
{ 0 }
}
Definition: msg.h:34
#define WM_SETFONT
Definition: winuser.h:1632

Definition at line 309 of file button.c.

Referenced by test_button_messages().

◆ setstate_ownerdraw_seq

const struct message setstate_ownerdraw_seq[]
static
Initial value:
=
{
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ WM_PAINT, sent },
{ 0 }
}
#define BM_SETSTATE
Definition: winuser.h:1884
Definition: msg.h:39
#define WM_NCPAINT
Definition: winuser.h:1669
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:41
r parent
Definition: btrfs.c:2708
#define WM_PAINT
Definition: winuser.h:1602
Definition: msg.h:34
#define WM_APP
Definition: eventvwr.h:70
#define ID_BUTTON
Definition: button.c:48
#define WM_DRAWITEM
Definition: winuser.h:1627
#define WM_ERASEBKGND
Definition: winuser.h:1607
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 393 of file button.c.

Referenced by test_button_messages().

◆ setstate_seq

const struct message setstate_seq[]
static
Initial value:
=
{
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ WM_PAINT, sent },
{ 0 }
}
#define BM_SETSTATE
Definition: winuser.h:1884
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:41
#define WM_PAINT
Definition: winuser.h:1602
Definition: msg.h:34
#define WM_APP
Definition: eventvwr.h:70
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 365 of file button.c.

Referenced by test_button_messages().

◆ setstate_static_seq

const struct message setstate_static_seq[]
static
Initial value:
=
{
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ WM_PAINT, sent },
{ 0 }
}
#define BM_SETSTATE
Definition: winuser.h:1884
Definition: msg.h:39
#define WM_NCPAINT
Definition: winuser.h:1669
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:41
#define WM_PAINT
Definition: winuser.h:1602
Definition: msg.h:34
#define WM_APP
Definition: eventvwr.h:70
#define WM_ERASEBKGND
Definition: winuser.h:1607
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 374 of file button.c.

Referenced by test_button_messages().

◆ setstate_user_seq

const struct message setstate_user_seq[]
static
Initial value:
=
{
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ WM_PAINT, sent },
{ 0 }
}
#define BM_SETSTATE
Definition: winuser.h:1884
#define MAKEWPARAM(l, h)
Definition: winuser.h:3916
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define BN_HILITE
Definition: winuser.h:1890
r parent
Definition: btrfs.c:2708
#define WM_PAINT
Definition: winuser.h:1602
Definition: msg.h:34
#define WM_APP
Definition: eventvwr.h:70
#define WM_COMMAND
Definition: winuser.h:1716
#define ID_BUTTON
Definition: button.c:48
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 384 of file button.c.

Referenced by test_button_messages().

◆ setstyle_ownerdraw_seq

const struct message setstyle_ownerdraw_seq[]
static
Initial value:
=
{
{ WM_STYLECHANGING, sent|wparam|defwinproc, GWL_STYLE },
{ WM_STYLECHANGED, sent|wparam|defwinproc, GWL_STYLE },
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ WM_PAINT, sent },
{ 0 }
}
Definition: msg.h:39
#define WM_NCPAINT
Definition: winuser.h:1669
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:41
r parent
Definition: btrfs.c:2708
#define BM_SETSTYLE
Definition: winuser.h:1885
#define WM_PAINT
Definition: winuser.h:1602
Definition: msg.h:34
#define WM_APP
Definition: eventvwr.h:70
#define GWL_STYLE
Definition: winuser.h:846
#define ID_BUTTON
Definition: button.c:48
#define WM_DRAWITEM
Definition: winuser.h:1627
#define WM_ERASEBKGND
Definition: winuser.h:1607
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 352 of file button.c.

Referenced by test_button_messages().

◆ setstyle_seq

const struct message setstyle_seq[]
static
Initial value:
=
{
{ WM_STYLECHANGING, sent|wparam|defwinproc, GWL_STYLE },
{ WM_STYLECHANGED, sent|wparam|defwinproc, GWL_STYLE },
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ WM_PAINT, sent },
{ 0 }
}
Definition: msg.h:39
#define WM_NCPAINT
Definition: winuser.h:1669
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:41
#define BM_SETSTYLE
Definition: winuser.h:1885
#define WM_PAINT
Definition: winuser.h:1602
Definition: msg.h:34
#define WM_APP
Definition: eventvwr.h:70
#define GWL_STYLE
Definition: winuser.h:846
#define WM_ERASEBKGND
Definition: winuser.h:1607
static UINT WPARAM wparam
Definition: combo.c:716

Definition at line 315 of file button.c.

Referenced by test_button_messages().

◆ setstyle_static_seq

const struct message setstyle_static_seq[]
static
Initial value:
=
{
{ WM_STYLECHANGING, sent|wparam|defwinproc, GWL_STYLE },
{ WM_STYLECHANGED, sent|wparam|defwinproc, GWL_STYLE },
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ WM_PAINT, sent },
{ 0 }
}
Definition: msg.h:39
#define WM_NCPAINT
Definition: winuser.h:1669
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Definition: msg.h:41