ReactOS  0.4.15-dev-5109-g2469ce2
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:1913
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1616
#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:2463
#define DLGC_UNDEFPUSHBUTTON
Definition: winuser.h:2606
#define IMAGE_ICON
Definition: winuser.h:212
static HBRUSH hbrush
#define WM_GETDLGCODE
Definition: winuser.h:1679
#define WM_LBUTTONDOWN
Definition: winuser.h:1766
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define MK_LBUTTON
Definition: winuser.h:2357
HDC WINAPI GetDC(_In_opt_ HWND)
#define BS_RADIOBUTTON
Definition: pedump.c:655
#define TRUE
Definition: types.h:120
UINT state
Definition: button.c:168
#define pt(x, y)
Definition: drawing.c:79
#define BM_GETSTATE
Definition: winuser.h:1910
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1762
#define WM_CAPTURECHANGED
Definition: winuser.h:1798
static HDC
Definition: imagelist.c:92
#define DLGC_RADIOBUTTON
Definition: winuser.h:2607
#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:1676
UINT_PTR WPARAM
Definition: windef.h:207
#define GetWindowLongPtrW
Definition: winuser.h:4819
#define FNID_DESTROY
Definition: ntuser.h:877
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
LONG right
Definition: windef.h:308
#define ODA_FOCUS
Definition: winuser.h:2534
#define BM_GETIMAGE
Definition: winuser.h:1909
#define BM_SETIMAGE
Definition: winuser.h:1912
#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:1605
#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:146
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
#define WM_CTLCOLORBTN
Definition: winuser.h:1759
static void BUTTON_CheckAutoRadioButton(HWND hwnd)
Definition: button.c:1189
#define FALSE
Definition: types.h:117
static const pfButtonPaint btnPaintFunc[MAX_BTN_TYPE]
Definition: button.c:122
DWORD fnid
Definition: ntuser.h:688
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:2881
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_GETFONT
Definition: winuser.h:1641
#define BS_AUTOCHECKBOX
Definition: pedump.c:654
#define BS_AUTO3STATE
Definition: pedump.c:657
#define WM_KEYDOWN
Definition: winuser.h:1705
#define BM_GETCHECK
Definition: winuser.h:1908
#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:1607
#define WM_DESTROY
Definition: winuser.h:1599
#define BM_CLICK
Definition: winuser.h:1907
#define ODA_DRAWENTIRE
Definition: winuser.h:2532
DWORD NTAPI NtUserAlterWindowStyle(HWND hWnd, DWORD Index, LONG NewValue)
Definition: window.c:4077
#define DLGC_DEFPUSHBUTTON
Definition: winuser.h:2605
#define BM_SETCHECK
Definition: winuser.h:1911
#define TRACE(s)
Definition: solgame.cpp:4
#define WM_KILLFOCUS
Definition: winuser.h:1604
r parent
Definition: btrfs.c:2979
#define BM_SETSTYLE
Definition: winuser.h:1914
#define BST_PUSHED
Definition: winuser.h:201
#define WM_NCDESTROY
Definition: winuser.h:1674
#define WM_KEYUP
Definition: winuser.h:1706
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
static FILE * client
Definition: client.c:41
#define BN_CLICKED
Definition: winuser.h:1915
static LPARAM
Definition: button.c:42
#define BN_KILLFOCUS
Definition: winuser.h:1920
#define WM_PAINT
Definition: winuser.h:1610
static HFONT get_button_font(HWND hwnd)
Definition: button.c:182
#define BS_ICON
Definition: winuser.h:264
#define OPAQUE
Definition: wingdi.h:949
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:1768
#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:672
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define BN_SETFOCUS
Definition: winuser.h:1923
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:2610
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_LBUTTONUP
Definition: winuser.h:1767
#define FNID_BUTTON
Definition: ntuser.h:845
unsigned int UINT
Definition: ndis.h:50
#define WM_MOUSEMOVE
Definition: winuser.h:1765
#define NULL
Definition: types.h:112
#define VK_SPACE
Definition: winuser.h:2209
#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:1640
#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:2890
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:1598
static void set_button_state(HWND hwnd, LONG state)
Definition: button.c:163
#define HIWORD(l)
Definition: typedefs.h:247
BOOL WINAPI IsWindowVisible(_In_ HWND)
LONG bottom
Definition: windef.h:309
BOOL NTAPI NtUserSetWindowFNID(HWND hWnd, WORD fnID)
Definition: window.c:4332
#define BN_DOUBLECLICKED
Definition: winuser.h:1918
#define SetWindowLongPtrW
Definition: winuser.h:5336
static HBITMAP
Definition: button.c:44
#define BS_USERBUTTON
Definition: pedump.c:659
#define WM_ERASEBKGND
Definition: winuser.h:1615
#define WM_SETFOCUS
Definition: winuser.h:1603
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:2609
#define ODA_SELECT
Definition: winuser.h:2533
#define ValidateHwnd(hwnd)
Definition: precomp.h:85

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 1116 of file combo.c.

1117 {
1118  if( lphc->wState & CBF_DROPPED )
1119  {
1120  CBRollUp( lphc, ok, bRedrawButton );
1121  return FALSE;
1122  }
1123 
1124  CBDropDown( lphc );
1125  return TRUE;
1126 }
static void CBDropDown(LPHEADCOMBO lphc)
Definition: combo.c:959
#define TRUE
Definition: types.h:120
static void CBRollUp(LPHEADCOMBO lphc, BOOL ok, BOOL bButton)
Definition: combo.c:1061
#define FALSE
Definition: types.h:117
#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:1990
#define CB_GETTOPINDEX
Definition: winuser.h:1945
#define LB_SETCURSEL
Definition: winuser.h:2053
#define WM_GETTEXTLENGTH
Definition: winuser.h:1609
#define CB_SETITEMDATA
Definition: winuser.h:1956
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:2057
Definition: tftpd.h:59
#define CB_GETLBTEXTLEN
Definition: winuser.h:1943
#define DLGC_WANTCHARS
Definition: winuser.h:2608
static void COMBO_Font(LPHEADCOMBO lphc, HFONT hFont, BOOL bRedraw)
Definition: combo.c:1578
#define LB_DIR
Definition: winuser.h:2023
#define FNID_COMBOBOX
Definition: ntuser.h:846
#define DLGC_WANTMESSAGE
Definition: winuser.h:2603
#define MK_SHIFT
Definition: winuser.h:2359
#define CB_GETDROPPEDSTATE
Definition: winuser.h:1935
#define LB_FINDSTRINGEXACT
Definition: winuser.h:2025
#define WM_GETDLGCODE
Definition: winuser.h:1679
#define WM_CHAR
Definition: winuser.h:1707
#define WM_LBUTTONDOWN
Definition: winuser.h:1766
#define LB_SETHORIZONTALEXTENT
Definition: winuser.h:2054
#define WM_CUT
Definition: winuser.h:1851
GLuint64EXT * result
Definition: glext.h:11304
#define WM_IME_CHAR
Definition: winuser.h:1824
#define LB_ADDSTRING
Definition: winuser.h:2021
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define LB_GETHORIZONTALEXTENT
Definition: winuser.h:2030
static void CBCalcPlacement(HWND hwnd, LPHEADCOMBO lphc, LPRECT lprEdit, LPRECT lprButton, LPRECT lprLB)
Definition: combo.c:328
#define CB_SETDROPPEDWIDTH
Definition: winuser.h:1952
#define CB_SETHORIZONTALEXTENT
Definition: winuser.h:1955
#define TRUE
Definition: types.h:120
#define WM_CTLCOLORDLG
Definition: winuser.h:1760
#define CB_GETLBTEXT
Definition: winuser.h:1942
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_MOUSEWHEEL
Definition: treelist.c:96
#define LB_GETITEMDATA
Definition: winuser.h:2031
#define CB_GETITEMDATA
Definition: winuser.h:1940
WORD vk
Definition: input.c:77
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1762
UINT wState
Definition: comctl32.h:149
#define WM_GETTEXT
Definition: winuser.h:1608
#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:1606
static LRESULT COMBO_GetTextW(LPHEADCOMBO lphc, INT count, LPWSTR buf)
Definition: combo.c:1384
HWND hWndEdit
Definition: comctl32.h:147
#define WM_PASTE
Definition: winuser.h:1853
RECT droppedRect
Definition: comctl32.h:153
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:152
#define VK_DOWN
Definition: winuser.h:2217
#define GetWindowLongPtrW
Definition: winuser.h:4819
LONG left
Definition: windef.h:306
#define CB_SETLOCALE
Definition: winuser.h:1958
#define FNID_DESTROY
Definition: ntuser.h:877
#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:2204
#define WM_CLEAR
Definition: winuser.h:1854
LONG right
Definition: windef.h:308
static void COMBO_LButtonDown(LPHEADCOMBO lphc, LPARAM lParam)
Definition: combo.c:1673
#define WM_CTLCOLORLISTBOX
Definition: winuser.h:1758
#define WM_NCCREATE
Definition: winuser.h:1673
BOOL NTAPI NtUserInvalidateRect(HWND hWnd, CONST RECT *lpRect, BOOL bErase)
Definition: painting.c:2547
int32_t INT
Definition: typedefs.h:58
static LRESULT COMBO_SetItemHeight(LPHEADCOMBO lphc, INT index, INT height)
Definition: combo.c:1615
#define VK_RETURN
Definition: winuser.h:2191
#define CB_GETCURSEL
Definition: winuser.h:1933
WPARAM wParam
Definition: combotst.c:138
#define WM_ENABLE
Definition: winuser.h:1605
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:1957
LPSTR WINAPI CharLowerA(_Inout_ LPSTR)
#define EM_GETSEL
Definition: winuser.h:1987
#define CB_GETEDITSEL
Definition: winuser.h:1937
LPSTR WINAPI CharUpperA(_Inout_ LPSTR)
struct tagCREATESTRUCTA * LPCREATESTRUCTA
#define CB_INITSTORAGE
Definition: winuser.h:1946
#define LB_RESETCONTENT
Definition: winuser.h:2045
#define CB_GETDROPPEDWIDTH
Definition: winuser.h:1936
#define WM_CTLCOLORBTN
Definition: winuser.h:1759
#define VK_UP
Definition: winuser.h:2215
#define FALSE
Definition: types.h:117
#define WM_COPY
Definition: winuser.h:1852
DWORD fnid
Definition: ntuser.h:688
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
#define WM_DELETEITEM
Definition: winuser.h:1637
#define CB_SHOWDROPDOWN
Definition: winuser.h:1960
static LRESULT COMBO_NCCreate(HWND hwnd, LONG style)
Definition: combo.c:135
#define CBN_KILLFOCUS
Definition: winuser.h:1968
#define CBS_SIMPLE
Definition: winuser.h:291
#define WM_CTLCOLORSCROLLBAR
Definition: winuser.h:1761
#define VK_F4
Definition: winuser.h:2248
#define CB_ADDSTRING
Definition: winuser.h:1926
#define CB_INSERTSTRING
Definition: winuser.h:1947
#define CB_GETCOMBOBOXINFO
Definition: winuser.h:1931
#define WM_GETFONT
Definition: winuser.h:1641
static HWND hwndParent
Definition: cryptui.c:300
#define WM_KEYDOWN
Definition: winuser.h:1705
#define WM_CTLCOLORMSGBOX
Definition: winuser.h:1756
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_LIMITTEXT
Definition: winuser.h:1948
#define LB_GETTEXTLEN
Definition: winuser.h:2040
#define LB_GETCOUNT
Definition: winuser.h:2028
#define WM_SETTEXT
Definition: winuser.h:1607
#define CB_RESETCONTENT
Definition: winuser.h:1949
RECT textRect
Definition: comctl32.h:151
#define CB_ERR
Definition: winuser.h:2425
#define LB_INITSTORAGE
Definition: winuser.h:2042
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:148
#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:1604
#define CB_GETDROPPEDCONTROLRECT
Definition: winuser.h:1934
#define GetProcessHeap()
Definition: compat.h:595
static LRESULT COMBO_SelectString(LPHEADCOMBO lphc, INT start, LPARAM pText, BOOL unicode)
Definition: combo.c:1654
#define LB_SETTOPINDEX
Definition: winuser.h:2060
__wchar_t WCHAR
Definition: xmlstorage.h:180
static void CBGetDroppedControlRect(LPHEADCOMBO lphc, LPRECT lpRect)
Definition: combo.c:438
#define WM_SIZE
Definition: winuser.h:1601
#define WM_NCDESTROY
Definition: winuser.h:1674
#define EM_SETSEL
Definition: winuser.h:2008
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define WM_MEASUREITEM
Definition: winuser.h:1636
HFONT hFont
Definition: comctl32.h:150
#define LB_SETITEMDATA
Definition: winuser.h:2055
#define WM_PAINT
Definition: winuser.h:1610
#define CB_GETHORIZONTALEXTENT
Definition: winuser.h:1939
int ret
INT droppedWidth
Definition: comctl32.h:156
#define KEYDATA_ALT
Definition: combo.c:44
#define ISWIN31
Definition: combo.c:45
#define LB_GETTEXT
Definition: winuser.h:2039
static void CBDropDown(LPHEADCOMBO lphc)
Definition: combo.c:990
struct HEADCOMBO * LPHEADCOMBO
#define CB_SELECTSTRING
Definition: winuser.h:1950
static LRESULT COMBO_GetTextA(LPHEADCOMBO lphc, INT count, LPSTR buf)
Definition: combo.c:1434
#define LB_GETLOCALE
Definition: winuser.h:2035
#define CB_SETCURSEL
Definition: winuser.h:1951
#define WM_COMMAND
Definition: winuser.h:1730
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_USER
Definition: winuser.h:1885
#define LB_GETITEMHEIGHT
Definition: winuser.h:2032
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:672
#define CB_OKAY
Definition: winuser.h:2424
static LRESULT COMBO_ItemOp(LPHEADCOMBO lphc, UINT msg, LPARAM lParam)
Definition: combo.c:1336
#define WM_COMPAREITEM
Definition: winuser.h:1645
#define LB_FINDSTRING
Definition: winuser.h:2024
BOOL COMBO_FlipListbox(LPHEADCOMBO lphc, BOOL ok, BOOL bRedrawButton)
Definition: combo.c:1116
static void COMBO_LButtonUp(LPHEADCOMBO lphc)
Definition: combo.c:1718
HWND self
Definition: comctl32.h:144
#define CB_DIR
Definition: winuser.h:1928
#define CB_SETEDITSEL
Definition: winuser.h:1953
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:1757
#define LB_GETTOPINDEX
Definition: winuser.h:2041
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_LBUTTONUP
Definition: winuser.h:1767
struct tagCREATESTRUCTW * LPCREATESTRUCTW
#define CB_SETEXTENDEDUI
Definition: winuser.h:1954
#define CB_GETLOCALE
Definition: winuser.h:1944
#define LB_GETCURSEL
Definition: winuser.h:2029
#define WM_MOUSEMOVE
Definition: winuser.h:1765
#define NULL
Definition: types.h:112
#define MK_CONTROL
Definition: winuser.h:2360
#define KF_ALTDOWN
Definition: winuser.h:2439
#define WM_SETFONT
Definition: winuser.h:1640
HWND owner
Definition: comctl32.h:145
#define WM_DRAWITEM
Definition: winuser.h:1635
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define SendMessage
Definition: winuser.h:5833
#define WM_CREATE
Definition: winuser.h:1598
#define CB_GETITEMHEIGHT
Definition: winuser.h:1941
#define WM_SYSKEYDOWN
Definition: winuser.h:1709
#define HIWORD(l)
Definition: typedefs.h:247
DWORD state2
Definition: ntuser.h:681
BOOL NTAPI NtUserSetWindowFNID(HWND hWnd, WORD fnID)
Definition: window.c:4332
#define CB_GETCOUNT
Definition: winuser.h:1932
#define CB_GETEXTENDEDUI
Definition: winuser.h:1938
#define WM_ERASEBKGND
Definition: winuser.h:1615
#define WM_SETFOCUS
Definition: winuser.h:1603
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define CB_DELETESTRING
Definition: winuser.h:1927
#define WNDS2_WIN40COMPAT
Definition: ntuser.h:633
LONG_PTR LRESULT
Definition: windef.h:209
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022
Arabic default style
Definition: afstyles.h:93
#define LB_DELETESTRING
Definition: winuser.h:2022
#define CB_FINDSTRING
Definition: winuser.h:1929
static const WCHAR empty_stringW[]
Definition: edit.c:171
#define LB_INSERTSTRING
Definition: winuser.h:2043
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:594
#define DLGC_WANTARROWS
Definition: winuser.h:2600
#define WIN_GetFullHandle(h)
Definition: user_x.h:108
UINT dwStyle
Definition: comctl32.h:146
static char * strdupA(LPCSTR str)
Definition: combo.c:1803
#define ValidateHwnd(hwnd)
Definition: precomp.h:85
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:1930

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  }
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
#define FALSE
Definition: types.h:117
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
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022
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 }
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1616
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
struct @1591 Msg[]
static HDC
Definition: imagelist.c:92
#define WM_NCCREATE
Definition: winuser.h:1673
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define FALSE
Definition: types.h:117
#define FNID_DESKTOP
Definition: ntuser.h:841
#define WM_SETCURSOR
Definition: winuser.h:1626
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_QUERYNEWPALETTE
Definition: winuser.h:1868
#define TRACE(s)
Definition: solgame.cpp:4
#define WM_CLOSE
Definition: winuser.h:1611
#define WM_PALETTECHANGED
Definition: winuser.h:1867
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
#define WM_PAINT
Definition: winuser.h:1610
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:1598
BOOL WINAPI PaintDesktop(_In_ HDC)
#define WM_ERASEBKGND
Definition: winuser.h:1615
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 4757 of file edit.c.

4758 {
4760  LRESULT result = 0;
4761 #ifdef __REACTOS__
4762  /* ReactOS r50219 */
4763  PWND pWnd;
4764 
4765  pWnd = ValidateHwnd(hwnd);
4766  if (pWnd)
4767  {
4768  if (!pWnd->fnid)
4769  {
4771  }
4772  else
4773  {
4774  if (pWnd->fnid != FNID_EDIT)
4775  {
4776  ERR("Wrong window class for Edit! fnId 0x%x\n",pWnd->fnid);
4777  return 0;
4778  }
4779  }
4780  }
4781 #endif
4782 
4783  TRACE("hwnd=%p msg=%x (%s) wparam=%lx lparam=%lx\n", hwnd, msg, SPY_GetMsgName(msg, hwnd), wParam, lParam);
4784 
4785  if (!es && msg != WM_NCCREATE)
4786  return DefWindowProcT(hwnd, msg, wParam, lParam, unicode);
4787 
4788  if (es && (msg != WM_NCDESTROY)) EDIT_LockBuffer(es);
4789 
4790  switch (msg) {
4791  case EM_GETSEL:
4793  break;
4794 
4795  case EM_SETSEL:
4798  result = 1;
4799  break;
4800 
4801  case EM_GETRECT:
4802  if (lParam)
4803  CopyRect((LPRECT)lParam, &es->format_rect);
4804  break;
4805 
4806  case EM_SETRECT:
4807  if ((es->style & ES_MULTILINE) && lParam) {
4810  }
4811  break;
4812 
4813  case EM_SETRECTNP:
4814  if ((es->style & ES_MULTILINE) && lParam)
4816  break;
4817 
4818  case EM_SCROLL:
4820  break;
4821 
4822  case EM_LINESCROLL:
4824  break;
4825 
4826  case EM_SCROLLCARET:
4828  result = 1;
4829  break;
4830 
4831  case EM_GETMODIFY:
4832  result = ((es->flags & EF_MODIFIED) != 0);
4833  break;
4834 
4835  case EM_SETMODIFY:
4836  if (wParam)
4837  es->flags |= EF_MODIFIED;
4838  else
4839  es->flags &= ~(EF_MODIFIED | EF_UPDATE); /* reset pending updates */
4840  break;
4841 
4842  case EM_GETLINECOUNT:
4843  result = (es->style & ES_MULTILINE) ? es->line_count : 1;
4844  break;
4845 
4846  case EM_LINEINDEX:
4848  break;
4849 
4850  case EM_SETHANDLE:
4852  break;
4853 
4854  case EM_GETHANDLE:
4856  break;
4857 
4858  case EM_GETTHUMB:
4860  break;
4861 
4862  /* these messages missing from specs */
4863  case 0x00bf:
4864  case 0x00c0:
4865  case 0x00c3:
4866  case 0x00ca:
4867  FIXME("undocumented message 0x%x, please report\n", msg);
4869  break;
4870 
4871  case EM_LINELENGTH:
4873  break;
4874 
4875  case EM_REPLACESEL:
4876  {
4877  LPWSTR textW;
4878 
4879  if(unicode)
4880  textW = (LPWSTR)lParam;
4881  else
4882  {
4883  LPSTR textA = (LPSTR)lParam;
4884  INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0);
4885  if (!(textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR)))) break;
4886  MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW);
4887  }
4888 
4890  result = 1;
4891 
4892  if(!unicode)
4893  HeapFree(GetProcessHeap(), 0, textW);
4894  break;
4895  }
4896 
4897  case EM_GETLINE:
4899  break;
4900 
4901  case EM_SETLIMITTEXT:
4903  break;
4904 
4905  case EM_CANUNDO:
4907  break;
4908 
4909  case EM_UNDO:
4910  case WM_UNDO:
4912  break;
4913 
4914  case EM_FMTLINES:
4916  break;
4917 
4918  case EM_LINEFROMCHAR:
4920  break;
4921 
4922  case EM_SETTABSTOPS:
4924  break;
4925 
4926  case EM_SETPASSWORDCHAR:
4927  {
4928  WCHAR charW = 0;
4929 
4930  if(unicode)
4931  charW = (WCHAR)wParam;
4932  else
4933  {
4934  CHAR charA = wParam;
4935  MultiByteToWideChar(CP_ACP, 0, &charA, 1, &charW, 1);
4936  }
4937 
4938  EDIT_EM_SetPasswordChar(es, charW);
4939  break;
4940  }
4941 
4942  case EM_EMPTYUNDOBUFFER:
4944  break;
4945 
4947  result = (es->style & ES_MULTILINE) ? es->y_offset : es->x_offset;
4948  break;
4949 
4950  case EM_SETREADONLY:
4951  {
4952  DWORD old_style = es->style;
4953 
4954  if (wParam) {
4957  es->style |= ES_READONLY;
4958  } else {
4961  es->style &= ~ES_READONLY;
4962  }
4963 
4964  if (old_style ^ es->style)
4965  InvalidateRect(es->hwndSelf, NULL, TRUE);
4966 
4967  result = 1;
4968  break;
4969  }
4970 
4971  case EM_SETWORDBREAKPROC:
4973  break;
4974 
4975  case EM_GETWORDBREAKPROC:
4976  result = (LRESULT)es->word_break_proc;
4977  break;
4978 
4979  case EM_GETPASSWORDCHAR:
4980  {
4981  if(unicode)
4982  result = es->password_char;
4983  else
4984  {
4985  WCHAR charW = es->password_char;
4986  CHAR charA = 0;
4987  WideCharToMultiByte(CP_ACP, 0, &charW, 1, &charA, 1, NULL, NULL);
4988  result = charA;
4989  }
4990  break;
4991  }
4992 
4993  case EM_SETMARGINS:
4995  break;
4996 
4997  case EM_GETMARGINS:
4998  result = MAKELONG(es->left_margin, es->right_margin);
4999  break;
5000 
5001  case EM_GETLIMITTEXT:
5002  result = es->buffer_limit;
5003  break;
5004 
5005  case EM_POSFROMCHAR:
5006  if ((INT)wParam >= get_text_length(es)) result = -1;
5008  break;
5009 
5010  case EM_CHARFROMPOS:
5011  result = EDIT_EM_CharFromPos(es, (short)LOWORD(lParam), (short)HIWORD(lParam));
5012  break;
5013 
5014  /* End of the EM_ messages which were in numerical order; what order
5015  * are these in? vaguely alphabetical?
5016  */
5017 
5018  case WM_NCCREATE:
5020  break;
5021 
5022  case WM_NCDESTROY:
5024 #ifdef __REACTOS__
5026 #endif
5027  es = NULL;
5028  break;
5029 
5030  case WM_GETDLGCODE:
5032 
5033  if (es->style & ES_MULTILINE)
5035 
5036  if (lParam)
5037  {
5038  es->flags|=EF_DIALOGMODE;
5039 
5040  if (((LPMSG)lParam)->message == WM_KEYDOWN)
5041  {
5042  int vk = (int)((LPMSG)lParam)->wParam;
5043 
5044  if (es->hwndListBox)
5045  {
5046  if (vk == VK_RETURN || vk == VK_ESCAPE)
5049  }
5050  }
5051  }
5052  break;
5053 
5054  case WM_IME_CHAR:
5055  if (!unicode)
5056  {
5057  WCHAR charW;
5058  CHAR strng[2];
5059 
5060  strng[0] = wParam >> 8;
5061  strng[1] = wParam & 0xff;
5062  if (strng[0]) MultiByteToWideChar(CP_ACP, 0, strng, 2, &charW, 1);
5063  else MultiByteToWideChar(CP_ACP, 0, &strng[1], 1, &charW, 1);
5064  result = EDIT_WM_Char(es, charW);
5065  break;
5066  }
5067  /* fall through */
5068  case WM_CHAR:
5069  {
5070  WCHAR charW;
5071 
5072  if(unicode)
5073  charW = wParam;
5074  else
5075  {
5076  CHAR charA = wParam;
5077  MultiByteToWideChar(CP_ACP, 0, &charA, 1, &charW, 1);
5078  }
5079 
5080  if (es->hwndListBox)
5081  {
5082  if (charW == VK_RETURN || charW == VK_ESCAPE)
5083  {
5085  SendMessageW(GetParent(hwnd), WM_KEYDOWN, charW, 0);
5086  break;
5087  }
5088  }
5089  result = EDIT_WM_Char(es, charW);
5090  break;
5091  }
5092 
5093  case WM_UNICHAR:
5094  if (unicode)
5095  {
5096  if (wParam == UNICODE_NOCHAR) return TRUE;
5097  if (wParam <= 0x000fffff)
5098  {
5099  if(wParam > 0xffff) /* convert to surrogates */
5100  {
5101  wParam -= 0x10000;
5102  EDIT_WM_Char(es, (wParam >> 10) + 0xd800);
5103  EDIT_WM_Char(es, (wParam & 0x03ff) + 0xdc00);
5104  }
5105  else EDIT_WM_Char(es, wParam);
5106  }
5107  return 0;
5108  }
5109  break;
5110 
5111  case WM_CLEAR:
5112  EDIT_WM_Clear(es);
5113  break;
5114 
5115  case WM_CONTEXTMENU:
5116  EDIT_WM_ContextMenu(es, (short)LOWORD(lParam), (short)HIWORD(lParam));
5117  break;
5118 
5119  case WM_COPY:
5120  EDIT_WM_Copy(es);
5121  break;
5122 
5123  case WM_CREATE:
5124  if(unicode)
5125  result = EDIT_WM_Create(es, ((LPCREATESTRUCTW)lParam)->lpszName);
5126  else
5127  {
5128  LPCSTR nameA = ((LPCREATESTRUCTA)lParam)->lpszName;
5129  LPWSTR nameW = NULL;
5130  if(nameA)
5131  {
5132  INT countW = MultiByteToWideChar(CP_ACP, 0, nameA, -1, NULL, 0);
5133  if((nameW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR))))
5134  MultiByteToWideChar(CP_ACP, 0, nameA, -1, nameW, countW);
5135  }
5137  HeapFree(GetProcessHeap(), 0, nameW);
5138  }
5139  break;
5140 
5141  case WM_CUT:
5142  EDIT_WM_Cut(es);
5143  break;
5144 
5145  case WM_ENABLE:
5146  es->bEnableState = (BOOL) wParam;
5148  break;
5149 
5150  case WM_ERASEBKGND:
5151  /* we do the proper erase in EDIT_WM_Paint */
5152  result = 1;
5153  break;
5154 
5155  case WM_GETFONT:
5156  result = (LRESULT)es->font;
5157  break;
5158 
5159  case WM_GETTEXT:
5161  break;
5162 
5163  case WM_GETTEXTLENGTH:
5164  if (unicode) result = get_text_length(es);
5165  else result = WideCharToMultiByte( CP_ACP, 0, es->text, get_text_length(es),
5166  NULL, 0, NULL, NULL );
5167  break;
5168 
5169  case WM_HSCROLL:
5171  break;
5172 
5173  case WM_KEYDOWN:
5175  break;
5176 
5177  case WM_KILLFOCUS:
5179  break;
5180 
5181  case WM_LBUTTONDBLCLK:
5183  break;
5184 
5185  case WM_LBUTTONDOWN:
5186  result = EDIT_WM_LButtonDown(es, wParam, (short)LOWORD(lParam), (short)HIWORD(lParam));
5187  break;
5188 
5189  case WM_LBUTTONUP:
5191  break;
5192 
5193  case WM_MBUTTONDOWN:
5195  break;
5196 
5197  case WM_MOUSEMOVE:
5198  result = EDIT_WM_MouseMove(es, (short)LOWORD(lParam), (short)HIWORD(lParam));
5199  break;
5200 
5201  case WM_PRINTCLIENT:
5202  case WM_PAINT:
5204  break;
5205 
5206  case WM_PASTE:
5207  EDIT_WM_Paste(es);
5208  break;
5209 
5210  case WM_SETFOCUS:
5212  break;
5213 
5214  case WM_SETFONT:
5216  break;
5217 
5218  case WM_SETREDRAW:
5219  /* FIXME: actually set an internal flag and behave accordingly */
5220  break;
5221 
5222  case WM_SETTEXT:
5223  EDIT_WM_SetText(es, (LPCWSTR)lParam, unicode);
5224  result = TRUE;
5225  break;
5226 
5227  case WM_SIZE:
5229  break;
5230 
5231  case WM_STYLECHANGED:
5233  break;
5234 
5235  case WM_STYLECHANGING:
5236  result = 0; /* See EDIT_WM_StyleChanged */
5237  break;
5238 
5239  case WM_SYSKEYDOWN:
5241  break;
5242 
5243  case WM_TIMER:
5244  EDIT_WM_Timer(es);
5245  break;
5246 
5247  case WM_VSCROLL:
5249  break;
5250 
5251  case WM_MOUSEWHEEL:
5252  {
5253  int wheelDelta;
5254  UINT pulScrollLines = 3;
5255  SystemParametersInfoW(SPI_GETWHEELSCROLLLINES,0, &pulScrollLines, 0);
5256 
5257  if (wParam & (MK_SHIFT | MK_CONTROL)) {
5259  break;
5260  }
5261  wheelDelta = GET_WHEEL_DELTA_WPARAM(wParam);
5262  /* if scrolling changes direction, ignore left overs */
5263  if ((wheelDelta < 0 && es->wheelDeltaRemainder < 0) ||
5264  (wheelDelta > 0 && es->wheelDeltaRemainder > 0))
5265  es->wheelDeltaRemainder += wheelDelta;
5266  else
5267  es->wheelDeltaRemainder = wheelDelta;
5268  if (es->wheelDeltaRemainder && pulScrollLines)
5269  {
5270  int cLineScroll;
5271  pulScrollLines = (int) min((UINT) es->line_count, pulScrollLines);
5272  cLineScroll = pulScrollLines * (float)es->wheelDeltaRemainder / WHEEL_DELTA;
5273  es->wheelDeltaRemainder -= WHEEL_DELTA * cLineScroll / (int)pulScrollLines;
5274  result = EDIT_EM_LineScroll(es, 0, -cLineScroll);
5275  }
5276  }
5277  break;
5278 
5279 
5280  /* IME messages to make the edit control IME aware */
5281  case WM_IME_SETCONTEXT:
5282  break;
5283 
5284  case WM_IME_STARTCOMPOSITION:
5285  es->composition_start = es->selection_end;
5286  es->composition_len = 0;
5287  break;
5288 
5289  case WM_IME_COMPOSITION:
5291  break;
5292 
5293  case WM_IME_ENDCOMPOSITION:
5294  if (es->composition_len > 0)
5295  {
5297  es->selection_end = es->selection_start;
5298  es->composition_len= 0;
5299  }
5300  break;
5301 
5303  break;
5304 
5305  case WM_IME_SELECT:
5306  break;
5307 
5308  case WM_IME_CONTROL:
5309  break;
5310 
5311  case WM_IME_REQUEST:
5312  switch (wParam)
5313  {
5314  case IMR_QUERYCHARPOSITION:
5315  {
5316  LRESULT pos;
5318 
5319  pos = EDIT_EM_PosFromChar(es, es->selection_start + chpos->dwCharPos, FALSE);
5320  chpos->pt.x = LOWORD(pos);
5321  chpos->pt.y = HIWORD(pos);
5322  chpos->cLineHeight = es->line_height;
5323  chpos->rcDocument = es->format_rect;
5324  MapWindowPoints(hwnd, 0, &chpos->pt, 1);
5325  MapWindowPoints(hwnd, 0, (POINT*)&chpos->rcDocument, 2);
5326  result = 1;
5327  break;
5328  }
5329  }
5330  break;
5331 
5332  default:
5333  result = DefWindowProcT(hwnd, msg, wParam, lParam, unicode);
5334  break;
5335  }
5336 
5337 #ifdef __REACTOS__
5338  /* ReactOS: check GetWindowLong in case es has been destroyed during processing */
5339  if (IsWindow(hwnd) && es && GetWindowLongPtrW(hwnd, 0))
5341 #else
5343 #endif
5344 
5345  TRACE("hwnd=%p msg=%x (%s) -- 0x%08lx\n", hwnd, msg, SPY_GetMsgName(msg, hwnd), result);
5346 
5347  return result;
5348 }
#define WM_GETTEXTLENGTH
Definition: winuser.h:1609
#define FNID_EDIT
Definition: ntuser.h:849
static LRESULT EDIT_WM_MouseMove(EDITSTATE *es, INT x, INT y)
Definition: edit.c:3766
static LRESULT EDIT_WM_VScroll(EDITSTATE *es, INT action, INT pos)
Definition: edit.c:4276
static void EDIT_EM_SetSel(EDITSTATE *es, UINT start, UINT end, BOOL after_wrap)
Definition: edit.c:1640
static LRESULT EDIT_WM_NCCreate(HWND hwnd, LPCREATESTRUCTW lpcs, BOOL unicode)
Definition: edit.c:4549
Definition: tftpd.h:59
#define DLGC_WANTCHARS
Definition: winuser.h:2608
#define DLGC_WANTMESSAGE
Definition: winuser.h:2603
#define EM_LINELENGTH
Definition: winuser.h:1993
#define MK_SHIFT
Definition: winuser.h:2359
#define CB_GETDROPPEDSTATE
Definition: winuser.h:1935
long y
Definition: polytest.cpp:48
#define WM_GETDLGCODE
Definition: winuser.h:1679
#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:1707
#define WM_LBUTTONDOWN
Definition: winuser.h:1766
#define WM_CUT
Definition: winuser.h:1851
#define WideCharToMultiByte
Definition: compat.h:111
GLuint64EXT * result
Definition: glext.h:11304
#define WM_IME_CHAR
Definition: winuser.h:1824
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define EM_SETMARGINS
Definition: winuser.h:2002
BOOL WINAPI IsWindow(_In_opt_ HWND)
long x
Definition: polytest.cpp:48
#define EM_SETREADONLY
Definition: winuser.h:2005
#define TRUE
Definition: types.h:120
static void EDIT_UpdateText(EDITSTATE *es, const RECT *rc, BOOL bErase)
Definition: edit.c:1510
#define WM_MOUSEWHEEL
Definition: treelist.c:96
#define CP_ACP
Definition: compat.h:109
#define EM_SETLIMITTEXT
Definition: winuser.h:2001
WORD vk
Definition: input.c:77
static INT EDIT_EM_GetLine(EDITSTATE *es, INT line, LPWSTR dst, BOOL unicode)
Definition: edit.c:2553
char CHAR
Definition: xmlstorage.h:175
#define WM_GETTEXT
Definition: winuser.h:1608
static void EDIT_EM_SetHandle(EDITSTATE *es, HLOCAL hloc)
Definition: edit.c:2832
#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:3979
static HDC
Definition: imagelist.c:92
#define WM_SETREDRAW
Definition: winuser.h:1606
#define EM_SETWORDBREAKPROC
Definition: winuser.h:2010
static BOOL EDIT_EM_SetTabStops(EDITSTATE *es, INT count, const INT *tabs)
Definition: edit.c:3041
#define WM_IME_SELECT
Definition: winuser.h:1823
static void EDIT_UnlockBuffer(EDITSTATE *es, BOOL force)
Definition: edit.c:1358
static void EDIT_WM_Timer(EDITSTATE *es)
Definition: edit.c:4126
#define WM_PASTE
Definition: winuser.h:1853
#define ES_READONLY
Definition: pedump.c:675
#define GetWindowLongPtrW
Definition: winuser.h:4819
#define FNID_DESTROY
Definition: ntuser.h:877
if(dx==0 &&dy==0)
Definition: linetemp.h:174
static BOOL EDIT_EM_FmtLines(EDITSTATE *es, BOOL add_eol)
Definition: edit.c:2486
static void EDIT_EM_SetMargins(EDITSTATE *es, INT action, WORD left, WORD right, BOOL repaint)
Definition: edit.c:2944
#define VK_ESCAPE
Definition: winuser.h:2204
char * LPSTR
Definition: xmlstorage.h:182
#define WM_CLEAR
Definition: winuser.h:1854
#define BOOL
Definition: nt_native.h:43
#define WM_NCCREATE
Definition: winuser.h:1673
#define WM_IME_COMPOSITIONFULL
Definition: winuser.h:1822
int32_t INT
Definition: typedefs.h:58
static void EDIT_EM_SetLimitText(EDITSTATE *es, UINT limit)
Definition: edit.c:2908
#define VK_RETURN
Definition: winuser.h:2191
#define DLGC_HASSETSEL
Definition: winuser.h:2604
static LRESULT EDIT_WM_LButtonDown(EDITSTATE *es, DWORD keys, INT x, INT y)
Definition: edit.c:3712
WPARAM wParam
Definition: combotst.c:138
#define WM_ENABLE
Definition: winuser.h:1605
#define WM_PRINTCLIENT
Definition: richedit.h:70
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define EM_SETHANDLE
Definition: winuser.h:1999
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:1987
#define EM_POSFROMCHAR
Definition: richedit.h:77
#define EM_GETPASSWORDCHAR
Definition: winuser.h:1985
static LRESULT(CALLBACK *p_edit_proc)(HWND
static LRESULT EDIT_WM_LButtonDblClk(EDITSTATE *es)
Definition: edit.c:3683
static BOOL EDIT_EM_LineScroll(EDITSTATE *es, INT dx, INT dy)
Definition: edit.c:1803
struct tagCREATESTRUCTA * LPCREATESTRUCTA
#define WHEEL_DELTA
Definition: treelist.c:99
static UINT get_text_length(EDITSTATE *es)
Definition: edit.c:255
static HLOCAL EDIT_EM_GetHandle(EDITSTATE *es)
Definition: edit.c:2508
#define FALSE
Definition: types.h:117
#define WM_COPY
Definition: winuser.h:1852
DWORD fnid
Definition: ntuser.h:688
unsigned int BOOL
Definition: ntddk_ex.h:94
static LRESULT DefWindowProcT(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: edit.c:4742
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
static LRESULT EDIT_WM_KillFocus(EDITSTATE *es)
Definition: edit.c:3640
#define FIXME(fmt,...)
Definition: debug.h:111
static void EDIT_SetRectNP(EDITSTATE *es, const RECT *rc)
Definition: edit.c:2409
#define IMR_QUERYCHARPOSITION
Definition: imm.h:543
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define EM_GETMARGINS
Definition: winuser.h:1983
#define WM_GETFONT
Definition: winuser.h:1641
static LRESULT EDIT_WM_MButtonDown(EDITSTATE *es)
Definition: edit.c:3754
static void EDIT_WM_Paste(EDITSTATE *es)
Definition: edit.c:3147
#define WM_KEYDOWN
Definition: winuser.h:1705
static LRESULT EDIT_EM_GetSel(const EDITSTATE *es, PUINT start, PUINT end)
Definition: edit.c:2599
const char * LPCSTR
Definition: xmlstorage.h:183
#define WM_IME_REQUEST
Definition: winuser.h:1826
#define WM_SETTEXT
Definition: winuser.h:1607
static LRESULT EDIT_WM_HScroll(EDITSTATE *es, INT action, INT pos)
Definition: edit.c:4144
static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, LPCWSTR lpsz_replace, BOOL send_update, BOOL honor_limit)
Definition: edit.c:2620
static LRESULT EDIT_WM_StyleChanged(EDITSTATE *es, WPARAM which, const STYLESTRUCT *style)
Definition: edit.c:4067
static const WCHAR nameW[]
Definition: main.c:46
static void EDIT_EM_SetWordBreakProc(EDITSTATE *es, void *wbp)
Definition: edit.c:3071
static void EDIT_WM_ContextMenu(EDITSTATE *es, INT x, INT y)
Definition: edit.c:3361
#define TRACE(s)
Definition: solgame.cpp:4
static void EDIT_LockBuffer(EDITSTATE *es)
Definition: edit.c:1293
#define WM_KILLFOCUS
Definition: winuser.h:1604
#define GetProcessHeap()
Definition: compat.h:595
#define EM_SETPASSWORDCHAR
Definition: winuser.h:2004
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
static LRESULT EDIT_WM_NCDestroy(EDITSTATE *es)
Definition: edit.c:4714
#define WM_SIZE
Definition: winuser.h:1601
static void EDIT_EM_SetPasswordChar(EDITSTATE *es, WCHAR c)
Definition: edit.c:3012
static const char textA[]
Definition: registrar.c:40
#define WM_IME_SETCONTEXT
Definition: winuser.h:1819
Definition: edit.c:97
#define EM_SCROLL
Definition: winuser.h:1997
#define WM_TIMER
Definition: winuser.h:1732
#define WM_IME_CONTROL
Definition: winuser.h:1821
#define EM_GETLIMITTEXT
Definition: richedit.h:74
#define WM_NCDESTROY
Definition: winuser.h:1674
#define EM_GETMODIFY
Definition: winuser.h:1984
#define EM_SETSEL
Definition: winuser.h:2008
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
static INT EDIT_EM_LineLength(EDITSTATE *es, INT index)
Definition: edit.c:1063
unsigned long DWORD
Definition: ntddk_ex.h:95
static LRESULT EDIT_WM_KeyDown(EDITSTATE *es, INT key)
Definition: edit.c:3502
DWORD dwCharPos
Definition: imm.h:141
#define WM_PAINT
Definition: winuser.h:1610
#define EM_LINESCROLL
Definition: winuser.h:1994
#define EM_SETRECTNP
Definition: winuser.h:2007
#define EM_UNDO
Definition: winuser.h:2011
#define EM_EMPTYUNDOBUFFER
Definition: winuser.h:1975
static void EDIT_EM_EmptyUndoBuffer(EDITSTATE *es)
Definition: edit.c:190
static BOOL EDIT_EM_Undo(EDITSTATE *es)
Definition: edit.c:3090
RECT rcDocument
Definition: imm.h:144
#define EM_GETHANDLE
Definition: winuser.h:1979
#define EM_FMTLINES
Definition: winuser.h:1976
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1768
#define EF_DIALOGMODE
Definition: edit.c:74
static LRESULT EDIT_WM_LButtonUp(EDITSTATE *es)
Definition: edit.c:3738
#define EM_SETTABSTOPS
Definition: winuser.h:2009
#define EM_SETMODIFY
Definition: winuser.h:2003
static const WCHAR textW[]
Definition: itemdlg.c:1559
#define DLGC_WANTALLKEYS
Definition: winuser.h:2602
static void EDIT_EM_ScrollCaret(EDITSTATE *es)
Definition: edit.c:1883
static LRESULT EDIT_EM_Scroll(EDITSTATE *es, INT action)
Definition: edit.c:1818
#define ERR(fmt,...)
Definition: debug.h:110
static INT EDIT_WM_GetText(const EDITSTATE *es, INT count, LPWSTR dst, BOOL unicode)
Definition: edit.c:3417
#define GWL_STYLE
Definition: winuser.h:846
Definition: ntuser.h:672
static INT EDIT_EM_LineFromChar(EDITSTATE *es, INT index)
Definition: edit.c:999
HWND WINAPI GetParent(_In_ HWND)
static void EDIT_WM_Clear(EDITSTATE *es)
Definition: edit.c:3204
static LRESULT EDIT_WM_Char(EDITSTATE *es, WCHAR c)
Definition: edit.c:3231
#define EM_SETRECT
Definition: winuser.h:2006
#define EM_LINEFROMCHAR
Definition: winuser.h:1991
static float(__cdecl *square_half_float)(float x
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define WM_LBUTTONUP
Definition: winuser.h:1767
static void EDIT_WM_Cut(EDITSTATE *es)
Definition: edit.c:3219
#define WM_MBUTTONDOWN
Definition: winuser.h:1772
#define min(a, b)
Definition: monoChain.cc:55
#define EF_UPDATE
Definition: edit.c:68
static BOOL EDIT_EM_CanUndo(const EDITSTATE *es)
Definition: edit.c:179
static void EDIT_ImeComposition(HWND hwnd, LPARAM CompFlag, EDITSTATE *es)
Definition: edit.c:4512
unsigned int UINT
Definition: ndis.h:50
static void EDIT_WM_SetFont(EDITSTATE *es, HFONT font, BOOL redraw)
Definition: edit.c:3925
#define WM_MOUSEMOVE
Definition: winuser.h:1765
#define NULL
Definition: types.h:112
#define WM_HSCROLL
Definition: winuser.h:1733
#define EM_GETWORDBREAKPROC
Definition: winuser.h:1989
#define EF_MODIFIED
Definition: edit.c:66
static INT EDIT_EM_LineIndex(const EDITSTATE *es, INT line)
Definition: edit.c:1028
static LRESULT EDIT_WM_SysKeyDown(EDITSTATE *es, INT key, DWORD key_data)
Definition: edit.c:4107
#define MK_CONTROL
Definition: winuser.h:2360
static void EDIT_WM_SetFocus(EDITSTATE *es)
Definition: edit.c:3893
#define MultiByteToWideChar
Definition: compat.h:110
#define WM_SETFONT
Definition: winuser.h:1640
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define msg(x)
Definition: auth_time.c:54
UINT cLineHeight
Definition: imm.h:143
static LRESULT EDIT_EM_CharFromPos(EDITSTATE *es, INT x, INT y)
Definition: edit.c:2458
#define EM_LINEINDEX
Definition: winuser.h:1992
#define WM_CREATE
Definition: winuser.h:1598
BOOL WINAPI CopyRect(_Out_ LPRECT, _In_ LPCRECT)
#define WM_SYSKEYDOWN
Definition: winuser.h:1709
#define EM_GETRECT
Definition: winuser.h:1986
#define EM_GETLINE
Definition: winuser.h:1981
#define EM_CANUNDO
Definition: winuser.h:1973
#define HIWORD(l)
Definition: typedefs.h:247
BOOL NTAPI NtUserSetWindowFNID(HWND hWnd, WORD fnID)
Definition: window.c:4332
static void EDIT_WM_Size(EDITSTATE *es, UINT action)
Definition: edit.c:4034
#define WM_ERASEBKGND
Definition: winuser.h:1615
#define WM_SETFOCUS
Definition: winuser.h:1603
#define WM_UNDO
Definition: winuser.h:1855
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static LRESULT EDIT_WM_Create(EDITSTATE *es, LPCWSTR name)
Definition: edit.c:4664
LONG_PTR LRESULT
Definition: windef.h:209
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022
static const WCHAR empty_stringW[]
Definition: edit.c:171
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:3798
#define HeapFree(x, y, z)
Definition: compat.h:594
#define DLGC_WANTARROWS
Definition: winuser.h:2600
#define EM_GETFIRSTVISIBLELINE
Definition: winuser.h:1978
unsigned int * PUINT
Definition: ndis.h:50
#define EM_REPLACESEL
Definition: winuser.h:1996
#define WM_UNICHAR
Definition: richedit.h:67
#define EM_SCROLLCARET
Definition: richedit.h:81
static void EDIT_WM_Copy(EDITSTATE *es)
Definition: edit.c:3175
#define es
Definition: i386-dis.c:441
#define WM_VSCROLL
Definition: winuser.h:1734
#define ValidateHwnd(hwnd)
Definition: precomp.h:85
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:4396
static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap)
Definition: edit.c:1099
#define EM_GETTHUMB
Definition: winuser.h:1988
#define EM_GETLINECOUNT
Definition: winuser.h:1982

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 }
static void Ghost_OnNCPaint(HWND hwnd, HRGN hrgn, BOOL bUnicode)
Definition: ghost.c:330
static void Ghost_OnPaint(HWND hwnd)
Definition: ghost.c:350
#define TRUE
Definition: types.h:120
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:1600
static void Ghost_OnDraw(HWND hwnd, HDC hdc)
Definition: ghost.c:309
int32_t INT
Definition: typedefs.h:58
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:1677
#define FALSE
Definition: types.h:117
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:2578
#define WM_SIZING
Definition: winuser.h:1797
#define IDC_WAIT
Definition: winuser.h:684
#define WM_DESTROY
Definition: winuser.h:1599
static HICON Ghost_GetIcon(HWND hwnd, INT fType)
Definition: ghost.c:487
#define WM_SIZE
Definition: winuser.h:1601
#define WM_TIMER
Definition: winuser.h:1732
#define WM_CLOSE
Definition: winuser.h:1611
#define WM_NCDESTROY
Definition: winuser.h:1674
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:1610
#define WM_COMMAND
Definition: winuser.h:1730
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define LoadCursor
Definition: winuser.h:5802
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define SC_SIZE
Definition: winuser.h:2574
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define WM_CREATE
Definition: winuser.h:1598
#define HIWORD(l)
Definition: typedefs.h:247
#define WM_ERASEBKGND
Definition: winuser.h:1615
LONG_PTR LRESULT
Definition: windef.h:209
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022
static void Ghost_OnDestroy(HWND hwnd)
Definition: ghost.c:376
#define WM_SYSCOMMAND
Definition: winuser.h:1731
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define WM_NCMOUSEMOVE
Definition: winuser.h:1681

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 }
LRESULT WINAPI GhostWndProc_common(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: ghost.c:515
WPARAM wParam
Definition: combotst.c:138
#define FALSE
Definition: types.h:117
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022
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 }
#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
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022
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:1618
#define WM_NCHITTEST
Definition: winuser.h:1676
#define WS_CHILD
Definition: pedump.c:617
#define GetWindowLongPtrW
Definition: winuser.h:4819
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 uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define SPI_GETICONTITLEWRAP
Definition: winuser.h:1364
#define WM_CLOSE
Definition: winuser.h:1611
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:2466
#define GWL_STYLE
Definition: winuser.h:846
#define WM_ACTIVATE
Definition: winuser.h:1602
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define NULL
Definition: types.h:112
#define GW_OWNER
Definition: winuser.h:761
#define SPI_GETICONTITLELOGFONT
Definition: winuser.h:1370
#define msg(x)
Definition: auth_time.c:54
#define WM_CREATE
Definition: winuser.h:1598
#define WM_ERASEBKGND
Definition: winuser.h:1615
LPARAM lParam
Definition: combotst.c:139
HWND WINAPI GetActiveWindow(void)
Definition: winpos.c:138
#define WM_NCMOUSEMOVE
Definition: winuser.h:1681
#define WM_NCLBUTTONDBLCLK
Definition: winuser.h:1684
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  return descr->page_size;
3059 
3060  case WM_DESTROY:
3061  return LISTBOX_Destroy( descr );
3062 
3063  case WM_ENABLE:
3064  InvalidateRect( descr->self, NULL, TRUE );
3065  return 0;
3066 
3067  case WM_SETREDRAW:
3068  LISTBOX_SetRedraw( descr, wParam != 0 );
3069  return 0;
3070 
3071  case WM_GETDLGCODE:
3073 
3074  case WM_PRINTCLIENT:
3075  case WM_PAINT:
3076  {
3077  PAINTSTRUCT ps;
3078  HDC hdc = ( wParam ) ? ((HDC)wParam) : BeginPaint( descr->self, &ps );
3079  ret = LISTBOX_Paint( descr, hdc );
3080  if( !wParam ) EndPaint( descr->self, &ps );
3081  }
3082  return ret;
3083  case WM_SIZE:
3085  return 0;
3086  case WM_GETFONT:
3087  return (LRESULT)descr->font;
3088  case WM_SETFONT:
3090  if (lParam) InvalidateRect( descr->self, 0, TRUE );
3091  return 0;
3092  case WM_SETFOCUS:
3093  descr->in_focus = TRUE;
3094  descr->caret_on = TRUE;
3095  if (descr->focus_item != -1)
3098  return 0;
3099  case WM_KILLFOCUS:
3100  LISTBOX_HandleLButtonUp( descr ); /* Release capture if we have it */
3101  descr->in_focus = FALSE;
3102  descr->wheel_remain = 0;
3103  if ((descr->focus_item != -1) && descr->caret_on)
3104  LISTBOX_RepaintItem( descr, descr->focus_item, ODA_FOCUS );
3106  return 0;
3107  case WM_HSCROLL:
3109  case WM_VSCROLL:
3111  case WM_MOUSEWHEEL:
3112  if (wParam & (MK_SHIFT | MK_CONTROL))
3113  return DefWindowProcW( descr->self, msg, wParam, lParam );
3115  case WM_LBUTTONDOWN:
3116  if (lphc)
3118  (INT16)LOWORD(lParam),
3119  (INT16)HIWORD(lParam) );
3121  (INT16)LOWORD(lParam),
3122  (INT16)HIWORD(lParam) );
3123  case WM_LBUTTONDBLCLK:
3124  if (lphc)
3126  (INT16)LOWORD(lParam),
3127  (INT16)HIWORD(lParam) );
3128  if (descr->style & LBS_NOTIFY)
3130  return 0;
3131  case WM_MOUSEMOVE:
3132  if ( lphc && ((lphc->dwStyle & CBS_DROPDOWNLIST) != CBS_SIMPLE) )
3133  {
3134  BOOL captured = descr->captured;
3135  POINT mousePos;
3136  RECT clientRect;
3137 
3138  mousePos.x = (INT16)LOWORD(lParam);
3139  mousePos.y = (INT16)HIWORD(lParam);
3140 
3141  /*
3142  * If we are in a dropdown combobox, we simulate that
3143  * the mouse is captured to show the tracking of the item.
3144  */
3145  if (GetClientRect(descr->self, &clientRect) && PtInRect( &clientRect, mousePos ))
3146  descr->captured = TRUE;
3147 
3148  LISTBOX_HandleMouseMove( descr, mousePos.x, mousePos.y);
3149 
3150  descr->captured = captured;
3151  }
3152  else if (GetCapture() == descr->self)
3153  {
3155  (INT16)HIWORD(lParam) );
3156  }
3157  return 0;
3158  case WM_LBUTTONUP:
3159  if (lphc)
3160  {
3161  POINT mousePos;
3162  RECT clientRect;
3163 
3164  /*
3165  * If the mouse button "up" is not in the listbox,
3166  * we make sure there is no selection by re-selecting the
3167  * item that was selected when the listbox was made visible.
3168  */
3169  mousePos.x = (INT16)LOWORD(lParam);
3170  mousePos.y = (INT16)HIWORD(lParam);
3171 
3172  GetClientRect(descr->self, &clientRect);
3173 
3174  /*
3175  * When the user clicks outside the combobox and the focus
3176  * is lost, the owning combobox will send a fake buttonup with
3177  * 0xFFFFFFF as the mouse location, we must also revert the
3178  * selection to the original selection.
3179  */
3180  if ( (lParam == (LPARAM)-1) || (!PtInRect( &clientRect, mousePos )) )
3182  }
3183  return LISTBOX_HandleLButtonUp( descr );
3184  case WM_KEYDOWN:
3185  if( lphc && (lphc->dwStyle & CBS_DROPDOWNLIST) != CBS_SIMPLE )
3186  {
3187  /* for some reason Windows makes it possible to
3188  * show/hide ComboLBox by sending it WM_KEYDOWNs */
3189 
3190  if( (!(lphc->wState & CBF_EUI) && wParam == VK_F4) ||
3191  ( (lphc->wState & CBF_EUI) && !(lphc->wState & CBF_DROPPED)
3192  && (wParam == VK_DOWN || wParam == VK_UP)) )
3193  {
3194  COMBO_FlipListbox( lphc, FALSE, FALSE );
3195  return 0;
3196  }
3197  }
3198  return LISTBOX_HandleKeyDown( descr, wParam );
3199  case WM_CHAR:
3200  {
3201  WCHAR charW;
3202  if(unicode)
3203  charW = (WCHAR)wParam;
3204  else
3205  {
3206  CHAR charA = (CHAR)wParam;
3207  MultiByteToWideChar(CP_ACP, 0, &charA, 1, &charW, 1);
3208  }
3209  return LISTBOX_HandleChar(