ReactOS 0.4.16-dev-125-g798ea90
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#ifdef __REACTOS__
536 if (((btn_type == BS_RADIOBUTTON) || (btn_type == BS_AUTORADIOBUTTON)) &&
538 {
540 }
541#endif
542 break;
543
544 case WM_KILLFOCUS:
545 TRACE("WM_KILLFOCUS %p\n",hWnd);
548 paint_button( hWnd, btn_type, ODA_FOCUS );
549
550 if ((state & BUTTON_BTNPRESSED) && GetCapture() == hWnd)
552 if (style & BS_NOTIFY)
554
556 break;
557
560 break;
561
562 case BM_SETSTYLE:
563 btn_type = wParam & BS_TYPEMASK;
564 style = (style & ~BS_TYPEMASK) | btn_type;
565#ifdef __REACTOS__
567#else
568 WIN_SetStyle( hWnd, style, BS_TYPEMASK & ~style );
569#endif
570
571 /* Only redraw if lParam flag is set.*/
572 if (lParam)
574
575 break;
576
577 case BM_CLICK:
578#ifdef __REACTOS__
580 if (state & BUTTON_BMCLICK)
581 break;
582 set_button_state(hWnd, state | BUTTON_BMCLICK); // Tracked in STATE_GWL_OFFSET.
583#endif
586#ifdef __REACTOS__
588 if (!(state & BUTTON_BMCLICK)) break;
589 state &= ~BUTTON_BMCLICK;
591#endif
592 break;
593
594 case BM_SETIMAGE:
595 /* Check that image format matches button style */
596 switch (style & (BS_BITMAP|BS_ICON))
597 {
598 case BS_BITMAP:
599 if (wParam != IMAGE_BITMAP) return 0;
600 break;
601 case BS_ICON:
602 if (wParam != IMAGE_ICON) return 0;
603 break;
604 default:
605 return 0;
606 }
609 return (LRESULT)oldHbitmap;
610
611 case BM_GETIMAGE:
613
614 case BM_GETCHECK:
615 return get_button_state( hWnd ) & 3;
616
617 case BM_SETCHECK:
618 if (wParam > maxCheckState[btn_type]) wParam = maxCheckState[btn_type];
620 if ((btn_type == BS_RADIOBUTTON) || (btn_type == BS_AUTORADIOBUTTON))
621 {
622#ifdef __REACTOS__
623 if (wParam) style |= WS_TABSTOP;
624 else style &= ~WS_TABSTOP;
626#else
627 if (wParam) WIN_SetStyle( hWnd, WS_TABSTOP, 0 );
628 else WIN_SetStyle( hWnd, 0, WS_TABSTOP );
629#endif
630 }
631 if ((state & 3) != wParam)
632 {
633 set_button_state( hWnd, (state & ~3) | wParam );
634 paint_button( hWnd, btn_type, ODA_SELECT );
635 }
636 break;
637
638 case BM_GETSTATE:
639 return get_button_state( hWnd );
640
641 case BM_SETSTATE:
643 if (wParam)
645 else
647
648 paint_button( hWnd, btn_type, ODA_SELECT );
649 break;
650
651#ifdef __REACTOS__
652 case WM_UPDATEUISTATE:
653 if (unicode)
655 else
657
658 if (button_update_uistate(hWnd, unicode))
659 paint_button( hWnd, btn_type, ODA_DRAWENTIRE );
660 break;
661#endif
662
663 case WM_NCHITTEST:
664 if(btn_type == BS_GROUPBOX) return HTTRANSPARENT;
665 /* fall through */
666 default:
667 return unicode ? DefWindowProcW(hWnd, uMsg, wParam, lParam) :
669 }
670 return 0;
671}
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: precomp.h:57
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:157
static UINT BUTTON_CalcLabelRect(const BUTTON_INFO *infoPtr, HDC hdc, RECT *rc)
Definition: button.c:1278
static void paint_button(BUTTON_INFO *infoPtr, LONG style, UINT action)
Definition: button.c:221
#define BUTTON_BTNPRESSED
Definition: button.c:78
static UINT get_button_type(LONG window_style)
Definition: button.c:214
static const WORD maxCheckState[MAX_BTN_TYPE]
Definition: button.c:125
#define MAX_BTN_TYPE
Definition: button.c:123
static void BUTTON_CheckAutoRadioButton(HWND hwnd)
Definition: button.c:1749
#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:898
#define FNID_BUTTON
Definition: ntuser.h:866
DWORD NTAPI NtUserAlterWindowStyle(HWND hWnd, DWORD Index, LONG NewValue)
Definition: window.c:4091
BOOL NTAPI NtUserSetWindowFNID(HWND hWnd, WORD fnID)
Definition: window.c:4334
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
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:694
DWORD fnid
Definition: ntuser.h:709
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:154
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:1623
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:1628
#define BS_BITMAP
Definition: winuser.h:258
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1775
#define BM_GETSTATE
Definition: winuser.h:1923
#define IMAGE_BITMAP
Definition: winuser.h:211
#define GetWindowLongPtrW
Definition: winuser.h:4832
#define WM_ENABLE
Definition: winuser.h:1618
#define WM_KEYUP
Definition: winuser.h:1719
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890
#define ODA_DRAWENTIRE
Definition: winuser.h:2545
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define DLGC_BUTTON
Definition: winuser.h:2623
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BST_UNCHECKED
Definition: winuser.h:199
#define BN_DOUBLECLICKED
Definition: winuser.h:1931
#define IMAGE_ICON
Definition: winuser.h:212
#define BN_SETFOCUS
Definition: winuser.h:1936
#define WM_CAPTURECHANGED
Definition: winuser.h:1811
#define WM_CREATE
Definition: winuser.h:1611
#define BS_ICON
Definition: winuser.h:264
#define VK_SPACE
Definition: winuser.h:2222
#define BS_PUSHLIKE
Definition: winuser.h:272
#define BM_SETSTATE
Definition: winuser.h:1926
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1781
#define BS_TYPEMASK
Definition: winuser.h:270
#define ODA_FOCUS
Definition: winuser.h:2547
#define DLGC_UNDEFPUSHBUTTON
Definition: winuser.h:2619
#define WM_NCHITTEST
Definition: winuser.h:1689
#define BN_KILLFOCUS
Definition: winuser.h:1933
#define WM_SETFOCUS
Definition: winuser.h:1616
#define WM_MOUSEMOVE
Definition: winuser.h:1778
HWND WINAPI GetCapture(void)
Definition: message.c:2881
#define BS_NOTIFY
Definition: winuser.h:268
#define WM_LBUTTONDOWN
Definition: winuser.h:1779
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1629
#define DLGC_DEFPUSHBUTTON
Definition: winuser.h:2618
#define WM_GETFONT
Definition: winuser.h:1654
#define BM_SETCHECK
Definition: winuser.h:1924
#define BM_SETIMAGE
Definition: winuser.h:1925
#define WM_CTLCOLORBTN
Definition: winuser.h:1772
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
#define WM_SETTEXT
Definition: winuser.h:1620
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI SetFocus(_In_opt_ HWND)
#define DLGC_RADIOBUTTON
Definition: winuser.h:2620
#define WM_SETFONT
Definition: winuser.h:1653
#define BM_CLICK
Definition: winuser.h:1920
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define BST_PUSHED
Definition: winuser.h:201
#define BM_GETIMAGE
Definition: winuser.h:1922
#define BM_SETSTYLE
Definition: winuser.h:1927
#define BST_FOCUS
Definition: winuser.h:200
HDC WINAPI GetDC(_In_opt_ HWND)
#define DLGC_STATIC
Definition: winuser.h:2622
#define WM_LBUTTONUP
Definition: winuser.h:1780
HWND WINAPI GetParent(_In_ HWND)
#define WM_NCDESTROY
Definition: winuser.h:1687
#define ODA_SELECT
Definition: winuser.h:2546
#define HTTRANSPARENT
Definition: winuser.h:2476
#define MK_LBUTTON
Definition: winuser.h:2370
#define BN_CLICKED
Definition: winuser.h:1928
#define WM_DESTROY
Definition: winuser.h:1612
#define WM_KEYDOWN
Definition: winuser.h:1718
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define SetWindowLongPtrW
Definition: winuser.h:5358
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define GWL_STYLE
Definition: winuser.h:855
BOOL WINAPI IsWindowVisible(_In_ HWND)
#define WM_KILLFOCUS
Definition: winuser.h:1617
#define WM_GETDLGCODE
Definition: winuser.h:1692
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BST_CHECKED
Definition: winuser.h:197
#define BM_GETCHECK
Definition: winuser.h:1921

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

1079{
1080 if( lphc->wState & CBF_DROPPED )
1081 {
1082 CBRollUp( lphc, ok, bRedrawButton );
1083 return FALSE;
1084 }
1085
1086 CBDropDown( lphc );
1087 return TRUE;
1088}
#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:1023
static void CBDropDown(LPHEADCOMBO lphc)
Definition: combo.c:921
UINT wState
Definition: comctl32.h:155

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

1815{
1817#ifdef __REACTOS__
1818 PWND pWnd;
1819
1820 pWnd = ValidateHwnd(hwnd);
1821 if (pWnd)
1822 {
1823 if (!pWnd->fnid)
1824 {
1826 }
1827 else
1828 {
1829 if (pWnd->fnid != FNID_COMBOBOX)
1830 {
1831 ERR("Wrong window class for ComboBox! fnId 0x%x\n",pWnd->fnid);
1832 return 0;
1833 }
1834 }
1835 }
1836#endif
1837
1838 TRACE("[%p]: msg %s wp %08lx lp %08lx\n", hwnd, SPY_GetMsgName(message, hwnd), wParam, lParam);
1839
1840#ifndef __REACTOS__
1841 if (!IsWindow(hwnd)) return 0;
1842#endif
1843
1844 if (lphc || message == WM_NCCREATE)
1845 switch(message)
1846 {
1847 case WM_NCCREATE:
1848 {
1849 LONG style = unicode ? ((LPCREATESTRUCTW)lParam)->style : ((LPCREATESTRUCTA)lParam)->style;
1850 return COMBO_NCCreate(hwnd, style);
1851 }
1852 case WM_NCDESTROY:
1853 COMBO_NCDestroy(lphc);
1854#ifdef __REACTOS__
1856#endif
1857 break;/* -> DefWindowProc */
1858
1859 case WM_CREATE:
1860 {
1862 LONG style;
1863 if(unicode)
1864 {
1865 hwndParent = ((LPCREATESTRUCTW)lParam)->hwndParent;
1866 style = ((LPCREATESTRUCTW)lParam)->style;
1867 }
1868 else
1869 {
1870 hwndParent = ((LPCREATESTRUCTA)lParam)->hwndParent;
1871 style = ((LPCREATESTRUCTA)lParam)->style;
1872 }
1873 return COMBO_Create(hwnd, lphc, hwndParent, style, unicode);
1874 }
1875 case WM_PRINTCLIENT:
1876 /* Fallthrough */
1877 case WM_PAINT:
1878 /* wParam may contain a valid HDC! */
1879 return COMBO_Paint(lphc, (HDC)wParam);
1880 case WM_ERASEBKGND:
1881 /* do all painting in WM_PAINT like Windows does */
1882 return 1;
1883
1884 case WM_GETDLGCODE:
1885 {
1887 if (lParam && (((LPMSG)lParam)->message == WM_KEYDOWN))
1888 {
1889 int vk = (int)((LPMSG)lParam)->wParam;
1890
1891 if ((vk == VK_RETURN || vk == VK_ESCAPE) && (lphc->wState & CBF_DROPPED))
1893 }
1894 return result;
1895 }
1896 case WM_SIZE:
1897 if (lphc->hWndLBox && !(lphc->wState & CBF_NORESIZE))
1898 COMBO_Size( lphc );
1899 return TRUE;
1900 case WM_SETFONT:
1901 COMBO_Font( lphc, (HFONT)wParam, (BOOL)lParam );
1902 return TRUE;
1903 case WM_GETFONT:
1904 return (LRESULT)lphc->hFont;
1905 case WM_SETFOCUS:
1906 if (lphc->wState & CBF_EDIT)
1907 {
1908 SetFocus( lphc->hWndEdit );
1909 /* The first time focus is received, select all the text */
1910 if (!(lphc->wState & CBF_BEENFOCUSED))
1911 {
1912 SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, -1);
1913 lphc->wState |= CBF_BEENFOCUSED;
1914 }
1915 }
1916 else
1917 COMBO_SetFocus( lphc );
1918 return TRUE;
1919 case WM_KILLFOCUS:
1920 {
1921 HWND hwndFocus = WIN_GetFullHandle((HWND)wParam);
1922 if (!hwndFocus || (hwndFocus != lphc->hWndEdit && hwndFocus != lphc->hWndLBox))
1923 COMBO_KillFocus( lphc );
1924 return TRUE;
1925 }
1926 case WM_COMMAND:
1928 case WM_GETTEXT:
1929 return unicode ? COMBO_GetTextW( lphc, wParam, (LPWSTR)lParam )
1930 : COMBO_GetTextA( lphc, wParam, (LPSTR)lParam );
1931 case WM_SETTEXT:
1932 case WM_GETTEXTLENGTH:
1933 case WM_CLEAR:
1934 if ((message == WM_GETTEXTLENGTH) && !ISWIN31 && !(lphc->wState & CBF_EDIT))
1935 {
1936 int j = SendMessageW(lphc->hWndLBox, LB_GETCURSEL, 0, 0);
1937 if (j == -1) return 0;
1938 return unicode ? SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, j, 0) :
1939 SendMessageA(lphc->hWndLBox, LB_GETTEXTLEN, j, 0);
1940 }
1941 else if ( lphc->wState & CBF_EDIT )
1942 {
1943 LRESULT ret;
1944 lphc->wState |= CBF_NOEDITNOTIFY;
1945 ret = unicode ? SendMessageW(lphc->hWndEdit, message, wParam, lParam) :
1946 SendMessageA(lphc->hWndEdit, message, wParam, lParam);
1947 lphc->wState &= ~CBF_NOEDITNOTIFY;
1948 return ret;
1949 }
1950 else
1951 return CB_ERR;
1952 case WM_CUT:
1953 case WM_PASTE:
1954 case WM_COPY:
1955 if (lphc->wState & CBF_EDIT)
1956 {
1957 return unicode ? SendMessageW(lphc->hWndEdit, message, wParam, lParam) :
1958 SendMessageA(lphc->hWndEdit, message, wParam, lParam);
1959 }
1960 else return CB_ERR;
1961
1962 case WM_DRAWITEM:
1963 case WM_DELETEITEM:
1964 case WM_COMPAREITEM:
1965 case WM_MEASUREITEM:
1966 return COMBO_ItemOp(lphc, message, lParam);
1967 case WM_ENABLE:
1968 if (lphc->wState & CBF_EDIT)
1969 EnableWindow( lphc->hWndEdit, (BOOL)wParam );
1970 EnableWindow( lphc->hWndLBox, (BOOL)wParam );
1971
1972 /* Force the control to repaint when the enabled state changes. */
1973 InvalidateRect(lphc->self, NULL, TRUE);
1974 return TRUE;
1975 case WM_SETREDRAW:
1976 if (wParam)
1977 lphc->wState &= ~CBF_NOREDRAW;
1978 else
1979 lphc->wState |= CBF_NOREDRAW;
1980
1981 if ( lphc->wState & CBF_EDIT )
1984 return 0;
1985 case WM_SYSKEYDOWN:
1986#ifdef __REACTOS__
1987 if ( KF_ALTDOWN & HIWORD(lParam) )
1988#else
1989 if ( KEYDATA_ALT & HIWORD(lParam) )
1990#endif
1991 if( wParam == VK_UP || wParam == VK_DOWN )
1992#ifdef __REACTOS__
1993 {
1994#endif
1995 COMBO_FlipListbox( lphc, FALSE, FALSE );
1996 return 0;
1997#ifdef __REACTOS__
1998 }
1999 break;
2000#endif
2001
2002 case WM_KEYDOWN:
2003 if ((wParam == VK_RETURN || wParam == VK_ESCAPE) &&
2004 (lphc->wState & CBF_DROPPED))
2005 {
2006 CBRollUp( lphc, wParam == VK_RETURN, FALSE );
2007 return TRUE;
2008 }
2009 else if ((wParam == VK_F4) && !(lphc->wState & CBF_EUI))
2010 {
2011 COMBO_FlipListbox( lphc, FALSE, FALSE );
2012 return TRUE;
2013 }
2014 /* fall through */
2015 case WM_CHAR:
2016 case WM_IME_CHAR:
2017 {
2018 HWND hwndTarget;
2019
2020#ifdef __REACTOS__
2021 if (lphc->wState & CBF_DROPPED)
2022 lphc->wState |= CBF_NOROLLUP;
2023#endif
2024 if ( lphc->wState & CBF_EDIT )
2025 hwndTarget = lphc->hWndEdit;
2026 else
2027 hwndTarget = lphc->hWndLBox;
2028
2029 return unicode ? SendMessageW(hwndTarget, message, wParam, lParam) :
2030 SendMessageA(hwndTarget, message, wParam, lParam);
2031 }
2032 case WM_LBUTTONDOWN:
2033 if ( !(lphc->wState & CBF_FOCUSED) ) SetFocus( lphc->self );
2034 if ( lphc->wState & CBF_FOCUSED ) COMBO_LButtonDown( lphc, lParam );
2035 return TRUE;
2036 case WM_LBUTTONUP:
2037 COMBO_LButtonUp( lphc );
2038 return TRUE;
2039 case WM_MOUSEMOVE:
2040 if ( lphc->wState & CBF_CAPTURE )
2041 COMBO_MouseMove( lphc, wParam, lParam );
2042 return TRUE;
2043
2044 case WM_MOUSEWHEEL:
2045 if (wParam & (MK_SHIFT | MK_CONTROL))
2046 return unicode ? DefWindowProcW(hwnd, message, wParam, lParam) :
2048
2049 if (GET_WHEEL_DELTA_WPARAM(wParam) > 0) return SendMessageW(hwnd, WM_KEYDOWN, VK_UP, 0);
2050 if (GET_WHEEL_DELTA_WPARAM(wParam) < 0) return SendMessageW(hwnd, WM_KEYDOWN, VK_DOWN, 0);
2051 return TRUE;
2052
2053 case WM_CTLCOLOR:
2054 case WM_CTLCOLORMSGBOX:
2055 case WM_CTLCOLOREDIT:
2056 case WM_CTLCOLORLISTBOX:
2057 case WM_CTLCOLORBTN:
2058 case WM_CTLCOLORDLG:
2060 case WM_CTLCOLORSTATIC:
2061#ifdef __REACTOS__
2062 if (pWnd && !(pWnd->state2 & WNDS2_WIN40COMPAT)) break; // Must be Win 4.0 and above.
2063#endif
2064 if (lphc->owner)
2065 return SendMessageW(lphc->owner, message, wParam, lParam);
2066 break;
2067
2068 /* Combo messages */
2069 case CB_ADDSTRING:
2070 if (unicode)
2071 {
2072 if (lphc->dwStyle & CBS_LOWERCASE)
2074 else if (lphc->dwStyle & CBS_UPPERCASE)
2076 return SendMessageW(lphc->hWndLBox, LB_ADDSTRING, 0, lParam);
2077 }
2078 else /* unlike the unicode version, the ansi version does not overwrite
2079 the string if converting case */
2080 {
2081 char *string = NULL;
2082 LRESULT ret;
2083 if (lphc->dwStyle & CBS_LOWERCASE)
2084 {
2085 string = strdupA((LPSTR)lParam);
2086 CharLowerA(string);
2087 }
2088
2089 else if (lphc->dwStyle & CBS_UPPERCASE)
2090 {
2091 string = strdupA((LPSTR)lParam);
2092 CharUpperA(string);
2093 }
2094
2095 ret = SendMessageA(lphc->hWndLBox, LB_ADDSTRING, 0, string ? (LPARAM)string : lParam);
2096 HeapFree(GetProcessHeap(), 0, string);
2097 return ret;
2098 }
2099 case CB_INSERTSTRING:
2100 if (unicode)
2101 {
2102 if (lphc->dwStyle & CBS_LOWERCASE)
2104 else if (lphc->dwStyle & CBS_UPPERCASE)
2107 }
2108 else
2109 {
2110 if (lphc->dwStyle & CBS_LOWERCASE)
2112 else if (lphc->dwStyle & CBS_UPPERCASE)
2115 }
2116 case CB_DELETESTRING:
2117 return unicode ? SendMessageW(lphc->hWndLBox, LB_DELETESTRING, wParam, 0) :
2118 SendMessageA(lphc->hWndLBox, LB_DELETESTRING, wParam, 0);
2119 case CB_SELECTSTRING:
2120 return COMBO_SelectString(lphc, (INT)wParam, lParam, unicode);
2121 case CB_FINDSTRING:
2122 return unicode ? SendMessageW(lphc->hWndLBox, LB_FINDSTRING, wParam, lParam) :
2123 SendMessageA(lphc->hWndLBox, LB_FINDSTRING, wParam, lParam);
2124 case CB_FINDSTRINGEXACT:
2125 return unicode ? SendMessageW(lphc->hWndLBox, LB_FINDSTRINGEXACT, wParam, lParam) :
2126 SendMessageA(lphc->hWndLBox, LB_FINDSTRINGEXACT, wParam, lParam);
2127 case CB_SETITEMHEIGHT:
2128 return COMBO_SetItemHeight( lphc, (INT)wParam, (INT)lParam);
2129 case CB_GETITEMHEIGHT:
2130 if ((INT)wParam >= 0) /* listbox item */
2131 return SendMessageW(lphc->hWndLBox, LB_GETITEMHEIGHT, wParam, 0);
2132 return CBGetTextAreaHeight(hwnd, lphc);
2133 case CB_RESETCONTENT:
2135 if ((lphc->wState & CBF_EDIT) && CB_HASSTRINGS(lphc))
2136 {
2137 static const WCHAR empty_stringW[] = { 0 };
2139 }
2140 else
2141 InvalidateRect(lphc->self, NULL, TRUE);
2142 return TRUE;
2143 case CB_INITSTORAGE:
2146 return SendMessageW(lphc->hWndLBox, LB_GETHORIZONTALEXTENT, 0, 0);
2149 case CB_GETTOPINDEX:
2150 return SendMessageW(lphc->hWndLBox, LB_GETTOPINDEX, 0, 0);
2151 case CB_GETLOCALE:
2152 return SendMessageW(lphc->hWndLBox, LB_GETLOCALE, 0, 0);
2153 case CB_SETLOCALE:
2154 return SendMessageW(lphc->hWndLBox, LB_SETLOCALE, wParam, 0);
2155 case CB_SETDROPPEDWIDTH:
2156 if ((CB_GETTYPE(lphc) == CBS_SIMPLE) || (INT)wParam >= 32768)
2157 return CB_ERR;
2158 /* new value must be higher than combobox width */
2159 if ((INT)wParam >= lphc->droppedRect.right - lphc->droppedRect.left)
2160 lphc->droppedWidth = wParam;
2161 else if (wParam)
2162 lphc->droppedWidth = 0;
2163
2164 /* recalculate the combobox area */
2165 CBCalcPlacement(hwnd, lphc, &lphc->textRect, &lphc->buttonRect, &lphc->droppedRect );
2166
2167 /* fall through */
2168 case CB_GETDROPPEDWIDTH:
2169 if (lphc->droppedWidth)
2170 return lphc->droppedWidth;
2171 return lphc->droppedRect.right - lphc->droppedRect.left;
2174 return CB_OKAY;
2175 case CB_GETDROPPEDSTATE:
2176 return (lphc->wState & CBF_DROPPED) != 0;
2177 case CB_DIR:
2178 return unicode ? SendMessageW(lphc->hWndLBox, LB_DIR, wParam, lParam) :
2179 SendMessageA(lphc->hWndLBox, LB_DIR, wParam, lParam);
2180
2181 case CB_SHOWDROPDOWN:
2182 if (CB_GETTYPE(lphc) != CBS_SIMPLE)
2183 {
2184 if (wParam)
2185 {
2186 if (!(lphc->wState & CBF_DROPPED))
2187 CBDropDown( lphc );
2188 }
2189 else if (lphc->wState & CBF_DROPPED)
2190 CBRollUp( lphc, FALSE, TRUE );
2191 }
2192 return TRUE;
2193 case CB_GETCOUNT:
2194 return SendMessageW(lphc->hWndLBox, LB_GETCOUNT, 0, 0);
2195 case CB_GETCURSEL:
2196 return SendMessageW(lphc->hWndLBox, LB_GETCURSEL, 0, 0);
2197 case CB_SETCURSEL:
2199 if (lParam >= 0)
2201
2202 /* no LBN_SELCHANGE in this case, update manually */
2203 CBPaintText(lphc, NULL);
2204 lphc->wState &= ~CBF_SELCHANGE;
2205 return lParam;
2206 case CB_GETLBTEXT:
2207 return unicode ? SendMessageW(lphc->hWndLBox, LB_GETTEXT, wParam, lParam) :
2208 SendMessageA(lphc->hWndLBox, LB_GETTEXT, wParam, lParam);
2209 case CB_GETLBTEXTLEN:
2210 return unicode ? SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, wParam, 0) :
2211 SendMessageA(lphc->hWndLBox, LB_GETTEXTLEN, wParam, 0);
2212 case CB_GETITEMDATA:
2213 return SendMessageW(lphc->hWndLBox, LB_GETITEMDATA, wParam, 0);
2214 case CB_SETITEMDATA:
2216 case CB_GETEDITSEL:
2217 /* Edit checks passed parameters itself */
2218 if (lphc->wState & CBF_EDIT)
2219 return SendMessageW(lphc->hWndEdit, EM_GETSEL, wParam, lParam);
2220 return CB_ERR;
2221 case CB_SETEDITSEL:
2222 if (lphc->wState & CBF_EDIT)
2224 return CB_ERR;
2225 case CB_SETEXTENDEDUI:
2226 if (CB_GETTYPE(lphc) == CBS_SIMPLE )
2227 return CB_ERR;
2228 if (wParam)
2229 lphc->wState |= CBF_EUI;
2230 else lphc->wState &= ~CBF_EUI;
2231 return CB_OKAY;
2232 case CB_GETEXTENDEDUI:
2233 return (lphc->wState & CBF_EUI) != 0;
2234 case CB_GETCOMBOBOXINFO:
2235 return COMBO_GetComboBoxInfo(lphc, (COMBOBOXINFO *)lParam);
2236 case CB_LIMITTEXT:
2237 if (lphc->wState & CBF_EDIT)
2239 return TRUE;
2240
2241#ifdef __REACTOS__
2242 case WM_UPDATEUISTATE:
2243 if (unicode)
2245 else
2247
2248 if (COMBO_update_uistate(lphc))
2249 {
2250 /* redraw text */
2251 if (!(lphc->wState & CBF_EDIT))
2252 NtUserInvalidateRect(lphc->self, &lphc->textRect, TRUE);
2253 }
2254 break;
2255
2256 case WM_CBLOSTTEXTFOCUS: /* undocumented message - deselects the text when focus is lost */
2257 if (lphc->hWndEdit != NULL)
2258 {
2259 SendMessage(lphc->self, WM_LBUTTONUP, 0, 0xFFFFFFFF);
2260 SendMessage(lphc->hWndEdit, EM_SETSEL, 0, 0);
2261 lphc->wState &= ~(CBF_FOCUSED | CBF_BEENFOCUSED);
2262 CB_NOTIFY(lphc, CBN_KILLFOCUS);
2263 }
2264 return TRUE;
2265#endif
2266
2267 default:
2268 if (message >= WM_USER)
2269 WARN("unknown msg WM_USER+%04x wp=%04lx lp=%08lx\n", message - WM_USER, wParam, lParam );
2270 break;
2271 }
2272 return unicode ? DefWindowProcW(hwnd, message, wParam, lParam) :
2274}
signed short INT16
#define WARN(fmt,...)
Definition: precomp.h:61
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_NOROLLUP
Definition: controls.h:47
#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:805
static LRESULT COMBO_NCDestroy(HEADCOMBO *lphc)
Definition: combo.c:159
static INT CBGetTextAreaHeight(HEADCOMBO *lphc, BOOL clip_item_height)
Definition: combo.c:206
static LRESULT COMBO_NCCreate(HWND hwnd, LONG style)
Definition: combo.c:124
#define ISWIN31
Definition: combo.c:60
static void COMBO_Size(HEADCOMBO *lphc)
Definition: combo.c:1390
static void COMBO_LButtonDown(LPHEADCOMBO lphc, LPARAM lParam)
Definition: combo.c:1529
#define CB_GETTYPE(lphc)
Definition: combo.c:58
static void COMBO_KillFocus(LPHEADCOMBO lphc)
Definition: combo.c:1124
static void COMBO_MouseMove(LPHEADCOMBO lphc, WPARAM wParam, LPARAM lParam)
Definition: combo.c:1607
static LRESULT COMBO_GetComboBoxInfo(const HEADCOMBO *lphc, COMBOBOXINFO *pcbi)
Definition: combo.c:1641
static void COMBO_SetFocus(LPHEADCOMBO lphc)
Definition: combo.c:1102
static void CBPaintText(HEADCOMBO *lphc, HDC hdc_paint)
Definition: combo.c:625
static LRESULT COMBO_Command(LPHEADCOMBO lphc, WPARAM wParam, HWND hWnd)
Definition: combo.c:1150
static void COMBO_LButtonUp(LPHEADCOMBO lphc)
Definition: combo.c:1574
static void CBCalcPlacement(HEADCOMBO *combo)
Definition: combo.c:317
#define CB_HASSTRINGS(lphc)
Definition: combo.c:56
#define KEYDATA_ALT
Definition: combo.c:43
static LRESULT COMBO_ItemOp(LPHEADCOMBO lphc, UINT msg, LPARAM lParam)
Definition: combo.c:1259
static LRESULT COMBO_SelectString(LPHEADCOMBO lphc, INT start, LPARAM pText)
Definition: combo.c:1511
BOOL COMBO_FlipListbox(LPHEADCOMBO lphc, BOOL ok, BOOL bRedrawButton)
Definition: combo.c:1078
static LRESULT COMBO_SetItemHeight(LPHEADCOMBO lphc, INT index, INT height)
Definition: combo.c:1476
static void COMBO_Font(LPHEADCOMBO lphc, HFONT hFont, BOOL bRedraw)
Definition: combo.c:1445
#define CB_NOTIFY(lphc, code)
Definition: combo.c:50
static void CBGetDroppedControlRect(LPHEADCOMBO lphc, LPRECT lpRect)
Definition: combo.c:386
static LRESULT COMBO_Create(HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG style)
Definition: combo.c:401
#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:650
#define FNID_COMBOBOX
Definition: ntuser.h:867
BOOL NTAPI NtUserInvalidateRect(HWND hWnd, CONST RECT *lpRect, BOOL bErase)
Definition: painting.c:2541
WORD vk
Definition: input.c:77
RECT buttonRect
Definition: comctl32.h:158
RECT textRect
Definition: comctl32.h:157
RECT droppedRect
Definition: comctl32.h:159
HWND hWndLBox
Definition: comctl32.h:154
HWND owner
Definition: comctl32.h:151
HWND hWndEdit
Definition: comctl32.h:153
HWND self
Definition: comctl32.h:150
HFONT hFont
Definition: comctl32.h:156
INT droppedWidth
Definition: comctl32.h:162
UINT dwStyle
Definition: comctl32.h:152
DWORD state2
Definition: ntuser.h:702
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:1376
static char * strdupA(LPCSTR str)
Definition: combo.c:1795
static LRESULT COMBO_GetTextA(LPHEADCOMBO lphc, INT count, LPSTR buf)
Definition: combo.c:1426
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:1963
#define CB_SETITEMDATA
Definition: winuser.h:1969
#define CB_GETHORIZONTALEXTENT
Definition: winuser.h:1952
#define MK_SHIFT
Definition: winuser.h:2372
#define LB_GETCOUNT
Definition: winuser.h:2041
#define WM_GETTEXTLENGTH
Definition: winuser.h:1622
#define CB_SETDROPPEDWIDTH
Definition: winuser.h:1965
#define LB_FINDSTRINGEXACT
Definition: winuser.h:2038
#define CB_GETLBTEXTLEN
Definition: winuser.h:1956
#define LB_GETITEMDATA
Definition: winuser.h:2044
#define EM_LIMITTEXT
Definition: winuser.h:2003
#define CB_GETLBTEXT
Definition: winuser.h:1955
#define WM_PASTE
Definition: winuser.h:1866
#define LB_SETHORIZONTALEXTENT
Definition: winuser.h:2067
#define CB_OKAY
Definition: winuser.h:2437
#define LB_GETTEXT
Definition: winuser.h:2052
#define LB_SETTOPINDEX
Definition: winuser.h:2073
#define DLGC_WANTCHARS
Definition: winuser.h:2621
#define CB_SHOWDROPDOWN
Definition: winuser.h:1973
#define CB_GETITEMHEIGHT
Definition: winuser.h:1954
#define EM_GETSEL
Definition: winuser.h:2000
#define CB_SETHORIZONTALEXTENT
Definition: winuser.h:1968
#define LB_DIR
Definition: winuser.h:2036
#define WM_SIZE
Definition: winuser.h:1614
#define WM_COMMAND
Definition: winuser.h:1743
#define KF_ALTDOWN
Definition: winuser.h:2452
struct tagCREATESTRUCTA * LPCREATESTRUCTA
LPWSTR WINAPI CharLowerW(_Inout_ LPWSTR)
#define CB_INITSTORAGE
Definition: winuser.h:1959
#define CB_ERR
Definition: winuser.h:2438
LPSTR WINAPI CharLowerA(_Inout_ LPSTR)
#define CB_SETCURSEL
Definition: winuser.h:1964
#define LB_GETTOPINDEX
Definition: winuser.h:2054
#define VK_UP
Definition: winuser.h:2228
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define LB_GETLOCALE
Definition: winuser.h:2048
#define WM_GETTEXT
Definition: winuser.h:1621
#define WM_CTLCOLORSCROLLBAR
Definition: winuser.h:1774
LPSTR WINAPI CharUpperA(_Inout_ LPSTR)
#define WM_CUT
Definition: winuser.h:1864
#define LB_SETLOCALE
Definition: winuser.h:2070
#define CB_RESETCONTENT
Definition: winuser.h:1962
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1943
#define LB_ADDSTRING
Definition: winuser.h:2034
#define CB_DIR
Definition: winuser.h:1941
#define CB_GETCOUNT
Definition: winuser.h:1945
#define CB_GETDROPPEDWIDTH
Definition: winuser.h:1949
#define WM_DELETEITEM
Definition: winuser.h:1650
#define CB_GETCOMBOBOXINFO
Definition: winuser.h:1944
#define WM_CTLCOLORMSGBOX
Definition: winuser.h:1769
#define WM_DRAWITEM
Definition: winuser.h:1648
#define CB_SETLOCALE
Definition: winuser.h:1971
#define WM_NCCREATE
Definition: winuser.h:1686
#define CBS_SIMPLE
Definition: winuser.h:291
#define WM_IME_CHAR
Definition: winuser.h:1837
#define LB_RESETCONTENT
Definition: winuser.h:2058
#define LB_DELETESTRING
Definition: winuser.h:2035
#define VK_RETURN
Definition: winuser.h:2204
#define CB_GETDROPPEDCONTROLRECT
Definition: winuser.h:1947
#define LB_FINDSTRING
Definition: winuser.h:2037
#define MK_CONTROL
Definition: winuser.h:2373
#define LB_GETITEMHEIGHT
Definition: winuser.h:2045
#define LB_GETHORIZONTALEXTENT
Definition: winuser.h:2043
#define DLGC_WANTARROWS
Definition: winuser.h:2613
#define LB_INSERTSTRING
Definition: winuser.h:2056
#define CB_ADDSTRING
Definition: winuser.h:1939
#define CB_GETITEMDATA
Definition: winuser.h:1953
#define SendMessage
Definition: winuser.h:5855
#define CBN_KILLFOCUS
Definition: winuser.h:1981
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define CBS_LOWERCASE
Definition: winuser.h:286
#define EM_SETSEL
Definition: winuser.h:2021
#define WM_MEASUREITEM
Definition: winuser.h:1649
#define CB_SETEDITSEL
Definition: winuser.h:1966
#define VK_F4
Definition: winuser.h:2261
#define CB_GETDROPPEDSTATE
Definition: winuser.h:1948
#define WM_CHAR
Definition: winuser.h:1720
#define LB_GETTEXTLEN
Definition: winuser.h:2053
#define LB_SETITEMDATA
Definition: winuser.h:2068
#define CB_GETEXTENDEDUI
Definition: winuser.h:1951
#define VK_DOWN
Definition: winuser.h:2230
#define WM_COPY
Definition: winuser.h:1865
#define CB_GETTOPINDEX
Definition: winuser.h:1958
#define CB_LIMITTEXT
Definition: winuser.h:1961
#define WM_USER
Definition: winuser.h:1898
#define CB_GETEDITSEL
Definition: winuser.h:1950
#define WM_CTLCOLORLISTBOX
Definition: winuser.h:1771
#define DLGC_WANTMESSAGE
Definition: winuser.h:2616
#define CB_FINDSTRING
Definition: winuser.h:1942
#define LB_SETCURSEL
Definition: winuser.h:2066
#define WM_CLEAR
Definition: winuser.h:1867
#define CBS_UPPERCASE
Definition: winuser.h:293
#define CB_SETEXTENDEDUI
Definition: winuser.h:1967
#define WM_COMPAREITEM
Definition: winuser.h:1658
#define CB_INSERTSTRING
Definition: winuser.h:1960
#define LB_GETCURSEL
Definition: winuser.h:2042
#define CB_GETCURSEL
Definition: winuser.h:1946
#define CB_DELETESTRING
Definition: winuser.h:1940
#define CB_GETLOCALE
Definition: winuser.h:1957
#define CB_SETITEMHEIGHT
Definition: winuser.h:1970
#define LB_INITSTORAGE
Definition: winuser.h:2055
#define WM_CTLCOLOREDIT
Definition: winuser.h:1770
#define VK_ESCAPE
Definition: winuser.h:2217
#define WM_CTLCOLORDLG
Definition: winuser.h:1773
struct tagCREATESTRUCTW * LPCREATESTRUCTW
#define WM_SYSKEYDOWN
Definition: winuser.h:1722
#define WM_SETREDRAW
Definition: winuser.h:1619
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:409

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 @1636 Msg[]
BOOL NTAPI NtUserMessageCall(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ResultInfo, DWORD dwType, BOOL Ansi)
Definition: message.c:2540
#define FNID_DESKTOP
Definition: ntuser.h:862
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define WM_QUERYNEWPALETTE
Definition: winuser.h:1881
#define WM_CLOSE
Definition: winuser.h:1624
HDC WINAPI GetWindowDC(_In_opt_ HWND)
#define WM_PALETTECHANGED
Definition: winuser.h:1880
#define IDC_ARROW
Definition: winuser.h:687
BOOL WINAPI PaintDesktop(_In_ HDC)
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2157
#define WM_SETCURSOR
Definition: winuser.h:1639
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 4854 of file edit.c.

4856{
4858 LRESULT result = 0;
4859#ifdef __REACTOS__
4860 /* ReactOS r50219 */
4861 PWND pWnd;
4862
4863 pWnd = ValidateHwnd(hwnd);
4864 if (pWnd)
4865 {
4866 if (!pWnd->fnid)
4867 {
4869 }
4870 else
4871 {
4872 if (pWnd->fnid != FNID_EDIT)
4873 {
4874 ERR("Wrong window class for Edit! fnId 0x%x\n",pWnd->fnid);
4875 return 0;
4876 }
4877 }
4878 }
4879#endif
4880
4881 TRACE("hwnd=%p msg=%x (%s) wparam=%lx lparam=%lx\n", hwnd, msg, SPY_GetMsgName(msg, hwnd), wParam, lParam);
4882
4883 if (!es && msg != WM_NCCREATE)
4884 return DefWindowProcT(hwnd, msg, wParam, lParam, unicode);
4885
4886 if (es && (msg != WM_NCDESTROY)) EDIT_LockBuffer(es);
4887
4888 switch (msg) {
4889 case EM_GETSEL:
4891 break;
4892
4893 case EM_SETSEL:
4896 result = 1;
4897 break;
4898
4899 case EM_GETRECT:
4900 if (lParam)
4901 CopyRect((LPRECT)lParam, &es->format_rect);
4902 break;
4903
4904 case EM_SETRECT:
4905 if ((es->style & ES_MULTILINE) && lParam) {
4908 }
4909 break;
4910
4911 case EM_SETRECTNP:
4912 if ((es->style & ES_MULTILINE) && lParam)
4914 break;
4915
4916 case EM_SCROLL:
4918 break;
4919
4920 case EM_LINESCROLL:
4922 break;
4923
4924 case EM_SCROLLCARET:
4926 result = 1;
4927 break;
4928
4929 case EM_GETMODIFY:
4930 result = ((es->flags & EF_MODIFIED) != 0);
4931 break;
4932
4933 case EM_SETMODIFY:
4934 if (wParam)
4935 es->flags |= EF_MODIFIED;
4936 else
4937 es->flags &= ~(EF_MODIFIED | EF_UPDATE); /* reset pending updates */
4938 break;
4939
4940 case EM_GETLINECOUNT:
4941 result = (es->style & ES_MULTILINE) ? es->line_count : 1;
4942 break;
4943
4944 case EM_LINEINDEX:
4946 break;
4947
4948 case EM_SETHANDLE:
4950 break;
4951
4952 case EM_GETHANDLE:
4954 break;
4955
4956 case EM_GETTHUMB:
4958 break;
4959
4960 /* these messages missing from specs */
4961 case 0x00bf:
4962 case 0x00c0:
4963 case 0x00c3:
4964 case 0x00ca:
4965 FIXME("undocumented message 0x%x, please report\n", msg);
4967 break;
4968
4969 case EM_LINELENGTH:
4971 break;
4972
4973 case EM_REPLACESEL:
4974 {
4975 LPWSTR textW;
4976
4977 if(unicode)
4978 textW = (LPWSTR)lParam;
4979 else
4980 {
4982 INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0);
4983 if (!(textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR)))) break;
4984 MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW);
4985 }
4986
4988 result = 1;
4989
4990 if(!unicode)
4992 break;
4993 }
4994
4995 case EM_GETLINE:
4997 break;
4998
4999 case EM_SETLIMITTEXT:
5001 break;
5002
5003 case EM_CANUNDO:
5005 break;
5006
5007 case EM_UNDO:
5008 case WM_UNDO:
5010 break;
5011
5012 case EM_FMTLINES:
5014 break;
5015
5016 case EM_LINEFROMCHAR:
5018 break;
5019
5020 case EM_SETTABSTOPS:
5022 break;
5023
5024 case EM_SETPASSWORDCHAR:
5025 {
5026 WCHAR charW = 0;
5027
5028 if(unicode)
5029 charW = (WCHAR)wParam;
5030 else
5031 {
5032 CHAR charA = wParam;
5033 MultiByteToWideChar(CP_ACP, 0, &charA, 1, &charW, 1);
5034 }
5035
5037 break;
5038 }
5039
5040 case EM_EMPTYUNDOBUFFER:
5042 break;
5043
5045 result = (es->style & ES_MULTILINE) ? es->y_offset : es->x_offset;
5046 break;
5047
5048 case EM_SETREADONLY:
5049 {
5050 DWORD old_style = es->style;
5051
5052 if (wParam) {
5055 es->style |= ES_READONLY;
5056 } else {
5059 es->style &= ~ES_READONLY;
5060 }
5061
5062 if (old_style ^ es->style)
5063 InvalidateRect(es->hwndSelf, NULL, TRUE);
5064
5065 result = 1;
5066 break;
5067 }
5068
5071 break;
5072
5074 result = (LRESULT)es->word_break_proc;
5075 break;
5076
5077 case EM_GETPASSWORDCHAR:
5078 {
5079 if(unicode)
5080 result = es->password_char;
5081 else
5082 {
5083 WCHAR charW = es->password_char;
5084 CHAR charA = 0;
5085 WideCharToMultiByte(CP_ACP, 0, &charW, 1, &charA, 1, NULL, NULL);
5086 result = charA;
5087 }
5088 break;
5089 }
5090
5091 case EM_SETMARGINS:
5093 break;
5094
5095 case EM_GETMARGINS:
5096 result = MAKELONG(es->left_margin, es->right_margin);
5097 break;
5098
5099 case EM_GETLIMITTEXT:
5100 result = es->buffer_limit;
5101 break;
5102
5103 case EM_POSFROMCHAR:
5104 if ((INT)wParam >= get_text_length(es)) result = -1;
5106 break;
5107
5108 case EM_CHARFROMPOS:
5109 result = EDIT_EM_CharFromPos(es, (short)LOWORD(lParam), (short)HIWORD(lParam));
5110 break;
5111
5112 /* End of the EM_ messages which were in numerical order; what order
5113 * are these in? vaguely alphabetical?
5114 */
5115
5116 case WM_NCCREATE:
5118 break;
5119
5120 case WM_NCDESTROY:
5122#ifdef __REACTOS__
5124#endif
5125 es = NULL;
5126 break;
5127
5128 case WM_GETDLGCODE:
5130
5131 if (es->style & ES_MULTILINE)
5133
5134 if (lParam)
5135 {
5136 es->flags|=EF_DIALOGMODE;
5137
5138 if (((LPMSG)lParam)->message == WM_KEYDOWN)
5139 {
5140 int vk = (int)((LPMSG)lParam)->wParam;
5141
5142 if (es->hwndListBox)
5143 {
5144 if (vk == VK_RETURN || vk == VK_ESCAPE)
5147 }
5148 }
5149 }
5150 break;
5151
5152 case WM_IME_CHAR:
5153#ifdef __REACTOS__
5154 /* Rely on DefWindowProc */
5155 result = DefWindowProcT(hwnd, msg, wParam, lParam, unicode);
5156 break;
5157#else
5158 if (!unicode)
5159 {
5160 WCHAR charW;
5161 CHAR strng[2];
5162
5163 strng[0] = wParam >> 8;
5164 strng[1] = wParam & 0xff;
5165 if (strng[0]) MultiByteToWideChar(CP_ACP, 0, strng, 2, &charW, 1);
5166 else MultiByteToWideChar(CP_ACP, 0, &strng[1], 1, &charW, 1);
5167 result = EDIT_WM_Char(es, charW);
5168 break;
5169 }
5170 /* fall through */
5171#endif
5172 case WM_CHAR:
5173 {
5174 WCHAR charW;
5175
5176 if(unicode)
5177 charW = wParam;
5178 else
5179 {
5180 CHAR charA = wParam;
5181 MultiByteToWideChar(CP_ACP, 0, &charA, 1, &charW, 1);
5182 }
5183
5184 if (es->hwndListBox)
5185 {
5186 if (charW == VK_RETURN || charW == VK_ESCAPE)
5187 {
5190 break;
5191 }
5192 }
5193 result = EDIT_WM_Char(es, charW);
5194 break;
5195 }
5196
5197 case WM_UNICHAR:
5198 if (unicode)
5199 {
5200 if (wParam == UNICODE_NOCHAR) return TRUE;
5201 if (wParam <= 0x000fffff)
5202 {
5203 if(wParam > 0xffff) /* convert to surrogates */
5204 {
5205 wParam -= 0x10000;
5206 EDIT_WM_Char(es, (wParam >> 10) + 0xd800);
5207 EDIT_WM_Char(es, (wParam & 0x03ff) + 0xdc00);
5208 }
5209 else EDIT_WM_Char(es, wParam);
5210 }
5211 return 0;
5212 }
5213 break;
5214
5215 case WM_CLEAR:
5217 break;
5218
5219 case WM_CONTEXTMENU:
5220 EDIT_WM_ContextMenu(es, (short)LOWORD(lParam), (short)HIWORD(lParam));
5221 break;
5222
5223 case WM_COPY:
5225 break;
5226
5227 case WM_CREATE:
5228 if(unicode)
5230 else
5231 {
5232 LPCSTR nameA = ((LPCREATESTRUCTA)lParam)->lpszName;
5233 LPWSTR nameW = NULL;
5234 if(nameA)
5235 {
5236 INT countW = MultiByteToWideChar(CP_ACP, 0, nameA, -1, NULL, 0);
5237 if((nameW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR))))
5238 MultiByteToWideChar(CP_ACP, 0, nameA, -1, nameW, countW);
5239 }
5242 }
5243 break;
5244
5245 case WM_CUT:
5246 EDIT_WM_Cut(es);
5247 break;
5248
5249 case WM_ENABLE:
5250 es->bEnableState = (BOOL) wParam;
5252 break;
5253
5254 case WM_ERASEBKGND:
5255 /* we do the proper erase in EDIT_WM_Paint */
5256 result = 1;
5257 break;
5258
5259 case WM_GETFONT:
5260 result = (LRESULT)es->font;
5261 break;
5262
5263 case WM_GETTEXT:
5265 break;
5266
5267 case WM_GETTEXTLENGTH:
5268 if (unicode) result = get_text_length(es);
5270 NULL, 0, NULL, NULL );
5271 break;
5272
5273 case WM_HSCROLL:
5275 break;
5276
5277 case WM_KEYDOWN:
5279 break;
5280
5281 case WM_KILLFOCUS:
5283 break;
5284
5285 case WM_LBUTTONDBLCLK:
5287 break;
5288
5289 case WM_LBUTTONDOWN:
5291 break;
5292
5293 case WM_LBUTTONUP:
5295 break;
5296
5297 case WM_MBUTTONDOWN:
5299 break;
5300
5301 case WM_MOUSEMOVE:
5302 result = EDIT_WM_MouseMove(es, (short)LOWORD(lParam), (short)HIWORD(lParam));
5303 break;
5304
5305 case WM_PRINTCLIENT:
5306 case WM_PAINT:
5308 break;
5309
5310 case WM_PASTE:
5312 break;
5313
5314 case WM_SETFOCUS:
5316 break;
5317
5318 case WM_SETFONT:
5320 break;
5321
5322 case WM_SETREDRAW:
5323 /* FIXME: actually set an internal flag and behave accordingly */
5324 break;
5325
5326 case WM_SETTEXT:
5327 EDIT_WM_SetText(es, (LPCWSTR)lParam, unicode);
5328 result = TRUE;
5329 break;
5330
5331 case WM_SIZE:
5333 break;
5334
5335 case WM_STYLECHANGED:
5337 break;
5338
5339 case WM_STYLECHANGING:
5340 result = 0; /* See EDIT_WM_StyleChanged */
5341 break;
5342
5343 case WM_SYSKEYDOWN:
5345 break;
5346
5347 case WM_TIMER:
5349 break;
5350
5351 case WM_VSCROLL:
5353 break;
5354
5355 case WM_MOUSEWHEEL:
5356 {
5357 int wheelDelta;
5358 UINT pulScrollLines = 3;
5359 SystemParametersInfoW(SPI_GETWHEELSCROLLLINES,0, &pulScrollLines, 0);
5360
5361 if (wParam & (MK_SHIFT | MK_CONTROL)) {
5363 break;
5364 }
5365 wheelDelta = GET_WHEEL_DELTA_WPARAM(wParam);
5366 /* if scrolling changes direction, ignore left overs */
5367 if ((wheelDelta < 0 && es->wheelDeltaRemainder < 0) ||
5368 (wheelDelta > 0 && es->wheelDeltaRemainder > 0))
5369 es->wheelDeltaRemainder += wheelDelta;
5370 else
5371 es->wheelDeltaRemainder = wheelDelta;
5372 if (es->wheelDeltaRemainder && pulScrollLines)
5373 {
5374 int cLineScroll;
5375 pulScrollLines = (int) min((UINT) es->line_count, pulScrollLines);
5376 cLineScroll = pulScrollLines * (float)es->wheelDeltaRemainder / WHEEL_DELTA;
5377 es->wheelDeltaRemainder -= WHEEL_DELTA * cLineScroll / (int)pulScrollLines;
5378 result = EDIT_EM_LineScroll(es, 0, -cLineScroll);
5379 }
5380 }
5381 break;
5382
5383
5384 /* IME messages to make the edit control IME aware */
5385 case WM_IME_SETCONTEXT:
5386#ifdef __REACTOS__
5387 if (FALSE) /* FIXME: Condition */
5388 lParam &= ~ISC_SHOWUICOMPOSITIONWINDOW;
5389
5390 if (wParam)
5391 {
5392 HIMC hIMC = ImmGetContext(hwnd);
5394 if (pIC)
5395 {
5396 pIC->dwUIFlags &= ~0x40000;
5397 ImmUnlockIMC(hIMC);
5398 }
5399 if (GetWin32ClientInfo()->CI_flags & CI_WOW)
5401 ImmReleaseContext(hwnd, hIMC);
5402 }
5403
5405#endif
5406 break;
5407
5408 case WM_IME_STARTCOMPOSITION:
5409#ifdef __REACTOS__
5410 if (FALSE) /* FIXME: Condition */
5411 return TRUE;
5412 result = DefWindowProcT(hwnd, msg, wParam, lParam, unicode);
5413#else
5414 es->composition_start = es->selection_end;
5415 es->composition_len = 0;
5416#endif
5417 break;
5418
5419 case WM_IME_COMPOSITION:
5421#ifdef __REACTOS__
5422 result = DefWindowProcT(hwnd, msg, wParam, lParam, unicode);
5423#endif
5424 break;
5425
5426 case WM_IME_ENDCOMPOSITION:
5427#ifdef __REACTOS__
5428 result = DefWindowProcT(hwnd, msg, wParam, lParam, unicode);
5429#else
5430 if (es->composition_len > 0)
5431 {
5433 es->selection_end = es->selection_start;
5434 es->composition_len= 0;
5435 }
5436#endif
5437 break;
5438
5440 break;
5441
5442 case WM_IME_SELECT:
5443#ifdef __REACTOS__
5444 result = DefWindowProcT(hwnd, msg, wParam, lParam, unicode);
5445#endif
5446 break;
5447
5448 case WM_IME_CONTROL:
5449#ifdef __REACTOS__
5450 result = DefWindowProcT(hwnd, msg, wParam, lParam, unicode);
5451#endif
5452 break;
5453
5454 case WM_IME_REQUEST:
5455 switch (wParam)
5456 {
5457 case IMR_QUERYCHARPOSITION:
5458 {
5459 LRESULT pos;
5460 IMECHARPOSITION *chpos = (IMECHARPOSITION *)lParam;
5461
5462 pos = EDIT_EM_PosFromChar(es, es->selection_start + chpos->dwCharPos, FALSE);
5463 chpos->pt.x = LOWORD(pos);
5464 chpos->pt.y = HIWORD(pos);
5465 chpos->cLineHeight = es->line_height;
5466 chpos->rcDocument = es->format_rect;
5467 MapWindowPoints(hwnd, 0, &chpos->pt, 1);
5468 MapWindowPoints(hwnd, 0, (POINT*)&chpos->rcDocument, 2);
5469 result = 1;
5470 break;
5471 }
5472 }
5473 break;
5474
5475 default:
5476 result = DefWindowProcT(hwnd, msg, wParam, lParam, unicode);
5477 break;
5478 }
5479
5480#ifdef __REACTOS__
5481 /* ReactOS: check GetWindowLong in case es has been destroyed during processing */
5482 if (IsWindow(hwnd) && es && msg != EM_GETHANDLE && GetWindowLongPtrW(hwnd, 0))
5483#else
5484 if (IsWindow(hwnd) && es && msg != EM_GETHANDLE)
5485#endif
5487
5488 TRACE("hwnd=%p msg=%x (%s) -- 0x%08lx\n", hwnd, msg, SPY_GetMsgName(msg, hwnd), result);
5489
5490 return result;
#define msg(x)
Definition: auth_time.c:54
static const WCHAR nameW[]
Definition: main.c:49
#define FIXME(fmt,...)
Definition: precomp.h:53
DWORD HIMC
Definition: dimm.idl:75
static void EDIT_WM_Paint(EDITSTATE *es, HDC hdc)
Definition: edit.c:3620
#define EF_MODIFIED
Definition: edit.c:65
static LRESULT EDIT_WM_LButtonDblClk(EDITSTATE *es)
Definition: edit.c:3505
static LRESULT EDIT_WM_Char(EDITSTATE *es, WCHAR c)
Definition: edit.c:3080
static void EDIT_WM_SetFont(EDITSTATE *es, HFONT font, BOOL redraw)
Definition: edit.c:3829
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:2492
static LRESULT EDIT_WM_MButtonDown(EDITSTATE *es)
Definition: edit.c:3576
static void EDIT_EM_ScrollCaret(EDITSTATE *es)
Definition: edit.c:1780
static void EDIT_SetRectNP(EDITSTATE *es, const RECT *rc)
Definition: edit.c:2319
static BOOL EDIT_EM_FmtLines(EDITSTATE *es, BOOL add_eol)
Definition: edit.c:2391
static void EDIT_WM_Copy(EDITSTATE *es)
Definition: edit.c:3024
static LRESULT EDIT_EM_CharFromPos(EDITSTATE *es, INT x, INT y)
Definition: edit.c:2363
static LRESULT EDIT_WM_HScroll(EDITSTATE *es, INT action, INT pos)
Definition: edit.c:4054
static void EDIT_WM_Cut(EDITSTATE *es)
Definition: edit.c:3068
static void EDIT_EM_SetPasswordChar(EDITSTATE *es, WCHAR c)
Definition: edit.c:2866
static INT EDIT_WM_GetText(const EDITSTATE *es, INT count, LPWSTR dst)
Definition: edit.c:3267
static void EDIT_WM_ContextMenu(EDITSTATE *es, INT x, INT y)
Definition: edit.c:3211
static LRESULT EDIT_WM_MouseMove(EDITSTATE *es, INT x, INT y)
Definition: edit.c:3588
static void EDIT_LockBuffer(EDITSTATE *es)
Definition: edit.c:1211
static void EDIT_UnlockBuffer(EDITSTATE *es, BOOL force)
Definition: edit.c:1230
static LRESULT EDIT_WM_NCDestroy(EDITSTATE *es)
Definition: edit.c:4687
static LRESULT EDIT_WM_LButtonDown(EDITSTATE *es, DWORD keys, INT x, INT y)
Definition: edit.c:3534
static INT EDIT_EM_LineIndex(const EDITSTATE *es, INT line)
Definition: edit.c:942
static HLOCAL EDIT_EM_GetHandle(EDITSTATE *es)
Definition: edit.c:2413
static INT EDIT_EM_GetLine(EDITSTATE *es, INT line, LPWSTR dst)
Definition: edit.c:2433
#define EF_UPDATE
Definition: edit.c:67
static BOOL EDIT_EM_Undo(EDITSTATE *es)
Definition: edit.c:2936
static UINT get_text_length(EDITSTATE *es)
Definition: edit.c:216
static void EDIT_WM_Paste(EDITSTATE *es)
Definition: edit.c:2988
static LRESULT EDIT_WM_KillFocus(HTHEME theme, EDITSTATE *es)
Definition: edit.c:3477
static LRESULT EDIT_WM_SysKeyDown(EDITSTATE *es, INT key, DWORD key_data)
Definition: edit.c:4017
static LRESULT EDIT_EM_GetThumb(EDITSTATE *es)
Definition: edit.c:4306
static LRESULT EDIT_WM_NCCreate(HWND hwnd, LPCREATESTRUCTW lpcs)
Definition: edit.c:4519
static LRESULT EDIT_WM_LButtonUp(EDITSTATE *es)
Definition: edit.c:3560
static void EDIT_WM_Clear(EDITSTATE *es)
Definition: edit.c:3053
static BOOL EDIT_EM_CanUndo(const EDITSTATE *es)
Definition: edit.c:181
static void EDIT_EM_EmptyUndoBuffer(EDITSTATE *es)
Definition: edit.c:192
static void EDIT_EM_SetMargins(EDITSTATE *es, INT action, WORD left, WORD right, BOOL repaint)
Definition: edit.c:2794
static void EDIT_WM_SetFocus(HTHEME theme, EDITSTATE *es)
Definition: edit.c:3771
static void EDIT_EM_SetHandle(EDITSTATE *es, HLOCAL hloc)
Definition: edit.c:2705
static LRESULT EDIT_WM_Create(EDITSTATE *es, const WCHAR *name)
Definition: edit.c:4632
static LRESULT EDIT_WM_KeyDown(EDITSTATE *es, INT key)
Definition: edit.c:3343
static void EDIT_EM_SetLimitText(EDITSTATE *es, UINT limit)
Definition: edit.c:2744
static void EDIT_WM_Timer(EDITSTATE *es)
Definition: edit.c:4036
static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap)
Definition: edit.c:1013
#define EF_DIALOGMODE
Definition: edit.c:72
static LRESULT EDIT_EM_Scroll(EDITSTATE *es, INT action)
Definition: edit.c:1672
static LRESULT EDIT_EM_GetSel(const EDITSTATE *es, PUINT start, PUINT end)
Definition: edit.c:2471
static void EDIT_EM_SetWordBreakProc(EDITSTATE *es, EDITWORDBREAKPROCW wbp)
Definition: edit.c:2917
static LRESULT EDIT_WM_StyleChanged(EDITSTATE *es, WPARAM which, const STYLESTRUCT *style)
Definition: edit.c:3977
static INT EDIT_EM_LineFromChar(EDITSTATE *es, INT index)
Definition: edit.c:913
static LRESULT EDIT_WM_VScroll(EDITSTATE *es, INT action, INT pos)
Definition: edit.c:4186
static void EDIT_WM_SetText(EDITSTATE *es, LPCWSTR text)
Definition: edit.c:3902
static void EDIT_UpdateText(EDITSTATE *es, const RECT *rc, BOOL bErase)
Definition: edit.c:1359
static BOOL EDIT_EM_SetTabStops(EDITSTATE *es, INT count, const INT *tabs)
Definition: edit.c:2895
static BOOL EDIT_EM_SetSel(EDITSTATE *es, UINT start, UINT end, BOOL after_wrap)
Definition: edit.c:1489
static void EDIT_ImeComposition(HWND hwnd, LPARAM CompFlag, EDITSTATE *es)
Definition: edit.c:4473
static BOOL EDIT_EM_LineScroll(EDITSTATE *es, INT dx, INT dy)
Definition: edit.c:1657
static void EDIT_WM_Size(EDITSTATE *es, UINT action)
Definition: edit.c:3944
static INT EDIT_EM_LineLength(EDITSTATE *es, INT index)
Definition: edit.c:977
#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_PTR dwValue)
Definition: ime.c:907
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1067
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1045
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:1086
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1058
unsigned long DWORD
Definition: ntddk_ex.h:95
#define es
Definition: i386-dis.c:440
struct INPUTCONTEXTDX * LPINPUTCONTEXTDX
#define CPS_CANCEL
Definition: imm.h:181
#define NI_COMPOSITIONSTR
Definition: immdev.h:403
#define FNID_EDIT
Definition: ntuser.h:870
#define GetWin32ClientInfo()
Definition: ntuser.h:352
#define CI_WOW
Definition: ntuser.h:302
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
Definition: edit.c:96
#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:4839
int * LPINT
Definition: windef.h:178
#define EM_SETREADONLY
Definition: winuser.h:2018
BOOL WINAPI CopyRect(_Out_ LPRECT, _In_ LPCRECT)
#define EM_GETRECT
Definition: winuser.h:1999
#define WM_IME_REQUEST
Definition: winuser.h:1839
#define EM_LINEFROMCHAR
Definition: winuser.h:2004
#define WM_HSCROLL
Definition: winuser.h:1746
#define EM_GETWORDBREAKPROC
Definition: winuser.h:2002
#define EM_FMTLINES
Definition: winuser.h:1989
#define EM_GETPASSWORDCHAR
Definition: winuser.h:1998
#define WM_VSCROLL
Definition: winuser.h:1747
#define EM_SETPASSWORDCHAR
Definition: winuser.h:2017
#define EM_GETMODIFY
Definition: winuser.h:1997
#define EM_EMPTYUNDOBUFFER
Definition: winuser.h:1988
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define DLGC_WANTALLKEYS
Definition: winuser.h:2615
#define EM_REPLACESEL
Definition: winuser.h:2009
#define EM_SETRECT
Definition: winuser.h:2019
#define EM_LINEINDEX
Definition: winuser.h:2005
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:2007
#define EM_GETFIRSTVISIBLELINE
Definition: winuser.h:1991
#define EM_GETHANDLE
Definition: winuser.h:1992
#define WM_UNDO
Definition: winuser.h:1868
#define WM_IME_SETCONTEXT
Definition: winuser.h:1832
#define EM_CANUNDO
Definition: winuser.h:1986
#define EM_LINELENGTH
Definition: winuser.h:2006
#define EM_SETHANDLE
Definition: winuser.h:2012
#define EM_GETLINE
Definition: winuser.h:1994
#define EM_SETRECTNP
Definition: winuser.h:2020
#define EM_SETLIMITTEXT
Definition: winuser.h:2014
#define WM_TIMER
Definition: winuser.h:1745
#define EM_UNDO
Definition: winuser.h:2024
#define EM_SCROLL
Definition: winuser.h:2010
#define EM_SETWORDBREAKPROC
Definition: winuser.h:2023
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define WM_IME_COMPOSITIONFULL
Definition: winuser.h:1835
#define EM_GETTHUMB
Definition: winuser.h:2001
#define EM_GETMARGINS
Definition: winuser.h:1996
#define WM_IME_CONTROL
Definition: winuser.h:1834
#define EM_SETTABSTOPS
Definition: winuser.h:2022
#define WM_IME_SELECT
Definition: winuser.h:1836
#define EM_GETLINECOUNT
Definition: winuser.h:1995
#define EM_SETMARGINS
Definition: winuser.h:2015
#define DLGC_HASSETSEL
Definition: winuser.h:2617
#define WM_MBUTTONDOWN
Definition: winuser.h:1785
#define EM_SETMODIFY
Definition: winuser.h:2016
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:1744
#define SC_SIZE
Definition: winuser.h:2587
#define WM_NCMOUSEMOVE
Definition: winuser.h:1694
#define LoadCursor
Definition: winuser.h:5824
#define WM_MOVE
Definition: winuser.h:1613
#define WM_SIZING
Definition: winuser.h:1810
#define IDC_WAIT
Definition: winuser.h:689
#define SC_MAXIMIZE
Definition: winuser.h:2591
#define WM_NCPAINT
Definition: winuser.h:1690

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:769
HWND WINAPI GetActiveWindow(void)
Definition: winpos.c:138
#define HTCAPTION
Definition: winuser.h:2479
BOOL WINAPI ValidateRect(_In_opt_ HWND, _In_opt_ LPCRECT)
#define SPI_GETICONTITLELOGFONT
Definition: winuser.h:1383
#define WM_NCLBUTTONDBLCLK
Definition: winuser.h:1697
#define WM_ACTIVATE
Definition: winuser.h:1615
#define WM_SHOWWINDOW
Definition: winuser.h:1631
HWND WINAPI SetActiveWindow(_In_ HWND)
#define SPI_GETICONTITLEWRAP
Definition: winuser.h:1377
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:125
#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:1759
#define SEND_NOTIFICATION(descr, code)
Definition: listbox.c:111
static LRESULT LISTBOX_InsertString(LB_DESCR *descr, INT index, LPCWSTR str)
Definition: listbox.c:1696
static void LISTBOX_DrawFocusRect(LB_DESCR *descr, BOOL on)
Definition: listbox.c:772
static LRESULT LISTBOX_HandleKeyDown(LB_DESCR *descr, DWORD key)
Definition: listbox.c:2424
static LRESULT LISTBOX_SetCaretIndex(LB_DESCR *descr, INT index, BOOL fully_visible)
Definition: listbox.c:1473
static BOOL LISTBOX_SetTabStops(LB_DESCR *descr, INT count, LPINT tabs)
Definition: listbox.c:812
static LRESULT LISTBOX_HandleLButtonUp(LB_DESCR *descr)
Definition: listbox.c:2304
static LRESULT LISTBOX_GetSelCount(const LB_DESCR *descr)
Definition: listbox.c:1050
static void LISTBOX_SetRedraw(LB_DESCR *descr, BOOL on)
Definition: listbox.c:712
static LRESULT LISTBOX_GetText(LB_DESCR *descr, INT index, LPWSTR buffer, BOOL unicode)
Definition: listbox.c:844
#define ISWIN31
Definition: listbox.c:115
static LRESULT LISTBOX_InitStorage(LB_DESCR *descr, INT nb_items)
Definition: listbox.c:799
static INT LISTBOX_FindFileStrPos(LB_DESCR *descr, LPCWSTR str)
Definition: listbox.c:946
static LRESULT LISTBOX_SetSelection(LB_DESCR *descr, INT index, BOOL on, BOOL send_notify)
Definition: listbox.c:1542
static LRESULT LISTBOX_HandleLButtonDownCombo(LB_DESCR *descr, UINT msg, DWORD keys, INT x, INT y)
Definition: listbox.c:2226
static LRESULT LISTBOX_HandleVScroll(LB_DESCR *descr, WORD scrollReq, WORD pos)
Definition: listbox.c:1953
#define IS_MULTISELECT(descr)
Definition: listbox.c:107
static void LISTBOX_ResetContent(LB_DESCR *descr)
Definition: listbox.c:1811
#define HAS_STRINGS(descr)
Definition: listbox.c:103
static LRESULT LISTBOX_HandleMouseWheel(LB_DESCR *descr, SHORT delta)
Definition: listbox.c:2083
static LRESULT LISTBOX_SetHorizontalExtent(LB_DESCR *descr, INT extent)
Definition: listbox.c:1355
static void LISTBOX_MoveCaret(LB_DESCR *descr, INT index, BOOL fully_visible)
Definition: listbox.c:1585
static LRESULT LISTBOX_GetSelItems(const LB_DESCR *descr, INT max, LPINT array)
Definition: listbox.c:1066
static LRESULT LISTBOX_Paint(LB_DESCR *descr, HDC hdc)
Definition: listbox.c:1080
static void LISTBOX_UpdateScroll(LB_DESCR *descr)
Definition: listbox.c:303
static LRESULT LISTBOX_SetTopItem(LB_DESCR *descr, INT index, BOOL scroll)
Definition: listbox.c:386
static INT LISTBOX_SetFont(LB_DESCR *descr, HFONT font)
Definition: listbox.c:1403
static LRESULT LISTBOX_SetColumnWidth(LB_DESCR *descr, INT column_width)
Definition: listbox.c:1381
static LRESULT LISTBOX_HandleHScroll(LB_DESCR *descr, WORD scrollReq, WORD pos)
Definition: listbox.c:1997
static LRESULT LISTBOX_SelectItemRange(LB_DESCR *descr, INT first, INT last, BOOL on)
Definition: listbox.c:1502
static void LISTBOX_RepaintItem(LB_DESCR *descr, INT index, UINT action)
Definition: listbox.c:739
static LRESULT LISTBOX_GetItemRect(const LB_DESCR *descr, INT index, RECT *rect)
Definition: listbox.c:500
static INT LISTBOX_FindString(LB_DESCR *descr, INT start, LPCWSTR str, BOOL exact)
Definition: listbox.c:990
static BOOL LISTBOX_Destroy(LB_DESCR *descr)
Definition: listbox.c:2655
static LRESULT LISTBOX_HandleSystemTimer(LB_DESCR *descr)
Definition: listbox.c:2360
static LRESULT LISTBOX_Directory(LB_DESCR *descr, UINT attrib, LPCWSTR filespec, BOOL long_names)
Definition: listbox.c:1870
static void LISTBOX_HandleMouseMove(LB_DESCR *descr, INT x, INT y)
Definition: listbox.c:2376
static LRESULT LISTBOX_GetItemHeight(const LB_DESCR *descr, INT index)
Definition: listbox.c:1273
static INT LISTBOX_FindStringPos(LB_DESCR *descr, LPCWSTR str, BOOL exact)
Definition: listbox.c:902
#define IS_OWNERDRAW(descr)
Definition: listbox.c:100
static INT LISTBOX_GetItemFromPoint(const LB_DESCR *descr, INT x, INT y)
Definition: listbox.c:558
#define LBS_DISPLAYCHANGED
Definition: listbox.c:52
static LRESULT LISTBOX_HandleChar(LB_DESCR *descr, WCHAR charW)
Definition: listbox.c:2535
static LRESULT LISTBOX_SetItemHeight(LB_DESCR *descr, INT index, INT height, BOOL repaint)
Definition: listbox.c:1291
static void LISTBOX_UpdateSize(LB_DESCR *descr)
Definition: listbox.c:455
static LRESULT LISTBOX_SetCount(LB_DESCR *descr, UINT count)
Definition: listbox.c:1831
static BOOL LISTBOX_Create(HWND hwnd, LPHEADCOMBO lphc)
Definition: listbox.c:2567
static LRESULT LISTBOX_HandleLButtonDown(LB_DESCR *descr, DWORD keys, INT x, INT y)
Definition: listbox.c:2121
#define SetLastError(x)
Definition: compat.h:752
BOOL WINAPI IsValidLocale(LCID lcid, DWORD flags)
Definition: locale.c:2922
GLuint index
Definition: glext.h:6031
#define FNID_LISTBOX
Definition: ntuser.h:871
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
#define DWORD
Definition: nt_native.h:44
#define LBS_NOTIFY
Definition: pedump.c:678
#define struprW(s)
Definition: unicode.h:63
#define strlenW(s)
Definition: unicode.h:34
#define strlwrW(s)
Definition: unicode.h:62
DWORD LCID
Definition: nls.h:13
const char * descr
Definition: boot.c:45
INT droppedIndex
Definition: comctl32.h:160
LPVOID lpCreateParams
Definition: winuser.h:2958
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#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:2435
#define LB_ADDFILE
Definition: winuser.h:2033
#define COLOR_WINDOW
Definition: winuser.h:921
#define CBS_DROPDOWNLIST
Definition: winuser.h:284
#define LB_SETCOUNT
Definition: winuser.h:2065
#define LB_OKAY
Definition: winuser.h:2434
#define LBN_DBLCLK
Definition: winuser.h:2074
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define WM_DROPFILES
Definition: winuser.h:1828
#define LB_GETSELCOUNT
Definition: winuser.h:2050
#define LB_GETITEMRECT
Definition: winuser.h:2046
#define LBN_SETFOCUS
Definition: winuser.h:2079
#define LB_GETANCHORINDEX
Definition: winuser.h:2039
#define LB_ERRSPACE
Definition: winuser.h:2436
#define LB_GETSEL
Definition: winuser.h:2049
#define LB_SETCOLUMNWIDTH
Definition: winuser.h:2064
#define LB_SELITEMRANGEEX
Definition: winuser.h:2061
#define LB_SELITEMRANGE
Definition: winuser.h:2060
#define LB_SETANCHORINDEX
Definition: winuser.h:2062
#define LB_SETITEMHEIGHT
Definition: winuser.h:2069
#define LB_GETLISTBOXINFO
Definition: winuser.h:2047
#define LB_SELECTSTRING
Definition: winuser.h:2059
#define WM_NCACTIVATE
Definition: winuser.h:1691
#define LBS_COMBOBOX
Definition: winuser.h:324
#define LB_ITEMFROMPOINT
Definition: winuser.h:2057
#define LB_GETCARETINDEX
Definition: winuser.h:2040
#define LBN_KILLFOCUS
Definition: winuser.h:2076
#define LB_SETTABSTOPS
Definition: winuser.h:2072
#define LB_SETSEL
Definition: winuser.h:2071
#define LB_GETSELITEMS
Definition: winuser.h:2051
#define LB_SETCARETINDEX
Definition: winuser.h:2063
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 WM_MDIACTIVATE:
1174 {
1175 if( ci->hwndActiveChild != (HWND)wParam )
1177 return 0;
1178 }
1179