ReactOS 0.4.15-dev-6056-gb29b268
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 {
305 style = (style & ~BS_TYPEMASK) | BS_PUSHBUTTON;
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 {
403 break;
404 }
407 if (uMsg == WM_KEYUP || PtInRect( &rect, pt ))
408 {
410 switch(btn_type)
411 {
412 case BS_AUTOCHECKBOX:
414 break;
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
428#endif
429 }
430#ifndef __REACTOS__
431 else
432 {
434 }
435#else
437 if (TellParent) BUTTON_NOTIFY_PARENT(hWnd, BN_CLICKED);
438 }
439#endif
440 break;
441
443 TRACE("WM_CAPTURECHANGED %p\n", hWnd);
444 if (hWnd == (HWND)lParam) break;
447 {
451 }
452 break;
453
454 case WM_MOUSEMOVE:
455 if ((wParam & MK_LBUTTON) && GetCapture() == hWnd)
456 {
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
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
493 (WPARAM)hdc, (LPARAM)hWnd);
494 if (!hbrush) /* did the app forget to call DefWindowProc ? */
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);
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)
545 if (style & BS_NOTIFY)
547
549 break;
550
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
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)
648 else
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) :
662 }
663 return 0;
664}
static HBRUSH hbrush
Arabic default style
Definition: afstyles.h:94
static int state
Definition: maze.c:121
HWND hWnd
Definition: settings.c:17
#define ERR(fmt,...)
Definition: debug.h:110
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define BUTTON_NSTATES
Definition: button.c:77
#define BUTTON_NOTIFY_PARENT(hWnd, code)
Definition: button.c:85
static const pfPaint btnPaintFunc[MAX_BTN_TYPE]
Definition: button.c:154
static UINT BUTTON_CalcLabelRect(const BUTTON_INFO *infoPtr, HDC hdc, RECT *rc)
Definition: button.c:1184
static void paint_button(BUTTON_INFO *infoPtr, LONG style, UINT action)
Definition: button.c:218
#define BUTTON_BTNPRESSED
Definition: button.c:78
static UINT get_button_type(LONG window_style)
Definition: button.c:211
static const WORD maxCheckState[MAX_BTN_TYPE]
Definition: button.c:122
#define MAX_BTN_TYPE
Definition: button.c:120
static void BUTTON_CheckAutoRadioButton(HWND hwnd)
Definition: button.c:1655
#define ValidateHwnd(hwnd)
Definition: precomp.h:85
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
#define pt(x, y)
Definition: drawing.c:79
r parent
Definition: btrfs.c:3010
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FNID_DESTROY
Definition: ntuser.h:893
#define FNID_BUTTON
Definition: ntuser.h:861
DWORD NTAPI NtUserAlterWindowStyle(HWND hWnd, DWORD Index, LONG NewValue)
Definition: window.c:4084
BOOL NTAPI NtUserSetWindowFNID(HWND hWnd, WORD fnID)
Definition: window.c:4339
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:92
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
unsigned int UINT
Definition: ndis.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define BS_AUTORADIOBUTTON
Definition: pedump.c:660
#define BS_USERBUTTON
Definition: pedump.c:659
#define WS_TABSTOP
Definition: pedump.c:634
#define WS_VISIBLE
Definition: pedump.c:620
#define BS_AUTOCHECKBOX
Definition: pedump.c:654
long LONG
Definition: pedump.c:60
#define BS_GROUPBOX
Definition: pedump.c:658
#define BS_OWNERDRAW
Definition: pedump.c:661
#define BS_AUTO3STATE
Definition: pedump.c:657
#define BS_RADIOBUTTON
Definition: pedump.c:655
#define BS_PUSHBUTTON
Definition: pedump.c:651
#define BS_DEFPUSHBUTTON
Definition: pedump.c:652
#define WM_PRINTCLIENT
Definition: richedit.h:70
static FILE * client
Definition: client.c:41
#define TRACE(s)
Definition: solgame.cpp:4
& rect
Definition: startmenu.cpp:1413
Definition: ntuser.h:689
DWORD fnid
Definition: ntuser.h:704
Definition: tftpd.h:60
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
#define HIWORD(l)
Definition: typedefs.h:247
HBRUSH FASTCALL GetControlColor(PWND pwndParent, PWND pwnd, HDC hdc, UINT CtlMsg)
Definition: misc.c:146
static void set_button_state(HWND hwnd, LONG state)
Definition: button.c:163
static void set_button_font(HWND hwnd, HFONT font)
Definition: button.c:187
static HFONT get_button_font(HWND hwnd)
Definition: button.c:182
static LONG get_button_state(HWND hwnd)
Definition: button.c:158
#define HIMAGE_GWL_OFFSET
Definition: button.c:73
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define OPAQUE
Definition: wingdi.h:949
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
#define WM_PAINT
Definition: winuser.h:1610
HWND WINAPI SetCapture(_In_ HWND hWnd)
#define BST_INDETERMINATE
Definition: winuser.h:198
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_ERASEBKGND
Definition: winuser.h:1615
#define BS_BITMAP
Definition: winuser.h:258
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1762
#define BM_GETSTATE
Definition: winuser.h:1910
#define IMAGE_BITMAP
Definition: winuser.h:211
#define GetWindowLongPtrW
Definition: winuser.h:4819
#define WM_ENABLE
Definition: winuser.h:1605
#define WM_KEYUP
Definition: winuser.h:1706
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890
#define ODA_DRAWENTIRE
Definition: winuser.h:2532
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define DLGC_BUTTON
Definition: winuser.h:2610
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BST_UNCHECKED
Definition: winuser.h:199
#define BN_DOUBLECLICKED
Definition: winuser.h:1918
#define IMAGE_ICON
Definition: winuser.h:212
#define BN_SETFOCUS
Definition: winuser.h:1923
#define WM_CAPTURECHANGED
Definition: winuser.h:1798
#define WM_CREATE
Definition: winuser.h:1598
#define BS_ICON
Definition: winuser.h:264
#define VK_SPACE
Definition: winuser.h:2209
#define BS_PUSHLIKE
Definition: winuser.h:272
#define BM_SETSTATE
Definition: winuser.h:1913
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1768
#define BS_TYPEMASK
Definition: winuser.h:270
#define ODA_FOCUS
Definition: winuser.h:2534
#define DLGC_UNDEFPUSHBUTTON
Definition: winuser.h:2606
#define WM_NCHITTEST
Definition: winuser.h:1676
#define BN_KILLFOCUS
Definition: winuser.h:1920
#define WM_SETFOCUS
Definition: winuser.h:1603
#define WM_MOUSEMOVE
Definition: winuser.h:1765
HWND WINAPI GetCapture(void)
Definition: message.c:2881
#define BS_NOTIFY
Definition: winuser.h:268
#define WM_LBUTTONDOWN
Definition: winuser.h:1766
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1616
#define DLGC_DEFPUSHBUTTON
Definition: winuser.h:2605
#define WM_GETFONT
Definition: winuser.h:1641
#define BM_SETCHECK
Definition: winuser.h:1911
#define BM_SETIMAGE
Definition: winuser.h:1912
#define WM_CTLCOLORBTN
Definition: winuser.h:1759
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
#define WM_SETTEXT
Definition: winuser.h:1607
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI SetFocus(_In_opt_ HWND)
#define DLGC_RADIOBUTTON
Definition: winuser.h:2607
#define WM_SETFONT
Definition: winuser.h:1640
#define BM_CLICK
Definition: winuser.h:1907
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define BST_PUSHED
Definition: winuser.h:201
#define BM_GETIMAGE
Definition: winuser.h:1909
#define BM_SETSTYLE
Definition: winuser.h:1914
#define BST_FOCUS
Definition: winuser.h:200
HDC WINAPI GetDC(_In_opt_ HWND)
#define DLGC_STATIC
Definition: winuser.h:2609
#define WM_LBUTTONUP
Definition: winuser.h:1767
HWND WINAPI GetParent(_In_ HWND)
#define WM_NCDESTROY
Definition: winuser.h:1674
#define ODA_SELECT
Definition: winuser.h:2533
#define HTTRANSPARENT
Definition: winuser.h:2463
#define MK_LBUTTON
Definition: winuser.h:2357
#define BN_CLICKED
Definition: winuser.h:1915
#define WM_DESTROY
Definition: winuser.h:1599
#define WM_KEYDOWN
Definition: winuser.h:1705
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define SetWindowLongPtrW
Definition: winuser.h:5336
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define GWL_STYLE
Definition: winuser.h:846
BOOL WINAPI IsWindowVisible(_In_ HWND)
#define WM_KILLFOCUS
Definition: winuser.h:1604
#define WM_GETDLGCODE
Definition: winuser.h:1679
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BST_CHECKED
Definition: winuser.h:197
#define BM_GETCHECK
Definition: winuser.h:1908

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  lphc,
BOOL  ok,
BOOL  bRedrawButton 
)

Definition at line 1116 of file combo.c.

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

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 {
1875 LONG style;
1876 if(unicode)
1877 {
1878 hwndParent = ((LPCREATESTRUCTW)lParam)->hwndParent;
1879 style = ((LPCREATESTRUCTW)lParam)->style;
1880 }
1881 else
1882 {
1883 hwndParent = ((LPCREATESTRUCTA)lParam)->hwndParent;
1884 style = ((LPCREATESTRUCTA)lParam)->style;
1885 }
1886 return COMBO_Create(hwnd, lphc, hwndParent, style, unicode);
1887 }
1888
1889 case WM_PRINTCLIENT:
1890 /* Fallthrough */
1891 case WM_PAINT:
1892 /* wParam may contain a valid HDC! */
1893 return COMBO_Paint(lphc, (HDC)wParam);
1894
1895 case WM_ERASEBKGND:
1896 /* do all painting in WM_PAINT like Windows does */
1897 return 1;
1898
1899 case WM_GETDLGCODE:
1900 {
1902 if (lParam && (((LPMSG)lParam)->message == WM_KEYDOWN))
1903 {
1904 int vk = (int)((LPMSG)lParam)->wParam;
1905
1906 if ((vk == VK_RETURN || vk == VK_ESCAPE) && (lphc->wState & CBF_DROPPED))
1908 }
1909 return result;
1910 }
1911 case WM_SIZE:
1912 if( lphc->hWndLBox &&
1913 !(lphc->wState & CBF_NORESIZE) ) COMBO_Size( lphc );
1914 return TRUE;
1915 case WM_SETFONT:
1916 COMBO_Font( lphc, (HFONT)wParam, (BOOL)lParam );
1917 return TRUE;
1918 case WM_GETFONT:
1919 return (LRESULT)lphc->hFont;
1920 case WM_SETFOCUS:
1921 if( lphc->wState & CBF_EDIT ) {
1922 SetFocus( lphc->hWndEdit );
1923 /* The first time focus is received, select all the text */
1924 if( !(lphc->wState & CBF_BEENFOCUSED) ) {
1925 SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, -1);
1926 lphc->wState |= CBF_BEENFOCUSED;
1927 }
1928 }
1929 else
1930 COMBO_SetFocus( lphc );
1931 return TRUE;
1932 case WM_KILLFOCUS:
1933 {
1934 HWND hwndFocus = WIN_GetFullHandle( (HWND)wParam );
1935 if( !hwndFocus ||
1936 (hwndFocus != lphc->hWndEdit && hwndFocus != lphc->hWndLBox ))
1937 COMBO_KillFocus( lphc );
1938 return TRUE;
1939 }
1940 case WM_COMMAND:
1941 return COMBO_Command( lphc, wParam, WIN_GetFullHandle( (HWND)lParam ) );
1942 case WM_GETTEXT:
1943 return unicode ? COMBO_GetTextW( lphc, wParam, (LPWSTR)lParam )
1944 : COMBO_GetTextA( lphc, wParam, (LPSTR)lParam );
1945 case WM_SETTEXT:
1946 case WM_GETTEXTLENGTH:
1947 case WM_CLEAR:
1948 if ((message == WM_GETTEXTLENGTH) && !ISWIN31 && !(lphc->wState & CBF_EDIT))
1949 {
1950 int j = SendMessageW(lphc->hWndLBox, LB_GETCURSEL, 0, 0);
1951 if (j == -1) return 0;
1952 return unicode ? SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, j, 0) :
1953 SendMessageA(lphc->hWndLBox, LB_GETTEXTLEN, j, 0);
1954 }
1955 else if( lphc->wState & CBF_EDIT )
1956 {
1957 LRESULT ret;
1958 lphc->wState |= CBF_NOEDITNOTIFY;
1959 ret = unicode ? SendMessageW(lphc->hWndEdit, message, wParam, lParam) :
1960 SendMessageA(lphc->hWndEdit, message, wParam, lParam);
1961 lphc->wState &= ~CBF_NOEDITNOTIFY;
1962 return ret;
1963 }
1964 else return CB_ERR;
1965 case WM_CUT:
1966 case WM_PASTE:
1967 case WM_COPY:
1968 if( lphc->wState & CBF_EDIT )
1969 {
1970 return unicode ? SendMessageW(lphc->hWndEdit, message, wParam, lParam) :
1971 SendMessageA(lphc->hWndEdit, message, wParam, lParam);
1972 }
1973 else return CB_ERR;
1974
1975 case WM_DRAWITEM:
1976 case WM_DELETEITEM:
1977 case WM_COMPAREITEM:
1978 case WM_MEASUREITEM:
1979 return COMBO_ItemOp(lphc, message, lParam);
1980 case WM_ENABLE:
1981 if( lphc->wState & CBF_EDIT )
1982 EnableWindow( lphc->hWndEdit, (BOOL)wParam );
1983 EnableWindow( lphc->hWndLBox, (BOOL)wParam );
1984
1985 /* Force the control to repaint when the enabled state changes. */
1986 InvalidateRect(lphc->self, NULL, TRUE);
1987 return TRUE;
1988 case WM_SETREDRAW:
1989 if( wParam )
1990 lphc->wState &= ~CBF_NOREDRAW;
1991 else
1992 lphc->wState |= CBF_NOREDRAW;
1993
1994 if( lphc->wState & CBF_EDIT )
1997 return 0;
1998 case WM_SYSKEYDOWN:
1999#ifdef __REACTOS__
2000 if( KF_ALTDOWN & HIWORD(lParam) )
2001#else
2002 if( KEYDATA_ALT & HIWORD(lParam) )
2003#endif
2004 if( wParam == VK_UP || wParam == VK_DOWN )
2005 COMBO_FlipListbox( lphc, FALSE, FALSE );
2006 return 0;
2007
2008 case WM_KEYDOWN:
2009 if ((wParam == VK_RETURN || wParam == VK_ESCAPE) &&
2010 (lphc->wState & CBF_DROPPED))
2011 {
2012 CBRollUp( lphc, wParam == VK_RETURN, FALSE );
2013 return TRUE;
2014 }
2015 else if ((wParam == VK_F4) && !(lphc->wState & CBF_EUI))
2016 {
2017 COMBO_FlipListbox( lphc, FALSE, FALSE );
2018 return TRUE;
2019 }
2020 /* fall through */
2021 case WM_CHAR:
2022 case WM_IME_CHAR:
2023 {
2024 HWND hwndTarget;
2025
2026 if( lphc->wState & CBF_EDIT )
2027 hwndTarget = lphc->hWndEdit;
2028 else
2029 hwndTarget = lphc->hWndLBox;
2030
2031 return unicode ? SendMessageW(hwndTarget, message, wParam, lParam) :
2032 SendMessageA(hwndTarget, message, wParam, lParam);
2033 }
2034 case WM_LBUTTONDOWN:
2035 if( !(lphc->wState & CBF_FOCUSED) ) SetFocus( lphc->self );
2036 if( lphc->wState & CBF_FOCUSED ) COMBO_LButtonDown( lphc, lParam );
2037 return TRUE;
2038 case WM_LBUTTONUP:
2039 COMBO_LButtonUp( lphc );
2040 return TRUE;
2041 case WM_MOUSEMOVE:
2042 if( lphc->wState & CBF_CAPTURE )
2043 COMBO_MouseMove( lphc, wParam, lParam );
2044 return TRUE;
2045
2046 case WM_MOUSEWHEEL:
2047 if (wParam & (MK_SHIFT | MK_CONTROL))
2048 return unicode ? DefWindowProcW(hwnd, message, wParam, lParam) :
2050
2051 if (GET_WHEEL_DELTA_WPARAM(wParam) > 0) return SendMessageW(hwnd, WM_KEYDOWN, VK_UP, 0);
2052 if (GET_WHEEL_DELTA_WPARAM(wParam) < 0) return SendMessageW(hwnd, WM_KEYDOWN, VK_DOWN, 0);
2053 return TRUE;
2054
2055 case WM_CTLCOLOR:
2056 case WM_CTLCOLORMSGBOX:
2057 case WM_CTLCOLOREDIT:
2058 case WM_CTLCOLORLISTBOX:
2059 case WM_CTLCOLORBTN:
2060 case WM_CTLCOLORDLG:
2062 case WM_CTLCOLORSTATIC:
2063#ifdef __REACTOS__
2064 if ( pWnd && !(pWnd->state2 & WNDS2_WIN40COMPAT) ) break; // Must be Win 4.0 and above.
2065#endif
2066 if (lphc->owner)
2067 return SendMessageW(lphc->owner, message, wParam, lParam);
2068 break;
2069
2070 /* Combo messages */
2071
2072 case CB_ADDSTRING:
2073 if( unicode )
2074 {
2075 if( lphc->dwStyle & CBS_LOWERCASE )
2077 else if( lphc->dwStyle & CBS_UPPERCASE )
2079 return SendMessageW(lphc->hWndLBox, LB_ADDSTRING, 0, lParam);
2080 }
2081 else /* unlike the unicode version, the ansi version does not overwrite
2082 the string if converting case */
2083 {
2084 char *string = NULL;
2085 LRESULT ret;
2086 if( lphc->dwStyle & CBS_LOWERCASE )
2087 {
2088 string = strdupA((LPSTR)lParam);
2089 CharLowerA(string);
2090 }
2091
2092 else if( lphc->dwStyle & CBS_UPPERCASE )
2093 {
2094 string = strdupA((LPSTR)lParam);
2095 CharUpperA(string);
2096 }
2097
2098 ret = SendMessageA(lphc->hWndLBox, LB_ADDSTRING, 0, string ? (LPARAM)string : lParam);
2099 HeapFree(GetProcessHeap(), 0, string);
2100 return ret;
2101 }
2102 case CB_INSERTSTRING:
2103 if( unicode )
2104 {
2105 if( lphc->dwStyle & CBS_LOWERCASE )
2107 else if( lphc->dwStyle & CBS_UPPERCASE )
2110 }
2111 else
2112 {
2113 if( lphc->dwStyle & CBS_LOWERCASE )
2115 else if( lphc->dwStyle & CBS_UPPERCASE )
2117
2119 }
2120 case CB_DELETESTRING:
2121 return unicode ? SendMessageW(lphc->hWndLBox, LB_DELETESTRING, wParam, 0) :
2122 SendMessageA(lphc->hWndLBox, LB_DELETESTRING, wParam, 0);
2123 case CB_SELECTSTRING:
2124 return COMBO_SelectString(lphc, (INT)wParam, lParam, unicode);
2125 case CB_FINDSTRING:
2126 return unicode ? SendMessageW(lphc->hWndLBox, LB_FINDSTRING, wParam, lParam) :
2127 SendMessageA(lphc->hWndLBox, LB_FINDSTRING, wParam, lParam);
2128 case CB_FINDSTRINGEXACT:
2129 return unicode ? SendMessageW(lphc->hWndLBox, LB_FINDSTRINGEXACT, wParam, lParam) :
2130 SendMessageA(lphc->hWndLBox, LB_FINDSTRINGEXACT, wParam, lParam);
2131 case CB_SETITEMHEIGHT:
2132 return COMBO_SetItemHeight( lphc, (INT)wParam, (INT)lParam);
2133 case CB_GETITEMHEIGHT:
2134 if( (INT)wParam >= 0 ) /* listbox item */
2135 return SendMessageW(lphc->hWndLBox, LB_GETITEMHEIGHT, wParam, 0);
2136 return CBGetTextAreaHeight(hwnd, lphc);
2137 case CB_RESETCONTENT:
2139 if( (lphc->wState & CBF_EDIT) && CB_HASSTRINGS(lphc) )
2140 {
2141 static const WCHAR empty_stringW[] = { 0 };
2143 }
2144 else
2145 InvalidateRect(lphc->self, NULL, TRUE);
2146 return TRUE;
2147 case CB_INITSTORAGE:
2150 return SendMessageW(lphc->hWndLBox, LB_GETHORIZONTALEXTENT, 0, 0);
2153 case CB_GETTOPINDEX:
2154 return SendMessageW(lphc->hWndLBox, LB_GETTOPINDEX, 0, 0);
2155 case CB_GETLOCALE:
2156 return SendMessageW(lphc->hWndLBox, LB_GETLOCALE, 0, 0);
2157 case CB_SETLOCALE:
2158 return SendMessageW(lphc->hWndLBox, LB_SETLOCALE, wParam, 0);
2159 case CB_SETDROPPEDWIDTH:
2160 if( (CB_GETTYPE(lphc) == CBS_SIMPLE) ||
2161 (INT)wParam >= 32768 )
2162 return CB_ERR;
2163 /* new value must be higher than combobox width */
2164 if((INT)wParam >= lphc->droppedRect.right - lphc->droppedRect.left)
2165 lphc->droppedWidth = wParam;
2166 else if(wParam)
2167 lphc->droppedWidth = 0;
2168
2169 /* recalculate the combobox area */
2170 CBCalcPlacement(hwnd, lphc, &lphc->textRect, &lphc->buttonRect, &lphc->droppedRect );
2171
2172 /* fall through */
2173 case CB_GETDROPPEDWIDTH:
2174 if( lphc->droppedWidth )
2175 return lphc->droppedWidth;
2176 return lphc->droppedRect.right - lphc->droppedRect.left;
2179 return CB_OKAY;
2180 case CB_GETDROPPEDSTATE:
2181 return (lphc->wState & CBF_DROPPED) != 0;
2182 case CB_DIR:
2183 return unicode ? SendMessageW(lphc->hWndLBox, LB_DIR, wParam, lParam) :
2184 SendMessageA(lphc->hWndLBox, LB_DIR, wParam, lParam);
2185
2186 case CB_SHOWDROPDOWN:
2187 if( CB_GETTYPE(lphc) != CBS_SIMPLE )
2188 {
2189 if( wParam )
2190 {
2191 if( !(lphc->wState & CBF_DROPPED) )
2192 CBDropDown( lphc );
2193 }
2194 else
2195 if( lphc->wState & CBF_DROPPED )
2196 CBRollUp( lphc, FALSE, TRUE );
2197 }
2198 return TRUE;
2199 case CB_GETCOUNT:
2200 return SendMessageW(lphc->hWndLBox, LB_GETCOUNT, 0, 0);
2201 case CB_GETCURSEL:
2202 return SendMessageW(lphc->hWndLBox, LB_GETCURSEL, 0, 0);
2203 case CB_SETCURSEL:
2205 if( lParam >= 0 )
2207
2208 /* no LBN_SELCHANGE in this case, update manually */
2209 CBPaintText( lphc, NULL );
2210 lphc->wState &= ~CBF_SELCHANGE;
2211 return lParam;
2212 case CB_GETLBTEXT:
2213 return unicode ? SendMessageW(lphc->hWndLBox, LB_GETTEXT, wParam, lParam) :
2214 SendMessageA(lphc->hWndLBox, LB_GETTEXT, wParam, lParam);
2215 case CB_GETLBTEXTLEN:
2216 return unicode ? SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, wParam, 0) :
2217 SendMessageA(lphc->hWndLBox, LB_GETTEXTLEN, wParam, 0);
2218 case CB_GETITEMDATA:
2219 return SendMessageW(lphc->hWndLBox, LB_GETITEMDATA, wParam, 0);
2220 case CB_SETITEMDATA:
2222 case CB_GETEDITSEL:
2223 /* Edit checks passed parameters itself */
2224 if( lphc->wState & CBF_EDIT )
2225 return SendMessageW(lphc->hWndEdit, EM_GETSEL, wParam, lParam);
2226 return CB_ERR;
2227 case CB_SETEDITSEL:
2228 if( lphc->wState & CBF_EDIT )
2229 return SendMessageW(lphc->hWndEdit, EM_SETSEL,
2231 return CB_ERR;
2232 case CB_SETEXTENDEDUI:
2233 if( CB_GETTYPE(lphc) == CBS_SIMPLE )
2234 return CB_ERR;
2235 if( wParam )
2236 lphc->wState |= CBF_EUI;
2237 else lphc->wState &= ~CBF_EUI;
2238 return CB_OKAY;
2239 case CB_GETEXTENDEDUI:
2240 return (lphc->wState & CBF_EUI) != 0;
2241 case CB_GETCOMBOBOXINFO:
2242 return COMBO_GetComboBoxInfo(lphc, (COMBOBOXINFO *)lParam);
2243 case CB_LIMITTEXT:
2244 if( lphc->wState & CBF_EDIT )
2246 return TRUE;
2247
2248#ifdef __REACTOS__
2249 case WM_UPDATEUISTATE:
2250 if (unicode)
2252 else
2254
2255 if (COMBO_update_uistate(lphc))
2256 {
2257 /* redraw text */
2258 if( !(lphc->wState & CBF_EDIT) )
2259 NtUserInvalidateRect(lphc->self, &lphc->textRect, TRUE);
2260 }
2261 break;
2262
2263 case WM_CBLOSTTEXTFOCUS: /* undocumented message - deselects the text when focus is lost */
2264 if (lphc->hWndEdit != NULL)
2265 {
2266 SendMessage(lphc->self, WM_LBUTTONUP, 0, 0xFFFFFFFF);
2267 SendMessage(lphc->hWndEdit, EM_SETSEL, 0, 0);
2268 lphc->wState &= ~(CBF_FOCUSED | CBF_BEENFOCUSED);
2269 CB_NOTIFY(lphc, CBN_KILLFOCUS);
2270 }
2271 return TRUE;
2272
2273#endif
2274
2275 default:
2276 if (message >= WM_USER)
2277 WARN("unknown msg WM_USER+%04x wp=%04lx lp=%08lx\n",
2279 break;
2280 }
2281 return unicode ? DefWindowProcW(hwnd, message, wParam, lParam) :
2283}
signed short INT16
#define WARN(fmt,...)
Definition: debug.h:112
struct HEADCOMBO * LPHEADCOMBO
#define CBF_EDIT
Definition: controls.h:51
#define CBF_NOREDRAW
Definition: controls.h:54
#define CBF_FOCUSED
Definition: controls.h:49
#define CBF_CAPTURE
Definition: controls.h:50
#define CBF_EUI
Definition: controls.h:59
#define CBF_BEENFOCUSED
Definition: controls.h:58
#define CBF_NOEDITNOTIFY
Definition: controls.h:56
#define CBF_NORESIZE
Definition: controls.h:52
static HWND hwndParent
Definition: cryptui.c:300
static LRESULT COMBO_Paint(HEADCOMBO *lphc, HDC hdc)
Definition: combo.c:842
static LRESULT COMBO_NCDestroy(HEADCOMBO *lphc)
Definition: combo.c:157
static LRESULT COMBO_NCCreate(HWND hwnd, LONG style)
Definition: combo.c:122
#define ISWIN31
Definition: combo.c:61
static void COMBO_LButtonDown(LPHEADCOMBO lphc, LPARAM lParam)
Definition: combo.c:1582
#define CB_GETTYPE(lphc)
Definition: combo.c:59
static void COMBO_KillFocus(LPHEADCOMBO lphc)
Definition: combo.c:1162
static void COMBO_MouseMove(LPHEADCOMBO lphc, WPARAM wParam, LPARAM lParam)
Definition: combo.c:1660
static void CBCalcPlacement(HWND hwnd, LPHEADCOMBO lphc, LPRECT lprEdit, LPRECT lprButton, LPRECT lprLB)
Definition: combo.c:311
static LRESULT COMBO_GetComboBoxInfo(const HEADCOMBO *lphc, COMBOBOXINFO *pcbi)
Definition: combo.c:1694
static void COMBO_SetFocus(LPHEADCOMBO lphc)
Definition: combo.c:1140
static void CBPaintText(HEADCOMBO *lphc, HDC hdc_paint)
Definition: combo.c:659
static LRESULT COMBO_Command(LPHEADCOMBO lphc, WPARAM wParam, HWND hWnd)
Definition: combo.c:1188
static void COMBO_LButtonUp(LPHEADCOMBO lphc)
Definition: combo.c:1627
#define CB_HASSTRINGS(lphc)
Definition: combo.c:57
static void COMBO_Size(LPHEADCOMBO lphc)
Definition: combo.c:1436
#define KEYDATA_ALT
Definition: combo.c:44
static INT CBGetTextAreaHeight(HWND hwnd, LPHEADCOMBO lphc)
Definition: combo.c:185
static LRESULT COMBO_ItemOp(LPHEADCOMBO lphc, UINT msg, LPARAM lParam)
Definition: combo.c:1297
static LRESULT COMBO_SelectString(LPHEADCOMBO lphc, INT start, LPARAM pText)
Definition: combo.c:1564
BOOL COMBO_FlipListbox(LPHEADCOMBO lphc, BOOL ok, BOOL bRedrawButton)
Definition: combo.c:1116
static LRESULT COMBO_SetItemHeight(LPHEADCOMBO lphc, INT index, INT height)
Definition: combo.c:1525
static void COMBO_Font(LPHEADCOMBO lphc, HFONT hFont, BOOL bRedraw)
Definition: combo.c:1488
#define CB_NOTIFY(lphc, code)
Definition: combo.c:51
static void CBGetDroppedControlRect(LPHEADCOMBO lphc, LPRECT lpRect)
Definition: combo.c:421
static LRESULT COMBO_Create(HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG style)
Definition: combo.c:436
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
GLuint64EXT * result
Definition: glext.h:11304
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
#define WNDS2_WIN40COMPAT
Definition: ntuser.h:645
#define FNID_COMBOBOX
Definition: ntuser.h:862
BOOL NTAPI NtUserInvalidateRect(HWND hWnd, CONST RECT *lpRect, BOOL bErase)
Definition: painting.c:2547
WORD vk
Definition: input.c:77
RECT buttonRect
Definition: comctl32.h:152
RECT textRect
Definition: comctl32.h:151
RECT droppedRect
Definition: comctl32.h:153
HWND hWndLBox
Definition: comctl32.h:148
HWND owner
Definition: comctl32.h:145
HWND hWndEdit
Definition: comctl32.h:147
HWND self
Definition: comctl32.h:144
HFONT hFont
Definition: comctl32.h:150
INT droppedWidth
Definition: comctl32.h:156
UINT dwStyle
Definition: comctl32.h:146
DWORD state2
Definition: ntuser.h:697
LONG left
Definition: windef.h:306
#define WM_MOUSEWHEEL
Definition: treelist.c:96
int32_t INT
Definition: typedefs.h:58
#define WM_CBLOSTTEXTFOCUS
Definition: undocuser.h:50
const char * SPY_GetMsgName(UINT msg, HWND hWnd)
Definition: spy.c:2218
#define WIN_GetFullHandle(h)
Definition: user_x.h:108
int ret
static LRESULT COMBO_GetTextW(LPHEADCOMBO lphc, INT count, LPWSTR buf)
Definition: combo.c:1384
static char * strdupA(LPCSTR str)
Definition: combo.c:1803
static LRESULT COMBO_GetTextA(LPHEADCOMBO lphc, INT count, LPSTR buf)
Definition: combo.c:1434
static const WCHAR empty_stringW[]
Definition: edit.c:173
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define WM_CTLCOLOR
Definition: windowsx.h:29
#define CB_SELECTSTRING
Definition: winuser.h:1950
#define CB_SETITEMDATA
Definition: winuser.h:1956
#define CB_GETHORIZONTALEXTENT
Definition: winuser.h:1939
#define MK_SHIFT
Definition: winuser.h:2359
#define LB_GETCOUNT
Definition: winuser.h:2028
#define WM_GETTEXTLENGTH
Definition: winuser.h:1609
#define CB_SETDROPPEDWIDTH
Definition: winuser.h:1952
#define LB_FINDSTRINGEXACT
Definition: winuser.h:2025
#define CB_GETLBTEXTLEN
Definition: winuser.h:1943
#define LB_GETITEMDATA
Definition: winuser.h:2031
#define EM_LIMITTEXT
Definition: winuser.h:1990
#define CB_GETLBTEXT
Definition: winuser.h:1942
#define WM_PASTE
Definition: winuser.h:1853
#define LB_SETHORIZONTALEXTENT
Definition: winuser.h:2054
#define CB_OKAY
Definition: winuser.h:2424
#define LB_GETTEXT
Definition: winuser.h:2039
#define LB_SETTOPINDEX
Definition: winuser.h:2060
#define DLGC_WANTCHARS
Definition: winuser.h:2608
#define CB_SHOWDROPDOWN
Definition: winuser.h:1960
#define CB_GETITEMHEIGHT
Definition: winuser.h:1941
#define EM_GETSEL
Definition: winuser.h:1987
#define CB_SETHORIZONTALEXTENT
Definition: winuser.h:1955
#define LB_DIR
Definition: winuser.h:2023
#define WM_SIZE
Definition: winuser.h:1601
#define WM_COMMAND
Definition: winuser.h:1730
#define KF_ALTDOWN
Definition: winuser.h:2439
struct tagCREATESTRUCTA * LPCREATESTRUCTA
LPWSTR WINAPI CharLowerW(_Inout_ LPWSTR)
#define CB_INITSTORAGE
Definition: winuser.h:1946
#define CB_ERR
Definition: winuser.h:2425
LPSTR WINAPI CharLowerA(_Inout_ LPSTR)
#define CB_SETCURSEL
Definition: winuser.h:1951
#define LB_GETTOPINDEX
Definition: winuser.h:2041
#define VK_UP
Definition: winuser.h:2215
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define LB_GETLOCALE
Definition: winuser.h:2035
#define WM_GETTEXT
Definition: winuser.h:1608
#define WM_CTLCOLORSCROLLBAR
Definition: winuser.h:1761
LPSTR WINAPI CharUpperA(_Inout_ LPSTR)
#define WM_CUT
Definition: winuser.h:1851
#define LB_SETLOCALE
Definition: winuser.h:2057
#define CB_RESETCONTENT
Definition: winuser.h:1949
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1930
#define LB_ADDSTRING
Definition: winuser.h:2021
#define CB_DIR
Definition: winuser.h:1928
#define CB_GETCOUNT
Definition: winuser.h:1932
#define CB_GETDROPPEDWIDTH
Definition: winuser.h:1936
#define WM_DELETEITEM
Definition: winuser.h:1637
#define CB_GETCOMBOBOXINFO
Definition: winuser.h:1931
#define WM_CTLCOLORMSGBOX
Definition: winuser.h:1756
#define WM_DRAWITEM
Definition: winuser.h:1635
#define CB_SETLOCALE
Definition: winuser.h:1958
#define WM_NCCREATE
Definition: winuser.h:1673
#define CBS_SIMPLE
Definition: winuser.h:291
#define WM_IME_CHAR
Definition: winuser.h:1824
#define LB_RESETCONTENT
Definition: winuser.h:2045
#define LB_DELETESTRING
Definition: winuser.h:2022
#define VK_RETURN
Definition: winuser.h:2191
#define CB_GETDROPPEDCONTROLRECT
Definition: winuser.h:1934
#define LB_FINDSTRING
Definition: winuser.h:2024
#define MK_CONTROL
Definition: winuser.h:2360
#define LB_GETITEMHEIGHT
Definition: winuser.h:2032
#define LB_GETHORIZONTALEXTENT
Definition: winuser.h:2030
#define DLGC_WANTARROWS
Definition: winuser.h:2600
#define LB_INSERTSTRING
Definition: winuser.h:2043
#define CB_ADDSTRING
Definition: winuser.h:1926
#define CB_GETITEMDATA
Definition: winuser.h:1940
#define SendMessage
Definition: winuser.h:5833
#define CBN_KILLFOCUS
Definition: winuser.h:1968
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define CBS_LOWERCASE
Definition: winuser.h:286
#define EM_SETSEL
Definition: winuser.h:2008
#define WM_MEASUREITEM
Definition: winuser.h:1636
#define CB_SETEDITSEL
Definition: winuser.h:1953
#define VK_F4
Definition: winuser.h:2248
#define CB_GETDROPPEDSTATE
Definition: winuser.h:1935
#define WM_CHAR
Definition: winuser.h:1707
#define LB_GETTEXTLEN
Definition: winuser.h:2040
#define LB_SETITEMDATA
Definition: winuser.h:2055
#define CB_GETEXTENDEDUI
Definition: winuser.h:1938
#define VK_DOWN
Definition: winuser.h:2217
#define WM_COPY
Definition: winuser.h:1852
#define CB_GETTOPINDEX
Definition: winuser.h:1945
#define CB_LIMITTEXT
Definition: winuser.h:1948
#define WM_USER
Definition: winuser.h:1885
#define CB_GETEDITSEL
Definition: winuser.h:1937
#define WM_CTLCOLORLISTBOX
Definition: winuser.h:1758
#define DLGC_WANTMESSAGE
Definition: winuser.h:2603
#define CB_FINDSTRING
Definition: winuser.h:1929
#define LB_SETCURSEL
Definition: winuser.h:2053
#define WM_CLEAR
Definition: winuser.h:1854
#define CBS_UPPERCASE
Definition: winuser.h:293
#define CB_SETEXTENDEDUI
Definition: winuser.h:1954
#define WM_COMPAREITEM
Definition: winuser.h:1645
#define CB_INSERTSTRING
Definition: winuser.h:1947
#define LB_GETCURSEL
Definition: winuser.h:2029
#define CB_GETCURSEL
Definition: winuser.h:1933
#define CB_DELETESTRING
Definition: winuser.h:1927
#define CB_GETLOCALE
Definition: winuser.h:1944
#define CB_SETITEMHEIGHT
Definition: winuser.h:1957
#define LB_INITSTORAGE
Definition: winuser.h:2042
#define WM_CTLCOLOREDIT
Definition: winuser.h:1757
#define VK_ESCAPE
Definition: winuser.h:2204
#define WM_CTLCOLORDLG
Definition: winuser.h:1760
struct tagCREATESTRUCTW * LPCREATESTRUCTW
#define WM_SYSKEYDOWN
Definition: winuser.h:1709
#define WM_SETREDRAW
Definition: winuser.h:1606
LPWSTR WINAPI CharUpperW(_Inout_ LPWSTR)
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by RegisterClientPFN().

◆ ComboWndProcA()

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

Referenced by RegisterClientPFN().

◆ ComboWndProcW()

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

Referenced by RegisterClientPFN().

◆ DesktopWndProcA()

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

Definition at line 1307 of file message.c.

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

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:
49 {
50 LRESULT lResult;
52 TRACE("Desktop lResult %d\n", lResult);
53 return lResult;
54 }
55
57 if (Wnd == (HWND)wParam) break;
59 {
60 HDC hdc = GetWindowDC( Wnd );
62 ReleaseDC( Wnd, hdc );
63 break;
64 }
65
66 case WM_SETCURSOR:
68
69 default:
70 return DefWindowProcW(Wnd, Msg, wParam, lParam);
71 }
72 return 0;
73}
struct @1609 Msg[]
BOOL NTAPI NtUserMessageCall(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ResultInfo, DWORD dwType, BOOL Ansi)
Definition: message.c:2486
#define FNID_DESKTOP
Definition: ntuser.h:857
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define WM_QUERYNEWPALETTE
Definition: winuser.h:1868
#define WM_CLOSE
Definition: winuser.h:1611
HDC WINAPI GetWindowDC(_In_opt_ HWND)
#define WM_PALETTECHANGED
Definition: winuser.h:1867
#define IDC_ARROW
Definition: winuser.h:682
BOOL WINAPI PaintDesktop(_In_ HDC)
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
#define WM_SETCURSOR
Definition: winuser.h:1626
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by DesktopWndProcA(), and RegisterClientPFN().

◆ EditWndProc_common()

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

Definition at line 4844 of file edit.c.

4846{
4848 LRESULT result = 0;
4849#ifdef __REACTOS__
4850 /* ReactOS r50219 */
4851 PWND pWnd;
4852
4853 pWnd = ValidateHwnd(hwnd);
4854 if (pWnd)
4855 {
4856 if (!pWnd->fnid)
4857 {
4859 }
4860 else
4861 {
4862 if (pWnd->fnid != FNID_EDIT)
4863 {
4864 ERR("Wrong window class for Edit! fnId 0x%x\n",pWnd->fnid);
4865 return 0;
4866 }
4867 }
4868 }
4869#endif
4870
4871 TRACE("hwnd=%p msg=%x (%s) wparam=%lx lparam=%lx\n", hwnd, msg, SPY_GetMsgName(msg, hwnd), wParam, lParam);
4872
4873 if (!es && msg != WM_NCCREATE)
4874 return DefWindowProcT(hwnd, msg, wParam, lParam, unicode);
4875
4876 if (es && (msg != WM_NCDESTROY)) EDIT_LockBuffer(es);
4877
4878 switch (msg) {
4879 case EM_GETSEL:
4881 break;
4882
4883 case EM_SETSEL:
4886 result = 1;
4887 break;
4888
4889 case EM_GETRECT:
4890 if (lParam)
4891 CopyRect((LPRECT)lParam, &es->format_rect);
4892 break;
4893
4894 case EM_SETRECT:
4895 if ((es->style & ES_MULTILINE) && lParam) {
4898 }
4899 break;
4900
4901 case EM_SETRECTNP:
4902 if ((es->style & ES_MULTILINE) && lParam)
4904 break;
4905
4906 case EM_SCROLL:
4908 break;
4909
4910 case EM_LINESCROLL:
4912 break;
4913
4914 case EM_SCROLLCARET:
4916 result = 1;
4917 break;
4918
4919 case EM_GETMODIFY:
4920 result = ((es->flags & EF_MODIFIED) != 0);
4921 break;
4922
4923 case EM_SETMODIFY:
4924 if (wParam)
4925 es->flags |= EF_MODIFIED;
4926 else
4927 es->flags &= ~(EF_MODIFIED | EF_UPDATE); /* reset pending updates */
4928 break;
4929
4930 case EM_GETLINECOUNT:
4931 result = (es->style & ES_MULTILINE) ? es->line_count : 1;
4932 break;
4933
4934 case EM_LINEINDEX:
4936 break;
4937
4938 case EM_SETHANDLE:
4940 break;
4941
4942 case EM_GETHANDLE:
4944 break;
4945
4946 case EM_GETTHUMB:
4948 break;
4949
4950 /* these messages missing from specs */
4951 case 0x00bf:
4952 case 0x00c0:
4953 case 0x00c3:
4954 case 0x00ca:
4955 FIXME("undocumented message 0x%x, please report\n", msg);
4957 break;
4958
4959 case EM_LINELENGTH:
4961 break;
4962
4963 case EM_REPLACESEL:
4964 {
4965 LPWSTR textW;
4966
4967 if(unicode)
4968 textW = (LPWSTR)lParam;
4969 else
4970 {
4972 INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0);
4973 if (!(textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR)))) break;
4974 MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW);
4975 }
4976
4978 result = 1;
4979
4980 if(!unicode)
4982 break;
4983 }
4984
4985 case EM_GETLINE:
4987 break;
4988
4989 case EM_SETLIMITTEXT:
4991 break;
4992
4993 case EM_CANUNDO:
4995 break;
4996
4997 case EM_UNDO:
4998 case WM_UNDO:
5000 break;
5001
5002 case EM_FMTLINES:
5004 break;
5005
5006 case EM_LINEFROMCHAR:
5008 break;
5009
5010 case EM_SETTABSTOPS:
5012 break;
5013
5014 case EM_SETPASSWORDCHAR:
5015 {
5016 WCHAR charW = 0;
5017
5018 if(unicode)
5019 charW = (WCHAR)wParam;
5020 else
5021 {
5022 CHAR charA = wParam;
5023 MultiByteToWideChar(CP_ACP, 0, &charA, 1, &charW, 1);
5024 }
5025
5027 break;
5028 }
5029
5030 case EM_EMPTYUNDOBUFFER:
5032 break;
5033
5035 result = (es->style & ES_MULTILINE) ? es->y_offset : es->x_offset;
5036 break;
5037
5038 case EM_SETREADONLY:
5039 {
5040 DWORD old_style = es->style;
5041
5042 if (wParam) {
5045 es->style |= ES_READONLY;
5046 } else {
5049 es->style &= ~ES_READONLY;
5050 }
5051
5052 if (old_style ^ es->style)
5053 InvalidateRect(es->hwndSelf, NULL, TRUE);
5054
5055 result = 1;
5056 break;
5057 }
5058
5061 break;
5062
5064 result = (LRESULT)es->word_break_proc;
5065 break;
5066
5067 case EM_GETPASSWORDCHAR:
5068 {
5069 if(unicode)
5070 result = es->password_char;
5071 else
5072 {
5073 WCHAR charW = es->password_char;
5074 CHAR charA = 0;
5075 WideCharToMultiByte(CP_ACP, 0, &charW, 1, &charA, 1, NULL, NULL);
5076 result = charA;
5077 }
5078 break;
5079 }
5080
5081 case EM_SETMARGINS:
5083 break;
5084
5085 case EM_GETMARGINS:
5086 result = MAKELONG(es->left_margin, es->right_margin);
5087 break;
5088
5089 case EM_GETLIMITTEXT:
5090 result = es->buffer_limit;
5091 break;
5092
5093 case EM_POSFROMCHAR:
5094 if ((INT)wParam >= get_text_length(es)) result = -1;
5096 break;
5097
5098 case EM_CHARFROMPOS:
5099 result = EDIT_EM_CharFromPos(es, (short)LOWORD(lParam), (short)HIWORD(lParam));
5100 break;
5101
5102 /* End of the EM_ messages which were in numerical order; what order
5103 * are these in? vaguely alphabetical?
5104 */
5105
5106 case WM_NCCREATE:
5108 break;
5109
5110 case WM_NCDESTROY:
5112#ifdef __REACTOS__
5114#endif
5115 es = NULL;
5116 break;
5117
5118 case WM_GETDLGCODE:
5120
5121 if (es->style & ES_MULTILINE)
5123
5124 if (lParam)
5125 {
5126 es->flags|=EF_DIALOGMODE;
5127
5128 if (((LPMSG)lParam)->message == WM_KEYDOWN)
5129 {
5130 int vk = (int)((LPMSG)lParam)->wParam;
5131
5132 if (es->hwndListBox)
5133 {
5134 if (vk == VK_RETURN || vk == VK_ESCAPE)
5137 }
5138 }
5139 }
5140 break;
5141
5142 case WM_IME_CHAR:
5143#ifdef __REACTOS__
5144 /* Rely on DefWindowProc */
5145 result = DefWindowProcT(hwnd, msg, wParam, lParam, unicode);
5146 break;
5147#else
5148 if (!unicode)
5149 {
5150 WCHAR charW;
5151 CHAR strng[2];
5152
5153 strng[0] = wParam >> 8;
5154 strng[1] = wParam & 0xff;
5155 if (strng[0]) MultiByteToWideChar(CP_ACP, 0, strng, 2, &charW, 1);
5156 else MultiByteToWideChar(CP_ACP, 0, &strng[1], 1, &charW, 1);
5157 result = EDIT_WM_Char(es, charW);
5158 break;
5159 }
5160 /* fall through */
5161#endif
5162 case WM_CHAR:
5163 {
5164 WCHAR charW;
5165
5166 if(unicode)
5167 charW = wParam;
5168 else
5169 {
5170 CHAR charA = wParam;
5171 MultiByteToWideChar(CP_ACP, 0, &charA, 1, &charW, 1);
5172 }
5173
5174 if (es->hwndListBox)
5175 {
5176 if (charW == VK_RETURN || charW == VK_ESCAPE)
5177 {
5180 break;
5181 }
5182 }
5183 result = EDIT_WM_Char(es, charW);
5184 break;
5185 }
5186
5187 case WM_UNICHAR:
5188 if (unicode)
5189 {
5190 if (wParam == UNICODE_NOCHAR) return TRUE;
5191 if (wParam <= 0x000fffff)
5192 {
5193 if(wParam > 0xffff) /* convert to surrogates */
5194 {
5195 wParam -= 0x10000;
5196 EDIT_WM_Char(es, (wParam >> 10) + 0xd800);
5197 EDIT_WM_Char(es, (wParam & 0x03ff) + 0xdc00);
5198 }
5199 else EDIT_WM_Char(es, wParam);
5200 }
5201 return 0;
5202 }
5203 break;
5204
5205 case WM_CLEAR:
5207 break;
5208
5209 case WM_CONTEXTMENU:
5210 EDIT_WM_ContextMenu(es, (short)LOWORD(lParam), (short)HIWORD(lParam));
5211 break;
5212
5213 case WM_COPY:
5215 break;
5216
5217 case WM_CREATE:
5218 if(unicode)
5220 else
5221 {
5222 LPCSTR nameA = ((LPCREATESTRUCTA)lParam)->lpszName;
5223 LPWSTR nameW = NULL;
5224 if(nameA)
5225 {
5226 INT countW = MultiByteToWideChar(CP_ACP, 0, nameA, -1, NULL, 0);
5227 if((nameW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR))))
5228 MultiByteToWideChar(CP_ACP, 0, nameA, -1, nameW, countW);
5229 }
5232 }
5233 break;
5234
5235 case WM_CUT:
5236 EDIT_WM_Cut(es);
5237 break;
5238
5239 case WM_ENABLE:
5240 es->bEnableState = (BOOL) wParam;
5242 break;
5243
5244 case WM_ERASEBKGND:
5245 /* we do the proper erase in EDIT_WM_Paint */
5246 result = 1;
5247 break;
5248
5249 case WM_GETFONT:
5250 result = (LRESULT)es->font;
5251 break;
5252
5253 case WM_GETTEXT:
5255 break;
5256
5257 case WM_GETTEXTLENGTH:
5258 if (unicode) result = get_text_length(es);
5260 NULL, 0, NULL, NULL );
5261 break;
5262
5263 case WM_HSCROLL:
5265 break;
5266
5267 case WM_KEYDOWN:
5269 break;
5270
5271 case WM_KILLFOCUS:
5273 break;
5274
5275 case WM_LBUTTONDBLCLK:
5277 break;
5278
5279 case WM_LBUTTONDOWN:
5281 break;
5282
5283 case WM_LBUTTONUP:
5285 break;
5286
5287 case WM_MBUTTONDOWN:
5289 break;
5290
5291 case WM_MOUSEMOVE:
5292 result = EDIT_WM_MouseMove(es, (short)LOWORD(lParam), (short)HIWORD(lParam));
5293 break;
5294
5295 case WM_PRINTCLIENT:
5296 case WM_PAINT:
5298 break;
5299
5300 case WM_PASTE:
5302 break;
5303
5304 case WM_SETFOCUS:
5306 break;
5307
5308 case WM_SETFONT:
5310 break;
5311
5312 case WM_SETREDRAW:
5313 /* FIXME: actually set an internal flag and behave accordingly */
5314 break;
5315
5316 case WM_SETTEXT:
5317 EDIT_WM_SetText(es, (LPCWSTR)lParam, unicode);
5318 result = TRUE;
5319 break;
5320
5321 case WM_SIZE:
5323 break;
5324
5325 case WM_STYLECHANGED:
5327 break;
5328
5329 case WM_STYLECHANGING:
5330 result = 0; /* See EDIT_WM_StyleChanged */
5331 break;
5332
5333 case WM_SYSKEYDOWN:
5335 break;
5336
5337 case WM_TIMER:
5339 break;
5340
5341 case WM_VSCROLL:
5343 break;
5344
5345 case WM_MOUSEWHEEL:
5346 {
5347 int wheelDelta;
5348 UINT pulScrollLines = 3;
5349 SystemParametersInfoW(SPI_GETWHEELSCROLLLINES,0, &pulScrollLines, 0);
5350
5351 if (wParam & (MK_SHIFT | MK_CONTROL)) {
5353 break;
5354 }
5355 wheelDelta = GET_WHEEL_DELTA_WPARAM(wParam);
5356 /* if scrolling changes direction, ignore left overs */
5357 if ((wheelDelta < 0 && es->wheelDeltaRemainder < 0) ||
5358 (wheelDelta > 0 && es->wheelDeltaRemainder > 0))
5359 es->wheelDeltaRemainder += wheelDelta;
5360 else
5361 es->wheelDeltaRemainder = wheelDelta;
5362 if (es->wheelDeltaRemainder && pulScrollLines)
5363 {
5364 int cLineScroll;
5365 pulScrollLines = (int) min((UINT) es->line_count, pulScrollLines);
5366 cLineScroll = pulScrollLines * (float)es->wheelDeltaRemainder / WHEEL_DELTA;
5367 es->wheelDeltaRemainder -= WHEEL_DELTA * cLineScroll / (int)pulScrollLines;
5368 result = EDIT_EM_LineScroll(es, 0, -cLineScroll);
5369 }
5370 }
5371 break;
5372
5373
5374 /* IME messages to make the edit control IME aware */
5375 case WM_IME_SETCONTEXT:
5376#ifdef __REACTOS__
5377 if (FALSE) /* FIXME: Condition */
5378 lParam &= ~ISC_SHOWUICOMPOSITIONWINDOW;
5379
5380 if (wParam)
5381 {
5382 HIMC hIMC = ImmGetContext(hwnd);
5384 if (pIC)
5385 {
5386 pIC->dwUIFlags &= ~0x40000;
5387 ImmUnlockIMC(hIMC);
5388 }
5389 if (GetWin32ClientInfo()->CI_flags & CI_WOW)
5391 ImmReleaseContext(hwnd, hIMC);
5392 }
5393
5395#endif
5396 break;
5397
5398 case WM_IME_STARTCOMPOSITION:
5399#ifdef __REACTOS__
5400 if (FALSE) /* FIXME: Condition */
5401 return TRUE;
5402 result = DefWindowProcT(hwnd, msg, wParam, lParam, unicode);
5403#else
5404 es->composition_start = es->selection_end;
5405 es->composition_len = 0;
5406#endif
5407 break;
5408
5409 case WM_IME_COMPOSITION:
5411#ifdef __REACTOS__
5412 result = DefWindowProcT(hwnd, msg, wParam, lParam, unicode);
5413#endif
5414 break;
5415
5416 case WM_IME_ENDCOMPOSITION:
5417#ifdef __REACTOS__
5418 result = DefWindowProcT(hwnd, msg, wParam, lParam, unicode);
5419#else
5420 if (es->composition_len > 0)
5421 {
5423 es->selection_end = es->selection_start;
5424 es->composition_len= 0;
5425 }
5426#endif
5427 break;
5428
5430 break;
5431
5432 case WM_IME_SELECT:
5433#ifdef __REACTOS__
5434 result = DefWindowProcT(hwnd, msg, wParam, lParam, unicode);
5435#endif
5436 break;
5437
5438 case WM_IME_CONTROL:
5439#ifdef __REACTOS__
5440 result = DefWindowProcT(hwnd, msg, wParam, lParam, unicode);
5441#endif
5442 break;
5443
5444 case WM_IME_REQUEST:
5445 switch (wParam)
5446 {
5448 {
5449 LRESULT pos;
5451
5452 pos = EDIT_EM_PosFromChar(es, es->selection_start + chpos->dwCharPos, FALSE);
5453 chpos->pt.x = LOWORD(pos);
5454 chpos->pt.y = HIWORD(pos);
5455 chpos->cLineHeight = es->line_height;
5456 chpos->rcDocument = es->format_rect;
5457 MapWindowPoints(hwnd, 0, &chpos->pt, 1);
5458 MapWindowPoints(hwnd, 0, (POINT*)&chpos->rcDocument, 2);
5459 result = 1;
5460 break;
5461 }
5462 }
5463 break;
5464
5465 default:
5466 result = DefWindowProcT(hwnd, msg, wParam, lParam, unicode);
5467 break;
5468 }
5469
5470#ifdef __REACTOS__
5471 /* ReactOS: check GetWindowLong in case es has been destroyed during processing */
5472 if (IsWindow(hwnd) && es && msg != EM_GETHANDLE && GetWindowLongPtrW(hwnd, 0))
5473#else
5474 if (IsWindow(hwnd) && es && msg != EM_GETHANDLE)
5475#endif
5477
5478 TRACE("hwnd=%p msg=%x (%s) -- 0x%08lx\n", hwnd, msg, SPY_GetMsgName(msg, hwnd), result);
5479
5480 return result;
#define msg(x)
Definition: auth_time.c:54
static const WCHAR nameW[]
Definition: main.c:46
#define FIXME(fmt,...)
Definition: debug.h:111
DWORD HIMC
Definition: dimm.idl:75
static void EDIT_WM_Paint(EDITSTATE *es, HDC hdc)
Definition: edit.c:3589
#define EF_MODIFIED
Definition: edit.c:69
static LRESULT EDIT_WM_LButtonDblClk(EDITSTATE *es)
Definition: edit.c:3474
static LRESULT EDIT_WM_Char(EDITSTATE *es, WCHAR c)
Definition: edit.c:3049
static void EDIT_WM_SetFont(EDITSTATE *es, HFONT font, BOOL redraw)
Definition: edit.c:3773
static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, const WCHAR *lpsz_replace, UINT strl, BOOL send_update, BOOL honor_limit)
Definition: edit.c:2479
static LRESULT EDIT_WM_MButtonDown(EDITSTATE *es)
Definition: edit.c:3545
static void EDIT_EM_ScrollCaret(EDITSTATE *es)
Definition: edit.c:1772
static void EDIT_SetRectNP(EDITSTATE *es, const RECT *rc)
Definition: edit.c:2306
static BOOL EDIT_EM_FmtLines(EDITSTATE *es, BOOL add_eol)
Definition: edit.c:2378
static void EDIT_WM_Copy(EDITSTATE *es)
Definition: edit.c:2993
static LRESULT EDIT_EM_CharFromPos(EDITSTATE *es, INT x, INT y)
Definition: edit.c:2350
static LRESULT EDIT_WM_HScroll(EDITSTATE *es, INT action, INT pos)
Definition: edit.c:3995
static void EDIT_WM_Cut(EDITSTATE *es)
Definition: edit.c:3037
static void EDIT_EM_SetPasswordChar(EDITSTATE *es, WCHAR c)
Definition: edit.c:2835
static INT EDIT_WM_GetText(const EDITSTATE *es, INT count, LPWSTR dst)
Definition: edit.c:3231
static void EDIT_WM_ContextMenu(EDITSTATE *es, INT x, INT y)
Definition: edit.c:3175
static LRESULT EDIT_WM_MouseMove(EDITSTATE *es, INT x, INT y)
Definition: edit.c:3557
static void EDIT_LockBuffer(EDITSTATE *es)
Definition: edit.c:1208
static void EDIT_UnlockBuffer(EDITSTATE *es, BOOL force)
Definition: edit.c:1227
static LRESULT EDIT_WM_NCDestroy(EDITSTATE *es)
Definition: edit.c:4579
static LRESULT EDIT_WM_LButtonDown(EDITSTATE *es, DWORD keys, INT x, INT y)
Definition: edit.c:3503
static INT EDIT_EM_LineIndex(const EDITSTATE *es, INT line)
Definition: edit.c:943
static HLOCAL EDIT_EM_GetHandle(EDITSTATE *es)
Definition: edit.c:2400
static INT EDIT_EM_GetLine(EDITSTATE *es, INT line, LPWSTR dst)
Definition: edit.c:2420
#define EF_UPDATE
Definition: edit.c:71
static BOOL EDIT_EM_Undo(EDITSTATE *es)
Definition: edit.c:2905
static UINT get_text_length(EDITSTATE *es)
Definition: edit.c:217
static void EDIT_WM_Paste(EDITSTATE *es)
Definition: edit.c:2957
static LRESULT EDIT_WM_KillFocus(HTHEME theme, EDITSTATE *es)
Definition: edit.c:3446
static LRESULT EDIT_WM_SysKeyDown(EDITSTATE *es, INT key, DWORD key_data)
Definition: edit.c:3958
static LRESULT EDIT_EM_GetThumb(EDITSTATE *es)
Definition: edit.c:4247
static LRESULT EDIT_WM_NCCreate(HWND hwnd, LPCREATESTRUCTW lpcs)
Definition: edit.c:4411
static LRESULT EDIT_WM_LButtonUp(EDITSTATE *es)
Definition: edit.c:3529
static void EDIT_WM_Clear(EDITSTATE *es)
Definition: edit.c:3022
static BOOL EDIT_EM_CanUndo(const EDITSTATE *es)
Definition: edit.c:182
static void EDIT_EM_EmptyUndoBuffer(EDITSTATE *es)
Definition: edit.c:193
static void EDIT_EM_SetMargins(EDITSTATE *es, INT action, WORD left, WORD right, BOOL repaint)
Definition: edit.c:2767
static void EDIT_WM_SetFocus(HTHEME theme, EDITSTATE *es)
Definition: edit.c:3738
static void EDIT_EM_SetHandle(EDITSTATE *es, HLOCAL hloc)
Definition: edit.c:2692
static LRESULT EDIT_WM_Create(EDITSTATE *es, const WCHAR *name)
Definition: edit.c:4524
static LRESULT EDIT_WM_KeyDown(EDITSTATE *es, INT key)
Definition: edit.c:3307
static void EDIT_EM_SetLimitText(EDITSTATE *es, UINT limit)
Definition: edit.c:2731
static void EDIT_WM_Timer(EDITSTATE *es)
Definition: edit.c:3977
static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap)
Definition: edit.c:1014
#define EF_DIALOGMODE
Definition: edit.c:76
static LRESULT EDIT_EM_Scroll(EDITSTATE *es, INT action)
Definition: edit.c:1669
static LRESULT EDIT_EM_GetSel(const EDITSTATE *es, PUINT start, PUINT end)
Definition: edit.c:2458
static void EDIT_EM_SetWordBreakProc(EDITSTATE *es, EDITWORDBREAKPROCW wbp)
Definition: edit.c:2886
static LRESULT EDIT_WM_StyleChanged(EDITSTATE *es, WPARAM which, const STYLESTRUCT *style)
Definition: edit.c:3918
static INT EDIT_EM_LineFromChar(EDITSTATE *es, INT index)
Definition: edit.c:914
static LRESULT EDIT_WM_VScroll(EDITSTATE *es, INT action, INT pos)
Definition: edit.c:4127
static void EDIT_WM_SetText(EDITSTATE *es, LPCWSTR text)
Definition: edit.c:3843
static void EDIT_UpdateText(EDITSTATE *es, const RECT *rc, BOOL bErase)
Definition: edit.c:1356
static BOOL EDIT_EM_SetTabStops(EDITSTATE *es, INT count, const INT *tabs)
Definition: edit.c:2864
static BOOL EDIT_EM_SetSel(EDITSTATE *es, UINT start, UINT end, BOOL after_wrap)
Definition: edit.c:1486
static void EDIT_ImeComposition(HWND hwnd, LPARAM CompFlag, EDITSTATE *es)
Definition: edit.c:4365
static BOOL EDIT_EM_LineScroll(EDITSTATE *es, INT dx, INT dy)
Definition: edit.c:1654
static void EDIT_WM_Size(EDITSTATE *es, UINT action)
Definition: edit.c:3885
static INT EDIT_EM_LineLength(EDITSTATE *es, INT index)
Definition: edit.c:978
#define CP_ACP
Definition: compat.h:109
#define HeapAlloc
Definition: compat.h:733
#define WideCharToMultiByte
Definition: compat.h:111
#define MultiByteToWideChar
Definition: compat.h:110
BOOL WINAPI ImmNotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue)
Definition: ime.c:907
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1079
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1057
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:1098
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1070
unsigned long DWORD
Definition: ntddk_ex.h:95
#define es
Definition: i386-dis.c:440
#define CPS_CANCEL
Definition: imm.h:315
#define NI_COMPOSITIONSTR
Definition: imm.h:298
#define IMR_QUERYCHARPOSITION
Definition: imm.h:543
struct INPUTCONTEXTDX * LPINPUTCONTEXTDX
#define FNID_EDIT
Definition: ntuser.h:865
#define GetWin32ClientInfo()
Definition: ntuser.h:347
#define CI_WOW
Definition: ntuser.h:301
if(dx< 0)
Definition: linetemp.h:194
static const char textA[]
Definition: registrar.c:40
static const WCHAR textW[]
Definition: itemdlg.c:1559
static float(__cdecl *square_half_float)(float x
#define min(a, b)
Definition: monoChain.cc:55
unsigned int * PUINT
Definition: ndis.h:50
#define BOOL
Definition: nt_native.h:43
#define LRESULT
Definition: ole.h:14
#define ES_READONLY
Definition: pedump.c:675
#define ES_MULTILINE
Definition: pedump.c:667
#define INT
Definition: polytest.cpp:20
#define EM_SCROLLCARET
Definition: richedit.h:81
#define WM_UNICHAR
Definition: richedit.h:67
#define EM_POSFROMCHAR
Definition: richedit.h:77
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define EM_CHARFROMPOS
Definition: richedit.h:78
#define EM_GETLIMITTEXT
Definition: richedit.h:74
DWORD dwUIFlags
Definition: immdev.h:132
RECT rcDocument
Definition: imm.h:144
DWORD dwCharPos
Definition: imm.h:141
UINT cLineHeight
Definition: imm.h:143
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define WHEEL_DELTA
Definition: treelist.c:99
#define MAKELONG(a, b)
Definition: typedefs.h:249
static LRESULT DefWindowProcT(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: edit.c:4829
int * LPINT
Definition: windef.h:178
#define EM_SETREADONLY
Definition: winuser.h:2005
BOOL WINAPI CopyRect(_Out_ LPRECT, _In_ LPCRECT)
#define EM_GETRECT
Definition: winuser.h:1986
#define WM_IME_REQUEST
Definition: winuser.h:1826
#define EM_LINEFROMCHAR
Definition: winuser.h:1991
#define WM_HSCROLL
Definition: winuser.h:1733
#define EM_GETWORDBREAKPROC
Definition: winuser.h:1989
#define EM_FMTLINES
Definition: winuser.h:1976
#define EM_GETPASSWORDCHAR
Definition: winuser.h:1985
#define WM_VSCROLL
Definition: winuser.h:1734
#define EM_SETPASSWORDCHAR
Definition: winuser.h:2004
#define EM_GETMODIFY
Definition: winuser.h:1984
#define EM_EMPTYUNDOBUFFER
Definition: winuser.h:1975
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define DLGC_WANTALLKEYS
Definition: winuser.h:2602
#define EM_REPLACESEL
Definition: winuser.h:1996
#define EM_SETRECT
Definition: winuser.h:2006
#define EM_LINEINDEX
Definition: winuser.h:1992
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
#define EM_LINESCROLL
Definition: winuser.h:1994
#define EM_GETFIRSTVISIBLELINE
Definition: winuser.h:1978
#define EM_GETHANDLE
Definition: winuser.h:1979
#define WM_UNDO
Definition: winuser.h:1855
#define WM_IME_SETCONTEXT
Definition: winuser.h:1819
#define EM_CANUNDO
Definition: winuser.h:1973
#define EM_LINELENGTH
Definition: winuser.h:1993
#define EM_SETHANDLE
Definition: winuser.h:1999
#define EM_GETLINE
Definition: winuser.h:1981
#define EM_SETRECTNP
Definition: winuser.h:2007
#define EM_SETLIMITTEXT
Definition: winuser.h:2001
#define WM_TIMER
Definition: winuser.h:1732
#define EM_UNDO
Definition: winuser.h:2011
#define EM_SCROLL
Definition: winuser.h:1997
#define EM_SETWORDBREAKPROC
Definition: winuser.h:2010
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define WM_IME_COMPOSITIONFULL
Definition: winuser.h:1822
#define EM_GETTHUMB
Definition: winuser.h:1988
#define EM_GETMARGINS
Definition: winuser.h:1983
#define WM_IME_CONTROL
Definition: winuser.h:1821
#define EM_SETTABSTOPS
Definition: winuser.h:2009
#define WM_IME_SELECT
Definition: winuser.h:1823
#define EM_GETLINECOUNT
Definition: winuser.h:1982
#define EM_SETMARGINS
Definition: winuser.h:2002
#define DLGC_HASSETSEL
Definition: winuser.h:2604
#define WM_MBUTTONDOWN
Definition: winuser.h:1772
#define EM_SETMODIFY
Definition: winuser.h:2003
const char * LPCSTR
Definition: xmlstorage.h:183
char CHAR
Definition: xmlstorage.h:175

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)
571 else
574 return 0;
575
576 case WM_GETICON:
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}
short SHORT
Definition: pedump.c:59
static void Ghost_Unenchant(HWND hwnd, BOOL bDestroyTarget)
Definition: ghost.c:298
static void Ghost_OnNCDestroy(HWND hwnd)
Definition: ghost.c:402
static void Ghost_OnNCPaint(HWND hwnd, HRGN hrgn, BOOL bUnicode)
Definition: ghost.c:330
static void Ghost_OnMove(HWND hwnd, int x, int y)
Definition: ghost.c:362
static BOOL Ghost_OnCreate(HWND hwnd, CREATESTRUCTW *lpcs)
Definition: ghost.c:158
static void Ghost_OnTimer(HWND hwnd, UINT id)
Definition: ghost.c:463
static void Ghost_OnPaint(HWND hwnd)
Definition: ghost.c:350
static void Ghost_OnDestroy(HWND hwnd)
Definition: ghost.c:376
static HICON Ghost_GetIcon(HWND hwnd, INT fType)
Definition: ghost.c:487
static void Ghost_OnDraw(HWND hwnd, HDC hdc)
Definition: ghost.c:309
static void Ghost_OnClose(HWND hwnd)
Definition: ghost.c:435
#define WM_SYSCOMMAND
Definition: winuser.h:1731
#define SC_SIZE
Definition: winuser.h:2574
#define WM_NCMOUSEMOVE
Definition: winuser.h:1681
#define LoadCursor
Definition: winuser.h:5802
#define WM_MOVE
Definition: winuser.h:1600
#define WM_SIZING
Definition: winuser.h:1797
#define IDC_WAIT
Definition: winuser.h:684
#define SC_MAXIMIZE
Definition: winuser.h:2578
#define WM_NCPAINT
Definition: winuser.h:1677

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

◆ GhostWndProcA()

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

Definition at line 604 of file ghost.c.

605{
606 return GhostWndProc_common(hwnd, uMsg, wParam, lParam, FALSE);
607}
LRESULT WINAPI GhostWndProc_common(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: ghost.c:515

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}

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;
200 }
201 return (hIconTitleFont ? 0 : -1);
202 case WM_NCHITTEST:
203 return HTCAPTION;
204 case WM_NCMOUSEMOVE:
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 ) )
222 return 1;
223 }
224 return DefWindowProcW( hWnd, msg, wParam, lParam );
225}
static BOOL ICONTITLE_SetTitlePos(HWND hwnd, HWND owner)
Definition: icontitle.c:71
static BOOL bMultiLineTitle
Definition: icontitle.c:23
static HFONT hIconTitleFont
Definition: icontitle.c:24
static BOOL ICONTITLE_Paint(HWND hwnd, HWND owner, HDC hDC, BOOL bActive)
Definition: icontitle.c:122
#define WS_CHILD
Definition: pedump.c:617
#define WM_ISACTIVEICON
Definition: undocuser.h:33
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
#define GW_OWNER
Definition: winuser.h:761
HWND WINAPI GetActiveWindow(void)
Definition: winpos.c:138
#define HTCAPTION
Definition: winuser.h:2466
BOOL WINAPI ValidateRect(_In_opt_ HWND, _In_opt_ LPCRECT)
#define SPI_GETICONTITLELOGFONT
Definition: winuser.h:1370
#define WM_NCLBUTTONDBLCLK
Definition: winuser.h:1684
#define WM_ACTIVATE
Definition: winuser.h:1602
#define WM_SHOWWINDOW
Definition: winuser.h:1618
HWND WINAPI SetActiveWindow(_In_ HWND)
#define SPI_GETICONTITLEWRAP
Definition: winuser.h:1364
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
BOOL WINAPI SystemParametersInfoA(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)

Referenced by RegisterClientPFN().

◆ ListBoxWndProc_common()

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

Definition at line 2614 of file listbox.c.

2616{
2618 LPHEADCOMBO lphc = 0;
2619 LRESULT ret;
2620#ifdef __REACTOS__
2621 PWND pWnd;
2622
2623 pWnd = ValidateHwnd(hwnd);
2624 if (pWnd)
2625 {
2626 if (!pWnd->fnid)
2627 {
2628 NtUserSetWindowFNID(hwnd, FNID_LISTBOX); // Could be FNID_COMBOLBOX by class.
2629 }
2630 else
2631 {
2632 if (pWnd->fnid != FNID_LISTBOX)
2633 {
2634 ERR("Wrong window class for listbox! fnId 0x%x\n",pWnd->fnid);
2635 return 0;
2636 }
2637 }
2638 }
2639#endif
2640
2641 if (!descr)
2642 {
2643 if (!IsWindow(hwnd)) return 0;
2644
2645 if (msg == WM_CREATE)
2646 {
2648 if (lpcs->style & LBS_COMBOBOX) lphc = lpcs->lpCreateParams;
2649 if (!LISTBOX_Create( hwnd, lphc )) return -1;
2650 TRACE("creating hwnd %p descr %p\n", hwnd, (void *)GetWindowLongPtrW( hwnd, 0 ) );
2651 return 0;
2652 }
2653 /* Ignore all other messages before we get a WM_CREATE */
2654 return unicode ? DefWindowProcW( hwnd, msg, wParam, lParam ) :
2656 }
2657 if (descr->style & LBS_COMBOBOX) lphc = descr->lphc;
2658
2659 TRACE("[%p]: msg %s wp %08lx lp %08lx\n",
2660 descr->self, SPY_GetMsgName(msg, descr->self), wParam, lParam );
2661
2662 switch(msg)
2663 {
2664 case LB_RESETCONTENT:
2667 InvalidateRect( descr->self, NULL, TRUE );
2668 return 0;
2669
2670 case LB_ADDSTRING:
2671#ifdef __REACTOS__
2672 case LB_ADDSTRING_LOWER:
2673 case LB_ADDSTRING_UPPER:
2674#endif
2675 {
2676 INT ret;
2677 LPWSTR textW;
2678 if(unicode || !HAS_STRINGS(descr))
2679 textW = (LPWSTR)lParam;
2680 else
2681 {
2683 INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0);
2684 if((textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR))))
2685 MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW);
2686 else
2687 return LB_ERRSPACE;
2688 }
2689#ifdef __REACTOS__
2690 /* in the unicode the version, the string is really overwritten
2691 during the converting case */
2692 if (msg == LB_ADDSTRING_LOWER)
2693 strlwrW(textW);
2694 else if (msg == LB_ADDSTRING_UPPER)
2695 struprW(textW);
2696#endif
2699 if (!unicode && HAS_STRINGS(descr))
2701 return ret;
2702 }
2703
2704 case LB_INSERTSTRING:
2705#ifdef __REACTOS__
2708#endif
2709 {
2710 INT ret;
2711 LPWSTR textW;
2712 if(unicode || !HAS_STRINGS(descr))
2713 textW = (LPWSTR)lParam;
2714 else
2715 {
2717 INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0);
2718 if((textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR))))
2719 MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW);
2720 else
2721 return LB_ERRSPACE;
2722 }
2723#ifdef __REACTOS__
2724 /* in the unicode the version, the string is really overwritten
2725 during the converting case */
2727 strlwrW(textW);
2728 else if (msg == LB_INSERTSTRING_UPPER)
2729 struprW(textW);
2730#endif
2732 if(!unicode && HAS_STRINGS(descr))
2734 return ret;
2735 }
2736
2737 case LB_ADDFILE:
2738 {
2739 INT ret;
2740 LPWSTR textW;
2741 if(unicode || !HAS_STRINGS(descr))
2742 textW = (LPWSTR)lParam;
2743 else
2744 {
2746 INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0);
2747 if((textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR))))
2748 MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW);
2749 else
2750 return LB_ERRSPACE;
2751 }
2754 if(!unicode && HAS_STRINGS(descr))
2756 return ret;
2757 }
2758
2759 case LB_DELETESTRING:
2761 return descr->nb_items;
2762 else
2763 {
2765 return LB_ERR;
2766 }
2767
2768 case LB_GETITEMDATA:
2769 if (((INT)wParam < 0) || ((INT)wParam >= descr->nb_items))
2770 {
2772 return LB_ERR;
2773 }
2774 return descr->items[wParam].data;
2775
2776 case LB_SETITEMDATA:
2777 if (((INT)wParam < 0) || ((INT)wParam >= descr->nb_items))
2778 {
2780 return LB_ERR;
2781 }
2782 descr->items[wParam].data = lParam;
2783 /* undocumented: returns TRUE, not LB_OKAY (0) */
2784 return TRUE;
2785
2786 case LB_GETCOUNT:
2787 return descr->nb_items;
2788
2789 case LB_GETTEXT:
2790 return LISTBOX_GetText( descr, wParam, (LPWSTR)lParam, unicode );
2791
2792 case LB_GETTEXTLEN:
2793 if ((INT)wParam >= descr->nb_items || (INT)wParam < 0)
2794 {
2796 return LB_ERR;
2797 }
2798 if (!HAS_STRINGS(descr)) return sizeof(DWORD);
2799 if (unicode) return strlenW( descr->items[wParam].str );
2800 return WideCharToMultiByte( CP_ACP, 0, descr->items[wParam].str,
2801 strlenW(descr->items[wParam].str), NULL, 0, NULL, NULL );
2802
2803 case LB_GETCURSEL:
2804 if (descr->nb_items == 0)
2805 return LB_ERR;
2806 if (!IS_MULTISELECT(descr))
2807 return descr->selected_item;
2808 if (descr->selected_item != -1)
2809 return descr->selected_item;
2810 return descr->focus_item;
2811 /* otherwise, if the user tries to move the selection with the */
2812 /* arrow keys, we will give the application something to choke on */
2813 case LB_GETTOPINDEX:
2814 return descr->top_item;
2815
2816 case LB_GETITEMHEIGHT:
2818
2819 case LB_SETITEMHEIGHT:
2821
2822 case LB_ITEMFROMPOINT:
2823 {
2824 POINT pt;
2825 RECT rect;
2826 int index;
2827 BOOL hit = TRUE;
2828
2829 /* The hiword of the return value is not a client area
2830 hittest as suggested by MSDN, but rather a hittest on
2831 the returned listbox item. */
2832
2833 if(descr->nb_items == 0)
2834 return 0x1ffff; /* win9x returns 0x10000, we copy winnt */
2835
2836 pt.x = (short)LOWORD(lParam);
2837 pt.y = (short)HIWORD(lParam);
2838
2839 SetRect(&rect, 0, 0, descr->width, descr->height);
2840
2841 if(!PtInRect(&rect, pt))
2842 {
2843 pt.x = min(pt.x, rect.right - 1);
2844 pt.x = max(pt.x, 0);
2845 pt.y = min(pt.y, rect.bottom - 1);
2846 pt.y = max(pt.y, 0);
2847 hit = FALSE;
2848 }
2849
2851
2852 if(index == -1)
2853 {
2854 index = descr->nb_items - 1;
2855 hit = FALSE;
2856 }
2857 return MAKELONG(index, hit ? 0 : 1);
2858 }
2859
2860 case LB_SETCARETINDEX:
2861 if ((!IS_MULTISELECT(descr)) && (descr->selected_item != -1)) return LB_ERR;
2863 return LB_ERR;
2864 else if (ISWIN31)
2865 return wParam;
2866 else
2867 return LB_OKAY;
2868
2869 case LB_GETCARETINDEX:
2870 return descr->focus_item;
2871
2872 case LB_SETTOPINDEX:
2873 return LISTBOX_SetTopItem( descr, wParam, TRUE );
2874
2875 case LB_SETCOLUMNWIDTH:
2877
2878 case LB_GETITEMRECT:
2880
2881 case LB_FINDSTRING:
2882 {
2883 INT ret;
2884 LPWSTR textW;
2885 if(unicode || !HAS_STRINGS(descr))
2886 textW = (LPWSTR)lParam;
2887 else
2888 {
2890 INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0);
2891 if((textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR))))
2892 MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW);
2893 }
2895 if(!unicode && HAS_STRINGS(descr))
2897 return ret;
2898 }
2899
2900 case LB_FINDSTRINGEXACT:
2901 {
2902 INT ret;
2903 LPWSTR textW;
2904 if(unicode || !HAS_STRINGS(descr))
2905 textW = (LPWSTR)lParam;
2906 else
2907 {
2909 INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0);
2910 if((textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR))))
2911 MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW);
2912 }
2914 if(!unicode && HAS_STRINGS(descr))
2916 return ret;
2917 }
2918
2919 case LB_SELECTSTRING:
2920 {
2921 INT index;
2922 LPWSTR textW;
2923
2924 if(HAS_STRINGS(descr))
2925 TRACE("LB_SELECTSTRING: %s\n", unicode ? debugstr_w((LPWSTR)lParam) :
2927 if(unicode || !HAS_STRINGS(descr))
2928 textW = (LPWSTR)lParam;
2929 else
2930 {
2932 INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0);
2933 if((textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR))))
2934 MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW);
2935 }
2937 if(!unicode && HAS_STRINGS(descr))
2939 if (index != LB_ERR)
2940 {
2943 }
2944 return index;
2945 }
2946
2947 case LB_GETSEL:
2948 if (((INT)wParam < 0) || ((INT)wParam >= descr->nb_items))
2949 return LB_ERR;
2950 return descr->items[wParam].selected;
2951
2952 case LB_SETSEL:
2954
2955 case LB_SETCURSEL:
2956 if (IS_MULTISELECT(descr)) return LB_ERR;
2959 if (ret != LB_ERR) ret = descr->selected_item;
2960 return ret;
2961
2962 case LB_GETSELCOUNT:
2963 return LISTBOX_GetSelCount( descr );
2964
2965 case LB_GETSELITEMS:
2967
2968 case LB_SELITEMRANGE:
2969 if (LOWORD(lParam) <= HIWORD(lParam))
2971 HIWORD(lParam), wParam );
2972 else
2974 LOWORD(lParam), wParam );
2975
2976 case LB_SELITEMRANGEEX:
2977 if ((INT)lParam >= (INT)wParam)
2979 else
2981
2983 return descr->horz_extent;
2984
2987
2988 case LB_GETANCHORINDEX:
2989 return descr->anchor_item;
2990
2991 case LB_SETANCHORINDEX:
2992 if (((INT)wParam < -1) || ((INT)wParam >= descr->nb_items))
2993 {
2995 return LB_ERR;
2996 }
2997 descr->anchor_item = (INT)wParam;
2998 return LB_OKAY;
2999
3000 case LB_DIR:
3001 {
3002 INT ret;
3003 LPWSTR textW;
3004 if(unicode)
3005 textW = (LPWSTR)lParam;
3006 else
3007 {
3009 INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0);
3010 if((textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR))))
3011 MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW);
3012 }
3014 if(!unicode)
3016 return ret;
3017 }
3018
3019 case LB_GETLOCALE:
3020 return descr->locale;
3021
3022 case LB_SETLOCALE:
3023 {
3024 LCID ret;
3026 return LB_ERR;
3027 ret = descr->locale;
3028 descr->locale = (LCID)wParam;
3029 return ret;
3030 }
3031
3032 case LB_INITSTORAGE:
3033 return LISTBOX_InitStorage( descr, wParam );
3034
3035 case LB_SETCOUNT:
3036 return LISTBOX_SetCount( descr, (INT)wParam );
3037
3038 case LB_SETTABSTOPS:
3040
3041 case LB_CARETON:
3042 if (descr->caret_on)
3043 return LB_OKAY;
3044 descr->caret_on = TRUE;
3045 if ((descr->focus_item != -1) && (descr->in_focus))
3046 LISTBOX_RepaintItem( descr, descr->focus_item, ODA_FOCUS );
3047 return LB_OKAY;
3048
3049 case LB_CARETOFF:
3050 if (!descr->caret_on)
3051 return LB_OKAY;
3052 descr->caret_on = FALSE;
3053 if ((descr->focus_item != -1) && (descr->in_focus))
3054 LISTBOX_RepaintItem( descr, descr->focus_item, ODA_FOCUS );
3055 return LB_OKAY;
3056
3057 case LB_GETLISTBOXINFO:
3058 return descr->page_size;
3059
3060 case WM_DESTROY:
3061 return LISTBOX_Destroy( descr );
3062
3063 case WM_ENABLE:
3064 InvalidateRect( descr->self, NULL, TRUE );
3065 return 0;
3066
3067 case WM_SETREDRAW:
3069 return 0;
3070
3071 case WM_GETDLGCODE:
3073
3074 case WM_PRINTCLIENT:
3075 case WM_PAINT:
3076 {
3077 PAINTSTRUCT ps;
3078 HDC hdc = ( wParam ) ? ((HDC)wParam) : BeginPaint( descr->self, &ps );
3079 ret = LISTBOX_Paint( descr, hdc );
3080 if( !wParam ) EndPaint( descr->self, &ps );
3081 }
3082 return ret;
3083 case WM_SIZE:
3085 return 0;
3086 case WM_GETFONT:
3087 return (LRESULT)descr->font;
3088 case WM_SETFONT:
3090 if (lParam) InvalidateRect( descr->self, 0, TRUE );
3091 return 0;
3092 case WM_SETFOCUS:
3093 descr->in_focus = TRUE;
3094 descr->caret_on = TRUE;
3095 if (descr->focus_item != -1)
3098 return 0;
3099 case WM_KILLFOCUS:
3100 LISTBOX_HandleLButtonUp( descr ); /* Release capture if we have it */
3101 descr->in_focus = FALSE;
3102 descr->wheel_remain = 0;
3103 if ((descr->focus_item != -1) && descr->caret_on)
3104 LISTBOX_RepaintItem( descr, descr->focus_item, ODA_FOCUS );
3106 return 0;
3107 case WM_HSCROLL:
3109 case WM_VSCROLL:
3111 case WM_MOUSEWHEEL:
3112 if (wParam & (MK_SHIFT | MK_CONTROL))
3113 return DefWindowProcW( descr->self, msg, wParam, lParam );
3115 case WM_LBUTTONDOWN:
3116 if (lphc)
3119 (INT16)HIWORD(lParam) );
3122 (INT16)HIWORD(lParam) );
3123 case WM_LBUTTONDBLCLK:
3124 if (lphc)
3127 (INT16)HIWORD(lParam) );
3128 if (descr->style & LBS_NOTIFY)
3130 return 0;
3131 case WM_MOUSEMOVE:
3132 if ( lphc && ((lphc->dwStyle & CBS_DROPDOWNLIST) != CBS_SIMPLE) )
3133 {
3134 BOOL captured = descr->captured;
3135 POINT mousePos;
3136 RECT clientRect;
3137
3138 mousePos.x = (INT16)LOWORD(lParam);
3139 mousePos.y = (INT16)HIWORD(lParam);
3140
3141 /*
3142 * If we are in a dropdown combobox, we simulate that
3143 * the mouse is captured to show the tracking of the item.
3144 */
3145 if (GetClientRect(descr->self, &clientRect) && PtInRect( &clientRect, mousePos ))
3146 descr->captured = TRUE;
3147
3148 LISTBOX_HandleMouseMove( descr, mousePos.x, mousePos.y);
3149
3150 descr->captured = captured;
3151 }
3152 else if (GetCapture() == descr->self)
3153 {
3155 (INT16)HIWORD(lParam) );
3156 }
3157 return 0;
3158 case WM_LBUTTONUP:
3159 if (lphc)
3160 {
3161 POINT mousePos;
3162 RECT clientRect;
3163
3164 /*
3165 * If the mouse button "up" is not in the listbox,
3166 * we make sure there is no selection by re-selecting the
3167 * item that was selected when the listbox was made visible.
3168 */
3169 mousePos.x = (INT16)LOWORD(lParam);
3170 mousePos.y = (INT16)HIWORD(lParam);
3171
3172 GetClientRect(descr->self, &clientRect);
3173
3174 /*
3175 * When the user clicks outside the combobox and the focus
3176 * is lost, the owning combobox will send a fake buttonup with
3177 * 0xFFFFFFF as the mouse location, we must also revert the
3178 * selection to the original selection.
3179 */
3180 if ( (lParam == (LPARAM)-1) || (!PtInRect( &clientRect, mousePos )) )
3182 }
3184 case WM_KEYDOWN:
3185 if( lphc && (lphc->dwStyle & CBS_DROPDOWNLIST) != CBS_SIMPLE )
3186 {
3187 /* for some reason Windows makes it possible to
3188 * show/hide ComboLBox by sending it WM_KEYDOWNs */
3189
3190 if( (!(lphc->wState & CBF_EUI) && wParam == VK_F4) ||
3191 ( (lphc->wState & CBF_EUI) && !(lphc->wState & CBF_DROPPED)
3192 && (wParam == VK_DOWN || wParam == VK_UP)) )
3193 {
3194 COMBO_FlipListbox( lphc, FALSE, FALSE );
3195 return 0;
3196 }
3197 }
3199 case WM_CHAR:
3200 {
3201 WCHAR charW;
3202 if(unicode)
3203 charW = (WCHAR)wParam;
3204 else
3205 {
3206 CHAR charA = (CHAR)wParam;
3207 MultiByteToWideChar(CP_ACP, 0, &charA, 1, &charW, 1);
3208 }
3209 return LISTBOX_HandleChar( descr, charW );
3210 }
3211 case WM_SYSTIMER:
3213 case WM_ERASEBKGND:
3214 if ((IS_OWNERDRAW(descr)) && !(descr->style & LBS_DISPLAYCHANGED))
3215 {
3216 RECT rect;
3217#ifdef __REACTOS__
3218 HBRUSH hbrush = GetControlColor( descr->owner, descr->self, (HDC)wParam, WM_CTLCOLORLISTBOX);
3219#else
3220 HBRUSH hbrush = (HBRUSH)SendMessageW( descr->owner, WM_CTLCOLORLISTBOX,
3221 wParam, (LPARAM)descr->self );
3222#endif
3223 TRACE("hbrush = %p\n", hbrush);
3224 if(!hbrush)
3226 if(hbrush)
3227 {
3228 GetClientRect(descr->self, &rect);
3230 }
3231 }
3232 return 1;
3233 case WM_DROPFILES:
3234 if( lphc ) return 0;
3235 return unicode ? SendMessageW( descr->owner, msg, wParam, lParam ) :
3236 SendMessageA( descr->owner, msg, wParam, lParam );
3237
3238 case WM_NCDESTROY:
3239 if( lphc && (lphc->dwStyle & CBS_DROPDOWNLIST) != CBS_SIMPLE )
3240 lphc->hWndLBox = 0;
3241#ifdef __REACTOS__
3243#endif
3244 break;
3245
3246 case WM_NCACTIVATE:
3247 if (lphc) return 0;
3248 break;
3249// ReactOS
3250 case WM_UPDATEUISTATE:
3251 if (unicode)
3253 else
3255
3257 {
3258 /* redraw text */
3259 if (descr->focus_item != -1)
3260 LISTBOX_DrawFocusRect( descr, descr->in_focus );
3261 }
3262 break;
3263//
3264 default:
3265 if ((msg >= WM_USER) && (msg < 0xc000))
3266 WARN("[%p]: unknown msg %04x wp %08lx lp %08lx\n",
3267 hwnd, msg, wParam, lParam );
3268 }
3269
3270 return unicode ? DefWindowProcW( hwnd, msg, wParam, lParam ) :
3272}
#define index(s, c)
Definition: various.h:29
#define CHAR(Char)
#define WM_SYSTIMER
Definition: comctl32.h:119
#define LB_INSERTSTRING_LOWER
Definition: controls.h:87
#define LB_INSERTSTRING_UPPER
Definition: controls.h:86
#define LB_ADDSTRING_LOWER
Definition: controls.h:89
#define LB_ADDSTRING_UPPER
Definition: controls.h:88
static LRESULT LISTBOX_RemoveItem(LB_DESCR *descr, INT index)
Definition: listbox.c:1670
#define SEND_NOTIFICATION(descr, code)
Definition: listbox.c:108
static LRESULT LISTBOX_InsertString(LB_DESCR *descr, INT index, LPCWSTR str)
Definition: listbox.c:1599
static void LISTBOX_DrawFocusRect(LB_DESCR *descr, BOOL on)
Definition: listbox.c:646
static LRESULT LISTBOX_HandleKeyDown(LB_DESCR *descr, DWORD key)
Definition: listbox.c:2329
static LRESULT LISTBOX_SetCaretIndex(LB_DESCR *descr, INT index, BOOL fully_visible)
Definition: listbox.c:1355
static BOOL LISTBOX_SetTabStops(LB_DESCR *descr, INT count, LPINT tabs)
Definition: listbox.c:702
static LRESULT LISTBOX_HandleLButtonUp(LB_DESCR *descr)
Definition: listbox.c:2209
static LRESULT LISTBOX_GetSelCount(const LB_DESCR *descr)
Definition: listbox.c:938
static void LISTBOX_SetRedraw(LB_DESCR *descr, BOOL on)
Definition: listbox.c:586
static LRESULT LISTBOX_GetText(LB_DESCR *descr, INT index, LPWSTR buffer, BOOL unicode)
Definition: listbox.c:734
static LRESULT LISTBOX_SetCount(LB_DESCR *descr, INT count)
Definition: listbox.c:1754
#define ISWIN31
Definition: listbox.c:112
static LRESULT LISTBOX_InitStorage(LB_DESCR *descr, INT nb_items)
Definition: listbox.c:673
static INT LISTBOX_FindFileStrPos(LB_DESCR *descr, LPCWSTR str)
Definition: listbox.c:833
static LRESULT LISTBOX_SetSelection(LB_DESCR *descr, INT index, BOOL on, BOOL send_notify)
Definition: listbox.c:1420
static LRESULT LISTBOX_HandleLButtonDownCombo(LB_DESCR *descr, UINT msg, DWORD keys, INT x, INT y)
Definition: listbox.c:2131
static LRESULT LISTBOX_HandleVScroll(LB_DESCR *descr, WORD scrollReq, WORD pos)
Definition: listbox.c:1869
#define IS_MULTISELECT(descr)
Definition: listbox.c:104
static void LISTBOX_ResetContent(LB_DESCR *descr)
Definition: listbox.c:1736
#define HAS_STRINGS(descr)
Definition: listbox.c:100
static LRESULT LISTBOX_HandleMouseWheel(LB_DESCR *descr, SHORT delta)
Definition: listbox.c:1999
static LRESULT LISTBOX_SetHorizontalExtent(LB_DESCR *descr, INT extent)
Definition: listbox.c:1244
static void LISTBOX_MoveCaret(LB_DESCR *descr, INT index, BOOL fully_visible)
Definition: listbox.c:1463
static LRESULT LISTBOX_GetSelItems(const LB_DESCR *descr, INT max, LPINT array)
Definition: listbox.c:955
static LRESULT LISTBOX_Paint(LB_DESCR *descr, HDC hdc)
Definition: listbox.c:970
static void LISTBOX_UpdateScroll(LB_DESCR *descr)
Definition: listbox.c:183
static LRESULT LISTBOX_SetTopItem(LB_DESCR *descr, INT index, BOOL scroll)
Definition: listbox.c:266
static INT LISTBOX_SetFont(LB_DESCR *descr, HFONT font)
Definition: listbox.c:1285
static LRESULT LISTBOX_HandleHScroll(LB_DESCR *descr, WORD scrollReq, WORD pos)
Definition: listbox.c:1913
static LRESULT LISTBOX_SelectItemRange(LB_DESCR *descr, INT first, INT last, BOOL on)
Definition: listbox.c:1380
static void LISTBOX_RepaintItem(LB_DESCR *descr, INT index, UINT action)
Definition: listbox.c:613
static LRESULT LISTBOX_GetItemRect(const LB_DESCR *descr, INT index, RECT *rect)
Definition: listbox.c:381
static INT LISTBOX_FindString(LB_DESCR *descr, INT start, LPCWSTR str, BOOL exact)
Definition: listbox.c:877
static BOOL LISTBOX_Destroy(LB_DESCR *descr)
Definition: listbox.c:2556
static LRESULT LISTBOX_HandleSystemTimer(LB_DESCR *descr)
Definition: listbox.c:2265
static LRESULT LISTBOX_Directory(LB_DESCR *descr, UINT attrib, LPCWSTR filespec, BOOL long_names)
Definition: listbox.c:1786
static void LISTBOX_HandleMouseMove(LB_DESCR *descr, INT x, INT y)
Definition: listbox.c:2281
static LRESULT LISTBOX_SetColumnWidth(LB_DESCR *descr, INT width)
Definition: listbox.c:1270
static LRESULT LISTBOX_GetItemHeight(const LB_DESCR *descr, INT index)
Definition: listbox.c:1162
static INT LISTBOX_FindStringPos(LB_DESCR *descr, LPCWSTR str, BOOL exact)
Definition: listbox.c:790
#define IS_OWNERDRAW(descr)
Definition: listbox.c:97
static INT LISTBOX_GetItemFromPoint(const LB_DESCR *descr, INT x, INT y)
Definition: listbox.c:439
#define LBS_DISPLAYCHANGED
Definition: listbox.c:54
static LRESULT LISTBOX_HandleChar(LB_DESCR *descr, WCHAR charW)
Definition: listbox.c:2441
static LRESULT LISTBOX_SetItemHeight(LB_DESCR *descr, INT index, INT height, BOOL repaint)
Definition: listbox.c:1180
static void LISTBOX_UpdateSize(LB_DESCR *descr)
Definition: listbox.c:336
static BOOL LISTBOX_Create(HWND hwnd, LPHEADCOMBO lphc)
Definition: listbox.c:2473
static LRESULT LISTBOX_HandleLButtonDown(LB_DESCR *descr, DWORD keys, INT x, INT y)
Definition: listbox.c:2026
#define SetLastError(x)
Definition: compat.h:752
GLuint index
Definition: glext.h:6031
#define FNID_LISTBOX
Definition: ntuser.h:866
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
BOOL WINAPI IsValidLocale(LCID lcid, DWORD flags)
Definition: lang.c:1552
#define DWORD
Definition: nt_native.h:44
#define LBS_NOTIFY
Definition: pedump.c:678
#define struprW(s)
Definition: unicode.h:57
#define strlenW(s)
Definition: unicode.h:28
#define strlwrW(s)
Definition: unicode.h:56
DWORD LCID
Definition: nls.h:13
const char * descr
Definition: boot.c:45
INT droppedIndex
Definition: comctl32.h:154
LPVOID lpCreateParams
Definition: winuser.h:2945
#define max(a, b)
Definition: svc.c:63
#define LB_CARETON
Definition: undocuser.h:51
#define LB_CARETOFF
Definition: undocuser.h:52
static BOOL LISTBOX_update_uistate(LB_DESCR *descr)
Definition: listbox.c:2498
#define ERROR_INVALID_INDEX
Definition: winerror.h:894
#define LCID_INSTALLED
Definition: winnls.h:201
#define LB_ERR
Definition: winuser.h:2422
#define LB_ADDFILE
Definition: winuser.h:2020
#define COLOR_WINDOW
Definition: winuser.h:912
#define CBS_DROPDOWNLIST
Definition: winuser.h:284
#define LB_SETCOUNT
Definition: winuser.h:2052
#define LB_OKAY
Definition: winuser.h:2421
#define LBN_DBLCLK
Definition: winuser.h:2061
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define WM_DROPFILES
Definition: winuser.h:1815
#define LB_GETSELCOUNT
Definition: winuser.h:2037
#define LB_GETITEMRECT
Definition: winuser.h:2033
#define LBN_SETFOCUS
Definition: winuser.h:2066
#define LB_GETANCHORINDEX
Definition: winuser.h:2026
#define LB_ERRSPACE
Definition: winuser.h:2423
#define LB_GETSEL
Definition: winuser.h:2036
#define LB_SETCOLUMNWIDTH
Definition: winuser.h:2051
#define LB_SELITEMRANGEEX
Definition: winuser.h:2048
#define LB_SELITEMRANGE
Definition: winuser.h:2047
#define LB_SETANCHORINDEX
Definition: winuser.h:2049
#define LB_SETITEMHEIGHT
Definition: winuser.h:2056
#define LB_GETLISTBOXINFO
Definition: winuser.h:2034
#define LB_SELECTSTRING
Definition: winuser.h:2046
#define WM_NCACTIVATE
Definition: winuser.h:1678
#define LBS_COMBOBOX
Definition: winuser.h:324
#define LB_ITEMFROMPOINT
Definition: winuser.h:2044
#define LB_GETCARETINDEX
Definition: winuser.h:2027
#define LBN_KILLFOCUS
Definition: winuser.h:2063
#define LB_SETTABSTOPS
Definition: winuser.h:2059
#define LB_SETSEL
Definition: winuser.h:2058
#define LB_GETSELITEMS
Definition: winuser.h:2038
#define LB_SETCARETINDEX
Definition: winuser.h:2050
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)

Referenced by ListBoxWndProcA(), ListBoxWndProcW(), and RegisterClientPFN().

◆ ListBoxWndProcA()

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

Definition at line 3277 of file listbox.c.

3278{
3280}
LRESULT WINAPI ListBoxWndProc_common(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: listbox.c:2614

Referenced by RegisterClientPFN().

◆ ListBoxWndProcW()

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

Definition at line 3285 of file listbox.c.

3286{
3288}

Referenced by RegisterClientPFN().

◆ MDIClientWndProc_common()

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

Definition at line 1097 of file mdi.c.

1099{
1100 MDICLIENTINFO *ci = NULL;
1101
1102 TRACE("%p %04x (%s) %08lx %08lx\n", hwnd, message, SPY_GetMsgName(message, hwnd), wParam, lParam);
1103
1104 if (!(ci = get_client_info( hwnd )))
1105 {
1106#ifdef __REACTOS__
1107 if (message == WM_NCCREATE)
1108 {
1109 if (!(ci = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ci))))
1110 return FALSE;
1112 ci->hBmpClose = 0;
1113 NtUserSetWindowFNID( hwnd, FNID_MDICLIENT); // wine uses WIN_ISMDICLIENT
1114 }
1115#else
1116 if (message == WM_NCCREATE) win_set_flags( hwnd, WIN_ISMDICLIENT, 0 );
1117#endif
1118 return unicode ? DefWindowProcW( hwnd, message, wParam, lParam ) :
1120 }
1121
1122 switch (message)
1123 {
1124 case WM_CREATE:
1125 {
1126 /* Since we are using only cs->lpCreateParams, we can safely
1127 * cast to LPCREATESTRUCTA here */
1129 LPCLIENTCREATESTRUCT ccs = (LPCLIENTCREATESTRUCT)cs->lpCreateParams;
1130
1131 ci->hWindowMenu = ccs->hWindowMenu;
1132 ci->idFirstChild = ccs->idFirstChild;
1133 ci->hwndChildMaximized = 0;
1134 ci->child = NULL;
1135 ci->nActiveChildren = 0;
1136 ci->nTotalCreated = 0;
1137 ci->frameTitle = NULL;
1138 ci->mdiFlags = 0;
1139 ci->hFrameMenu = GetMenu(cs->hwndParent);
1140
1141 if (!ci->hBmpClose) ci->hBmpClose = CreateMDIMenuBitmap();
1142
1143 TRACE("Client created: hwnd %p, Window menu %p, idFirst = %04x\n",
1144 hwnd, ci->hWindowMenu, ci->idFirstChild );
1145 return 0;
1146 }
1147
1148 case WM_DESTROY:
1149 {
1150 if( ci->hwndChildMaximized )
1152
1153 ci->nActiveChildren = 0;
1154 MDI_RefreshMenu(ci);
1155
1156 HeapFree( GetProcessHeap(), 0, ci->child );
1157 HeapFree( GetProcessHeap(), 0, ci->frameTitle );
1158#ifdef __REACTOS__
1159 HeapFree( GetProcessHeap(), 0, ci );
1161#endif
1162 return 0;
1163 }
1164
1165#ifdef __REACTOS__
1166 case WM_NCDESTROY:
1167 {
1169 return 0;
1170 }
1171#endif
1172
1173 case