ReactOS  0.4.14-dev-41-g31d7680
controls.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  HEADCOMBO
 

Macros

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

Typedefs

typedef struct HEADCOMBOLPHEADCOMBO
 

Functions

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

Macro Definition Documentation

◆ CB_GETTYPE

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

Definition at line 82 of file controls.h.

◆ CB_OKAY

#define CB_OKAY   0

Definition at line 42 of file controls.h.

◆ CBF_BEENFOCUSED

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

Definition at line 58 of file controls.h.

◆ CBF_BUTTONDOWN

#define CBF_BUTTONDOWN   0x0002

Definition at line 46 of file controls.h.

◆ CBF_CAPTURE

#define CBF_CAPTURE   0x0020

Definition at line 50 of file controls.h.

◆ CBF_DROPPED

#define CBF_DROPPED   0x0001

Definition at line 45 of file controls.h.

◆ CBF_EDIT

#define CBF_EDIT   0x0040

Definition at line 51 of file controls.h.

◆ CBF_EUI

#define CBF_EUI   0x8000

Definition at line 59 of file controls.h.

◆ CBF_FOCUSED

#define CBF_FOCUSED   0x0010

Definition at line 49 of file controls.h.

◆ CBF_MEASUREITEM

#define CBF_MEASUREITEM   0x0008

Definition at line 48 of file controls.h.

◆ CBF_NOEDITNOTIFY

#define CBF_NOEDITNOTIFY   0x1000

Definition at line 56 of file controls.h.

◆ CBF_NOLBSELECT

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

Definition at line 57 of file controls.h.

◆ CBF_NOREDRAW

#define CBF_NOREDRAW   0x0200

Definition at line 54 of file controls.h.

◆ CBF_NORESIZE

#define CBF_NORESIZE   0x0080

Definition at line 52 of file controls.h.

◆ CBF_NOROLLUP

#define CBF_NOROLLUP   0x0004

Definition at line 47 of file controls.h.

◆ CBF_NOTIFY

#define CBF_NOTIFY   0x0100

Definition at line 53 of file controls.h.

◆ CBF_SELCHANGE

#define CBF_SELCHANGE   0x0400

Definition at line 55 of file controls.h.

◆ HBMMENU_CALLBACK

#define HBMMENU_CALLBACK   ((HBITMAP) -1)

Definition at line 4 of file controls.h.

◆ HBMMENU_MBAR_CLOSE

#define HBMMENU_MBAR_CLOSE   ((HBITMAP) 5)

Definition at line 16 of file controls.h.

◆ HBMMENU_MBAR_CLOSE_D

#define HBMMENU_MBAR_CLOSE_D   ((HBITMAP) 6)

Definition at line 19 of file controls.h.

◆ HBMMENU_MBAR_MINIMIZE

#define HBMMENU_MBAR_MINIMIZE   ((HBITMAP) 3)

Definition at line 13 of file controls.h.

◆ HBMMENU_MBAR_MINIMIZE_D

#define HBMMENU_MBAR_MINIMIZE_D   ((HBITMAP) 7)

Definition at line 22 of file controls.h.

◆ HBMMENU_MBAR_RESTORE

#define HBMMENU_MBAR_RESTORE   ((HBITMAP) 2)

Definition at line 10 of file controls.h.

◆ HBMMENU_POPUP_CLOSE

#define HBMMENU_POPUP_CLOSE   ((HBITMAP) 8)

Definition at line 25 of file controls.h.

◆ HBMMENU_POPUP_MAXIMIZE

#define HBMMENU_POPUP_MAXIMIZE   ((HBITMAP) 10)

Definition at line 31 of file controls.h.

◆ HBMMENU_POPUP_MINIMIZE

#define HBMMENU_POPUP_MINIMIZE   ((HBITMAP) 11)

Definition at line 34 of file controls.h.

◆ HBMMENU_POPUP_RESTORE

#define HBMMENU_POPUP_RESTORE   ((HBITMAP) 9)

Definition at line 28 of file controls.h.

◆ HBMMENU_SYSTEM

#define HBMMENU_SYSTEM   ((HBITMAP) 1)

Definition at line 7 of file controls.h.

◆ ID_CB_EDIT

#define ID_CB_EDIT   1001

Definition at line 39 of file controls.h.

◆ ID_CB_LISTBOX

#define ID_CB_LISTBOX   1000

Definition at line 38 of file controls.h.

◆ LB_ADDSTRING_LOWER

#define LB_ADDSTRING_LOWER   0x1AD

Definition at line 89 of file controls.h.

◆ LB_ADDSTRING_UPPER

#define LB_ADDSTRING_UPPER   0x1AC

Definition at line 88 of file controls.h.

◆ LB_INSERTSTRING_LOWER

#define LB_INSERTSTRING_LOWER   0x1AB

Definition at line 87 of file controls.h.

◆ LB_INSERTSTRING_UPPER

#define LB_INSERTSTRING_UPPER   0x1AA

Definition at line 86 of file controls.h.

Typedef Documentation

◆ LPHEADCOMBO

Function Documentation

◆ ButtonWndProc_common()

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

Definition at line 243 of file button.c.

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

Referenced by RegisterClientPFN().

◆ ButtonWndProcA()

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

Referenced by RegisterClientPFN().

◆ ButtonWndProcW()

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

Referenced by RegisterClientPFN().

◆ COMBO_FlipListbox()

BOOL COMBO_FlipListbox ( LPHEADCOMBO  ,
BOOL  ,
BOOL   
)

Definition at line 1117 of file combo.c.

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

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

◆ ComboWndProc_common()

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

Definition at line 1822 of file combo.c.

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

Referenced by RegisterClientPFN().

◆ ComboWndProcA()

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

Referenced by RegisterClientPFN().

◆ ComboWndProcW()

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

Referenced by RegisterClientPFN().

◆ DesktopWndProcA()

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

Definition at line 1306 of file message.c.

1307 {
1308  LRESULT Result;
1309  MSG AnsiMsg, UcMsg;
1310 
1311  TRACE("Desktop A Class Atom! hWnd 0x%x, Msg %d\n", hwnd, message);
1312 
1313  AnsiMsg.hwnd = hwnd;
1314  AnsiMsg.message = message;
1315  AnsiMsg.wParam = wParam;
1316  AnsiMsg.lParam = lParam;
1317  AnsiMsg.time = 0;
1318  AnsiMsg.pt.x = 0;
1319  AnsiMsg.pt.y = 0;
1320 
1321  // Desktop is always Unicode so convert Ansi here.
1322  if (!MsgiAnsiToUnicodeMessage(hwnd, &UcMsg, &AnsiMsg))
1323  {
1324  return FALSE;
1325  }
1326 
1327  Result = DesktopWndProcW(hwnd, message, UcMsg.wParam, UcMsg.lParam);
1328 
1329  MsgiAnsiToUnicodeCleanup(&UcMsg, &AnsiMsg);
1330 
1331  return Result;
1332  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
LRESULT WINAPI DesktopWndProcW(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: desktop.c:33
Definition: tftpd.h:59
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glext.h:5579
WPARAM wParam
Definition: combotst.c:138
static BOOL FASTCALL MsgiAnsiToUnicodeMessage(HWND hwnd, LPMSG UnicodeMsg, LPMSG AnsiMsg)
Definition: message.c:516
_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:708
#define TRACE(s)
Definition: solgame.cpp:4
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139

Referenced by RegisterClientPFN().

◆ DesktopWndProcW()

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

Definition at line 33 of file desktop.c.

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

Referenced by DesktopWndProcA(), and RegisterClientPFN().

◆ EditWndProc_common()

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

Definition at line 4743 of file edit.c.

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

Referenced by RegisterClientPFN().

◆ EditWndProcA()

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

Referenced by RegisterClientPFN().

◆ EditWndProcW()

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

Referenced by RegisterClientPFN().

◆ GhostWndProc_common()

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

Definition at line 515 of file ghost.c.

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

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

◆ GhostWndProcA()

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

Definition at line 604 of file ghost.c.

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

Referenced by RegisterClientPFN().

◆ GhostWndProcW()

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

Definition at line 610 of file ghost.c.

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

Referenced by RegisterClientPFN().

◆ IconTitleWndProc()

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

Definition at line 184 of file icontitle.c.

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

Referenced by RegisterClientPFN().

◆ ListBoxWndProc_common()

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

Definition at line 2600 of file listbox.c.

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