ReactOS  0.4.15-dev-425-gc40b086
controls.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  HEADCOMBO
 

Macros

#define HBMMENU_CALLBACK   ((HBITMAP) -1)
 
#define HBMMENU_SYSTEM   ((HBITMAP) 1)
 
#define HBMMENU_MBAR_RESTORE   ((HBITMAP) 2)
 
#define HBMMENU_MBAR_MINIMIZE   ((HBITMAP) 3)
 
#define HBMMENU_MBAR_CLOSE   ((HBITMAP) 5)
 
#define HBMMENU_MBAR_CLOSE_D   ((HBITMAP) 6)
 
#define HBMMENU_MBAR_MINIMIZE_D   ((HBITMAP) 7)
 
#define HBMMENU_POPUP_CLOSE   ((HBITMAP) 8)
 
#define HBMMENU_POPUP_RESTORE   ((HBITMAP) 9)
 
#define HBMMENU_POPUP_MAXIMIZE   ((HBITMAP) 10)
 
#define HBMMENU_POPUP_MINIMIZE   ((HBITMAP) 11)
 
#define ID_CB_LISTBOX   1000
 
#define ID_CB_EDIT   1001
 
#define CB_OKAY   0
 
#define CBF_DROPPED   0x0001
 
#define CBF_BUTTONDOWN   0x0002
 
#define CBF_NOROLLUP   0x0004
 
#define CBF_MEASUREITEM   0x0008
 
#define CBF_FOCUSED   0x0010
 
#define CBF_CAPTURE   0x0020
 
#define CBF_EDIT   0x0040
 
#define CBF_NORESIZE   0x0080
 
#define CBF_NOTIFY   0x0100
 
#define CBF_NOREDRAW   0x0200
 
#define CBF_SELCHANGE   0x0400
 
#define CBF_NOEDITNOTIFY   0x1000
 
#define CBF_NOLBSELECT   0x2000 /* do not change current selection */
 
#define CBF_BEENFOCUSED   0x4000 /* has it ever had focus */
 
#define CBF_EUI   0x8000
 
#define CB_GETTYPE(lphc)   ((lphc)->dwStyle & (CBS_DROPDOWNLIST))
 
#define LB_INSERTSTRING_UPPER   0x1AA
 
#define LB_INSERTSTRING_LOWER   0x1AB
 
#define LB_ADDSTRING_UPPER   0x1AC
 
#define LB_ADDSTRING_LOWER   0x1AD
 

Typedefs

typedef struct HEADCOMBOLPHEADCOMBO
 

Functions

BOOL COMBO_FlipListbox (LPHEADCOMBO, BOOL, BOOL)
 
HRGN set_control_clipping (HDC hdc, const RECT *rect)
 
LRESULT WINAPI DesktopWndProcA (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI DesktopWndProcW (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI User32DefWindowProc (HWND, UINT, WPARAM, LPARAM, BOOL)
 
BOOL WINAPI RegisterClientPFN (VOID)
 
LRESULT WINAPI IconTitleWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI ButtonWndProcA (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI ButtonWndProcW (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI ButtonWndProc_common (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode)
 
LRESULT WINAPI ComboWndProcA (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI ComboWndProcW (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI ComboWndProc_common (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, BOOL unicode)
 
LRESULT WINAPI EditWndProcA (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI EditWndProcW (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI EditWndProc_common (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode)
 
LRESULT WINAPI GhostWndProcA (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI GhostWndProcW (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI GhostWndProc_common (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode)
 
LRESULT WINAPI ListBoxWndProcA (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI ListBoxWndProcW (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI ListBoxWndProc_common (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode)
 
LRESULT WINAPI MDIClientWndProcA (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI MDIClientWndProcW (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI MDIClientWndProc_common (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, BOOL unicode)
 
LRESULT WINAPI PopupMenuWndProcA (HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI PopupMenuWndProcW (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI ScrollBarWndProcW (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI ScrollBarWndProcA (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI StaticWndProcA (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI StaticWndProcW (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI StaticWndProc_common (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode)
 
LRESULT WINAPI SwitchWndProcA (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI SwitchWndProcW (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Macro Definition Documentation

◆ CB_GETTYPE

#define CB_GETTYPE (   lphc)    ((lphc)->dwStyle & (CBS_DROPDOWNLIST))

Definition at line 82 of file controls.h.

◆ CB_OKAY

#define CB_OKAY   0

Definition at line 42 of file controls.h.

◆ CBF_BEENFOCUSED

#define CBF_BEENFOCUSED   0x4000 /* has it ever had focus */

Definition at line 58 of file controls.h.

◆ CBF_BUTTONDOWN

#define CBF_BUTTONDOWN   0x0002

Definition at line 46 of file controls.h.

◆ CBF_CAPTURE

#define CBF_CAPTURE   0x0020

Definition at line 50 of file controls.h.

◆ CBF_DROPPED

#define CBF_DROPPED   0x0001

Definition at line 45 of file controls.h.

◆ CBF_EDIT

#define CBF_EDIT   0x0040

Definition at line 51 of file controls.h.

◆ CBF_EUI

#define CBF_EUI   0x8000

Definition at line 59 of file controls.h.

◆ CBF_FOCUSED

#define CBF_FOCUSED   0x0010

Definition at line 49 of file controls.h.

◆ CBF_MEASUREITEM

#define CBF_MEASUREITEM   0x0008

Definition at line 48 of file controls.h.

◆ CBF_NOEDITNOTIFY

#define CBF_NOEDITNOTIFY   0x1000

Definition at line 56 of file controls.h.

◆ CBF_NOLBSELECT

#define CBF_NOLBSELECT   0x2000 /* do not change current selection */

Definition at line 57 of file controls.h.

◆ CBF_NOREDRAW

#define CBF_NOREDRAW   0x0200

Definition at line 54 of file controls.h.

◆ CBF_NORESIZE

#define CBF_NORESIZE   0x0080

Definition at line 52 of file controls.h.

◆ CBF_NOROLLUP

#define CBF_NOROLLUP   0x0004

Definition at line 47 of file controls.h.

◆ CBF_NOTIFY

#define CBF_NOTIFY   0x0100

Definition at line 53 of file controls.h.

◆ CBF_SELCHANGE

#define CBF_SELCHANGE   0x0400

Definition at line 55 of file controls.h.

◆ HBMMENU_CALLBACK

#define HBMMENU_CALLBACK   ((HBITMAP) -1)

Definition at line 4 of file controls.h.

◆ HBMMENU_MBAR_CLOSE

#define HBMMENU_MBAR_CLOSE   ((HBITMAP) 5)

Definition at line 16 of file controls.h.

◆ HBMMENU_MBAR_CLOSE_D

#define HBMMENU_MBAR_CLOSE_D   ((HBITMAP) 6)

Definition at line 19 of file controls.h.

◆ HBMMENU_MBAR_MINIMIZE

#define HBMMENU_MBAR_MINIMIZE   ((HBITMAP) 3)

Definition at line 13 of file controls.h.

◆ HBMMENU_MBAR_MINIMIZE_D

#define HBMMENU_MBAR_MINIMIZE_D   ((HBITMAP) 7)

Definition at line 22 of file controls.h.

◆ HBMMENU_MBAR_RESTORE

#define HBMMENU_MBAR_RESTORE   ((HBITMAP) 2)

Definition at line 10 of file controls.h.

◆ HBMMENU_POPUP_CLOSE

#define HBMMENU_POPUP_CLOSE   ((HBITMAP) 8)

Definition at line 25 of file controls.h.

◆ HBMMENU_POPUP_MAXIMIZE

#define HBMMENU_POPUP_MAXIMIZE   ((HBITMAP) 10)

Definition at line 31 of file controls.h.

◆ HBMMENU_POPUP_MINIMIZE

#define HBMMENU_POPUP_MINIMIZE   ((HBITMAP) 11)

Definition at line 34 of file controls.h.

◆ HBMMENU_POPUP_RESTORE

#define HBMMENU_POPUP_RESTORE   ((HBITMAP) 9)

Definition at line 28 of file controls.h.

◆ HBMMENU_SYSTEM

#define HBMMENU_SYSTEM   ((HBITMAP) 1)

Definition at line 7 of file controls.h.

◆ ID_CB_EDIT

#define ID_CB_EDIT   1001

Definition at line 39 of file controls.h.

◆ ID_CB_LISTBOX

#define ID_CB_LISTBOX   1000

Definition at line 38 of file controls.h.

◆ LB_ADDSTRING_LOWER

#define LB_ADDSTRING_LOWER   0x1AD

Definition at line 89 of file controls.h.

◆ LB_ADDSTRING_UPPER

#define LB_ADDSTRING_UPPER   0x1AC

Definition at line 88 of file controls.h.

◆ LB_INSERTSTRING_LOWER

#define LB_INSERTSTRING_LOWER   0x1AB

Definition at line 87 of file controls.h.

◆ LB_INSERTSTRING_UPPER

#define LB_INSERTSTRING_UPPER   0x1AA

Definition at line 86 of file controls.h.

Typedef Documentation

◆ LPHEADCOMBO

Function Documentation

◆ ButtonWndProc_common()

LRESULT WINAPI ButtonWndProc_common ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL  unicode 
)

Definition at line 243 of file button.c.

245 {
246  RECT rect;
247  POINT pt;
249  UINT btn_type = get_button_type( style );
250  LONG state;
251  HANDLE oldHbitmap;
252 #ifdef __REACTOS__
253  PWND pWnd;
254 
255  pWnd = ValidateHwnd(hWnd);
256  if (pWnd)
257  {
258  if (!pWnd->fnid)
259  {
261  }
262  else
263  {
264  if (pWnd->fnid != FNID_BUTTON)
265  {
266  ERR("Wrong window class for Button! fnId 0x%x\n",pWnd->fnid);
267  return 0;
268  }
269  }
270  }
271  else
272  return 0;
273 #else
274  if (!IsWindow( hWnd )) return 0;
275 #endif
276 
277  pt.x = (short)LOWORD(lParam);
278  pt.y = (short)HIWORD(lParam);
279 
280  switch (uMsg)
281  {
282  case WM_GETDLGCODE:
283  switch(btn_type)
284  {
285  case BS_USERBUTTON:
288  case BS_RADIOBUTTON:
290  case BS_GROUPBOX: return DLGC_STATIC;
291  default: return DLGC_BUTTON;
292  }
293 
294  case WM_ENABLE:
295  paint_button( hWnd, btn_type, ODA_DRAWENTIRE );
296  break;
297 
298  case WM_CREATE:
299  if (btn_type >= MAX_BTN_TYPE)
300  return -1; /* abort */
301 
302  /* XP turns a BS_USERBUTTON into BS_PUSHBUTTON */
303  if (btn_type == BS_USERBUTTON )
304  {
306 #ifdef __REACTOS__
308 #else
309  WIN_SetStyle( hWnd, style, BS_TYPEMASK & ~style );
310 #endif
311  }
313 #ifdef __REACTOS__
314  button_update_uistate( hWnd, unicode );
315 #endif
316  return 0;
317 
318 #ifdef __REACTOS__
319  case WM_NCDESTROY:
321  case WM_DESTROY:
322  break;
323 #endif
324 
325  case WM_ERASEBKGND:
326  if (btn_type == BS_OWNERDRAW)
327  {
328  HDC hdc = (HDC)wParam;
329  RECT rc;
330  HBRUSH hBrush;
332  if (!parent) parent = hWnd;
333 #ifdef __REACTOS__
335 #else
336  hBrush = (HBRUSH)SendMessageW(parent, WM_CTLCOLORBTN, (WPARAM)hdc, (LPARAM)hWnd);
337  if (!hBrush) /* did the app forget to call defwindowproc ? */
338  hBrush = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORBTN,
339  (WPARAM)hdc, (LPARAM)hWnd);
340 #endif
341  GetClientRect(hWnd, &rc);
342  FillRect(hdc, &rc, hBrush);
343  }
344  return 1;
345 
346  case WM_PRINTCLIENT:
347  case WM_PAINT:
348  {
349  PAINTSTRUCT ps;
350  HDC hdc = wParam ? (HDC)wParam : BeginPaint( hWnd, &ps );
351  if (btnPaintFunc[btn_type])
352  {
353  int nOldMode = SetBkMode( hdc, OPAQUE );
354  (btnPaintFunc[btn_type])( hWnd, hdc, ODA_DRAWENTIRE );
355  SetBkMode(hdc, nOldMode); /* reset painting mode */
356  }
357  if ( !wParam ) EndPaint( hWnd, &ps );
358  break;
359  }
360 
361  case WM_KEYDOWN:
362  if (wParam == VK_SPACE)
363  {
366  SetCapture( hWnd );
367  }
368  break;
369 
370  case WM_LBUTTONDBLCLK:
371  if(style & BS_NOTIFY ||
372  btn_type == BS_RADIOBUTTON ||
373  btn_type == BS_USERBUTTON ||
374  btn_type == BS_OWNERDRAW)
375  {
377  break;
378  }
379  /* fall through */
380  case WM_LBUTTONDOWN:
381  SetCapture( hWnd );
382  SetFocus( hWnd );
385  break;
386 
387  case WM_KEYUP:
388  if (wParam != VK_SPACE)
389  break;
390  /* fall through */
391  case WM_LBUTTONUP:
392 #ifdef __REACTOS__
393  {
394  BOOL TellParent = FALSE;
395 #endif
397  if (!(state & BUTTON_BTNPRESSED)) break;
400  if (!(state & BST_PUSHED))
401  {
402  ReleaseCapture();
403  break;
404  }
406  GetClientRect( hWnd, &rect );
407  if (uMsg == WM_KEYUP || PtInRect( &rect, pt ))
408  {
410  switch(btn_type)
411  {
412  case BS_AUTOCHECKBOX:
414  break;
415  case BS_AUTORADIOBUTTON:
417  break;
418  case BS_AUTO3STATE:
420  (state & BST_INDETERMINATE) ? 0 : ((state & 3) + 1), 0 );
421  break;
422  }
423 #ifdef __REACTOS__
424  TellParent = TRUE; // <---- Fix CORE-10194, Notify parent after capture is released.
425 #else
426  ReleaseCapture();
428 #endif
429  }
430 #ifndef __REACTOS__
431  else
432  {
433  ReleaseCapture();
434  }
435 #else
436  ReleaseCapture();
437  if (TellParent) BUTTON_NOTIFY_PARENT(hWnd, BN_CLICKED);
438  }
439 #endif
440  break;
441 
442  case WM_CAPTURECHANGED:
443  TRACE("WM_CAPTURECHANGED %p\n", hWnd);
444  if (hWnd == (HWND)lParam) break;
446  if (state & BUTTON_BTNPRESSED)
447  {
451  }
452  break;
453 
454  case WM_MOUSEMOVE:
455  if ((wParam & MK_LBUTTON) && GetCapture() == hWnd)
456  {
457  GetClientRect( hWnd, &rect );
459  }
460  break;
461 
462  case WM_SETTEXT:
463  {
464  /* Clear an old text here as Windows does */
465 //
466 // ReactOS Note :
467 // wine Bug: http://bugs.winehq.org/show_bug.cgi?id=25790
468 // Patch: http://source.winehq.org/patches/data/70889
469 // By: Alexander LAW, Replicate Windows behavior of WM_SETTEXT handler regarding WM_CTLCOLOR*
470 //
471 #ifdef __REACTOS__
472  if (style & WS_VISIBLE)
473 #else
474  if (IsWindowVisible(hWnd))
475 #endif
476  {
477  HDC hdc = GetDC(hWnd);
478  HBRUSH hbrush;
479  RECT client, rc;
481  UINT message = (btn_type == BS_PUSHBUTTON ||
482  btn_type == BS_DEFPUSHBUTTON ||
483  btn_type == BS_PUSHLIKE ||
484  btn_type == BS_USERBUTTON ||
485  btn_type == BS_OWNERDRAW) ?
487 
488  if (!parent) parent = hWnd;
489 #ifdef __REACTOS__
491 #else
492  hbrush = (HBRUSH)SendMessageW(parent, message,
493  (WPARAM)hdc, (LPARAM)hWnd);
494  if (!hbrush) /* did the app forget to call DefWindowProc ? */
495  hbrush = (HBRUSH)DefWindowProcW(parent, message,
496  (WPARAM)hdc, (LPARAM)hWnd);
497 #endif
498 
500  rc = client;
501  /* FIXME: check other BS_* handlers */
502  if (btn_type == BS_GROUPBOX)
503  InflateRect(&rc, -7, 1); /* GB_Paint does this */
505  /* Clip by client rect bounds */
506  if (rc.right > client.right) rc.right = client.right;
507  if (rc.bottom > client.bottom) rc.bottom = client.bottom;
508  FillRect(hdc, &rc, hbrush);
509  ReleaseDC(hWnd, hdc);
510  }
511 
512  if (unicode) DefWindowProcW( hWnd, WM_SETTEXT, wParam, lParam );
514  if (btn_type == BS_GROUPBOX) /* Yes, only for BS_GROUPBOX */
516  else
517  paint_button( hWnd, btn_type, ODA_DRAWENTIRE );
518  return 1; /* success. FIXME: check text length */
519  }
520 
521  case WM_SETFONT:
524  break;
525 
526  case WM_GETFONT:
527  return (LRESULT)get_button_font( hWnd );
528 
529  case WM_SETFOCUS:
530  TRACE("WM_SETFOCUS %p\n",hWnd);
532  paint_button( hWnd, btn_type, ODA_FOCUS );
533  if (style & BS_NOTIFY)
535  break;
536 
537  case WM_KILLFOCUS:
538  TRACE("WM_KILLFOCUS %p\n",hWnd);
541  paint_button( hWnd, btn_type, ODA_FOCUS );
542 
543  if ((state & BUTTON_BTNPRESSED) && GetCapture() == hWnd)
544  ReleaseCapture();
545  if (style & BS_NOTIFY)
547 
549  break;
550 
551  case WM_SYSCOLORCHANGE:
553  break;
554 
555  case BM_SETSTYLE:
556  btn_type = wParam & BS_TYPEMASK;
557  style = (style & ~BS_TYPEMASK) | btn_type;
558 #ifdef __REACTOS__
560 #else
561  WIN_SetStyle( hWnd, style, BS_TYPEMASK & ~style );
562 #endif
563 
564  /* Only redraw if lParam flag is set.*/
565  if (lParam)
567 
568  break;
569 
570  case BM_CLICK:
571 #ifdef __REACTOS__
573  if (state & BUTTON_BMCLICK)
574  break;
575  set_button_state(hWnd, state | BUTTON_BMCLICK); // Tracked in STATE_GWL_OFFSET.
576 #endif
577  SendMessageW( hWnd, WM_LBUTTONDOWN, 0, 0 );
578  SendMessageW( hWnd, WM_LBUTTONUP, 0, 0 );
579 #ifdef __REACTOS__
581  if (!(state & BUTTON_BMCLICK)) break;
582  state &= ~BUTTON_BMCLICK;
584 #endif
585  break;
586 
587  case BM_SETIMAGE:
588  /* Check that image format matches button style */
589  switch (style & (BS_BITMAP|BS_ICON))
590  {
591  case BS_BITMAP:
592  if (wParam != IMAGE_BITMAP) return 0;
593  break;
594  case BS_ICON:
595  if (wParam != IMAGE_ICON) return 0;
596  break;
597  default:
598  return 0;
599  }
602  return (LRESULT)oldHbitmap;
603 
604  case BM_GETIMAGE:
606 
607  case BM_GETCHECK:
608  return get_button_state( hWnd ) & 3;
609 
610  case BM_SETCHECK:
611  if (wParam > maxCheckState[btn_type]) wParam = maxCheckState[btn_type];
613  if ((btn_type == BS_RADIOBUTTON) || (btn_type == BS_AUTORADIOBUTTON))
614  {
615 #ifdef __REACTOS__
616  if (wParam) style |= WS_TABSTOP;
617  else style &= ~WS_TABSTOP;
619 #else
620  if (wParam) WIN_SetStyle( hWnd, WS_TABSTOP, 0 );
621  else WIN_SetStyle( hWnd, 0, WS_TABSTOP );
622 #endif
623  }
624  if ((state & 3) != wParam)
625  {
626  set_button_state( hWnd, (state & ~3) | wParam );
627  paint_button( hWnd, btn_type, ODA_SELECT );
628  }
629  break;
630 
631  case BM_GETSTATE:
632  return get_button_state( hWnd );
633 
634  case BM_SETSTATE:
636  if (wParam)
638  else
640 
641  paint_button( hWnd, btn_type, ODA_SELECT );
642  break;
643 
644 #ifdef __REACTOS__
645  case WM_UPDATEUISTATE:
646  if (unicode)
647  DefWindowProcW(hWnd, uMsg, wParam, lParam);
648  else
649  DefWindowProcA(hWnd, uMsg, wParam, lParam);
650 
651  if (button_update_uistate(hWnd, unicode))
652  paint_button( hWnd, btn_type, ODA_DRAWENTIRE );
653  break;
654 #endif
655 
656  case WM_NCHITTEST:
657  if(btn_type == BS_GROUPBOX) return HTTRANSPARENT;
658  /* fall through */
659  default:
660  return unicode ? DefWindowProcW(hWnd, uMsg, wParam, lParam) :
661  DefWindowProcA(hWnd, uMsg, wParam, lParam);
662  }
663  return 0;
664 }
#define BS_NOTIFY
Definition: winuser.h:268
#define BM_SETSTATE
Definition: winuser.h:1905
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1608
#define BS_OWNERDRAW
Definition: pedump.c:661
#define BUTTON_NSTATES
Definition: button.c:78
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
Definition: tftpd.h:59
static const WORD maxCheckState[MAX_BTN_TYPE]
Definition: button.c:104
#define HTTRANSPARENT
Definition: winuser.h:2448
#define TRUE
Definition: types.h:120
#define DLGC_UNDEFPUSHBUTTON
Definition: winuser.h:2591
#define IMAGE_ICON
Definition: winuser.h:212
static HBRUSH hbrush
#define WM_GETDLGCODE
Definition: winuser.h:1671
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define MK_LBUTTON
Definition: winuser.h:2342
HDC WINAPI GetDC(_In_opt_ HWND)
#define BS_RADIOBUTTON
Definition: pedump.c:655
UINT state
Definition: button.c:168
#define pt(x, y)
Definition: drawing.c:79
#define BM_GETSTATE
Definition: winuser.h:1902
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1754
#define WM_CAPTURECHANGED
Definition: winuser.h:1790
static HDC
Definition: imagelist.c:92
#define DLGC_RADIOBUTTON
Definition: winuser.h:2592
#define BS_DEFPUSHBUTTON
Definition: pedump.c:652
HWND hWnd
Definition: settings.c:17
HWND WINAPI SetFocus(_In_opt_ HWND)
#define WM_NCHITTEST
Definition: winuser.h:1668
UINT_PTR WPARAM
Definition: windef.h:207
#define GetWindowLongPtrW
Definition: winuser.h:4804
#define FNID_DESTROY
Definition: ntuser.h:859
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
LONG right
Definition: windef.h:308
#define ODA_FOCUS
Definition: winuser.h:2519
#define BM_GETIMAGE
Definition: winuser.h:1901
#define BM_SETIMAGE
Definition: winuser.h:1904
#define BS_GROUPBOX
Definition: pedump.c:658
& rect
Definition: startmenu.cpp:1413
WPARAM wParam
Definition: combotst.c:138
#define BST_INDETERMINATE
Definition: winuser.h:198
#define WM_ENABLE
Definition: winuser.h:1597
#define WM_PRINTCLIENT
Definition: richedit.h:70
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BUTTON_BTNPRESSED
Definition: button.c:79
HBRUSH FASTCALL GetControlColor(PWND pwndParent, PWND pwnd, HDC hdc, UINT CtlMsg)
Definition: misc.c:145
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1032
#define WM_CTLCOLORBTN
Definition: winuser.h:1751
static void BUTTON_CheckAutoRadioButton(HWND hwnd)
Definition: button.c:1189
static const pfButtonPaint btnPaintFunc[MAX_BTN_TYPE]
Definition: button.c:122
DWORD fnid
Definition: ntuser.h:673
unsigned int BOOL
Definition: ntddk_ex.h:94
static void set_button_font(HWND hwnd, HFONT font)
Definition: button.c:187
long LONG
Definition: pedump.c:60
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
HWND WINAPI GetCapture(void)
Definition: message.c:2880
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
smooth NULL
Definition: ftsmooth.c:416
#define WM_GETFONT
Definition: winuser.h:1633
#define BS_AUTOCHECKBOX
Definition: pedump.c:654
#define BS_AUTO3STATE
Definition: pedump.c:657
#define WM_KEYDOWN
Definition: winuser.h:1697
#define BM_GETCHECK
Definition: winuser.h:1900
#define BST_FOCUS
Definition: winuser.h:200
static UINT get_button_type(LONG window_style)
Definition: button.c:192
#define WM_SETTEXT
Definition: winuser.h:1599
#define WM_DESTROY
Definition: winuser.h:1591
#define BM_CLICK
Definition: winuser.h:1899
#define ODA_DRAWENTIRE
Definition: winuser.h:2517
DWORD NTAPI NtUserAlterWindowStyle(HWND hWnd, DWORD Index, LONG NewValue)
Definition: window.c:3832
#define DLGC_DEFPUSHBUTTON
Definition: winuser.h:2590
#define BM_SETCHECK
Definition: winuser.h:1903
#define TRACE(s)
Definition: solgame.cpp:4
#define WM_KILLFOCUS
Definition: winuser.h:1596
r parent
Definition: btrfs.c:2944
#define BM_SETSTYLE
Definition: winuser.h:1906
#define BST_PUSHED
Definition: winuser.h:201
#define WM_NCDESTROY
Definition: winuser.h:1666
#define WM_KEYUP
Definition: winuser.h:1698
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
static FILE * client
Definition: client.c:41
#define BN_CLICKED
Definition: winuser.h:1907
static LPARAM
Definition: button.c:42
#define BN_KILLFOCUS
Definition: winuser.h:1912
#define WM_PAINT
Definition: winuser.h:1602
static HFONT get_button_font(HWND hwnd)
Definition: button.c:182
#define BS_ICON
Definition: winuser.h:264
#define OPAQUE
Definition: wingdi.h:948
PWND FASTCALL ValidateHwnd(HWND hwnd)
Definition: misc.c:369
HDC hdc
Definition: main.c:9
#define BS_BITMAP
Definition: winuser.h:258
static LONG get_button_state(HWND hwnd)
Definition: button.c:158
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1760
#define WS_TABSTOP
Definition: pedump.c:634
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BST_UNCHECKED
Definition: winuser.h:199
#define BS_PUSHBUTTON
Definition: pedump.c:651
#define MAX_BTN_TYPE
Definition: button.c:102
#define ERR(fmt,...)
Definition: debug.h:110
#define GWL_STYLE
Definition: winuser.h:846
Definition: ntuser.h:657
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define BN_SETFOCUS
Definition: winuser.h:1915
HWND WINAPI GetParent(_In_ HWND)
HWND WINAPI SetCapture(_In_ HWND hWnd)
#define BUTTON_NOTIFY_PARENT(hWnd, code)
Definition: button.c:86
#define BS_AUTORADIOBUTTON
Definition: pedump.c:660
#define BS_TYPEMASK
Definition: winuser.h:270
#define DLGC_BUTTON
Definition: winuser.h:2595
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_LBUTTONUP
Definition: winuser.h:1759
#define FNID_BUTTON
Definition: ntuser.h:828
unsigned int UINT
Definition: ndis.h:50
#define WM_MOUSEMOVE
Definition: winuser.h:1757
#define VK_SPACE
Definition: winuser.h:2194
#define IMAGE_BITMAP
Definition: winuser.h:211
static void paint_button(HWND hwnd, LONG style, UINT action)
Definition: button.c:198
#define WM_SETFONT
Definition: winuser.h:1632
#define BST_CHECKED
Definition: winuser.h:197
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2889
static UINT BUTTON_CalcLabelRect(HWND hwnd, HDC hdc, RECT *rc)
Definition: button.c:750
#define BS_PUSHLIKE
Definition: winuser.h:272
#define WM_CREATE
Definition: winuser.h:1590
static void set_button_state(HWND hwnd, LONG state)
Definition: button.c:163
#define HIWORD(l)
Definition: typedefs.h:246
BOOL WINAPI IsWindowVisible(_In_ HWND)
LONG bottom
Definition: windef.h:309
BOOL NTAPI NtUserSetWindowFNID(HWND hWnd, WORD fnID)
Definition: window.c:4057
#define BN_DOUBLECLICKED
Definition: winuser.h:1910
#define SetWindowLongPtrW
Definition: winuser.h:5321
static HBITMAP
Definition: button.c:44
#define BS_USERBUTTON
Definition: pedump.c:659
#define WM_ERASEBKGND
Definition: winuser.h:1607
#define WM_SETFOCUS
Definition: winuser.h:1595
LONG_PTR LRESULT
Definition: windef.h:209
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620
#define HIMAGE_GWL_OFFSET
Definition: button.c:73
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define DLGC_STATIC
Definition: winuser.h:2594
#define ODA_SELECT
Definition: winuser.h:2518

Referenced by RegisterClientPFN().

◆ ButtonWndProcA()

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

Referenced by RegisterClientPFN().

◆ ButtonWndProcW()

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

Referenced by RegisterClientPFN().

◆ COMBO_FlipListbox()

BOOL COMBO_FlipListbox ( LPHEADCOMBO  ,
BOOL  ,
BOOL   
)

Definition at line 1117 of file combo.c.

1118 {
1119  if( lphc->wState & CBF_DROPPED )
1120  {
1121  CBRollUp( lphc, ok, bRedrawButton );
1122  return FALSE;
1123  }
1124 
1125  CBDropDown( lphc );
1126  return TRUE;
1127 }
#define TRUE
Definition: types.h:120
static void CBDropDown(LPHEADCOMBO lphc)
Definition: combo.c:959
static void CBRollUp(LPHEADCOMBO lphc, BOOL ok, BOOL bButton)
Definition: combo.c:1062
#define ok(value,...)
Definition: atltest.h:57

Referenced by COMBO_WindowProc(), ComboWndProc_common(), LISTBOX_HandleLButtonDownCombo(), LISTBOX_WindowProc(), and ListBoxWndProc_common().

◆ ComboWndProc_common()

LRESULT WINAPI ComboWndProc_common ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam,
BOOL  unicode 
)

Definition at line 1822 of file combo.c.

1823 {
1825 #ifdef __REACTOS__
1826  PWND pWnd;
1827 
1828  pWnd = ValidateHwnd(hwnd);
1829  if (pWnd)
1830  {
1831  if (!pWnd->fnid)
1832  {
1834  }
1835  else
1836  {
1837  if (pWnd->fnid != FNID_COMBOBOX)
1838  {
1839  ERR("Wrong window class for ComboBox! fnId 0x%x\n",pWnd->fnid);
1840  return 0;
1841  }
1842  }
1843  }
1844 #endif
1845 
1846  TRACE("[%p]: msg %s wp %08lx lp %08lx\n",
1848 
1849 #ifndef __REACTOS__
1850  if (!IsWindow(hwnd)) return 0;
1851 #endif
1852 
1853  if( lphc || message == WM_NCCREATE )
1854  switch(message)
1855  {
1856 
1857  /* System messages */
1858 
1859  case WM_NCCREATE:
1860  {
1861  LONG style = unicode ? ((LPCREATESTRUCTW)lParam)->style :
1862  ((LPCREATESTRUCTA)lParam)->style;
1863  return COMBO_NCCreate(hwnd, style);
1864  }
1865  case WM_NCDESTROY:
1866  COMBO_NCDestroy(lphc);
1867 #ifdef __REACTOS__
1869 #endif
1870  break;/* -> DefWindowProc */
1871 
1872  case WM_CREATE:
1873  {
1874  HWND hwndParent;
1875  LONG style;
1876  if(unicode)
1877  {
1878  hwndParent = ((LPCREATESTRUCTW)lParam)->hwndParent;
1879  style = ((LPCREATESTRUCTW)lParam)->style;
1880  }
1881  else
1882  {
1883  hwndParent = ((LPCREATESTRUCTA)lParam)->hwndParent;
1884  style = ((LPCREATESTRUCTA)lParam)->style;
1885  }
1886  return COMBO_Create(hwnd, lphc, hwndParent, style, unicode);
1887  }
1888 
1889  case WM_PRINTCLIENT:
1890  /* Fallthrough */
1891  case WM_PAINT:
1892  /* wParam may contain a valid HDC! */
1893  return COMBO_Paint(lphc, (HDC)wParam);
1894 
1895  case WM_ERASEBKGND:
1896  /* do all painting in WM_PAINT like Windows does */
1897  return 1;
1898 
1899  case WM_GETDLGCODE:
1900  {
1902  if (lParam && (((LPMSG)lParam)->message == WM_KEYDOWN))
1903  {
1904  int vk = (int)((LPMSG)lParam)->wParam;
1905 
1906  if ((vk == VK_RETURN || vk == VK_ESCAPE) && (lphc->wState & CBF_DROPPED))
1908  }
1909  return result;
1910  }
1911  case WM_SIZE:
1912  if( lphc->hWndLBox &&
1913  !(lphc->wState & CBF_NORESIZE) ) COMBO_Size( lphc );
1914  return TRUE;
1915  case WM_SETFONT:
1916  COMBO_Font( lphc, (HFONT)wParam, (BOOL)lParam );
1917  return TRUE;
1918  case WM_GETFONT:
1919  return (LRESULT)lphc->hFont;
1920  case WM_SETFOCUS:
1921  if( lphc->wState & CBF_EDIT ) {
1922  SetFocus( lphc->hWndEdit );
1923  /* The first time focus is received, select all the text */
1924  if( !(lphc->wState & CBF_BEENFOCUSED) ) {
1925  SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, -1);
1926  lphc->wState |= CBF_BEENFOCUSED;
1927  }
1928  }
1929  else
1930  COMBO_SetFocus( lphc );
1931  return TRUE;
1932  case WM_KILLFOCUS:
1933  {
1934  HWND hwndFocus = WIN_GetFullHandle( (HWND)wParam );
1935  if( !hwndFocus ||
1936  (hwndFocus != lphc->hWndEdit && hwndFocus != lphc->hWndLBox ))
1937  COMBO_KillFocus( lphc );
1938  return TRUE;
1939  }
1940  case WM_COMMAND:
1941  return COMBO_Command( lphc, wParam, WIN_GetFullHandle( (HWND)lParam ) );
1942  case WM_GETTEXT:
1943  return unicode ? COMBO_GetTextW( lphc, wParam, (LPWSTR)lParam )
1944  : COMBO_GetTextA( lphc, wParam, (LPSTR)lParam );
1945  case WM_SETTEXT:
1946  case WM_GETTEXTLENGTH:
1947  case WM_CLEAR:
1948  if ((message == WM_GETTEXTLENGTH) && !ISWIN31 && !(lphc->wState & CBF_EDIT))
1949  {
1950  int j = SendMessageW(lphc->hWndLBox, LB_GETCURSEL, 0, 0);
1951  if (j == -1) return 0;
1952  return unicode ? SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, j, 0) :
1953  SendMessageA(lphc->hWndLBox, LB_GETTEXTLEN, j, 0);
1954  }
1955  else if( lphc->wState & CBF_EDIT )
1956  {
1957  LRESULT ret;
1958  lphc->wState |= CBF_NOEDITNOTIFY;
1959  ret = unicode ? SendMessageW(lphc->hWndEdit, message, wParam, lParam) :
1960  SendMessageA(lphc->hWndEdit, message, wParam, lParam);
1961  lphc->wState &= ~CBF_NOEDITNOTIFY;
1962  return ret;
1963  }
1964  else return CB_ERR;
1965  case WM_CUT:
1966  case WM_PASTE:
1967  case WM_COPY:
1968  if( lphc->wState & CBF_EDIT )
1969  {
1970  return unicode ? SendMessageW(lphc->hWndEdit, message, wParam, lParam) :
1971  SendMessageA(lphc->hWndEdit, message, wParam, lParam);
1972  }
1973  else return CB_ERR;
1974 
1975  case WM_DRAWITEM:
1976  case WM_DELETEITEM:
1977  case WM_COMPAREITEM:
1978  case WM_MEASUREITEM:
1979  return COMBO_ItemOp(lphc, message, lParam);
1980  case WM_ENABLE:
1981  if( lphc->wState & CBF_EDIT )
1982  EnableWindow( lphc->hWndEdit, (BOOL)wParam );
1983  EnableWindow( lphc->hWndLBox, (BOOL)wParam );
1984 
1985  /* Force the control to repaint when the enabled state changes. */
1986  InvalidateRect(lphc->self, NULL, TRUE);
1987  return TRUE;
1988  case WM_SETREDRAW:
1989  if( wParam )
1990  lphc->wState &= ~CBF_NOREDRAW;
1991  else
1992  lphc->wState |= CBF_NOREDRAW;
1993 
1994  if( lphc->wState & CBF_EDIT )
1997  return 0;
1998  case WM_SYSKEYDOWN:
1999 #ifdef __REACTOS__
2000  if( KF_ALTDOWN & HIWORD(lParam) )
2001 #else
2002  if( KEYDATA_ALT & HIWORD(lParam) )
2003 #endif
2004  if( wParam == VK_UP || wParam == VK_DOWN )
2005  COMBO_FlipListbox( lphc, FALSE, FALSE );
2006  return 0;
2007 
2008  case WM_KEYDOWN:
2009  if ((wParam == VK_RETURN || wParam == VK_ESCAPE) &&
2010  (lphc->wState & CBF_DROPPED))
2011  {
2012  CBRollUp( lphc, wParam == VK_RETURN, FALSE );
2013  return TRUE;
2014  }
2015  else if ((wParam == VK_F4) && !(lphc->wState & CBF_EUI))
2016  {
2017  COMBO_FlipListbox( lphc, FALSE, FALSE );
2018  return TRUE;
2019  }
2020  /* fall through */
2021  case WM_CHAR:
2022  case WM_IME_CHAR:
2023  {
2024  HWND hwndTarget;
2025 
2026  if( lphc->wState & CBF_EDIT )
2027  hwndTarget = lphc->hWndEdit;
2028  else
2029  hwndTarget = lphc->hWndLBox;
2030 
2031  return unicode ? SendMessageW(hwndTarget, message, wParam, lParam) :
2032  SendMessageA(hwndTarget, message, wParam, lParam);
2033  }
2034  case WM_LBUTTONDOWN:
2035  if( !(lphc->wState & CBF_FOCUSED) ) SetFocus( lphc->self );
2036  if( lphc->wState & CBF_FOCUSED ) COMBO_LButtonDown( lphc, lParam );
2037  return TRUE;
2038  case WM_LBUTTONUP:
2039  COMBO_LButtonUp( lphc );
2040  return TRUE;
2041  case WM_MOUSEMOVE:
2042  if( lphc->wState & CBF_CAPTURE )
2043  COMBO_MouseMove( lphc, wParam, lParam );
2044  return TRUE;
2045 
2046  case WM_MOUSEWHEEL:
2047  if (wParam & (MK_SHIFT | MK_CONTROL))
2048  return unicode ? DefWindowProcW(hwnd, message, wParam, lParam) :
2050 
2051  if (GET_WHEEL_DELTA_WPARAM(wParam) > 0) return SendMessageW(hwnd, WM_KEYDOWN, VK_UP, 0);
2052  if (GET_WHEEL_DELTA_WPARAM(wParam) < 0) return SendMessageW(hwnd, WM_KEYDOWN, VK_DOWN, 0);
2053  return TRUE;
2054 
2055  case WM_CTLCOLOR:
2056  case WM_CTLCOLORMSGBOX:
2057  case WM_CTLCOLOREDIT:
2058  case WM_CTLCOLORLISTBOX:
2059  case WM_CTLCOLORBTN:
2060  case WM_CTLCOLORDLG:
2061  case WM_CTLCOLORSCROLLBAR:
2062  case WM_CTLCOLORSTATIC:
2063 #ifdef __REACTOS__
2064  if ( pWnd && !(pWnd->state2 & WNDS2_WIN40COMPAT) ) break; // Must be Win 4.0 and above.
2065 #endif
2066  if (lphc->owner)
2067  return SendMessageW(lphc->owner, message, wParam, lParam);
2068  break;
2069 
2070  /* Combo messages */
2071 
2072  case CB_ADDSTRING:
2073  if( unicode )
2074  {
2075  if( lphc->dwStyle & CBS_LOWERCASE )
2077  else if( lphc->dwStyle & CBS_UPPERCASE )
2079  return SendMessageW(lphc->hWndLBox, LB_ADDSTRING, 0, lParam);
2080  }
2081  else /* unlike the unicode version, the ansi version does not overwrite
2082  the string if converting case */
2083  {
2084  char *string = NULL;
2085  LRESULT ret;
2086  if( lphc->dwStyle & CBS_LOWERCASE )
2087  {
2088  string = strdupA((LPSTR)lParam);
2089  CharLowerA(string);
2090  }
2091 
2092  else if( lphc->dwStyle & CBS_UPPERCASE )
2093  {
2094  string = strdupA((LPSTR)lParam);
2095  CharUpperA(string);
2096  }
2097 
2098  ret = SendMessageA(lphc->hWndLBox, LB_ADDSTRING, 0, string ? (LPARAM)string : lParam);
2099  HeapFree(GetProcessHeap(), 0, string);
2100  return ret;
2101  }
2102  case CB_INSERTSTRING:
2103  if( unicode )
2104  {
2105  if( lphc->dwStyle & CBS_LOWERCASE )
2107  else if( lphc->dwStyle & CBS_UPPERCASE )
2110  }
2111  else
2112  {
2113  if( lphc->dwStyle & CBS_LOWERCASE )
2115  else if( lphc->dwStyle & CBS_UPPERCASE )
2117 
2119  }
2120  case CB_DELETESTRING:
2121  return unicode ? SendMessageW(lphc->hWndLBox, LB_DELETESTRING, wParam, 0) :
2122  SendMessageA(lphc->hWndLBox, LB_DELETESTRING, wParam, 0);
2123  case CB_SELECTSTRING:
2124  return COMBO_SelectString(lphc, (INT)wParam, lParam, unicode);
2125  case CB_FINDSTRING:
2126  return unicode ? SendMessageW(lphc->hWndLBox, LB_FINDSTRING, wParam, lParam) :
2127  SendMessageA(lphc->hWndLBox, LB_FINDSTRING, wParam, lParam);
2128  case CB_FINDSTRINGEXACT:
2129  return unicode ? SendMessageW(lphc->hWndLBox, LB_FINDSTRINGEXACT, wParam, lParam) :
2130  SendMessageA(lphc->hWndLBox, LB_FINDSTRINGEXACT, wParam, lParam);
2131  case CB_SETITEMHEIGHT:
2132  return COMBO_SetItemHeight( lphc, (INT)wParam, (INT)lParam);
2133  case CB_GETITEMHEIGHT:
2134  if( (INT)wParam >= 0 ) /* listbox item */
2135  return SendMessageW(lphc->hWndLBox, LB_GETITEMHEIGHT, wParam, 0);
2136  return CBGetTextAreaHeight(hwnd, lphc);
2137  case CB_RESETCONTENT:
2138  SendMessageW(lphc->hWndLBox, LB_RESETCONTENT, 0, 0);
2139  if( (lphc->wState & CBF_EDIT) && CB_HASSTRINGS(lphc) )
2140  {
2141  static const WCHAR empty_stringW[] = { 0 };
2143  }
2144  else
2145  InvalidateRect(lphc->self, NULL, TRUE);
2146  return TRUE;
2147  case CB_INITSTORAGE:
2150  return SendMessageW(lphc->hWndLBox, LB_GETHORIZONTALEXTENT, 0, 0);
2153  case CB_GETTOPINDEX:
2154  return SendMessageW(lphc->hWndLBox, LB_GETTOPINDEX, 0, 0);
2155  case CB_GETLOCALE:
2156  return SendMessageW(lphc->hWndLBox, LB_GETLOCALE, 0, 0);
2157  case CB_SETLOCALE:
2158  return SendMessageW(lphc->hWndLBox, LB_SETLOCALE, wParam, 0);
2159  case CB_SETDROPPEDWIDTH:
2160  if( (CB_GETTYPE(lphc) == CBS_SIMPLE) ||
2161  (INT)wParam >= 32768 )
2162  return CB_ERR;
2163  /* new value must be higher than combobox width */
2164  if((INT)wParam >= lphc->droppedRect.right - lphc->droppedRect.left)
2165  lphc->droppedWidth = wParam;
2166  else if(wParam)
2167  lphc->droppedWidth = 0;
2168 
2169  /* recalculate the combobox area */
2170  CBCalcPlacement(hwnd, lphc, &lphc->textRect, &lphc->buttonRect, &lphc->droppedRect );
2171 
2172  /* fall through */
2173  case CB_GETDROPPEDWIDTH:
2174  if( lphc->droppedWidth )
2175  return lphc->droppedWidth;
2176  return lphc->droppedRect.right - lphc->droppedRect.left;
2179  return CB_OKAY;
2180  case CB_GETDROPPEDSTATE:
2181  return (lphc->wState & CBF_DROPPED) != 0;
2182  case CB_DIR:
2183  return unicode ? SendMessageW(lphc->hWndLBox, LB_DIR, wParam, lParam) :
2184  SendMessageA(lphc->hWndLBox, LB_DIR, wParam, lParam);
2185 
2186  case CB_SHOWDROPDOWN:
2187  if( CB_GETTYPE(lphc) != CBS_SIMPLE )
2188  {
2189  if( wParam )
2190  {
2191  if( !(lphc->wState & CBF_DROPPED) )
2192  CBDropDown( lphc );
2193  }
2194  else
2195  if( lphc->wState & CBF_DROPPED )
2196  CBRollUp( lphc, FALSE, TRUE );
2197  }
2198  return TRUE;
2199  case CB_GETCOUNT:
2200  return SendMessageW(lphc->hWndLBox, LB_GETCOUNT, 0, 0);
2201  case CB_GETCURSEL:
2202  return SendMessageW(lphc->hWndLBox, LB_GETCURSEL, 0, 0);
2203  case CB_SETCURSEL:
2205  if( lParam >= 0 )
2207 
2208  /* no LBN_SELCHANGE in this case, update manually */
2209  CBPaintText( lphc, NULL );
2210  lphc->wState &= ~CBF_SELCHANGE;
2211  return lParam;
2212  case CB_GETLBTEXT:
2213  return unicode ? SendMessageW(lphc->hWndLBox, LB_GETTEXT, wParam, lParam) :
2214  SendMessageA(lphc->hWndLBox, LB_GETTEXT, wParam, lParam);
2215  case CB_GETLBTEXTLEN:
2216  return unicode ? SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, wParam, 0) :
2217  SendMessageA(lphc->hWndLBox, LB_GETTEXTLEN, wParam, 0);
2218  case CB_GETITEMDATA:
2219  return SendMessageW(lphc->hWndLBox, LB_GETITEMDATA, wParam, 0);
2220  case CB_SETITEMDATA:
2222  case CB_GETEDITSEL:
2223  /* Edit checks passed parameters itself */
2224  if( lphc->wState & CBF_EDIT )
2225  return SendMessageW(lphc->hWndEdit, EM_GETSEL, wParam, lParam);
2226  return CB_ERR;
2227  case CB_SETEDITSEL:
2228  if( lphc->wState & CBF_EDIT )
2229  return SendMessageW(lphc->hWndEdit, EM_SETSEL,
2231  return CB_ERR;
2232  case CB_SETEXTENDEDUI:
2233  if( CB_GETTYPE(lphc) == CBS_SIMPLE )
2234  return CB_ERR;
2235  if( wParam )
2236  lphc->wState |= CBF_EUI;
2237  else lphc->wState &= ~CBF_EUI;
2238  return CB_OKAY;
2239  case CB_GETEXTENDEDUI:
2240  return (lphc->wState & CBF_EUI) != 0;
2241  case CB_GETCOMBOBOXINFO:
2242  return COMBO_GetComboBoxInfo(lphc, (COMBOBOXINFO *)lParam);
2243  case CB_LIMITTEXT:
2244  if( lphc->wState & CBF_EDIT )
2245  return SendMessageW(lphc->hWndEdit, EM_LIMITTEXT, wParam, lParam);
2246  return TRUE;
2247 
2248 #ifdef __REACTOS__
2249  case WM_UPDATEUISTATE:
2250  if (unicode)
2252  else
2254 
2255  if (COMBO_update_uistate(lphc))
2256  {
2257  /* redraw text */
2258  if( !(lphc->wState & CBF_EDIT) )
2259  NtUserInvalidateRect(lphc->self, &lphc->textRect, TRUE);
2260  }
2261  break;
2262 
2263  case WM_CBLOSTTEXTFOCUS: /* undocumented message - deselects the text when focus is lost */
2264  if (lphc->hWndEdit != NULL)
2265  {
2266  SendMessage(lphc->self, WM_LBUTTONUP, 0, 0xFFFFFFFF);
2267  SendMessage(lphc->hWndEdit, EM_SETSEL, 0, 0);
2268  lphc->wState &= ~(CBF_FOCUSED | CBF_BEENFOCUSED);
2269  CB_NOTIFY(lphc, CBN_KILLFOCUS);
2270  }
2271  return TRUE;
2272 
2273 #endif
2274 
2275  default:
2276  if (message >= WM_USER)
2277  WARN("unknown msg WM_USER+%04x wp=%04lx lp=%08lx\n",
2278  message - WM_USER, wParam, lParam );
2279  break;
2280  }
2281  return unicode ? DefWindowProcW(hwnd, message, wParam, lParam) :
2283 }
#define EM_LIMITTEXT
Definition: winuser.h:1982
#define CB_GETTOPINDEX
Definition: winuser.h:1937
#define LB_SETCURSEL
Definition: winuser.h:2045
#define WM_GETTEXTLENGTH
Definition: winuser.h:1601
#define CB_SETITEMDATA
Definition: winuser.h:1948
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static INT CBGetTextAreaHeight(HWND hwnd, LPHEADCOMBO lphc)
Definition: combo.c:202
static void COMBO_KillFocus(LPHEADCOMBO lphc)
Definition: combo.c:1191
#define LB_SETLOCALE
Definition: winuser.h:2049
Definition: tftpd.h:59
#define CB_GETLBTEXTLEN
Definition: winuser.h:1935
#define TRUE
Definition: types.h:120
#define DLGC_WANTCHARS
Definition: winuser.h:2593
static void COMBO_Font(LPHEADCOMBO lphc, HFONT hFont, BOOL bRedraw)
Definition: combo.c:1578
#define LB_DIR
Definition: winuser.h:2015
#define FNID_COMBOBOX
Definition: ntuser.h:829
#define DLGC_WANTMESSAGE
Definition: winuser.h:2588
#define MK_SHIFT
Definition: winuser.h:2344
#define CB_GETDROPPEDSTATE
Definition: winuser.h:1927
#define LB_FINDSTRINGEXACT
Definition: winuser.h:2017
#define WM_GETDLGCODE
Definition: winuser.h:1671
#define WM_CHAR
Definition: winuser.h:1699
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
#define LB_SETHORIZONTALEXTENT
Definition: winuser.h:2046
#define WM_CUT
Definition: winuser.h:1843
#define WM_IME_CHAR
Definition: winuser.h:1816
#define LB_ADDSTRING
Definition: winuser.h:2013
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define LB_GETHORIZONTALEXTENT
Definition: winuser.h:2022
static void CBCalcPlacement(HWND hwnd, LPHEADCOMBO lphc, LPRECT lprEdit, LPRECT lprButton, LPRECT lprLB)
Definition: combo.c:328
#define CB_SETDROPPEDWIDTH
Definition: winuser.h:1944
#define CB_SETHORIZONTALEXTENT
Definition: winuser.h:1947
#define WM_CTLCOLORDLG
Definition: winuser.h:1752
#define CB_GETLBTEXT
Definition: winuser.h:1934
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_MOUSEWHEEL
Definition: treelist.c:96
#define LB_GETITEMDATA
Definition: winuser.h:2023
#define CB_GETITEMDATA
Definition: winuser.h:1932
WORD vk
Definition: input.c:77
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1754
UINT wState
Definition: comctl32.h:142
#define WM_GETTEXT
Definition: winuser.h:1600
#define WARN(fmt,...)
Definition: debug.h:112
LPWSTR WINAPI CharLowerW(_Inout_ LPWSTR)
static LRESULT COMBO_Create(HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG style, BOOL unicode)
Definition: combo.c:453
static HDC
Definition: imagelist.c:92
#define WM_SETREDRAW
Definition: winuser.h:1598
static LRESULT COMBO_GetTextW(LPHEADCOMBO lphc, INT count, LPWSTR buf)
Definition: combo.c:1384
HWND hWndEdit
Definition: comctl32.h:140
#define WM_PASTE
Definition: winuser.h:1845
RECT droppedRect
Definition: comctl32.h:146
HWND WINAPI SetFocus(_In_opt_ HWND)
#define WM_CTLCOLOR
Definition: windowsx.h:4
#define CB_GETTYPE(lphc)
Definition: combo.c:42
RECT buttonRect
Definition: comctl32.h:145
#define VK_DOWN
Definition: winuser.h:2202
#define GetWindowLongPtrW
Definition: winuser.h:4804
LONG left
Definition: windef.h:306
#define CB_SETLOCALE
Definition: winuser.h:1950
#define FNID_DESTROY
Definition: ntuser.h:859
#define CB_NOTIFY(lphc, code)
Definition: combo.c:32
#define CB_HASSTRINGS(lphc)
Definition: combo.c:38
#define WM_CBLOSTTEXTFOCUS
Definition: undocuser.h:49
char * LPSTR
Definition: xmlstorage.h:182
#define VK_ESCAPE
Definition: winuser.h:2189
#define WM_CLEAR
Definition: winuser.h:1846
LONG right
Definition: windef.h:308
static void COMBO_LButtonDown(LPHEADCOMBO lphc, LPARAM lParam)
Definition: combo.c:1673
#define WM_CTLCOLORLISTBOX
Definition: winuser.h:1750
#define WM_NCCREATE
Definition: winuser.h:1665
BOOL NTAPI NtUserInvalidateRect(HWND hWnd, CONST RECT *lpRect, BOOL bErase)
Definition: painting.c:2532
int32_t INT
Definition: typedefs.h:57
static LRESULT COMBO_SetItemHeight(LPHEADCOMBO lphc, INT index, INT height)
Definition: combo.c:1615
#define VK_RETURN
Definition: winuser.h:2176
#define CB_GETCURSEL
Definition: winuser.h:1925
WPARAM wParam
Definition: combotst.c:138
#define WM_ENABLE
Definition: winuser.h:1597
LPWSTR WINAPI CharUpperW(_Inout_ LPWSTR)
#define WM_PRINTCLIENT
Definition: richedit.h:70
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static void COMBO_Size(LPHEADCOMBO lphc)
Definition: combo.c:1526
const char * SPY_GetMsgName(UINT msg, HWND hWnd)
Definition: spy.c:2218
#define CB_SETITEMHEIGHT
Definition: winuser.h:1949
LPSTR WINAPI CharLowerA(_Inout_ LPSTR)
#define EM_GETSEL
Definition: winuser.h:1979
#define CB_GETEDITSEL
Definition: winuser.h:1929
LPSTR WINAPI CharUpperA(_Inout_ LPSTR)
struct tagCREATESTRUCTA * LPCREATESTRUCTA
#define CB_INITSTORAGE
Definition: winuser.h:1938
#define LB_RESETCONTENT
Definition: winuser.h:2037
#define CB_GETDROPPEDWIDTH
Definition: winuser.h:1928
#define WM_CTLCOLORBTN
Definition: winuser.h:1751
#define VK_UP
Definition: winuser.h:2200
#define WM_COPY
Definition: winuser.h:1844
DWORD fnid
Definition: ntuser.h:673
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
#define WM_DELETEITEM
Definition: winuser.h:1629
#define CB_SHOWDROPDOWN
Definition: winuser.h:1952
static LRESULT COMBO_NCCreate(HWND hwnd, LONG style)
Definition: combo.c:135
#define CBN_KILLFOCUS
Definition: winuser.h:1960
#define CBS_SIMPLE
Definition: winuser.h:291
#define WM_CTLCOLORSCROLLBAR
Definition: winuser.h:1753
#define VK_F4
Definition: winuser.h:2233
#define CB_ADDSTRING
Definition: winuser.h:1918
#define CB_INSERTSTRING
Definition: winuser.h:1939
#define CB_GETCOMBOBOXINFO
Definition: winuser.h:1923
smooth NULL
Definition: ftsmooth.c:416
#define WM_GETFONT
Definition: winuser.h:1633
static HWND hwndParent
Definition: cryptui.c:300
#define WM_KEYDOWN
Definition: winuser.h:1697
#define WM_CTLCOLORMSGBOX
Definition: winuser.h:1748
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_LIMITTEXT
Definition: winuser.h:1940
#define LB_GETTEXTLEN
Definition: winuser.h:2032
#define LB_GETCOUNT
Definition: winuser.h:2020
#define WM_SETTEXT
Definition: winuser.h:1599
#define CB_RESETCONTENT
Definition: winuser.h:1941
RECT textRect
Definition: comctl32.h:144
#define CB_ERR
Definition: winuser.h:2410
#define LB_INITSTORAGE
Definition: winuser.h:2034
static LRESULT COMBO_NCDestroy(LPHEADCOMBO lphc)
Definition: combo.c:174
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
HWND hWndLBox
Definition: comctl32.h:141
#define TRACE(s)
Definition: solgame.cpp:4
static void COMBO_MouseMove(LPHEADCOMBO lphc, WPARAM wParam, LPARAM lParam)
Definition: combo.c:1751
#define WM_KILLFOCUS
Definition: winuser.h:1596
#define CB_GETDROPPEDCONTROLRECT
Definition: winuser.h:1926
#define GetProcessHeap()
Definition: compat.h:404
static LRESULT COMBO_SelectString(LPHEADCOMBO lphc, INT start, LPARAM pText, BOOL unicode)
Definition: combo.c:1654
#define LB_SETTOPINDEX
Definition: winuser.h:2052
__wchar_t WCHAR
Definition: xmlstorage.h:180
static void CBGetDroppedControlRect(LPHEADCOMBO lphc, LPRECT lpRect)
Definition: combo.c:438
#define WM_SIZE
Definition: winuser.h:1593
#define WM_NCDESTROY
Definition: winuser.h:1666
#define EM_SETSEL
Definition: winuser.h:2000
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define WM_MEASUREITEM
Definition: winuser.h:1628
HFONT hFont
Definition: comctl32.h:143
#define LB_SETITEMDATA
Definition: winuser.h:2047
#define WM_PAINT
Definition: winuser.h:1602
#define CB_GETHORIZONTALEXTENT
Definition: winuser.h:1931
int ret
INT droppedWidth
Definition: comctl32.h:149
#define KEYDATA_ALT
Definition: combo.c:44
#define ISWIN31
Definition: combo.c:45
#define LB_GETTEXT
Definition: winuser.h:2031
PWND FASTCALL ValidateHwnd(HWND hwnd)
Definition: misc.c:369
static void CBDropDown(LPHEADCOMBO lphc)
Definition: combo.c:990
struct HEADCOMBO * LPHEADCOMBO
#define CB_SELECTSTRING
Definition: winuser.h:1942
static LRESULT COMBO_GetTextA(LPHEADCOMBO lphc, INT count, LPSTR buf)
Definition: combo.c:1434
#define LB_GETLOCALE
Definition: winuser.h:2027
#define CB_SETCURSEL
Definition: winuser.h:1943
#define WM_COMMAND
Definition: winuser.h:1722
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_USER
Definition: winuser.h:1877
#define LB_GETITEMHEIGHT
Definition: winuser.h:2024
static void CBPaintText(LPHEADCOMBO lphc, HDC hdc_paint)
Definition: combo.c:700
#define CBS_UPPERCASE
Definition: winuser.h:293
static LRESULT COMBO_Command(LPHEADCOMBO lphc, WPARAM wParam, HWND hWnd)
Definition: combo.c:1217
static LRESULT COMBO_Paint(LPHEADCOMBO lphc, HDC hParamDC)
Definition: combo.c:856
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define ERR(fmt,...)
Definition: debug.h:110
Definition: ntuser.h:657
#define CB_OKAY
Definition: winuser.h:2409
static LRESULT COMBO_ItemOp(LPHEADCOMBO lphc, UINT msg, LPARAM lParam)
Definition: combo.c:1336
#define WM_COMPAREITEM
Definition: winuser.h:1637
#define LB_FINDSTRING
Definition: winuser.h:2016
BOOL COMBO_FlipListbox(LPHEADCOMBO lphc, BOOL ok, BOOL bRedrawButton)
Definition: combo.c:1117
static void COMBO_LButtonUp(LPHEADCOMBO lphc)
Definition: combo.c:1718
HWND self
Definition: comctl32.h:137
#define CB_DIR
Definition: winuser.h:1920
#define CB_SETEDITSEL
Definition: winuser.h:1945
static LRESULT COMBO_GetComboBoxInfo(const HEADCOMBO *lphc, COMBOBOXINFO *pcbi)
Definition: combo.c:1785
#define CBS_LOWERCASE
Definition: winuser.h:286
#define WM_CTLCOLOREDIT
Definition: winuser.h:1749
#define LB_GETTOPINDEX
Definition: winuser.h:2033
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_LBUTTONUP
Definition: winuser.h:1759
struct tagCREATESTRUCTW * LPCREATESTRUCTW
#define CB_SETEXTENDEDUI
Definition: winuser.h:1946
#define CB_GETLOCALE
Definition: winuser.h:1936
#define LB_GETCURSEL
Definition: winuser.h:2021
#define WM_MOUSEMOVE
Definition: winuser.h:1757
#define MK_CONTROL
Definition: winuser.h:2345
#define KF_ALTDOWN
Definition: winuser.h:2424
#define WM_SETFONT
Definition: winuser.h:1632
HWND owner
Definition: comctl32.h:138
#define WM_DRAWITEM
Definition: winuser.h:1627
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define SendMessage
Definition: winuser.h:5818
#define WM_CREATE
Definition: winuser.h:1590
#define CB_GETITEMHEIGHT
Definition: winuser.h:1933
#define WM_SYSKEYDOWN
Definition: winuser.h:1701
#define HIWORD(l)
Definition: typedefs.h:246
DWORD state2
Definition: ntuser.h:666
BOOL NTAPI NtUserSetWindowFNID(HWND hWnd, WORD fnID)
Definition: window.c:4057
#define CB_GETCOUNT
Definition: winuser.h:1924
#define CB_GETEXTENDEDUI
Definition: winuser.h:1930
#define WM_ERASEBKGND
Definition: winuser.h:1607
#define WM_SETFOCUS
Definition: winuser.h:1595
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define CB_DELETESTRING
Definition: winuser.h:1919
#define WNDS2_WIN40COMPAT
Definition: ntuser.h:618
LONG_PTR LRESULT
Definition: windef.h:209
Arabic default style
Definition: afstyles.h:93
#define LB_DELETESTRING
Definition: winuser.h:2014
GLuint64EXT * result
Definition: glext.h:11304
#define CB_FINDSTRING
Definition: winuser.h:1921
static const WCHAR empty_stringW[]
Definition: edit.c:166
#define LB_INSERTSTRING
Definition: winuser.h:2035
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
static void CBRollUp(LPHEADCOMBO lphc, BOOL ok, BOOL bButton)
Definition: combo.c:1090
#define HeapFree(x, y, z)
Definition: compat.h:403
#define DLGC_WANTARROWS
Definition: winuser.h:2585
#define WIN_GetFullHandle(h)
Definition: user_x.h:108
UINT dwStyle
Definition: comctl32.h:139
static char * strdupA(LPCSTR str)
Definition: combo.c:1803
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
static void COMBO_SetFocus(LPHEADCOMBO lphc)
Definition: combo.c:1169
signed short INT16
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1922

Referenced by RegisterClientPFN().

◆ ComboWndProcA()

LRESULT WINAPI ComboWndProcA ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)

Referenced by RegisterClientPFN().

◆ ComboWndProcW()

LRESULT WINAPI ComboWndProcW ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)

Referenced by RegisterClientPFN().

◆ DesktopWndProcA()

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

Definition at line 1307 of file message.c.

1308 {
1309  LRESULT Result;
1310  MSG AnsiMsg, UcMsg;
1311 
1312  TRACE("Desktop A Class Atom! hWnd 0x%x, Msg %d\n", hwnd, message);
1313 
1314  AnsiMsg.hwnd = hwnd;
1315  AnsiMsg.message = message;
1316  AnsiMsg.wParam = wParam;
1317  AnsiMsg.lParam = lParam;
1318  AnsiMsg.time = 0;
1319  AnsiMsg.pt.x = 0;
1320  AnsiMsg.pt.y = 0;
1321 
1322  // Desktop is always Unicode so convert Ansi here.
1323  if (!MsgiAnsiToUnicodeMessage(hwnd, &UcMsg, &AnsiMsg))
1324  {
1325  return FALSE;
1326  }
1327 
1328  Result = DesktopWndProcW(hwnd, message, UcMsg.wParam, UcMsg.lParam);
1329 
1330  MsgiAnsiToUnicodeCleanup(&UcMsg, &AnsiMsg);
1331 
1332  return Result;
1333  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
LRESULT WINAPI DesktopWndProcW(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: desktop.c:33
Definition: tftpd.h:59
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glext.h:5579
WPARAM wParam
Definition: combotst.c:138
static BOOL FASTCALL MsgiAnsiToUnicodeMessage(HWND hwnd, LPMSG UnicodeMsg, LPMSG AnsiMsg)
Definition: message.c:517
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
static BOOL FASTCALL MsgiAnsiToUnicodeCleanup(LPMSG UnicodeMsg, LPMSG AnsiMsg)
Definition: message.c:709
#define TRACE(s)
Definition: solgame.cpp:4
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139

Referenced by RegisterClientPFN().

◆ DesktopWndProcW()

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

Definition at line 33 of file desktop.c.

37 {
38  TRACE("Desktop W Class Atom! hWnd 0x%x, Msg %d\n", Wnd, Msg);
39 
40  switch(Msg)
41  {
42  case WM_ERASEBKGND:
43  case WM_NCCREATE:
44  case WM_CREATE:
45  case WM_CLOSE:
46  case WM_DISPLAYCHANGE:
47  case WM_PAINT:
48  case WM_SYSCOLORCHANGE:
49  {
50  LRESULT lResult;
52  TRACE("Desktop lResult %d\n", lResult);
53  return lResult;
54  }
55 
56  case WM_PALETTECHANGED:
57  if (Wnd == (HWND)wParam) break;
58  case WM_QUERYNEWPALETTE:
59  {
60  HDC hdc = GetWindowDC( Wnd );
62  ReleaseDC( Wnd, hdc );
63  break;
64  }
65 
66  case WM_SETCURSOR:
68 
69  default:
70  return DefWindowProcW(Wnd, Msg, wParam, lParam);
71  }
72  return 0;
73 }
struct @1608 Msg[]
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1608
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
static HDC
Definition: imagelist.c:92
#define WM_NCCREATE
Definition: winuser.h:1665
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
uint32_t ULONG_PTR
Definition: typedefs.h:64
#define FNID_DESKTOP
Definition: ntuser.h:824
#define WM_SETCURSOR
Definition: winuser.h:1618
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_QUERYNEWPALETTE
Definition: winuser.h:1860
#define TRACE(s)
Definition: solgame.cpp:4
#define WM_CLOSE
Definition: winuser.h:1603
#define WM_PALETTECHANGED
Definition: winuser.h:1859
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
#define WM_PAINT
Definition: winuser.h:1602
HDC hdc
Definition: main.c:9
BOOL NTAPI NtUserMessageCall(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ResultInfo, DWORD dwType, BOOL Ansi)
Definition: message.c:2486
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
HDC WINAPI GetWindowDC(_In_opt_ HWND)
#define IDC_ARROW
Definition: winuser.h:682
#define WM_CREATE
Definition: winuser.h:1590
BOOL WINAPI PaintDesktop(_In_ HDC)
#define WM_ERASEBKGND
Definition: winuser.h:1607
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139

Referenced by DesktopWndProcA(), and RegisterClientPFN().

◆ EditWndProc_common()

LRESULT WINAPI EditWndProc_common ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam,
BOOL  unicode 
)

Definition at line 4752 of file edit.c.

4753 {
4755  LRESULT result = 0;
4756 #ifdef __REACTOS__
4757  /* ReactOS r50219 */
4758  PWND pWnd;
4759 
4760  pWnd = ValidateHwnd(hwnd);
4761  if (pWnd)
4762  {
4763  if (!pWnd->fnid)
4764  {
4766  }
4767  else
4768  {
4769  if (pWnd->fnid != FNID_EDIT)
4770  {
4771  ERR("Wrong window class for Edit! fnId 0x%x\n",pWnd->fnid);
4772  return 0;
4773  }
4774  }
4775  }
4776 #endif
4777 
4778  TRACE("hwnd=%p msg=%x (%s) wparam=%lx lparam=%lx\n", hwnd, msg, SPY_GetMsgName(msg, hwnd), wParam, lParam);
4779 
4780  if (!es && msg != WM_NCCREATE)
4781  return DefWindowProcT(hwnd, msg, wParam, lParam, unicode);
4782 
4783  if (es && (msg != WM_NCDESTROY)) EDIT_LockBuffer(es);
4784 
4785  switch (msg) {
4786  case EM_GETSEL:
4788  break;
4789 
4790  case EM_SETSEL:
4793  result = 1;
4794  break;
4795 
4796  case EM_GETRECT:
4797  if (lParam)
4798  CopyRect((LPRECT)lParam, &es->format_rect);
4799  break;
4800 
4801  case EM_SETRECT:
4802  if ((es->style & ES_MULTILINE) && lParam) {
4805  }
4806  break;
4807 
4808  case EM_SETRECTNP:
4809  if ((es->style & ES_MULTILINE) && lParam)
4811  break;
4812 
4813  case EM_SCROLL:
4815  break;
4816 
4817  case EM_LINESCROLL:
4819  break;
4820 
4821  case EM_SCROLLCARET:
4823  result = 1;
4824  break;
4825 
4826  case EM_GETMODIFY:
4827  result = ((es->flags & EF_MODIFIED) != 0);
4828  break;
4829 
4830  case EM_SETMODIFY:
4831  if (wParam)
4832  es->flags |= EF_MODIFIED;
4833  else
4834  es->flags &= ~(EF_MODIFIED | EF_UPDATE); /* reset pending updates */
4835  break;
4836 
4837  case EM_GETLINECOUNT:
4838  result = (es->style & ES_MULTILINE) ? es->line_count : 1;
4839  break;
4840 
4841  case EM_LINEINDEX:
4843  break;
4844 
4845  case EM_SETHANDLE:
4847  break;
4848 
4849  case EM_GETHANDLE:
4851  break;
4852 
4853  case EM_GETTHUMB:
4855  break;
4856 
4857  /* these messages missing from specs */
4858  case 0x00bf:
4859  case 0x00c0:
4860  case 0x00c3:
4861  case 0x00ca:
4862  FIXME("undocumented message 0x%x, please report\n", msg);
4864  break;
4865 
4866  case EM_LINELENGTH:
4868  break;
4869 
4870  case EM_REPLACESEL:
4871  {
4872  LPWSTR textW;
4873 
4874  if(unicode)
4875  textW = (LPWSTR)lParam;
4876  else
4877  {
4878  LPSTR textA = (LPSTR)lParam;
4879  INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0);
4880  if (!(textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR)))) break;
4881  MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW);
4882  }
4883 
4885  result = 1;
4886 
4887  if(!unicode)
4888  HeapFree(GetProcessHeap(), 0, textW);
4889  break;
4890  }
4891 
4892  case EM_GETLINE:
4894  break;
4895 
4896  case EM_SETLIMITTEXT:
4898  break;
4899 
4900  case EM_CANUNDO:
4902  break;
4903 
4904  case EM_UNDO:
4905  case WM_UNDO:
4907  break;
4908 
4909  case EM_FMTLINES:
4911  break;
4912 
4913  case EM_LINEFROMCHAR:
4915  break;
4916 
4917  case EM_SETTABSTOPS:
4919  break;
4920 
4921  case EM_SETPASSWORDCHAR:
4922  {
4923  WCHAR charW = 0;
4924 
4925  if(unicode)
4926  charW = (WCHAR)wParam;
4927  else
4928  {
4929  CHAR charA = wParam;
4930  MultiByteToWideChar(CP_ACP, 0, &charA, 1, &charW, 1);
4931  }
4932 
4934  break;
4935  }
4936 
4937  case EM_EMPTYUNDOBUFFER:
4939  break;
4940 
4942  result = (es->style & ES_MULTILINE) ? es->y_offset : es->x_offset;
4943  break;
4944 
4945  case EM_SETREADONLY:
4946  {
4947  DWORD old_style = es->style;
4948 
4949  if (wParam) {
4952  es->style |= ES_READONLY;
4953  } else {
4956  es->style &= ~ES_READONLY;
4957  }
4958 
4959  if (old_style ^ es->style)
4960  InvalidateRect(es->hwndSelf, NULL, TRUE);
4961 
4962  result = 1;
4963  break;
4964  }
4965 
4966  case EM_SETWORDBREAKPROC:
4968  break;
4969 
4970  case EM_GETWORDBREAKPROC:
4971  result = (LRESULT)es->word_break_proc;
4972  break;
4973 
4974  case EM_GETPASSWORDCHAR:
4975  {
4976  if(unicode)
4977  result = es->password_char;
4978  else
4979  {
4980  WCHAR charW = es->password_char;
4981  CHAR charA = 0;
4982  WideCharToMultiByte(CP_ACP, 0, &charW, 1, &charA, 1, NULL, NULL);
4983  result = charA;
4984  }
4985  break;
4986  }
4987 
4988  case EM_SETMARGINS:
4990  break;
4991 
4992  case EM_GETMARGINS:
4993  result = MAKELONG(es->left_margin, es->right_margin);
4994  break;
4995 
4996  case EM_GETLIMITTEXT:
4997  result = es->buffer_limit;
4998  break;
4999 
5000  case EM_POSFROMCHAR:
5001  if ((INT)wParam >= get_text_length(es)) result = -1;
5003  break;
5004 
5005  case EM_CHARFROMPOS:
5006  result = EDIT_EM_CharFromPos(es, (short)LOWORD(lParam), (short)HIWORD(lParam));
5007  break;
5008 
5009  /* End of the EM_ messages which were in numerical order; what order
5010  * are these in? vaguely alphabetical?
5011  */
5012 
5013  case WM_NCCREATE:
5015  break;
5016 
5017  case WM_NCDESTROY:
5019 #ifdef __REACTOS__
5021 #endif
5022  es = NULL;
5023  break;
5024 
5025  case WM_GETDLGCODE:
5027 
5028  if (es->style & ES_MULTILINE)
5030 
5031  if (lParam)
5032  {
5033  es->flags|=EF_DIALOGMODE;
5034 
5035  if (((LPMSG)lParam)->message == WM_KEYDOWN)
5036  {
5037  int vk = (int)((LPMSG)lParam)->wParam;
5038 
5039  if (es->hwndListBox)
5040  {
5041  if (vk == VK_RETURN || vk == VK_ESCAPE)
5044  }
5045  }
5046  }
5047  break;
5048 
5049  case WM_IME_CHAR:
5050  if (!unicode)
5051  {
5052  WCHAR charW;
5053  CHAR strng[2];
5054 
5055  strng[0] = wParam >> 8;
5056  strng[1] = wParam & 0xff;
5057  if (strng[0]) MultiByteToWideChar(CP_ACP, 0, strng, 2, &charW, 1);
5058  else MultiByteToWideChar(CP_ACP, 0, &strng[1], 1, &charW, 1);
5060  break;
5061  }
5062  /* fall through */
5063  case WM_CHAR:
5064  {
5065  WCHAR charW;
5066 
5067  if(unicode)
5068  charW = wParam;
5069  else
5070  {
5071  CHAR charA = wParam;
5072  MultiByteToWideChar(CP_ACP, 0, &charA, 1, &charW, 1);
5073  }
5074 
5075  if (es->hwndListBox)
5076  {
5077  if (charW == VK_RETURN || charW == VK_ESCAPE)
5078  {
5081  break;
5082  }
5083  }
5085  break;
5086  }
5087 
5088  case WM_UNICHAR:
5089  if (unicode)
5090  {
5091  if (wParam == UNICODE_NOCHAR) return TRUE;
5092  if (wParam <= 0x000fffff)
5093  {
5094  if(wParam > 0xffff) /* convert to surrogates */
5095  {
5096  wParam -= 0x10000;
5097  EDIT_WM_Char(es, (wParam >> 10) + 0xd800);
5098  EDIT_WM_Char(es, (wParam & 0x03ff) + 0xdc00);
5099  }
5100  else EDIT_WM_Char(es, wParam);
5101  }
5102  return 0;
5103  }
5104  break;
5105 
5106  case WM_CLEAR:
5107  EDIT_WM_Clear(es);
5108  break;
5109 
5110  case WM_CONTEXTMENU:
5111  EDIT_WM_ContextMenu(es, (short)LOWORD(lParam), (short)HIWORD(lParam));
5112  break;
5113 
5114  case WM_COPY:
5115  EDIT_WM_Copy(es);
5116  break;
5117 
5118  case WM_CREATE:
5119  if(unicode)
5120  result = EDIT_WM_Create(es, ((LPCREATESTRUCTW)lParam)->lpszName);
5121  else
5122  {
5123  LPCSTR nameA = ((LPCREATESTRUCTA)lParam)->lpszName;
5124  LPWSTR nameW = NULL;
5125  if(nameA)
5126  {
5127  INT countW = MultiByteToWideChar(CP_ACP, 0, nameA, -1, NULL, 0);
5128  if((nameW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR))))
5129  MultiByteToWideChar(CP_ACP, 0, nameA, -1, nameW, countW);
5130  }
5132  HeapFree(GetProcessHeap(), 0, nameW);
5133  }
5134  break;
5135 
5136  case WM_CUT:
5137  EDIT_WM_Cut(es);
5138  break;
5139 
5140  case WM_ENABLE:
5141  es->bEnableState = (BOOL) wParam;
5143  break;
5144 
5145  case WM_ERASEBKGND:
5146  /* we do the proper erase in EDIT_WM_Paint */
5147  result = 1;
5148  break;
5149 
5150  case WM_GETFONT:
5151  result = (LRESULT)es->font;
5152  break;
5153 
5154  case WM_GETTEXT:
5156  break;
5157 
5158  case WM_GETTEXTLENGTH:
5159  if (unicode) result = get_text_length(es);
5160  else result = WideCharToMultiByte( CP_ACP, 0, es->text, get_text_length(es),
5161  NULL, 0, NULL, NULL );
5162  break;
5163 
5164  case WM_HSCROLL:
5166  break;
5167 
5168  case WM_KEYDOWN:
5170  break;
5171 
5172  case WM_KILLFOCUS:
5174  break;
5175 
5176  case WM_LBUTTONDBLCLK:
5178  break;
5179 
5180  case WM_LBUTTONDOWN:
5181  result = EDIT_WM_LButtonDown(es, wParam, (short)LOWORD(lParam), (short)HIWORD(lParam));
5182  break;
5183 
5184  case WM_LBUTTONUP:
5186  break;
5187 
5188  case WM_MBUTTONDOWN:
5190  break;
5191 
5192  case WM_MOUSEMOVE:
5193  result = EDIT_WM_MouseMove(es, (short)LOWORD(lParam), (short)HIWORD(lParam));
5194  break;
5195 
5196  case WM_PRINTCLIENT:
5197  case WM_PAINT:
5199  break;
5200 
5201  case WM_PASTE:
5202  EDIT_WM_Paste(es);
5203  break;
5204 
5205  case WM_SETFOCUS:
5207  break;
5208 
5209  case WM_SETFONT:
5211  break;
5212 
5213  case WM_SETREDRAW:
5214  /* FIXME: actually set an internal flag and behave accordingly */
5215  break;
5216 
5217  case WM_SETTEXT:
5218  EDIT_WM_SetText(es, (LPCWSTR)lParam, unicode);
5219  result = TRUE;
5220  break;
5221 
5222  case WM_SIZE:
5224  break;
5225 
5226  case WM_STYLECHANGED:
5228  break;
5229 
5230  case WM_STYLECHANGING:
5231  result = 0; /* See EDIT_WM_StyleChanged */
5232  break;
5233 
5234  case WM_SYSKEYDOWN:
5236  break;
5237 
5238  case WM_TIMER:
5239  EDIT_WM_Timer(es);
5240  break;
5241 
5242  case WM_VSCROLL:
5244  break;
5245 
5246  case WM_MOUSEWHEEL:
5247  {
5248  int wheelDelta;
5249  UINT pulScrollLines = 3;
5250  SystemParametersInfoW(SPI_GETWHEELSCROLLLINES,0, &pulScrollLines, 0);
5251 
5252  if (wParam & (MK_SHIFT | MK_CONTROL)) {
5254  break;
5255  }
5256  wheelDelta = GET_WHEEL_DELTA_WPARAM(wParam);
5257  /* if scrolling changes direction, ignore left overs */
5258  if ((wheelDelta < 0 && es->wheelDeltaRemainder < 0) ||
5259  (wheelDelta > 0 && es->wheelDeltaRemainder > 0))
5260  es->wheelDeltaRemainder += wheelDelta;
5261  else
5262  es->wheelDeltaRemainder = wheelDelta;
5263  if (es->wheelDeltaRemainder && pulScrollLines)
5264  {
5265  int cLineScroll;
5266  pulScrollLines = (int) min((UINT) es->line_count, pulScrollLines);
5267  cLineScroll = pulScrollLines * (float)es->wheelDeltaRemainder / WHEEL_DELTA;
5268  es->wheelDeltaRemainder -= WHEEL_DELTA * cLineScroll / (int)pulScrollLines;
5269  result = EDIT_EM_LineScroll(es, 0, -cLineScroll);
5270  }
5271  }
5272  break;
5273 
5274 
5275  /* IME messages to make the edit control IME aware */
5276  case WM_IME_SETCONTEXT:
5277  break;
5278 
5279  case WM_IME_STARTCOMPOSITION:
5280  es->composition_start = es->selection_end;
5281  es->composition_len = 0;
5282  break;
5283 
5284  case WM_IME_COMPOSITION:
5286  break;
5287 
5288  case WM_IME_ENDCOMPOSITION:
5289  if (es->composition_len > 0)
5290  {
5292  es->selection_end = es->selection_start;
5293  es->composition_len= 0;
5294  }
5295  break;
5296 
5298  break;
5299 
5300  case WM_IME_SELECT:
5301  break;
5302 
5303  case WM_IME_CONTROL:
5304  break;
5305 
5306  case WM_IME_REQUEST:
5307  switch (wParam)
5308  {
5309  case IMR_QUERYCHARPOSITION:
5310  {
5311  LRESULT pos;
5313 
5314  pos = EDIT_EM_PosFromChar(es, es->selection_start + chpos->dwCharPos, FALSE);
5315  chpos->pt.x = LOWORD(pos);
5316  chpos->pt.y = HIWORD(pos);
5317  chpos->cLineHeight = es->line_height;
5318  chpos->rcDocument = es->format_rect;
5319  MapWindowPoints(hwnd, 0, &chpos->pt, 1);
5320  MapWindowPoints(hwnd, 0, (POINT*)&chpos->rcDocument, 2);
5321  result = 1;
5322  break;
5323  }
5324  }
5325  break;
5326 
5327  default:
5328  result = DefWindowProcT(hwnd, msg, wParam, lParam, unicode);
5329  break;
5330  }
5331 
5332 #ifdef __REACTOS__
5333  /* ReactOS: check GetWindowLong in case es has been destroyed during processing */
5334  if (IsWindow(hwnd) && es && GetWindowLongPtrW(hwnd, 0))
5336 #else
5338 #endif
5339 
5340  TRACE("hwnd=%p msg=%x (%s) -- 0x%08lx\n", hwnd, msg, SPY_GetMsgName(msg, hwnd), result);
5341 
5342  return result;
5343 }
#define WM_GETTEXTLENGTH
Definition: winuser.h:1601
#define FNID_EDIT
Definition: ntuser.h:832
static LRESULT EDIT_WM_MouseMove(EDITSTATE *es, INT x, INT y)
Definition: edit.c:3761
static LRESULT EDIT_WM_VScroll(EDITSTATE *es, INT action, INT pos)
Definition: edit.c:4271
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static void EDIT_EM_SetSel(EDITSTATE *es, UINT start, UINT end, BOOL after_wrap)
Definition: edit.c:1635
static LRESULT EDIT_WM_NCCreate(HWND hwnd, LPCREATESTRUCTW lpcs, BOOL unicode)
Definition: edit.c:4544
Definition: tftpd.h:59
#define TRUE
Definition: types.h:120
#define DLGC_WANTCHARS
Definition: winuser.h:2593
#define DLGC_WANTMESSAGE
Definition: winuser.h:2588
#define EM_LINELENGTH
Definition: winuser.h:1985
#define MK_SHIFT
Definition: winuser.h:2344
#define CB_GETDROPPEDSTATE
Definition: winuser.h:1927
long y
Definition: polytest.cpp:48
#define WM_GETDLGCODE
Definition: winuser.h:1671
#define WM_CONTEXTMENU
Definition: richedit.h:64
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
#define WM_CHAR
Definition: winuser.h:1699
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
#define WM_CUT
Definition: winuser.h:1843
#define WideCharToMultiByte
Definition: compat.h:101
#define WM_IME_CHAR
Definition: winuser.h:1816
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define EM_SETMARGINS
Definition: winuser.h:1994
BOOL WINAPI IsWindow(_In_opt_ HWND)
long x
Definition: polytest.cpp:48
#define EM_SETREADONLY
Definition: winuser.h:1997
static void EDIT_UpdateText(EDITSTATE *es, const RECT *rc, BOOL bErase)
Definition: edit.c:1505
#define WM_MOUSEWHEEL
Definition: treelist.c:96
#define CP_ACP
Definition: compat.h:99
#define EM_SETLIMITTEXT
Definition: winuser.h:1993
WORD vk
Definition: input.c:77
static INT EDIT_EM_GetLine(EDITSTATE *es, INT line, LPWSTR dst, BOOL unicode)
Definition: edit.c:2548
char CHAR
Definition: xmlstorage.h:175
#define WM_GETTEXT
Definition: winuser.h:1600
static void EDIT_EM_SetHandle(EDITSTATE *es, HLOCAL hloc)
Definition: edit.c:2827
#define ES_MULTILINE
Definition: pedump.c:667
#define INT
Definition: polytest.cpp:20
static void EDIT_WM_SetText(EDITSTATE *es, LPCWSTR text, BOOL unicode)
Definition: edit.c:3974
static HDC
Definition: imagelist.c:92
#define WM_SETREDRAW
Definition: winuser.h:1598
#define EM_SETWORDBREAKPROC
Definition: winuser.h:2002
static BOOL EDIT_EM_SetTabStops(EDITSTATE *es, INT count, const INT *tabs)
Definition: edit.c:3036
#define WM_IME_SELECT
Definition: winuser.h:1815
#define IMR_QUERYCHARPOSITION
Definition: imm.h:536
static void EDIT_UnlockBuffer(EDITSTATE *es, BOOL force)
Definition: edit.c:1353
static void EDIT_WM_Timer(EDITSTATE *es)
Definition: edit.c:4121
#define WM_PASTE
Definition: winuser.h:1845
static const WCHAR charW[]
Definition: tokenize.c:46
#define ES_READONLY
Definition: pedump.c:675
#define GetWindowLongPtrW
Definition: winuser.h:4804
#define FNID_DESTROY
Definition: ntuser.h:859
static BOOL EDIT_EM_FmtLines(EDITSTATE *es, BOOL add_eol)
Definition: edit.c:2481
static void EDIT_EM_SetMargins(EDITSTATE *es, INT action, WORD left, WORD right, BOOL repaint)
Definition: edit.c:2939
#define VK_ESCAPE
Definition: winuser.h:2189
char * LPSTR
Definition: xmlstorage.h:182
#define WM_CLEAR
Definition: winuser.h:1846
#define BOOL
Definition: nt_native.h:43
#define WM_NCCREATE
Definition: winuser.h:1665
#define WM_IME_COMPOSITIONFULL
Definition: winuser.h:1814
int32_t INT
Definition: typedefs.h:57
static void EDIT_EM_SetLimitText(EDITSTATE *es, UINT limit)
Definition: edit.c:2903
#define VK_RETURN
Definition: winuser.h:2176
#define DLGC_HASSETSEL
Definition: winuser.h:2589
static LRESULT EDIT_WM_LButtonDown(EDITSTATE *es, DWORD keys, INT x, INT y)
Definition: edit.c:3707
WPARAM wParam
Definition: combotst.c:138
#define WM_ENABLE
Definition: winuser.h:1597
#define WM_PRINTCLIENT
Definition: richedit.h:70
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define EM_SETHANDLE
Definition: winuser.h:1991
const char * SPY_GetMsgName(UINT msg, HWND hWnd)
Definition: spy.c:2218
#define EM_CHARFROMPOS
Definition: richedit.h:78
#define EM_GETSEL
Definition: winuser.h:1979
#define EM_POSFROMCHAR
Definition: richedit.h:77
#define EM_GETPASSWORDCHAR
Definition: winuser.h:1977
static LRESULT(CALLBACK *p_edit_proc)(HWND
static LRESULT EDIT_WM_LButtonDblClk(EDITSTATE *es)
Definition: edit.c:3678
static BOOL EDIT_EM_LineScroll(EDITSTATE *es, INT dx, INT dy)
Definition: edit.c:1798
struct tagCREATESTRUCTA * LPCREATESTRUCTA
#define WHEEL_DELTA
Definition: treelist.c:99
static UINT get_text_length(EDITSTATE *es)
Definition: edit.c:250
static HLOCAL EDIT_EM_GetHandle(EDITSTATE *es)
Definition: edit.c:2503
#define WM_COPY
Definition: winuser.h:1844
DWORD fnid
Definition: ntuser.h:673
unsigned int BOOL
Definition: ntddk_ex.h:94
static LRESULT DefWindowProcT(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: edit.c:4737
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
static LRESULT EDIT_WM_KillFocus(EDITSTATE *es)
Definition: edit.c:3635
#define FIXME(fmt,...)
Definition: debug.h:111
static void EDIT_SetRectNP(EDITSTATE *es, const RECT *rc)
Definition: edit.c:2404
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define MAKELONG(a, b)
Definition: typedefs.h:248
#define EM_GETMARGINS
Definition: winuser.h:1975
smooth NULL
Definition: ftsmooth.c:416
#define WM_GETFONT
Definition: winuser.h:1633
static LRESULT EDIT_WM_MButtonDown(EDITSTATE *es)
Definition: edit.c:3749
static void EDIT_WM_Paste(EDITSTATE *es)
Definition: edit.c:3142
#define WM_KEYDOWN
Definition: winuser.h:1697
static LRESULT EDIT_EM_GetSel(const EDITSTATE *es, PUINT start, PUINT end)
Definition: edit.c:2594
const char * LPCSTR
Definition: xmlstorage.h:183
#define WM_IME_REQUEST
Definition: winuser.h:1818
#define WM_SETTEXT
Definition: winuser.h:1599
static LRESULT EDIT_WM_HScroll(EDITSTATE *es, INT action, INT pos)
Definition: edit.c:4139
static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, LPCWSTR lpsz_replace, BOOL send_update, BOOL honor_limit)
Definition: edit.c:2615
static LRESULT EDIT_WM_StyleChanged(EDITSTATE *es, WPARAM which, const STYLESTRUCT *style)
Definition: edit.c:4062
static const WCHAR nameW[]
Definition: main.c:46
static void EDIT_EM_SetWordBreakProc(EDITSTATE *es, void *wbp)
Definition: edit.c:3066
static void EDIT_WM_ContextMenu(EDITSTATE *es, INT x, INT y)
Definition: edit.c:3356
BOOL WINAPI SystemParametersInfoW(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
#define TRACE(s)
Definition: solgame.cpp:4
static void EDIT_LockBuffer(EDITSTATE *es)
Definition: edit.c:1288
#define WM_KILLFOCUS
Definition: winuser.h:1596
#define GetProcessHeap()
Definition: compat.h:404
#define EM_SETPASSWORDCHAR
Definition: winuser.h:1996
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
if(!(yy_init))
Definition: macro.lex.yy.c:714
__wchar_t WCHAR
Definition: xmlstorage.h:180
static LRESULT EDIT_WM_NCDestroy(EDITSTATE *es)
Definition: edit.c:4709
#define WM_SIZE
Definition: winuser.h:1593
static void EDIT_EM_SetPasswordChar(EDITSTATE *es, WCHAR c)
Definition: edit.c:3007
static const char textA[]
Definition: registrar.c:40
#define WM_IME_SETCONTEXT
Definition: winuser.h:1811
Definition: edit.c:97
#define EM_SCROLL
Definition: winuser.h:1989
#define WM_TIMER
Definition: winuser.h:1724
#define WM_IME_CONTROL
Definition: winuser.h:1813
#define EM_GETLIMITTEXT
Definition: richedit.h:74
#define WM_NCDESTROY
Definition: winuser.h:1666
#define EM_GETMODIFY
Definition: winuser.h:1976
#define EM_SETSEL
Definition: winuser.h:2000
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
static INT EDIT_EM_LineLength(EDITSTATE *es, INT index)
Definition: edit.c:1058
unsigned long DWORD
Definition: ntddk_ex.h:95
static LRESULT EDIT_WM_KeyDown(EDITSTATE *es, INT key)
Definition: edit.c:3497
DWORD dwCharPos
Definition: imm.h:135
#define WM_PAINT
Definition: winuser.h:1602
#define EM_LINESCROLL
Definition: winuser.h:1986
#define EM_SETRECTNP
Definition: winuser.h:1999
#define EM_UNDO
Definition: winuser.h:2003
PWND FASTCALL ValidateHwnd(HWND hwnd)
Definition: misc.c:369
#define EM_EMPTYUNDOBUFFER
Definition: winuser.h:1967
static void EDIT_EM_EmptyUndoBuffer(EDITSTATE *es)
Definition: edit.c:185
static BOOL EDIT_EM_Undo(EDITSTATE *es)
Definition: edit.c:3085
RECT rcDocument
Definition: imm.h:138
#define EM_GETHANDLE
Definition: winuser.h:1971
#define EM_FMTLINES
Definition: winuser.h:1968
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1760
#define EF_DIALOGMODE
Definition: edit.c:69
static LRESULT EDIT_WM_LButtonUp(EDITSTATE *es)
Definition: edit.c:3733
#define EM_SETTABSTOPS
Definition: winuser.h:2001
#define EM_SETMODIFY
Definition: winuser.h:1995
static const WCHAR textW[]
Definition: itemdlg.c:1559
#define DLGC_WANTALLKEYS
Definition: winuser.h:2587
static void EDIT_EM_ScrollCaret(EDITSTATE *es)
Definition: edit.c:1878
static LRESULT EDIT_EM_Scroll(EDITSTATE *es, INT action)
Definition: edit.c:1813
#define ERR(fmt,...)
Definition: debug.h:110
static INT EDIT_WM_GetText(const EDITSTATE *es, INT count, LPWSTR dst, BOOL unicode)
Definition: edit.c:3412
#define GWL_STYLE
Definition: winuser.h:846
Definition: ntuser.h:657
static INT EDIT_EM_LineFromChar(EDITSTATE *es, INT index)
Definition: edit.c:994
HWND WINAPI GetParent(_In_ HWND)
static void EDIT_WM_Clear(EDITSTATE *es)
Definition: edit.c:3199
static LRESULT EDIT_WM_Char(EDITSTATE *es, WCHAR c)
Definition: edit.c:3226
#define EM_SETRECT
Definition: winuser.h:1998
#define EM_LINEFROMCHAR
Definition: winuser.h:1983
static float(__cdecl *square_half_float)(float x
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_LBUTTONUP
Definition: winuser.h:1759
static void EDIT_WM_Cut(EDITSTATE *es)
Definition: edit.c:3214
#define WM_MBUTTONDOWN
Definition: winuser.h:1764
#define min(a, b)
Definition: monoChain.cc:55
#define EF_UPDATE
Definition: edit.c:63
static BOOL EDIT_EM_CanUndo(const EDITSTATE *es)
Definition: edit.c:174
static void EDIT_ImeComposition(HWND hwnd, LPARAM CompFlag, EDITSTATE *es)
Definition: edit.c:4507
unsigned int UINT
Definition: ndis.h:50
static void EDIT_WM_SetFont(EDITSTATE *es, HFONT font, BOOL redraw)
Definition: edit.c:3920
#define WM_MOUSEMOVE
Definition: winuser.h:1757
#define WM_HSCROLL
Definition: winuser.h:1725
#define EM_GETWORDBREAKPROC
Definition: winuser.h:1981
#define EF_MODIFIED
Definition: edit.c:61
static INT EDIT_EM_LineIndex(const EDITSTATE *es, INT line)
Definition: edit.c:1023
static LRESULT EDIT_WM_SysKeyDown(EDITSTATE *es, INT key, DWORD key_data)
Definition: edit.c:4102
#define MK_CONTROL
Definition: winuser.h:2345
static void EDIT_WM_SetFocus(EDITSTATE *es)
Definition: edit.c:3888
#define MultiByteToWideChar
Definition: compat.h:100
#define WM_SETFONT
Definition: winuser.h:1632
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define msg(x)
Definition: auth_time.c:54
UINT cLineHeight
Definition: imm.h:137
static LRESULT EDIT_EM_CharFromPos(EDITSTATE *es, INT x, INT y)
Definition: edit.c:2453
#define EM_LINEINDEX
Definition: winuser.h:1984
#define WM_CREATE
Definition: winuser.h:1590
BOOL WINAPI CopyRect(_Out_ LPRECT, _In_ LPCRECT)
#define WM_SYSKEYDOWN
Definition: winuser.h:1701
#define EM_GETRECT
Definition: winuser.h:1978
#define EM_GETLINE
Definition: winuser.h:1973
#define EM_CANUNDO
Definition: winuser.h:1965
#define HIWORD(l)
Definition: typedefs.h:246
BOOL NTAPI NtUserSetWindowFNID(HWND hWnd, WORD fnID)
Definition: window.c:4057
static void EDIT_WM_Size(EDITSTATE *es, UINT action)
Definition: edit.c:4029
#define WM_ERASEBKGND
Definition: winuser.h:1607
#define WM_SETFOCUS
Definition: winuser.h:1595
#define WM_UNDO
Definition: winuser.h:1847
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static LRESULT EDIT_WM_Create(EDITSTATE *es, LPCWSTR name)
Definition: edit.c:4659
LONG_PTR LRESULT
Definition: windef.h:209
#define es
Definition: i386-dis.c:431
GLuint64EXT * result
Definition: glext.h:11304
static const WCHAR empty_stringW[]
Definition: edit.c:166
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
static void EDIT_WM_Paint(EDITSTATE *es, HDC hdc)
Definition: edit.c:3793
#define HeapFree(x, y, z)
Definition: compat.h:403
#define DLGC_WANTARROWS
Definition: winuser.h:2585
#define EM_GETFIRSTVISIBLELINE
Definition: winuser.h:1970
unsigned int * PUINT
Definition: ndis.h:50
#define EM_REPLACESEL
Definition: winuser.h:1988
#define WM_UNICHAR
Definition: richedit.h:67
#define EM_SCROLLCARET
Definition: richedit.h:81
static void EDIT_WM_Copy(EDITSTATE *es)
Definition: edit.c:3170
#define WM_VSCROLL
Definition: winuser.h:1726
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
int * LPINT
Definition: windef.h:178
static LRESULT EDIT_EM_GetThumb(EDITSTATE *es)
Definition: edit.c:4391
static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap)
Definition: edit.c:1094
#define EM_GETTHUMB
Definition: winuser.h:1980
#define EM_GETLINECOUNT
Definition: winuser.h:1974

Referenced by RegisterClientPFN().

◆ EditWndProcA()

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

Referenced by RegisterClientPFN().

◆ EditWndProcW()

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

Referenced by RegisterClientPFN().

◆ GhostWndProc_common()

LRESULT WINAPI GhostWndProc_common ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL  unicode 
)

Definition at line 515 of file ghost.c.

517 {
518  switch (uMsg)
519  {
520  case WM_CREATE:
522  return -1;
523  break;
524 
525  case WM_NCPAINT:
526  Ghost_OnNCPaint(hwnd, (HRGN)wParam, unicode);
527  return 0;
528 
529  case WM_ERASEBKGND:
531  return TRUE;
532 
533  case WM_PAINT:
535  break;
536 
537  case WM_MOVE:
539  break;
540 
541  case WM_SIZE:
542  break;
543 
544  case WM_SIZING:
545  return TRUE;
546 
547  case WM_SYSCOMMAND:
548  switch ((UINT)wParam)
549  {
550  case SC_MAXIMIZE:
551  case SC_SIZE:
552  // sizing-related
553  return 0;
554  }
555  if (unicode)
556  return DefWindowProcW(hwnd, uMsg, wParam, lParam);
557  else
558  return DefWindowProcA(hwnd, uMsg, wParam, lParam);
559 
560  case WM_CLOSE:
562  break;
563 
564  case WM_TIMER:
566  break;
567 
568  case WM_NCMOUSEMOVE:
569  if (unicode)
570  DefWindowProcW(hwnd, uMsg, wParam, lParam);
571  else
572  DefWindowProcA(hwnd, uMsg, wParam, lParam);
574  return 0;
575 
576  case WM_GETICON:
577  return (LRESULT)Ghost_GetIcon(hwnd, (INT)wParam);
578 
579  case WM_COMMAND:
580  if (LOWORD(wParam) == 3333)
582  break;
583 
584  case WM_DESTROY:
586  break;
587 
588  case WM_NCDESTROY:
590  break;
591 
592  default:
593  {
594  if (unicode)
595  return DefWindowProcW(hwnd, uMsg, wParam, lParam);
596  else
597  return DefWindowProcA(hwnd, uMsg, wParam, lParam);
598  }
599  }
600  return 0;
601 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
static void Ghost_OnNCPaint(HWND hwnd, HRGN hrgn, BOOL bUnicode)
Definition: ghost.c:330
static void Ghost_OnPaint(HWND hwnd)
Definition: ghost.c:350
static void Ghost_OnClose(HWND hwnd)
Definition: ghost.c:435
static HDC
Definition: imagelist.c:92
static BOOL Ghost_OnCreate(HWND hwnd, CREATESTRUCTW *lpcs)
Definition: ghost.c:158
#define WM_MOVE
Definition: winuser.h:1592
static void Ghost_OnDraw(HWND hwnd, HDC hdc)
Definition: ghost.c:309
int32_t INT
Definition: typedefs.h:57
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static void Ghost_OnNCDestroy(HWND hwnd)
Definition: ghost.c:402
#define WM_NCPAINT
Definition: winuser.h:1669
short SHORT
Definition: pedump.c:59
static void Ghost_OnMove(HWND hwnd, int x, int y)
Definition: ghost.c:362
#define SC_MAXIMIZE
Definition: winuser.h:2563
#define WM_SIZING
Definition: winuser.h:1789
smooth NULL
Definition: ftsmooth.c:416
#define IDC_WAIT
Definition: winuser.h:684
#define WM_DESTROY
Definition: winuser.h:1591
static HICON Ghost_GetIcon(HWND hwnd, INT fType)
Definition: ghost.c:487
#define WM_SIZE
Definition: winuser.h:1593
#define WM_TIMER
Definition: winuser.h:1724
#define WM_CLOSE
Definition: winuser.h:1603
#define WM_NCDESTROY
Definition: winuser.h:1666
static void Ghost_Unenchant(HWND hwnd, BOOL bDestroyTarget)
Definition: ghost.c:298
static void Ghost_OnTimer(HWND hwnd, UINT id)
Definition: ghost.c:463
#define WM_PAINT
Definition: winuser.h:1602
#define WM_COMMAND
Definition: winuser.h:1722
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define LoadCursor
Definition: winuser.h:5787
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define SC_SIZE
Definition: winuser.h:2559
unsigned int UINT
Definition: ndis.h:50
#define WM_CREATE
Definition: winuser.h:1590
#define HIWORD(l)
Definition: typedefs.h:246
#define WM_ERASEBKGND
Definition: winuser.h:1607
LONG_PTR LRESULT
Definition: windef.h:209
static void Ghost_OnDestroy(HWND hwnd)
Definition: ghost.c:376
#define WM_SYSCOMMAND
Definition: winuser.h:1723
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define WM_NCMOUSEMOVE
Definition: winuser.h:1673

Referenced by GhostWndProcA(), GhostWndProcW(), and RegisterClientPFN().

◆ GhostWndProcA()

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

Definition at line 604 of file ghost.c.

605 {
606  return GhostWndProc_common(hwnd, uMsg, wParam, lParam, FALSE);
607 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
LRESULT WINAPI GhostWndProc_common(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: ghost.c:515
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139

Referenced by RegisterClientPFN().

◆ GhostWndProcW()

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

Definition at line 610 of file ghost.c.

611 {
612  return GhostWndProc_common(hwnd, uMsg, wParam, lParam, TRUE);
613 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
LRESULT WINAPI GhostWndProc_common(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: ghost.c:515
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139

Referenced by RegisterClientPFN().

◆ IconTitleWndProc()

LRESULT WINAPI IconTitleWndProc ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 184 of file icontitle.c.

186 {
187  HWND owner = GetWindow( hWnd, GW_OWNER );
188 
189  if (!IsWindow(hWnd)) return 0;
190 
191  switch( msg )
192  {
193  case WM_CREATE:
194  if (!hIconTitleFont)
195  {
196  LOGFONTA logFont;
199  hIconTitleFont = CreateFontIndirectA( &logFont );
200  }
201  return (hIconTitleFont ? 0 : -1);
202  case WM_NCHITTEST:
203  return HTCAPTION;
204  case WM_NCMOUSEMOVE:
205  case WM_NCLBUTTONDBLCLK:
206  return SendMessageW( owner, msg, wParam, lParam );
207  case WM_ACTIVATE:
208  if( wParam ) SetActiveWindow( owner );
209  return 0;
210  case WM_CLOSE:
211  return 0;
212  case WM_SHOWWINDOW:
213  if (wParam) ICONTITLE_SetTitlePos( hWnd, owner );
214  return 0;
215  case WM_ERASEBKGND:
216  if( GetWindowLongPtrW( owner, GWL_STYLE ) & WS_CHILD )
217  lParam = SendMessageW( owner, WM_ISACTIVEICON, 0, 0 );
218  else
219  lParam = (owner == GetActiveWindow());
220  if( ICONTITLE_Paint( hWnd, owner, (HDC)wParam, (BOOL)lParam ) )
221  ValidateRect( hWnd, NULL );
222  return 1;
223  }
224  return DefWindowProcW( hWnd, msg, wParam, lParam );
225 }
static BOOL ICONTITLE_Paint(HWND hwnd, HWND owner, HDC hDC, BOOL bActive)
Definition: icontitle.c:122
BOOL WINAPI IsWindow(_In_opt_ HWND)
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
static HDC
Definition: imagelist.c:92
HWND hWnd
Definition: settings.c:17
#define WM_SHOWWINDOW
Definition: winuser.h:1610
#define WM_NCHITTEST
Definition: winuser.h:1668
#define WS_CHILD
Definition: pedump.c:617
#define GetWindowLongPtrW
Definition: winuser.h:4804
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static BOOL ICONTITLE_SetTitlePos(HWND hwnd, HWND owner)
Definition: icontitle.c:71
HWND WINAPI SetActiveWindow(_In_ HWND)
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI SystemParametersInfoA(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
smooth NULL
Definition: ftsmooth.c:416
#define SPI_GETICONTITLEWRAP
Definition: winuser.h:1356
#define WM_CLOSE
Definition: winuser.h:1603
BOOL WINAPI ValidateRect(_In_opt_ HWND, _In_opt_ LPCRECT)
static HFONT hIconTitleFont
Definition: icontitle.c:24
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
#define WM_ISACTIVEICON
Definition: undocuser.h:33
#define HTCAPTION
Definition: winuser.h:2451
#define GWL_STYLE
Definition: winuser.h:846
#define WM_ACTIVATE
Definition: winuser.h:1594
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define GW_OWNER
Definition: winuser.h:761
#define SPI_GETICONTITLELOGFONT
Definition: winuser.h:1362
#define msg(x)
Definition: auth_time.c:54
#define WM_CREATE
Definition: winuser.h:1590
#define WM_ERASEBKGND
Definition: winuser.h:1607
LPARAM lParam
Definition: combotst.c:139
HWND WINAPI GetActiveWindow(void)
Definition: winpos.c:138
#define WM_NCMOUSEMOVE
Definition: winuser.h:1673
#define WM_NCLBUTTONDBLCLK
Definition: winuser.h:1676
static BOOL bMultiLineTitle
Definition: icontitle.c:23

Referenced by RegisterClientPFN().

◆ ListBoxWndProc_common()

LRESULT WINAPI ListBoxWndProc_common ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam,
BOOL  unicode 
)

Definition at line 2614 of file listbox.c.

2616 {
2618  LPHEADCOMBO lphc = 0;
2619  LRESULT ret;
2620 #ifdef __REACTOS__
2621  PWND pWnd;
2622 
2623  pWnd = ValidateHwnd(hwnd);
2624  if (pWnd)
2625  {
2626  if (!pWnd->fnid)
2627  {
2628  NtUserSetWindowFNID(hwnd, FNID_LISTBOX); // Could be FNID_COMBOLBOX by class.
2629  }
2630  else
2631  {
2632  if (pWnd->fnid != FNID_LISTBOX)
2633  {
2634  ERR("Wrong window class for listbox! fnId 0x%x\n",pWnd->fnid);
2635  return 0;
2636  }
2637  }
2638  }
2639 #endif
2640 
2641  if (!descr)
2642  {
2643  if (!IsWindow(hwnd)) return 0;
2644 
2645  if (msg == WM_CREATE)
2646  {
2647  CREATESTRUCTW *lpcs = (CREATESTRUCTW *)lParam;
2648  if (lpcs->style & LBS_COMBOBOX) lphc = lpcs->lpCreateParams;
2649  if (!LISTBOX_Create( hwnd, lphc )) return -1;
2650  TRACE("creating hwnd %p descr %p\n", hwnd, (void *)GetWindowLongPtrW( hwnd, 0 ) );
2651  return 0;
2652  }
2653  /* Ignore all other messages before we get a WM_CREATE */
2654  return unicode ? DefWindowProcW( hwnd, msg, wParam, lParam ) :
2656  }
2657  if (descr->style & LBS_COMBOBOX) lphc = descr->lphc;
2658 
2659  TRACE("[%p]: msg %s wp %08lx lp %08lx\n",
2660  descr->self, SPY_GetMsgName(msg, descr->self), wParam, lParam );
2661 
2662  switch(msg)
2663  {
2664  case LB_RESETCONTENT:
2667  InvalidateRect( descr->self, NULL, TRUE );
2668  return 0;
2669 
2670  case LB_ADDSTRING:
2671 #ifdef __REACTOS__
2672  case LB_ADDSTRING_LOWER:
2673  case LB_ADDSTRING_UPPER:
2674 #endif
2675  {
2676  INT ret;
2677  LPWSTR textW;
2678  if(unicode || !HAS_STRINGS(descr))
2679  textW = (LPWSTR)lParam;
2680  else
2681  {
2682  LPSTR textA = (LPSTR)lParam;
2683  INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0);
2684  if((textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR))))
2685  MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW);
2686  else
2687  return LB_ERRSPACE;
2688  }
2689 #ifdef __REACTOS__
2690  /* in the unicode the version, the string is really overwritten
2691  during the converting case */
2692  if (msg == LB_ADDSTRING_LOWER)
2693  strlwrW(textW);
2694  else if (msg == LB_ADDSTRING_UPPER)
2695  struprW(textW);
2696 #endif
2699  if (!unicode && HAS_STRINGS(descr))
2700  HeapFree(GetProcessHeap(), 0, textW);
2701  return ret;
2702  }
2703 
2704  case LB_INSERTSTRING:
2705 #ifdef __REACTOS__
2706  case LB_INSERTSTRING_UPPER:
2707  case LB_INSERTSTRING_LOWER:
2708 #endif
2709  {
2710  INT ret;
2711  LPWSTR textW;
2712  if(unicode || !HAS_STRINGS(descr))
2713  textW = (LPWSTR)lParam;
2714  else
2715  {
2716  LPSTR textA = (LPSTR)lParam;
2717  INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0);
2718  if((textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR))))
2719  MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW);
2720  else
2721  return LB_ERRSPACE;
2722  }
2723 #ifdef __REACTOS__
2724  /* in the unicode the version, the string is really overwritten
2725  during the converting case */
2726  if (msg == LB_INSERTSTRING_LOWER)
2727  strlwrW(textW);
2728  else if (msg == LB_INSERTSTRING_UPPER)
2729  struprW(textW);
2730 #endif
2732  if(!unicode && HAS_STRINGS(descr))
2733  HeapFree(GetProcessHeap(), 0, textW);
2734  return ret;
2735  }
2736 
2737  case LB_ADDFILE:
2738  {
2739  INT ret;
2740  LPWSTR textW;
2741  if(unicode || !HAS_STRINGS(descr))
2742  textW = (LPWSTR)lParam;
2743  else
2744  {
2745  LPSTR textA = (LPSTR)lParam;
2746  INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0);
2747  if((textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR))))
2748  MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW);
2749  else
2750  return LB_ERRSPACE;
2751  }
2754  if(!unicode && HAS_STRINGS(descr))
2755  HeapFree(GetProcessHeap(), 0, textW);
2756  return ret;
2757  }
2758 
2759  case LB_DELETESTRING:
2761  return descr->nb_items;
2762  else
2763  {
2765  return LB_ERR;
2766  }
2767 
2768  case LB_GETITEMDATA:
2769  if (((INT)wParam < 0) || ((INT)wParam >= descr->nb_items))
2770  {
2772  return LB_ERR;
2773  }
2774  return descr->items[wParam].data;
2775 
2776  case LB_SETITEMDATA:
2777  if (((INT)wParam < 0) || ((INT)wParam >= descr->nb_items))
2778  {
2780  return LB_ERR;
2781  }
2782  descr->items[wParam].data = lParam;
2783  /* undocumented: returns TRUE, not LB_OKAY (0) */
2784  return TRUE;
2785 
2786  case LB_GETCOUNT:
2787  return descr->nb_items;
2788 
2789  case LB_GETTEXT:
2790  return LISTBOX_GetText( descr, wParam, (LPWSTR)lParam, unicode );
2791 
2792  case LB_GETTEXTLEN:
2793  if ((INT)wParam >= descr->nb_items || (INT)wParam < 0)
2794  {
2796  return LB_ERR;
2797  }
2798  if (!HAS_STRINGS(descr)) return sizeof(DWORD);
2799  if (unicode) return strlenW( descr->items[wParam].str );
2800  return WideCharToMultiByte( CP_ACP, 0, descr->items[wParam].str,
2801  strlenW(descr->items[wParam].str), NULL, 0, NULL, NULL );
2802 
2803  case LB_GETCURSEL:
2804  if (descr->nb_items == 0)
2805  return LB_ERR;
2806  if (!IS_MULTISELECT(descr))
2807  return descr->selected_item;
2808  if (descr->selected_item != -1)
2809  return descr->selected_item;
2810  return descr->focus_item;
2811  /* otherwise, if the user tries to move the selection with the */
2812  /* arrow keys, we will give the application something to choke on */
2813  case LB_GETTOPINDEX:
2814  return descr->top_item;
2815 
2816  case LB_GETITEMHEIGHT:
2817  return LISTBOX_GetItemHeight( descr, wParam );
2818 
2819  case LB_SETITEMHEIGHT:
2821 
2822  case LB_ITEMFROMPOINT:
2823  {
2824  POINT pt;
2825  RECT rect;
2826  int index;
2827  BOOL hit = TRUE;
2828 
2829  /* The hiword of the return value is not a client area
2830  hittest as suggested by MSDN, but rather a hittest on
2831  the returned listbox item. */
2832 
2833  if(descr->nb_items == 0)
2834  return 0x1ffff; /* win9x returns 0x10000, we copy winnt */
2835 
2836  pt.x = (short)LOWORD(lParam);
2837  pt.y = (short)HIWORD(lParam);
2838 
2839  SetRect(&rect, 0, 0, descr->width, descr->height);
2840 
2841  if(!PtInRect(&rect, pt))
2842  {
2843  pt.x = min(pt.x, rect.right - 1);
2844  pt.x = max(pt.x, 0);
2845  pt.y = min(pt.y, rect.bottom - 1);
2846  pt.y = max(pt.y, 0);
2847  hit = FALSE;
2848  }
2849 
2851 
2852  if(index == -1)
2853  {
2854  index = descr->nb_items - 1;
2855  hit = FALSE;
2856  }
2857  return MAKELONG(index, hit ? 0 : 1);
2858  }
2859 
2860  case LB_SETCARETINDEX:
2861  if ((!IS_MULTISELECT(descr)) && (descr->selected_item != -1)) return LB_ERR;
2863  return LB_ERR;
2864  else if (ISWIN31)
2865  return wParam;
2866  else
2867  return LB_OKAY;
2868 
2869  case LB_GETCARETINDEX:
2870  return descr->focus_item;
2871 
2872  case LB_SETTOPINDEX:
2873  return LISTBOX_SetTopItem( descr, wParam, TRUE );
2874 
2875  case LB_SETCOLUMNWIDTH:
2876  return LISTBOX_SetColumnWidth( descr, wParam );
2877 
2878  case LB_GETITEMRECT:
2879  return LISTBOX_GetItemRect( descr, wParam, (RECT *)lParam );
2880 
2881  case LB_FINDSTRING:
2882  {
2883  INT ret;
2884  LPWSTR textW;
2885  if(unicode || !HAS_STRINGS(descr))
2886  textW = (LPWSTR)lParam;
2887  else
2888  {
2889  LPSTR textA = (LPSTR)lParam;
2890  INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0);
2891  if((textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR))))
2892  MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW);
2893  }
2895  if(!unicode && HAS_STRINGS(descr))
2896  HeapFree(GetProcessHeap(), 0, textW);
2897  return ret;
2898  }
2899 
2900  case LB_FINDSTRINGEXACT:
2901  {
2902  INT ret;
2903  LPWSTR textW;
2904  if(unicode || !HAS_STRINGS(descr))
2905  textW = (LPWSTR)lParam;
2906  else
2907  {
2908  LPSTR textA = (LPSTR)lParam;
2909  INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0);
2910  if((textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR))))
2911  MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW);
2912  }
2914  if(!unicode && HAS_STRINGS(descr))
2915  HeapFree(GetProcessHeap(), 0, textW);
2916  return ret;
2917  }
2918 
2919  case LB_SELECTSTRING:
2920  {
2921  INT index;
2922  LPWSTR textW;
2923 
2924  if(HAS_STRINGS(descr))
2925  TRACE("LB_SELECTSTRING: %s\n", unicode ? debugstr_w((LPWSTR)lParam) :
2926  debugstr_a((LPSTR)lParam));
2927  if(unicode || !HAS_STRINGS(descr))
2928  textW = (LPWSTR)lParam;
2929  else
2930  {
2931  LPSTR textA = (LPSTR)lParam;
2932  INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0);
2933  if((textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR))))
2934  MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW);
2935  }
2937  if(!unicode && HAS_STRINGS(descr))
2938  HeapFree(GetProcessHeap(), 0, textW);
2939  if (index != LB_ERR)
2940  {
2943  }
2944  return index;
2945  }
2946 
2947  case LB_GETSEL:
2948  if (((INT)wParam < 0) || ((INT)wParam >= descr->nb_items))
2949  return LB_ERR;
2950  return descr->items[wParam].selected;
2951 
2952  case LB_SETSEL:
2954 
2955  case LB_SETCURSEL:
2956  if (IS_MULTISELECT(descr)) return LB_ERR;
2959  if (ret != LB_ERR) ret = descr->selected_item;
2960  return ret;
2961 
2962  case LB_GETSELCOUNT:
2963  return LISTBOX_GetSelCount( descr );
2964 
2965  case LB_GETSELITEMS:
2967 
2968  case LB_SELITEMRANGE:
2969  if (LOWORD(lParam) <= HIWORD(lParam))
2971  HIWORD(lParam), wParam );
2972  else
2974  LOWORD(lParam), wParam );
2975 
2976  case LB_SELITEMRANGEEX:
2977  if ((INT)lParam >= (INT)wParam)
2979  else
2981 
2983  return descr->horz_extent;
2984 
2987 
2988  case LB_GETANCHORINDEX:
2989  return descr->anchor_item;
2990 
2991  case LB_SETANCHORINDEX:
2992  if (((INT)wParam < -1) || ((INT)wParam >= descr->nb_items))
2993  {
2995  return LB_ERR;
2996  }
2997  descr->anchor_item = (INT)wParam;
2998  return LB_OKAY;
2999 
3000  case LB_DIR:
3001  {
3002  INT ret;
3003  LPWSTR textW;
3004  if(unicode)
3005  textW = (LPWSTR)lParam;
3006  else
3007  {
3008  LPSTR textA = (LPSTR)lParam;
3009  INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0);
3010  if((textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR))))
3011  MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW);
3012  }
3014  if(!unicode)
3015  HeapFree(GetProcessHeap(), 0, textW);
3016  return ret;
3017  }
3018 
3019  case LB_GETLOCALE:
3020  return descr->locale;
3021 
3022  case LB_SETLOCALE:
3023  {
3024  LCID ret;
3026  return LB_ERR;
3027  ret = descr->locale;
3028  descr->locale = (LCID)wParam;
3029  return ret;
3030  }
3031 
3032  case LB_INITSTORAGE:
3033  return LISTBOX_InitStorage( descr, wParam );
3034 
3035  case LB_SETCOUNT:
3036  return LISTBOX_SetCount( descr, (INT)wParam );
3037 
3038  case LB_SETTABSTOPS:
3040 
3041  case LB_CARETON:
3042  if (descr->caret_on)
3043  return LB_OKAY;
3044  descr->caret_on = TRUE;
3045  if ((descr->focus_item != -1) && (descr->in_focus))
3046  LISTBOX_RepaintItem( descr, descr->focus_item, ODA_FOCUS );
3047  return LB_OKAY;
3048 
3049  case LB_CARETOFF:
3050  if (!descr->caret_on)
3051  return LB_OKAY;
3052  descr->caret_on = FALSE;
3053  if ((descr->focus_item != -1) && (descr->in_focus))
3054  LISTBOX_RepaintItem( descr, descr->focus_item, ODA_FOCUS );
3055  return LB_OKAY;
3056 
3057  case LB_GETLISTBOXINFO:
3058  if (descr->style & LBS_MULTICOLUMN)
3059  return descr->page_size * descr->column_width;
3060  else
3061  return descr->page_size;
3062 
3063  case WM_DESTROY:
3064  return LISTBOX_Destroy( descr );
3065 
3066  case WM_ENABLE:
3067  InvalidateRect( descr->self, NULL, TRUE );
3068  return 0;
3069 
3070  case WM_SETREDRAW:
3071  LISTBOX_SetRedraw( descr, wParam != 0 );
3072  return 0;
3073 
3074  case WM_GETDLGCODE:
3076 
3077  case WM_PRINTCLIENT:
3078  case WM_PAINT:
3079  {
3080  PAINTSTRUCT ps;
3081  HDC hdc = ( wParam ) ? ((HDC)wParam) : BeginPaint( descr->self, &ps );
3082  ret = LISTBOX_Paint( descr, hdc );
3083  if( !wParam ) EndPaint( descr->self, &ps );
3084  }
3085  return ret;
3086  case WM_SIZE:
3088  return 0;
3089  case WM_GETFONT:
3090  return (LRESULT)descr->font;
3091  case WM_SETFONT:
3093  if (lParam) InvalidateRect( descr->self, 0, TRUE );
3094  return 0;
3095  case WM_SETFOCUS:
3096  descr->in_focus = TRUE;
3097  descr->caret_on = TRUE;
3098  if (descr->focus_item != -1)
3101  return 0;
3102  case WM_KILLFOCUS:
3103  LISTBOX_HandleLButtonUp( descr ); /* Release capture if we have it */
3104  descr->in_focus = FALSE;
3105  descr->wheel_remain = 0;
3106  if ((descr->focus_item != -1) && descr->caret_on)
3107  LISTBOX_RepaintItem( descr, descr->focus_item, ODA_FOCUS );
3109  return 0;
3110  case WM_HSCROLL:
3112  case WM_VSCROLL:
3114  case WM_MOUSEWHEEL:
3115  if (wParam & (MK_SHIFT | MK_CONTROL))
3116  return DefWindowProcW( descr->self, msg, wParam, lParam );
3118  case WM_LBUTTONDOWN:
3119  if (lphc)
3121  (INT16)LOWORD(lParam),
3122  (INT16)HIWORD(lParam) );
3124  (INT16)LOWORD(lParam),
3125  (INT16)HIWORD(lParam) );
3126  case WM_LBUTTONDBLCLK:
3127  if (lphc)
3129  (INT16)LOWORD(lParam),
3130  (INT16)HIWORD(lParam) );
3131  if (descr->style & LBS_NOTIFY)
3133  return 0;
3134  case WM_MOUSEMOVE:
3135  if ( lphc && ((lphc->dwStyle & CBS_DROPDOWNLIST) != CBS_SIMPLE) )
3136  {
3137  BOOL captured = descr->captured;
3138  POINT mousePos;
3139  RECT clientRect;
3140 
3141  mousePos.x = (INT16)LOWORD(lParam);
3142  mousePos.y = (INT16)HIWORD(lParam);
3143 
3144  /*
3145  * If we are in a dropdown combobox, we simulate that
3146  * the mouse is captured to show the tracking of the item.
3147  */
3148  if (GetClientRect(descr->self, &clientRect) && PtInRect( &clientRect, mousePos ))
3149  descr->captured = TRUE;
3150 
3151  LISTBOX_HandleMouseMove( descr, mousePos.x, mousePos.y);
3152 
3153  descr->captured = captured;
3154  }
3155  else if (GetCapture() == descr->self)
3156  {
3158  (INT16)HIWORD(lParam) );
3159  }
3160  return 0;
3161  case WM_LBUTTONUP:
3162  if (lphc)
3163  {
3164  POINT mousePos;
3165  RECT clientRect;
3166 
3167  /*
3168  * If the mouse button "up" is not in the listbox,
3169  * we make sure there is no selection by re-selecting the
3170  * item that was selected when the listbox was made visible.
3171  */
3172  mousePos.x = (INT16)LOWORD(lParam);
3173  mousePos.y = (INT16)HIWORD(lParam);
3174 
3175  GetClientRect(descr->self, &clientRect);
3176 
3177  /*
3178  * When the user clicks outside the combobox and the focus
3179  * is lost, the owning combobox will send a fake buttonup with
3180  * 0xFFFFFFF as the mouse location, we must also revert the
3181  * selection to the original selection.
3182  */
3183  if ( (lParam == (LPARAM)-1) || (!PtInRect( &clientRect, mousePos )) )
3185  }
3186  return LISTBOX_HandleLButtonUp( descr );
3187  case WM_KEYDOWN:
3188  if( lphc && (lphc->dwStyle & CBS_DROPDOWNLIST) != CBS_SIMPLE )
3189  {
3190  /* for some reason Windows makes it possible to
3191  * show/hide ComboLBox by sending it WM_KEYDOWNs */
3192 
3193  if( (!(lphc->wState & CBF_EUI) && wParam == VK_F4) ||
3194  ( (lphc->wState & CBF_EUI) && !(lphc->wState & CBF_DROPPED)
3195  && (wParam == VK_DOWN || wParam == VK_UP)) )
3196  {
3197  COMBO_FlipListbox( lphc, FALSE, FALSE );
3198  return 0;
3199  }
3200  }
3201  return LISTBOX_HandleKeyDown( descr, wParam );
3202  case WM_CHAR:
3203  {
3204  WCHAR charW;
3205  if(unicode)
3206  charW = (WCHAR)wParam;
3207  else
3208  {
3209  CHAR charA = (CHAR)wParam;
3210