ReactOS 0.4.16-dev-981-g80eb313
pager.c
Go to the documentation of this file.
1/*
2 * Pager control
3 *
4 * Copyright 1998, 1999 Eric Kohl
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 *
20 * NOTES
21 *
22 * This code was audited for completeness against the documented features
23 * of Comctl32.dll version 6.0 on Sep. 18, 2004, by Robert Shearman.
24 *
25 * Unless otherwise noted, we believe this code to be complete, as per
26 * the specification mentioned above.
27 * If you discover missing features or bugs please note them below.
28 *
29 * TODO:
30 * Implement repetitive button press.
31 * Adjust arrow size relative to size of button.
32 * Allow border size changes.
33 * Styles:
34 * PGS_DRAGNDROP
35 * Notifications:
36 * PGN_HOTITEMCHANGE
37 * Messages:
38 * WM_PRINT and/or WM_PRINTCLIENT
39 *
40 * TESTING:
41 * Tested primarily with the controlspy Pager application.
42 * Susan Farley (susan@codeweavers.com)
43 *
44 * IMPLEMENTATION NOTES:
45 * This control uses WM_NCPAINT instead of WM_PAINT to paint itself
46 * as we need to scroll a child window. In order to do this we move
47 * the child window in the control's client area, using the clipping
48 * region that is automatically set around the client area. As the
49 * entire client area now consists of the child window, we must
50 * allocate space (WM_NCCALCSIZE) for the buttons and draw them as
51 * a non-client area (WM_NCPAINT).
52 * Robert Shearman <rob@codeweavers.com>
53 */
54
55#include <stdarg.h>
56#include <string.h>
57#include "windef.h"
58#include "winbase.h"
59#include "wingdi.h"
60#include "winuser.h"
61#include "winnls.h"
62#include "commctrl.h"
63#include "comctl32.h"
64#include "wine/debug.h"
65#include "wine/heap.h"
66
68
69typedef struct
70{
71 HWND hwndSelf; /* handle of the control wnd */
72 HWND hwndChild; /* handle of the contained wnd */
73 HWND hwndNotify; /* handle of the parent wnd */
74 BOOL bUnicode; /* send notifications in Unicode */
75 DWORD dwStyle; /* styles for this control */
76 COLORREF clrBk; /* background color */
77 INT nBorder; /* border size for the control */
78 INT nButtonSize;/* size of the pager btns */
79 INT nPos; /* scroll position */
80 INT nWidth; /* from child wnd's response to PGN_CALCSIZE */
81 INT nHeight; /* from child wnd's response to PGN_CALCSIZE */
82 BOOL bForward; /* forward WM_MOUSEMOVE msgs to the contained wnd */
83 BOOL bCapture; /* we have captured the mouse */
84 INT TLbtnState; /* state of top or left btn */
85 INT BRbtnState; /* state of bottom or right btn */
86 INT direction; /* direction of the scroll, (e.g. PGF_SCROLLUP) */
87 WCHAR *pwszBuffer;/* text buffer for converted notifications */
88 INT nBufferSize;/* size of the above buffer */
89#ifdef __REACTOS__
90 BOOL m_bProcessingReCalcSize;
91#endif
93
94#define TIMERID1 1
95#define TIMERID2 2
96#define INITIAL_DELAY 500
97#define REPEAT_DELAY 50
98
99/* Text field conversion behavior flags for PAGER_SendConvertedNotify() */
101{
102 /* Convert Unicode text to ANSI for parent before sending. If not set, do nothing */
104 /* Convert ANSI text from parent back to Unicode for children */
106 /* Send empty text to parent if text is NULL. Original text pointer still remains NULL */
108 /* Set text to null after parent received the notification if the required mask is not set before sending notification */
110 /* Zero out the text buffer before sending it to parent */
111 ZERO_SEND = 0x10
113
114static void
115PAGER_GetButtonRects(const PAGER_INFO* infoPtr, RECT* prcTopLeft, RECT* prcBottomRight, BOOL bClientCoords)
116{
117 RECT rcWindow;
118 GetWindowRect (infoPtr->hwndSelf, &rcWindow);
119
120 if (bClientCoords)
121 MapWindowPoints( 0, infoPtr->hwndSelf, (POINT *)&rcWindow, 2 );
122 else
123 OffsetRect(&rcWindow, -rcWindow.left, -rcWindow.top);
124
125 *prcTopLeft = *prcBottomRight = rcWindow;
126 if (infoPtr->dwStyle & PGS_HORZ)
127 {
128 prcTopLeft->right = prcTopLeft->left + infoPtr->nButtonSize;
129 prcBottomRight->left = prcBottomRight->right - infoPtr->nButtonSize;
130 }
131 else
132 {
133 prcTopLeft->bottom = prcTopLeft->top + infoPtr->nButtonSize;
134 prcBottomRight->top = prcBottomRight->bottom - infoPtr->nButtonSize;
135 }
136}
137
138static void
140 BOOL horz, BOOL topLeft, INT btnState)
141{
142 UINT flags;
143
144 TRACE("rc = %s, btnState = %d\n", wine_dbgstr_rect(&rc), btnState);
145
146 if (btnState == PGF_INVISIBLE)
147 return;
148
149 if ((rc.right - rc.left <= 0) || (rc.bottom - rc.top <= 0))
150 return;
151
152 if (horz)
154 else
155 flags = topLeft ? DFCS_SCROLLUP : DFCS_SCROLLDOWN;
156
157 switch (btnState)
158 {
159 case PGF_HOT:
160 break;
161 case PGF_NORMAL:
162 flags |= DFCS_FLAT;
163 break;
164 case PGF_DEPRESSED:
166 break;
167 case PGF_GRAYED:
169 break;
170 }
172}
173
174/* << PAGER_GetDropTarget >> */
175
176static inline LRESULT
178{
179 TRACE("[%p]\n", infoPtr->hwndSelf);
180
181 infoPtr->bForward = bFwd;
182
183 return 0;
184}
185
186static inline LRESULT
188{
189 LRESULT btnState = PGF_INVISIBLE;
190 TRACE("[%p]\n", infoPtr->hwndSelf);
191
192 if (btn == PGB_TOPORLEFT)
193 btnState = infoPtr->TLbtnState;
194 else if (btn == PGB_BOTTOMORRIGHT)
195 btnState = infoPtr->BRbtnState;
196
197 return btnState;
198}
199
200
201static inline INT
203{
204 TRACE("[%p] returns %d\n", infoPtr->hwndSelf, infoPtr->nPos);
205 return infoPtr->nPos;
206}
207
208static inline INT
210{
211 TRACE("[%p] returns %d\n", infoPtr->hwndSelf, infoPtr->nButtonSize);
212 return infoPtr->nButtonSize;
213}
214
215static inline INT
217{
218 TRACE("[%p] returns %d\n", infoPtr->hwndSelf, infoPtr->nBorder);
219 return infoPtr->nBorder;
220}
221
222static inline COLORREF
224{
225 TRACE("[%p] returns %06x\n", infoPtr->hwndSelf, infoPtr->clrBk);
226 return infoPtr->clrBk;
227}
228
229static void
231{
232 NMPGCALCSIZE nmpgcs;
233 ZeroMemory (&nmpgcs, sizeof (NMPGCALCSIZE));
234 nmpgcs.hdr.hwndFrom = infoPtr->hwndSelf;
235 nmpgcs.hdr.idFrom = GetWindowLongPtrW (infoPtr->hwndSelf, GWLP_ID);
236 nmpgcs.hdr.code = PGN_CALCSIZE;
237 nmpgcs.dwFlag = (infoPtr->dwStyle & PGS_HORZ) ? PGF_CALCWIDTH : PGF_CALCHEIGHT;
238 nmpgcs.iWidth = infoPtr->nWidth;
239 nmpgcs.iHeight = infoPtr->nHeight;
240 SendMessageW (infoPtr->hwndNotify, WM_NOTIFY, nmpgcs.hdr.idFrom, (LPARAM)&nmpgcs);
241
242 if (infoPtr->dwStyle & PGS_HORZ)
243 infoPtr->nWidth = nmpgcs.iWidth;
244 else
245 infoPtr->nHeight = nmpgcs.iHeight;
246
247 TRACE("[%p] PGN_CALCSIZE returns %dx%d\n", infoPtr->hwndSelf, nmpgcs.iWidth, nmpgcs.iHeight );
248}
249
250static void
252{
253 if (infoPtr->hwndChild)
254 {
255 RECT rcClient;
256 int nPos = infoPtr->nPos;
257
258 /* compensate for a grayed btn, which will soon become invisible */
259 if (infoPtr->TLbtnState == PGF_GRAYED)
260 nPos += infoPtr->nButtonSize;
261
262 GetClientRect(infoPtr->hwndSelf, &rcClient);
263
264 if (infoPtr->dwStyle & PGS_HORZ)
265 {
266 int wndSize = max(0, rcClient.right - rcClient.left);
267 if (infoPtr->nWidth < wndSize)
268 infoPtr->nWidth = wndSize;
269
270 TRACE("[%p] SWP %dx%d at (%d,%d)\n", infoPtr->hwndSelf,
271 infoPtr->nWidth, infoPtr->nHeight,
272 -nPos, 0);
274 -nPos, 0,
275 infoPtr->nWidth, infoPtr->nHeight, 0);
276 }
277 else
278 {
279 int wndSize = max(0, rcClient.bottom - rcClient.top);
280 if (infoPtr->nHeight < wndSize)
281 infoPtr->nHeight = wndSize;
282
283 TRACE("[%p] SWP %dx%d at (%d,%d)\n", infoPtr->hwndSelf,
284 infoPtr->nWidth, infoPtr->nHeight,
285 0, -nPos);
287 0, -nPos,
288 infoPtr->nWidth, infoPtr->nHeight, 0);
289 }
290
291 InvalidateRect(infoPtr->hwndChild, NULL, TRUE);
292 }
293}
294
295static INT
297{
298 INT scrollRange = 0;
299
300 if (infoPtr->hwndChild)
301 {
302 INT wndSize, childSize;
303 RECT wndRect;
304 GetWindowRect(infoPtr->hwndSelf, &wndRect);
305
306 if (calc_size)
307 PAGER_CalcSize(infoPtr);
308 if (infoPtr->dwStyle & PGS_HORZ)
309 {
310 wndSize = wndRect.right - wndRect.left;
311 childSize = infoPtr->nWidth;
312 }
313 else
314 {
315 wndSize = wndRect.bottom - wndRect.top;
316 childSize = infoPtr->nHeight;
317 }
318
319 TRACE("childSize = %d, wndSize = %d\n", childSize, wndSize);
320 if (childSize > wndSize)
321 scrollRange = childSize - wndSize + infoPtr->nButtonSize;
322 }
323
324 TRACE("[%p] returns %d\n", infoPtr->hwndSelf, scrollRange);
325 return scrollRange;
326}
327
328static void
329PAGER_UpdateBtns(PAGER_INFO *infoPtr, INT scrollRange, BOOL hideGrayBtns)
330{
331 BOOL resizeClient;
332 BOOL repaintBtns;
333 INT oldTLbtnState = infoPtr->TLbtnState;
334 INT oldBRbtnState = infoPtr->BRbtnState;
335 POINT pt;
336 RECT rcTopLeft, rcBottomRight;
337
338 /* get button rects */
339 PAGER_GetButtonRects(infoPtr, &rcTopLeft, &rcBottomRight, TRUE);
340
342 ScreenToClient( infoPtr->hwndSelf, &pt );
343
344 /* update states based on scroll position */
345 if (infoPtr->nPos > 0)
346 {
347 if (infoPtr->TLbtnState == PGF_INVISIBLE || infoPtr->TLbtnState == PGF_GRAYED)
348 infoPtr->TLbtnState = PGF_NORMAL;
349 }
350 else if (!hideGrayBtns && PtInRect(&rcTopLeft, pt))
351 infoPtr->TLbtnState = PGF_GRAYED;
352 else
353 infoPtr->TLbtnState = PGF_INVISIBLE;
354
355 if (scrollRange <= 0)
356 {
357 infoPtr->TLbtnState = PGF_INVISIBLE;
358 infoPtr->BRbtnState = PGF_INVISIBLE;
359 }
360 else if (infoPtr->nPos < scrollRange)
361 {
362 if (infoPtr->BRbtnState == PGF_INVISIBLE || infoPtr->BRbtnState == PGF_GRAYED)
363 infoPtr->BRbtnState = PGF_NORMAL;
364 }
365 else if (!hideGrayBtns && PtInRect(&rcBottomRight, pt))
366 infoPtr->BRbtnState = PGF_GRAYED;
367 else
368 infoPtr->BRbtnState = PGF_INVISIBLE;
369
370 /* only need to resize when entering or leaving PGF_INVISIBLE state */
371 resizeClient =
372 ((oldTLbtnState == PGF_INVISIBLE) != (infoPtr->TLbtnState == PGF_INVISIBLE)) ||
373 ((oldBRbtnState == PGF_INVISIBLE) != (infoPtr->BRbtnState == PGF_INVISIBLE));
374 /* initiate NCCalcSize to resize client wnd if necessary */
375 if (resizeClient)
376 SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, 0, 0,
379
380 /* repaint when changing any state */
381 repaintBtns = (oldTLbtnState != infoPtr->TLbtnState) ||
382 (oldBRbtnState != infoPtr->BRbtnState);
383 if (repaintBtns)
384 SendMessageW(infoPtr->hwndSelf, WM_NCPAINT, 0, 0);
385}
386
387static LRESULT
388PAGER_SetPos(PAGER_INFO* infoPtr, INT newPos, BOOL fromBtnPress, BOOL calc_size)
389{
390 INT scrollRange = PAGER_GetScrollRange(infoPtr, calc_size);
391 INT oldPos = infoPtr->nPos;
392
393 if ((scrollRange <= 0) || (newPos < 0))
394 infoPtr->nPos = 0;
395 else if (newPos > scrollRange)
396 infoPtr->nPos = scrollRange;
397 else
398 infoPtr->nPos = newPos;
399
400 TRACE("[%p] pos=%d, oldpos=%d\n", infoPtr->hwndSelf, infoPtr->nPos, oldPos);
401
402 if (infoPtr->nPos != oldPos)
403 {
404 /* gray and restore btns, and if from WM_SETPOS, hide the gray btns */
405 PAGER_UpdateBtns(infoPtr, scrollRange, !fromBtnPress);
406 PAGER_PositionChildWnd(infoPtr);
407 }
408
409 return 0;
410}
411
412/******************************************************************
413 * For the PGM_RECALCSIZE message (but not the other uses in *
414 * this module), the native control does only the following: *
415 * *
416 * if (some condition) *
417 * PostMessageW(hwnd, EM_FMTLINES, 0, 0); *
418 * return DefWindowProcW(hwnd, PGM_RECALCSIZE, 0, 0); *
419 * *
420 * When we figure out what the "some condition" is we will *
421 * implement that for the message processing. *
422 ******************************************************************/
423
424static LRESULT
426{
427 TRACE("[%p]\n", infoPtr->hwndSelf);
428
429#ifdef __REACTOS__
430 if (!infoPtr->m_bProcessingReCalcSize)
431 {
432 infoPtr->m_bProcessingReCalcSize = TRUE;
433 /* NOTE: Posting a recalc message to ourselves, not actually an edit control message */
434 PostMessageW(infoPtr->hwndSelf, EM_FMTLINES, 0, 0);
435 }
436 return 0;
437#else
438 if (infoPtr->hwndChild)
439 {
440 INT scrollRange = PAGER_GetScrollRange(infoPtr, TRUE);
441
442 if (scrollRange <= 0)
443 {
444 infoPtr->nPos = -1;
445 PAGER_SetPos(infoPtr, 0, FALSE, TRUE);
446 }
447 else
448 PAGER_PositionChildWnd(infoPtr);
449 }
450
451 return 1;
452#endif
453}
454
455
456static COLORREF
458{
459 COLORREF clrTemp = infoPtr->clrBk;
460
461 infoPtr->clrBk = clrBk;
462 TRACE("[%p] %06x\n", infoPtr->hwndSelf, infoPtr->clrBk);
463
464 /* the native control seems to do things this way */
465 SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, 0, 0,
468
470
471 return clrTemp;
472}
473
474
475static INT
476PAGER_SetBorder (PAGER_INFO* infoPtr, INT iBorder)
477{
478 INT nTemp = infoPtr->nBorder;
479
480 infoPtr->nBorder = iBorder;
481 TRACE("[%p] %d\n", infoPtr->hwndSelf, infoPtr->nBorder);
482
483 PAGER_RecalcSize(infoPtr);
484
485 return nTemp;
486}
487
488
489static INT
490PAGER_SetButtonSize (PAGER_INFO* infoPtr, INT iButtonSize)
491{
492 INT nTemp = infoPtr->nButtonSize;
493
494 infoPtr->nButtonSize = iButtonSize;
495 TRACE("[%p] %d\n", infoPtr->hwndSelf, infoPtr->nButtonSize);
496
497 PAGER_RecalcSize(infoPtr);
498
499 return nTemp;
500}
501
502
503static LRESULT
504PAGER_SetChild (PAGER_INFO* infoPtr, HWND hwndChild)
505{
506 infoPtr->hwndChild = IsWindow (hwndChild) ? hwndChild : 0;
507
508 if (infoPtr->hwndChild)
509 {
510 TRACE("[%p] hwndChild=%p\n", infoPtr->hwndSelf, infoPtr->hwndChild);
511
512 SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, 0, 0,
514
515 infoPtr->nPos = -1;
516 PAGER_SetPos(infoPtr, 0, FALSE, FALSE);
517 }
518
519 return 0;
520}
521
522static void
524{
525 NMPGSCROLL nmpgScroll;
526 RECT rcWnd;
527
528 if (infoPtr->hwndChild)
529 {
530 ZeroMemory (&nmpgScroll, sizeof (NMPGSCROLL));
531 nmpgScroll.hdr.hwndFrom = infoPtr->hwndSelf;
532 nmpgScroll.hdr.idFrom = GetWindowLongPtrW (infoPtr->hwndSelf, GWLP_ID);
533 nmpgScroll.hdr.code = PGN_SCROLL;
534
535 GetWindowRect(infoPtr->hwndSelf, &rcWnd);
536 GetClientRect(infoPtr->hwndSelf, &nmpgScroll.rcParent);
537 nmpgScroll.iXpos = nmpgScroll.iYpos = 0;
538 nmpgScroll.iDir = dir;
539
540 if (infoPtr->dwStyle & PGS_HORZ)
541 {
542 nmpgScroll.iScroll = rcWnd.right - rcWnd.left;
543 nmpgScroll.iXpos = infoPtr->nPos;
544 }
545 else
546 {
547 nmpgScroll.iScroll = rcWnd.bottom - rcWnd.top;
548 nmpgScroll.iYpos = infoPtr->nPos;
549 }
550 nmpgScroll.iScroll -= 2*infoPtr->nButtonSize;
551
552 SendMessageW (infoPtr->hwndNotify, WM_NOTIFY, nmpgScroll.hdr.idFrom, (LPARAM)&nmpgScroll);
553
554 TRACE("[%p] PGN_SCROLL returns iScroll=%d\n", infoPtr->hwndSelf, nmpgScroll.iScroll);
555
556 if (nmpgScroll.iScroll > 0)
557 {
558 infoPtr->direction = dir;
559
560 if (dir == PGF_SCROLLLEFT || dir == PGF_SCROLLUP)
561 PAGER_SetPos(infoPtr, infoPtr->nPos - nmpgScroll.iScroll, TRUE, TRUE);
562 else
563 PAGER_SetPos(infoPtr, infoPtr->nPos + nmpgScroll.iScroll, TRUE, TRUE);
564 }
565 else
566 infoPtr->direction = -1;
567 }
568}
569
570static LRESULT
571#ifdef __REACTOS__
573#else
575#endif
576{
577#ifdef __REACTOS__
578 infoPtr->m_bProcessingReCalcSize = FALSE;
579#endif
580 /* initiate NCCalcSize to resize client wnd and get size */
581 SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, 0, 0,
584
585 SetWindowPos(infoPtr->hwndChild, 0,
586 0,0,infoPtr->nWidth,infoPtr->nHeight,
587 0);
588
589 return DefWindowProcW (infoPtr->hwndSelf, EM_FMTLINES, 0, 0);
590}
591
592static LRESULT
594{
595 PAGER_INFO *infoPtr;
596 INT ret;
597
598 /* allocate memory for info structure */
599 infoPtr = heap_alloc_zero (sizeof(*infoPtr));
600 if (!infoPtr) return -1;
601 SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
602
603 /* set default settings */
604 infoPtr->hwndSelf = hwnd;
605 infoPtr->hwndChild = NULL;
606 infoPtr->hwndNotify = lpcs->hwndParent;
607 infoPtr->dwStyle = lpcs->style;
608 infoPtr->clrBk = GetSysColor(COLOR_BTNFACE);
609 infoPtr->nBorder = 0;
610 infoPtr->nButtonSize = 12;
611 infoPtr->nPos = 0;
612 infoPtr->nWidth = 0;
613 infoPtr->nHeight = 0;
614 infoPtr->bForward = FALSE;
615 infoPtr->bCapture = FALSE;
616 infoPtr->TLbtnState = PGF_INVISIBLE;
617 infoPtr->BRbtnState = PGF_INVISIBLE;
618 infoPtr->direction = -1;
619
620 if (infoPtr->dwStyle & PGS_DRAGNDROP)
621 FIXME("[%p] Drag and Drop style is not implemented yet.\n", infoPtr->hwndSelf);
622
623 ret = SendMessageW(infoPtr->hwndNotify, WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwndSelf, NF_QUERY);
624 infoPtr->bUnicode = (ret == NFR_UNICODE);
625
626 return 0;
627}
628
629
630static LRESULT
632{
633 SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0);
634 heap_free (infoPtr->pwszBuffer);
635 heap_free (infoPtr);
636 return 0;
637}
638
639static LRESULT
641{
642 RECT rcChild, rcWindow;
643
644 /*
645 * lpRect points to a RECT struct. On entry, the struct
646 * contains the proposed wnd rectangle for the window.
647 * On exit, the struct should contain the screen
648 * coordinates of the corresponding window's client area.
649 */
650
651 DefWindowProcW (infoPtr->hwndSelf, WM_NCCALCSIZE, wParam, (LPARAM)lpRect);
652
653 TRACE("orig rect=%s\n", wine_dbgstr_rect(lpRect));
654
655 GetWindowRect (infoPtr->hwndChild, &rcChild);
656 MapWindowPoints (0, infoPtr->hwndSelf, (LPPOINT)&rcChild, 2); /* FIXME: RECT != 2 POINTS */
657 GetWindowRect (infoPtr->hwndSelf, &rcWindow);
658
659 infoPtr->nWidth = lpRect->right - lpRect->left;
660 infoPtr->nHeight = lpRect->bottom - lpRect->top;
661 PAGER_CalcSize( infoPtr );
662
663 if (infoPtr->dwStyle & PGS_HORZ)
664 {
665 if (infoPtr->TLbtnState && (lpRect->left + infoPtr->nButtonSize < lpRect->right))
666 lpRect->left += infoPtr->nButtonSize;
667 if (infoPtr->BRbtnState && (lpRect->right - infoPtr->nButtonSize > lpRect->left))
668 lpRect->right -= infoPtr->nButtonSize;
669 }
670 else
671 {
672 if (infoPtr->TLbtnState && (lpRect->top + infoPtr->nButtonSize < lpRect->bottom))
673 lpRect->top += infoPtr->nButtonSize;
674 if (infoPtr->BRbtnState && (lpRect->bottom - infoPtr->nButtonSize > lpRect->top))
675 lpRect->bottom -= infoPtr->nButtonSize;
676 }
677
678 TRACE("nPos=%d, nHeight=%d, window=%s\n", infoPtr->nPos, infoPtr->nHeight, wine_dbgstr_rect(&rcWindow));
679 TRACE("[%p] client rect set to %s BtnState[%d,%d]\n", infoPtr->hwndSelf, wine_dbgstr_rect(lpRect),
680 infoPtr->TLbtnState, infoPtr->BRbtnState);
681
682 return 0;
683}
684
685static LRESULT
686PAGER_NCPaint (const PAGER_INFO* infoPtr, HRGN hRgn)
687{
688 RECT rcBottomRight, rcTopLeft;
689 HDC hdc;
690
691 if (infoPtr->dwStyle & WS_MINIMIZE)
692 return 0;
693
695
696 if (!(hdc = GetDCEx (infoPtr->hwndSelf, 0, DCX_USESTYLE | DCX_WINDOW)))
697 return 0;
698
699 PAGER_GetButtonRects(infoPtr, &rcTopLeft, &rcBottomRight, FALSE);
700
701 PAGER_DrawButton(hdc, infoPtr->clrBk, rcTopLeft,
702 infoPtr->dwStyle & PGS_HORZ, TRUE, infoPtr->TLbtnState);
703 PAGER_DrawButton(hdc, infoPtr->clrBk, rcBottomRight,
704 infoPtr->dwStyle & PGS_HORZ, FALSE, infoPtr->BRbtnState);
705
706 ReleaseDC( infoPtr->hwndSelf, hdc );
707 return 0;
708}
709
710static INT
711PAGER_HitTest (const PAGER_INFO* infoPtr, const POINT * pt)
712{
713 RECT clientRect, rcTopLeft, rcBottomRight;
714 POINT ptWindow;
715
716 GetClientRect (infoPtr->hwndSelf, &clientRect);
717
718 if (PtInRect(&clientRect, *pt))
719 {
720 TRACE("child\n");
721 return -1;
722 }
723
724 ptWindow = *pt;
725 PAGER_GetButtonRects(infoPtr, &rcTopLeft, &rcBottomRight, TRUE);
726
727 if ((infoPtr->TLbtnState != PGF_INVISIBLE) && PtInRect(&rcTopLeft, ptWindow))
728 {
729 TRACE("PGB_TOPORLEFT\n");
730 return PGB_TOPORLEFT;
731 }
732 else if ((infoPtr->BRbtnState != PGF_INVISIBLE) && PtInRect(&rcBottomRight, ptWindow))
733 {
734 TRACE("PGB_BOTTOMORRIGHT\n");
735 return PGB_BOTTOMORRIGHT;
736 }
737
738 TRACE("nowhere\n");
739 return -1;
740}
741
742static LRESULT
744{
745 POINT pt;
746 INT nHit;
747
748 pt.x = x;
749 pt.y = y;
750
751 ScreenToClient (infoPtr->hwndSelf, &pt);
752 nHit = PAGER_HitTest(infoPtr, &pt);
753
754 return (nHit < 0) ? HTTRANSPARENT : HTCLIENT;
755}
756
757static LRESULT
759{
760 POINT clpt, pt;
761 RECT wnrect;
762 BOOL topLeft = FALSE;
763 INT btnstate = 0;
764 INT hit;
765 HDC hdc;
766
767 pt.x = x;
768 pt.y = y;
769
770 TRACE("[%p] to (%d,%d)\n", infoPtr->hwndSelf, x, y);
771 ClientToScreen(infoPtr->hwndSelf, &pt);
772 GetWindowRect(infoPtr->hwndSelf, &wnrect);
773 if (PtInRect(&wnrect, pt)) {
774 RECT topleft, bottomright, *rect = NULL;
775
776 PAGER_GetButtonRects(infoPtr, &topleft, &bottomright, FALSE);
777
778 clpt = pt;
779 MapWindowPoints(0, infoPtr->hwndSelf, &clpt, 1);
780 hit = PAGER_HitTest(infoPtr, &clpt);
781 if ((hit == PGB_TOPORLEFT) && (infoPtr->TLbtnState == PGF_NORMAL))
782 {
783 topLeft = TRUE;
784 rect = &topleft;
785 infoPtr->TLbtnState = PGF_HOT;
786 btnstate = infoPtr->TLbtnState;
787 }
788 else if ((hit == PGB_BOTTOMORRIGHT) && (infoPtr->BRbtnState == PGF_NORMAL))
789 {
790 topLeft = FALSE;
791 rect = &bottomright;
792 infoPtr->BRbtnState = PGF_HOT;
793 btnstate = infoPtr->BRbtnState;
794 }
795
796 /* If in one of the buttons the capture and draw buttons */
797 if (rect)
798 {
799 TRACE("[%p] draw btn (%s), Capture %s, style %08x\n",
800 infoPtr->hwndSelf, wine_dbgstr_rect(rect),
801 (infoPtr->bCapture) ? "TRUE" : "FALSE",
802 infoPtr->dwStyle);
803 if (!infoPtr->bCapture)
804 {
805 TRACE("[%p] SetCapture\n", infoPtr->hwndSelf);
806 SetCapture(infoPtr->hwndSelf);
807 infoPtr->bCapture = TRUE;
808 }
809 if (infoPtr->dwStyle & PGS_AUTOSCROLL)
810 SetTimer(infoPtr->hwndSelf, TIMERID1, 0x3e, 0);
811 hdc = GetWindowDC(infoPtr->hwndSelf);
812 /* OffsetRect(wnrect, 0 | 1, 0 | 1) */
813 PAGER_DrawButton(hdc, infoPtr->clrBk, *rect,
814 infoPtr->dwStyle & PGS_HORZ, topLeft, btnstate);
815 ReleaseDC(infoPtr->hwndSelf, hdc);
816 return 0;
817 }
818 }
819
820 /* If we think we are captured, then do release */
821 if (infoPtr->bCapture && (WindowFromPoint(pt) != infoPtr->hwndSelf))
822 {
823 NMHDR nmhdr;
824
825 infoPtr->bCapture = FALSE;
826
827 if (GetCapture() == infoPtr->hwndSelf)
828 {
830
831 if (infoPtr->TLbtnState == PGF_GRAYED)
832 {
833 infoPtr->TLbtnState = PGF_INVISIBLE;
834 SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, 0, 0,
837 }
838 else if (infoPtr->TLbtnState == PGF_HOT)
839 {
840 infoPtr->TLbtnState = PGF_NORMAL;
841 /* FIXME: just invalidate button rect */
843 }
844
845 if (infoPtr->BRbtnState == PGF_GRAYED)
846 {
847 infoPtr->BRbtnState = PGF_INVISIBLE;
848 SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, 0, 0,
851 }
852 else if (infoPtr->BRbtnState == PGF_HOT)
853 {
854 infoPtr->BRbtnState = PGF_NORMAL;
855 /* FIXME: just invalidate button rect */
857 }
858
859 /* Notify parent of released mouse capture */
860 memset(&nmhdr, 0, sizeof(NMHDR));
861 nmhdr.hwndFrom = infoPtr->hwndSelf;
862 nmhdr.idFrom = GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID);
863 nmhdr.code = NM_RELEASEDCAPTURE;
864 SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, nmhdr.idFrom, (LPARAM)&nmhdr);
865 }
866 if (IsWindow(infoPtr->hwndSelf))
867 KillTimer(infoPtr->hwndSelf, TIMERID1);
868 }
869 return 0;
870}
871
872static LRESULT
874{
875 BOOL repaintBtns = FALSE;
876 POINT pt;
877 INT hit;
878
879 pt.x = x;
880 pt.y = y;
881
882 TRACE("[%p] at (%d,%d)\n", infoPtr->hwndSelf, x, y);
883
884 hit = PAGER_HitTest(infoPtr, &pt);
885
886 /* put btn in DEPRESSED state */
887 if (hit == PGB_TOPORLEFT)
888 {
889 repaintBtns = infoPtr->TLbtnState != PGF_DEPRESSED;
890 infoPtr->TLbtnState = PGF_DEPRESSED;
892 }
893 else if (hit == PGB_BOTTOMORRIGHT)
894 {
895 repaintBtns = infoPtr->BRbtnState != PGF_DEPRESSED;
896 infoPtr->BRbtnState = PGF_DEPRESSED;
898 }
899
900 if (repaintBtns)
901 SendMessageW(infoPtr->hwndSelf, WM_NCPAINT, 0, 0);
902
903 switch(hit)
904 {
905 case PGB_TOPORLEFT:
906 if (infoPtr->dwStyle & PGS_HORZ)
907 {
908 TRACE("[%p] PGF_SCROLLLEFT\n", infoPtr->hwndSelf);
910 }
911 else
912 {
913 TRACE("[%p] PGF_SCROLLUP\n", infoPtr->hwndSelf);
914 PAGER_Scroll(infoPtr, PGF_SCROLLUP);
915 }
916 break;
918 if (infoPtr->dwStyle & PGS_HORZ)
919 {
920 TRACE("[%p] PGF_SCROLLRIGHT\n", infoPtr->hwndSelf);
922 }
923 else
924 {
925 TRACE("[%p] PGF_SCROLLDOWN\n", infoPtr->hwndSelf);
927 }
928 break;
929 default:
930 break;
931 }
932
933 return 0;
934}
935
936static LRESULT
938{
939 TRACE("[%p]\n", infoPtr->hwndSelf);
940
941 KillTimer (infoPtr->hwndSelf, TIMERID1);
942 KillTimer (infoPtr->hwndSelf, TIMERID2);
943
944 /* make PRESSED btns NORMAL but don't hide gray btns */
945 if (infoPtr->TLbtnState & (PGF_HOT | PGF_DEPRESSED))
946 infoPtr->TLbtnState = PGF_NORMAL;
947 if (infoPtr->BRbtnState & (PGF_HOT | PGF_DEPRESSED))
948 infoPtr->BRbtnState = PGF_NORMAL;
949
950 return 0;
951}
952
953static LRESULT
954PAGER_Timer (PAGER_INFO* infoPtr, INT nTimerId)
955{
956 INT dir;
957
958 /* if initial timer, kill it and start the repeat timer */
959 if (nTimerId == TIMERID1) {
960 if (infoPtr->TLbtnState == PGF_HOT)
961 dir = (infoPtr->dwStyle & PGS_HORZ) ?
963 else
964 dir = (infoPtr->dwStyle & PGS_HORZ) ?
966 TRACE("[%p] TIMERID1: style=%08x, dir=%d\n",
967 infoPtr->hwndSelf, infoPtr->dwStyle, dir);
968 KillTimer(infoPtr->hwndSelf, TIMERID1);
969 SetTimer(infoPtr->hwndSelf, TIMERID1, REPEAT_DELAY, 0);
970 if (infoPtr->dwStyle & PGS_AUTOSCROLL) {
971 PAGER_Scroll(infoPtr, dir);
972 SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, 0, 0,
975 }
976 return 0;
977
978 }
979
980 TRACE("[%p] TIMERID2: dir=%d\n", infoPtr->hwndSelf, infoPtr->direction);
981 KillTimer(infoPtr->hwndSelf, TIMERID2);
982 if (infoPtr->direction > 0) {
983 PAGER_Scroll(infoPtr, infoPtr->direction);
984 SetTimer(infoPtr->hwndSelf, TIMERID2, REPEAT_DELAY, 0);
985 }
986 return 0;
987}
988
989static LRESULT
991{
992 POINT pt, ptorig;
993 HWND parent;
994 LRESULT ret;
995
996 pt.x = 0;
997 pt.y = 0;
998 parent = GetParent(infoPtr->hwndSelf);
999 MapWindowPoints(infoPtr->hwndSelf, parent, &pt, 1);
1000 OffsetWindowOrgEx (hdc, pt.x, pt.y, &ptorig);
1002 SetWindowOrgEx (hdc, ptorig.x, ptorig.y, 0);
1003
1004 return ret;
1005}
1006
1007
1008static LRESULT
1010{
1011 /* note that WM_SIZE is sent whenever NCCalcSize resizes the client wnd */
1012
1013 TRACE("[%p] %d,%d\n", infoPtr->hwndSelf, x, y);
1014
1015 if (infoPtr->dwStyle & PGS_HORZ)
1016 infoPtr->nHeight = y;
1017 else
1018 infoPtr->nWidth = x;
1019
1020 return PAGER_RecalcSize(infoPtr);
1021}
1022
1023
1024static LRESULT
1025PAGER_StyleChanged(PAGER_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lpss)
1026{
1027 DWORD oldStyle = infoPtr->dwStyle;
1028
1029 TRACE("(styletype=%lx, styleOld=0x%08x, styleNew=0x%08x)\n",
1030 wStyleType, lpss->styleOld, lpss->styleNew);
1031
1032 if (wStyleType != GWL_STYLE) return 0;
1033
1034 infoPtr->dwStyle = lpss->styleNew;
1035
1036 if ((oldStyle ^ lpss->styleNew) & (PGS_HORZ | PGS_VERT))
1037 {
1038 PAGER_RecalcSize(infoPtr);
1039 }
1040
1041 return 0;
1042}
1043
1045{
1046 INT ret;
1047 switch (command)
1048 {
1049 case NF_REQUERY:
1050 ret = SendMessageW(infoPtr->hwndNotify, WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwndSelf, NF_QUERY);
1051 infoPtr->bUnicode = (ret == NFR_UNICODE);
1052 return ret;
1053 case NF_QUERY:
1054 /* Pager always wants Unicode notifications from children */
1055 return NFR_UNICODE;
1056 default:
1057 return 0;
1058 }
1059}
1060
1062{
1063 switch (code)
1064 {
1065 /* ComboxBoxEx */
1066 case CBEN_DRAGBEGINW: return CBEN_DRAGBEGINA;
1067 case CBEN_ENDEDITW: return CBEN_ENDEDITA;
1069 /* Date and Time Picker */
1070 case DTN_FORMATW: return DTN_FORMATA;
1072 case DTN_USERSTRINGW: return DTN_USERSTRINGA;
1073 case DTN_WMKEYDOWNW: return DTN_WMKEYDOWNA;
1074 /* Header */
1075 case HDN_BEGINTRACKW: return HDN_BEGINTRACKA;
1077 case HDN_ENDTRACKW: return HDN_ENDTRACKA;
1081 case HDN_ITEMCLICKW: return HDN_ITEMCLICKA;
1083 case HDN_TRACKW: return HDN_TRACKA;
1084 /* List View */
1088 case LVN_GETINFOTIPW: return LVN_GETINFOTIPA;
1090 case LVN_ODFINDITEMW: return LVN_ODFINDITEMA;
1092 /* Toolbar */
1094 case TBN_GETINFOTIPW: return TBN_GETINFOTIPA;
1095 /* Tooltip */
1097 /* Tree View */
1098 case TVN_BEGINDRAGW: return TVN_BEGINDRAGA;
1100 case TVN_BEGINRDRAGW: return TVN_BEGINRDRAGA;
1101 case TVN_DELETEITEMW: return TVN_DELETEITEMA;
1104 case TVN_GETINFOTIPW: return TVN_GETINFOTIPA;
1107 case TVN_SELCHANGEDW: return TVN_SELCHANGEDA;
1110 }
1111 return code;
1112}
1113
1115{
1116 if (!infoPtr->pwszBuffer)
1117 infoPtr->pwszBuffer = heap_alloc(size);
1118 else if (infoPtr->nBufferSize < size)
1119 infoPtr->pwszBuffer = heap_realloc(infoPtr->pwszBuffer, size);
1120
1121 if (!infoPtr->pwszBuffer) return FALSE;
1122 if (infoPtr->nBufferSize < size) infoPtr->nBufferSize = size;
1123
1124 return TRUE;
1125}
1126
1127/* Convert text to Unicode and return the original text address */
1129{
1130 WCHAR *oldText = *text;
1131 *text = NULL;
1132 Str_SetPtrWtoA((CHAR **)text, oldText);
1133 return oldText;
1134}
1135
1136static void PAGER_RestoreText(WCHAR **text, WCHAR *oldText)
1137{
1138 if (!oldText) return;
1139
1140 Free(*text);
1141 *text = oldText;
1142}
1143
1145 INT *textMax, DWORD flags)
1146{
1147 CHAR *sendBuffer = NULL;
1148 CHAR *receiveBuffer;
1150 WCHAR *oldText;
1151 INT oldTextMax;
1153
1154 oldText = *text;
1155 oldTextMax = textMax ? *textMax : 0;
1156
1157 hdr->code = PAGER_GetAnsiNtfCode(hdr->code);
1158
1159 if (mask && !(*mask & requiredMask))
1160 {
1161 ret = SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, hdr->idFrom, (LPARAM)hdr);
1162 if (flags & SET_NULL_IF_NO_MASK) oldText = NULL;
1163 goto done;
1164 }
1165
1166 if (oldTextMax < 0) goto done;
1167
1168 if ((*text && flags & (CONVERT_SEND | ZERO_SEND)) || (!*text && flags & SEND_EMPTY_IF_NULL))
1169 {
1170 bufferSize = textMax ? *textMax : lstrlenW(*text) + 1;
1171 sendBuffer = heap_alloc_zero(bufferSize);
1172 if (!sendBuffer) goto done;
1173 if (!(flags & ZERO_SEND)) WideCharToMultiByte(CP_ACP, 0, *text, -1, sendBuffer, bufferSize, NULL, FALSE);
1174 *text = (WCHAR *)sendBuffer;
1175 }
1176
1177 ret = SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, hdr->idFrom, (LPARAM)hdr);
1178
1179 if (*text && oldText && (flags & CONVERT_RECEIVE))
1180 {
1181 /* MultiByteToWideChar requires that source and destination are not the same buffer */
1182 if (*text == oldText)
1183 {
1184 bufferSize = lstrlenA((CHAR *)*text) + 1;
1185 receiveBuffer = heap_alloc(bufferSize);
1186 if (!receiveBuffer) goto done;
1187 memcpy(receiveBuffer, *text, bufferSize);
1188 MultiByteToWideChar(CP_ACP, 0, receiveBuffer, bufferSize, oldText, oldTextMax);
1189 heap_free(receiveBuffer);
1190 }
1191 else
1192 MultiByteToWideChar(CP_ACP, 0, (CHAR *)*text, -1, oldText, oldTextMax);
1193 }
1194
1195done:
1196 heap_free(sendBuffer);
1197 *text = oldText;
1198 return ret;
1199}
1200
1202{
1203 LRESULT ret;
1204
1205 if (infoPtr->bUnicode) return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, hdr->idFrom, (LPARAM)hdr);
1206
1207 switch (hdr->code)
1208 {
1209 /* ComboBoxEx */
1210 case CBEN_GETDISPINFOW:
1211 {
1212 NMCOMBOBOXEXW *nmcbe = (NMCOMBOBOXEXW *)hdr;
1213 return PAGER_SendConvertedNotify(infoPtr, hdr, &nmcbe->ceItem.mask, CBEIF_TEXT, &nmcbe->ceItem.pszText,
1215 }
1216 case CBEN_DRAGBEGINW:
1217 {
1219 NMCBEDRAGBEGINA nmdbA = {{0}};
1220 nmdbA.hdr.code = PAGER_GetAnsiNtfCode(nmdbW->hdr.code);
1221 nmdbA.hdr.hwndFrom = nmdbW->hdr.hwndFrom;
1222 nmdbA.hdr.idFrom = nmdbW->hdr.idFrom;
1223 nmdbA.iItemid = nmdbW->iItemid;
1224 WideCharToMultiByte(CP_ACP, 0, nmdbW->szText, ARRAY_SIZE(nmdbW->szText), nmdbA.szText, ARRAY_SIZE(nmdbA.szText),
1225 NULL, FALSE);
1226 return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, hdr->idFrom, (LPARAM)&nmdbA);
1227 }
1228 case CBEN_ENDEDITW:
1229 {
1230 NMCBEENDEDITW *nmedW = (NMCBEENDEDITW *)hdr;
1231 NMCBEENDEDITA nmedA = {{0}};
1232 nmedA.hdr.code = PAGER_GetAnsiNtfCode(nmedW->hdr.code);
1233 nmedA.hdr.hwndFrom = nmedW->hdr.hwndFrom;
1234 nmedA.hdr.idFrom = nmedW->hdr.idFrom;
1235 nmedA.fChanged = nmedW->fChanged;
1236 nmedA.iNewSelection = nmedW->iNewSelection;
1237 nmedA.iWhy = nmedW->iWhy;
1238 WideCharToMultiByte(CP_ACP, 0, nmedW->szText, ARRAY_SIZE(nmedW->szText), nmedA.szText, ARRAY_SIZE(nmedA.szText),
1239 NULL, FALSE);
1240 return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, hdr->idFrom, (LPARAM)&nmedA);
1241 }
1242 /* Date and Time Picker */
1243 case DTN_FORMATW:
1244 {
1246 WCHAR *oldFormat;
1247 INT textLength;
1248
1249 hdr->code = PAGER_GetAnsiNtfCode(hdr->code);
1250 oldFormat = PAGER_ConvertText((WCHAR **)&nmdtf->pszFormat);
1251 ret = SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, hdr->idFrom, (LPARAM)nmdtf);
1252 PAGER_RestoreText((WCHAR **)&nmdtf->pszFormat, oldFormat);
1253
1254 if (nmdtf->pszDisplay)
1255 {
1256 textLength = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)nmdtf->pszDisplay, -1, 0, 0);
1257 if (!PAGER_AdjustBuffer(infoPtr, textLength * sizeof(WCHAR))) return ret;
1258 MultiByteToWideChar(CP_ACP, 0, (LPCSTR)nmdtf->pszDisplay, -1, infoPtr->pwszBuffer, textLength);
1259 if (nmdtf->pszDisplay != nmdtf->szDisplay)
1260 nmdtf->pszDisplay = infoPtr->pwszBuffer;
1261 else
1262 {
1263 textLength = min(textLength, ARRAY_SIZE(nmdtf->szDisplay));
1264 memcpy(nmdtf->szDisplay, infoPtr->pwszBuffer, textLength * sizeof(WCHAR));
1265 }
1266 }
1267
1268 return ret;
1269 }
1270 case DTN_FORMATQUERYW:
1271 {
1273 return PAGER_SendConvertedNotify(infoPtr, hdr, NULL, 0, (WCHAR **)&nmdtfq->pszFormat, NULL, CONVERT_SEND);
1274 }
1275 case DTN_WMKEYDOWNW:
1276 {
1278 return PAGER_SendConvertedNotify(infoPtr, hdr, NULL, 0, (WCHAR **)&nmdtkd->pszFormat, NULL, CONVERT_SEND);
1279 }
1280 case DTN_USERSTRINGW:
1281 {
1283 return PAGER_SendConvertedNotify(infoPtr, hdr, NULL, 0, (WCHAR **)&nmdts->pszUserString, NULL, CONVERT_SEND);
1284 }
1285 /* Header */
1286 case HDN_BEGINTRACKW:
1288 case HDN_ENDTRACKW:
1289 case HDN_ITEMCHANGEDW:
1290 case HDN_ITEMCHANGINGW:
1291 case HDN_ITEMCLICKW:
1292 case HDN_ITEMDBLCLICKW:
1293 case HDN_TRACKW:
1294 {
1295 NMHEADERW *nmh = (NMHEADERW *)hdr;
1296 WCHAR *oldText = NULL, *oldFilterText = NULL;
1298
1299 hdr->code = PAGER_GetAnsiNtfCode(hdr->code);
1300
1301 if (!nmh->pitem) return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, hdr->idFrom, (LPARAM)hdr);
1302 if (nmh->pitem->mask & HDI_TEXT) oldText = PAGER_ConvertText(&nmh->pitem->pszText);
1303 if ((nmh->pitem->mask & HDI_FILTER) && (nmh->pitem->type == HDFT_ISSTRING) && nmh->pitem->pvFilter)
1304 {
1305 tf = (HD_TEXTFILTERW *)nmh->pitem->pvFilter;
1306 oldFilterText = PAGER_ConvertText(&tf->pszText);
1307 }
1308 ret = SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, hdr->idFrom, (LPARAM)hdr);
1309 PAGER_RestoreText(&nmh->pitem->pszText, oldText);
1310 if (tf) PAGER_RestoreText(&tf->pszText, oldFilterText);
1311 return ret;
1312 }
1313 case HDN_GETDISPINFOW:
1314 {
1315 NMHDDISPINFOW *nmhddi = (NMHDDISPINFOW *)hdr;
1316 return PAGER_SendConvertedNotify(infoPtr, hdr, &nmhddi->mask, HDI_TEXT, &nmhddi->pszText, &nmhddi->cchTextMax,
1318 }
1319 /* List View */
1321 case LVN_ENDLABELEDITW:
1322 case LVN_SETDISPINFOW:
1323 {
1324 NMLVDISPINFOW *nmlvdi = (NMLVDISPINFOW *)hdr;
1325 return PAGER_SendConvertedNotify(infoPtr, hdr, &nmlvdi->item.mask, LVIF_TEXT, &nmlvdi->item.pszText,
1327 }
1328 case LVN_GETDISPINFOW:
1329 {
1330 NMLVDISPINFOW *nmlvdi = (NMLVDISPINFOW *)hdr;
1331 return PAGER_SendConvertedNotify(infoPtr, hdr, &nmlvdi->item.mask, LVIF_TEXT, &nmlvdi->item.pszText,
1332 &nmlvdi->item.cchTextMax, CONVERT_RECEIVE);
1333 }
1334 case LVN_GETINFOTIPW:
1335 {
1336 NMLVGETINFOTIPW *nmlvgit = (NMLVGETINFOTIPW *)hdr;
1337 return PAGER_SendConvertedNotify(infoPtr, hdr, NULL, 0, &nmlvgit->pszText, &nmlvgit->cchTextMax,
1339 }
1341 case LVN_ODFINDITEMW:
1342 {
1343 NMLVFINDITEMW *nmlvfi = (NMLVFINDITEMW *)hdr;
1345 (WCHAR **)&nmlvfi->lvfi.psz, NULL, CONVERT_SEND);
1346 }
1347 /* Toolbar */
1348 case TBN_GETBUTTONINFOW:
1349 {
1350 NMTOOLBARW *nmtb = (NMTOOLBARW *)hdr;
1351 return PAGER_SendConvertedNotify(infoPtr, hdr, NULL, 0, &nmtb->pszText, &nmtb->cchText,
1353 }
1354 case TBN_GETINFOTIPW:
1355 {
1356 NMTBGETINFOTIPW *nmtbgit = (NMTBGETINFOTIPW *)hdr;
1357 return PAGER_SendConvertedNotify(infoPtr, hdr, NULL, 0, &nmtbgit->pszText, &nmtbgit->cchTextMax, CONVERT_RECEIVE);
1358 }
1359 /* Tooltip */
1360 case TTN_GETDISPINFOW:
1361 {
1362 NMTTDISPINFOW *nmttdiW = (NMTTDISPINFOW *)hdr;
1363 NMTTDISPINFOA nmttdiA = {{0}};
1364 INT size;
1365
1366 nmttdiA.hdr.code = PAGER_GetAnsiNtfCode(nmttdiW->hdr.code);
1367 nmttdiA.hdr.hwndFrom = nmttdiW->hdr.hwndFrom;
1368 nmttdiA.hdr.idFrom = nmttdiW->hdr.idFrom;
1369 nmttdiA.hinst = nmttdiW->hinst;
1370 nmttdiA.uFlags = nmttdiW->uFlags;
1371 nmttdiA.lParam = nmttdiW->lParam;
1372 nmttdiA.lpszText = nmttdiA.szText;
1373 WideCharToMultiByte(CP_ACP, 0, nmttdiW->szText, ARRAY_SIZE(nmttdiW->szText), nmttdiA.szText,
1374 ARRAY_SIZE(nmttdiA.szText), NULL, FALSE);
1375
1376 ret = SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, hdr->idFrom, (LPARAM)&nmttdiA);
1377
1378 nmttdiW->hinst = nmttdiA.hinst;
1379 nmttdiW->uFlags = nmttdiA.uFlags;
1380 nmttdiW->lParam = nmttdiA.lParam;
1381
1382 MultiByteToWideChar(CP_ACP, 0, nmttdiA.szText, ARRAY_SIZE(nmttdiA.szText), nmttdiW->szText,
1383 ARRAY_SIZE(nmttdiW->szText));
1384 if (!nmttdiA.lpszText)
1385 nmttdiW->lpszText = nmttdiW->szText;
1386 else if (!IS_INTRESOURCE(nmttdiA.lpszText))
1387 {
1388 size = MultiByteToWideChar(CP_ACP, 0, nmttdiA.lpszText, -1, 0, 0);
1389 if (size > ARRAY_SIZE(nmttdiW->szText))
1390 {
1391 if (!PAGER_AdjustBuffer(infoPtr, size * sizeof(WCHAR))) return ret;
1392 MultiByteToWideChar(CP_ACP, 0, nmttdiA.lpszText, -1, infoPtr->pwszBuffer, size);
1393 nmttdiW->lpszText = infoPtr->pwszBuffer;
1394 /* Override content in szText */
1395 memcpy(nmttdiW->szText, nmttdiW->lpszText, min(sizeof(nmttdiW->szText), size * sizeof(WCHAR)));
1396 }
1397 else
1398 {
1399 MultiByteToWideChar(CP_ACP, 0, nmttdiA.lpszText, -1, nmttdiW->szText, ARRAY_SIZE(nmttdiW->szText));
1400 nmttdiW->lpszText = nmttdiW->szText;
1401 }
1402 }
1403 else
1404 {
1405 nmttdiW->szText[0] = 0;
1406 nmttdiW->lpszText = (WCHAR *)nmttdiA.lpszText;
1407 }
1408
1409 return ret;
1410 }
1411 /* Tree View */
1412 case TVN_BEGINDRAGW:
1413 case TVN_BEGINRDRAGW:
1414 case TVN_ITEMEXPANDEDW:
1415 case TVN_ITEMEXPANDINGW:
1416 {
1417 NMTREEVIEWW *nmtv = (NMTREEVIEWW *)hdr;
1418 return PAGER_SendConvertedNotify(infoPtr, hdr, &nmtv->itemNew.mask, TVIF_TEXT, &nmtv->itemNew.pszText, NULL,
1419 CONVERT_SEND);
1420 }
1421 case TVN_DELETEITEMW:
1422 {
1423 NMTREEVIEWW *nmtv = (NMTREEVIEWW *)hdr;
1424 return PAGER_SendConvertedNotify(infoPtr, hdr, &nmtv->itemOld.mask, TVIF_TEXT, &nmtv->itemOld.pszText, NULL,
1425 CONVERT_SEND);
1426 }
1428 case TVN_ENDLABELEDITW:
1429 {
1430 NMTVDISPINFOW *nmtvdi = (NMTVDISPINFOW *)hdr;
1431 return PAGER_SendConvertedNotify(infoPtr, hdr, &nmtvdi->item.mask, TVIF_TEXT, &nmtvdi->item.pszText,
1433 }
1434 case TVN_SELCHANGINGW:
1435 case TVN_SELCHANGEDW:
1436 {
1437 NMTREEVIEWW *nmtv = (NMTREEVIEWW *)hdr;
1438 WCHAR *oldItemOldText = NULL;
1439 WCHAR *oldItemNewText = NULL;
1440
1441 hdr->code = PAGER_GetAnsiNtfCode(hdr->code);
1442
1443 if (!((nmtv->itemNew.mask | nmtv->itemOld.mask) & TVIF_TEXT))
1444 return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, hdr->idFrom, (LPARAM)hdr);
1445
1446 if (nmtv->itemOld.mask & TVIF_TEXT) oldItemOldText = PAGER_ConvertText(&nmtv->itemOld.pszText);
1447 if (nmtv->itemNew.mask & TVIF_TEXT) oldItemNewText = PAGER_ConvertText(&nmtv->itemNew.pszText);
1448
1449 ret = SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, hdr->idFrom, (LPARAM)hdr);
1450 PAGER_RestoreText(&nmtv->itemOld.pszText, oldItemOldText);
1451 PAGER_RestoreText(&nmtv->itemNew.pszText, oldItemNewText);
1452 return ret;
1453 }
1454 case TVN_GETDISPINFOW:
1455 {
1456 NMTVDISPINFOW *nmtvdi = (NMTVDISPINFOW *)hdr;
1457 return PAGER_SendConvertedNotify(infoPtr, hdr, &nmtvdi->item.mask, TVIF_TEXT, &nmtvdi->item.pszText,
1459 }
1460 case TVN_SETDISPINFOW:
1461 {
1462 NMTVDISPINFOW *nmtvdi = (NMTVDISPINFOW *)hdr;
1463 return PAGER_SendConvertedNotify(infoPtr, hdr, &nmtvdi->item.mask, TVIF_TEXT, &nmtvdi->item.pszText,
1465 }
1466 case TVN_GETINFOTIPW:
1467 {
1468 NMTVGETINFOTIPW *nmtvgit = (NMTVGETINFOTIPW *)hdr;
1469 return PAGER_SendConvertedNotify(infoPtr, hdr, NULL, 0, &nmtvgit->pszText, &nmtvgit->cchTextMax, CONVERT_RECEIVE);
1470 }
1471 }
1472 /* Other notifications, no need to convert */
1473 return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, hdr->idFrom, (LPARAM)hdr);
1474}
1475
1476static LRESULT WINAPI
1478{
1479 PAGER_INFO *infoPtr = (PAGER_INFO *)GetWindowLongPtrW(hwnd, 0);
1480
1481 TRACE("(%p, %#x, %#lx, %#lx)\n", hwnd, uMsg, wParam, lParam);
1482
1483 if (!infoPtr && (uMsg != WM_CREATE))
1484 return DefWindowProcW (hwnd, uMsg, wParam, lParam);
1485
1486 switch (uMsg)
1487 {
1488 case EM_FMTLINES:
1489 return PAGER_FmtLines(infoPtr);
1490
1491 case PGM_FORWARDMOUSE:
1492 return PAGER_ForwardMouse (infoPtr, (BOOL)wParam);
1493
1494 case PGM_GETBKCOLOR:
1495 return PAGER_GetBkColor(infoPtr);
1496
1497 case PGM_GETBORDER:
1498 return PAGER_GetBorder(infoPtr);
1499
1500 case PGM_GETBUTTONSIZE:
1501 return PAGER_GetButtonSize(infoPtr);
1502
1503 case PGM_GETPOS:
1504 return PAGER_GetPos(infoPtr);
1505
1506 case PGM_GETBUTTONSTATE:
1507 return PAGER_GetButtonState (infoPtr, (INT)lParam);
1508
1509/* case PGM_GETDROPTARGET: */
1510
1511 case PGM_RECALCSIZE:
1512 return PAGER_RecalcSize(infoPtr);
1513
1514 case PGM_SETBKCOLOR:
1515 return PAGER_SetBkColor (infoPtr, (COLORREF)lParam);
1516
1517 case PGM_SETBORDER:
1518 return PAGER_SetBorder (infoPtr, (INT)lParam);
1519
1520 case PGM_SETBUTTONSIZE:
1521 return PAGER_SetButtonSize (infoPtr, (INT)lParam);
1522
1523 case PGM_SETCHILD:
1524 return PAGER_SetChild (infoPtr, (HWND)lParam);
1525
1526 case PGM_SETPOS:
1527 return PAGER_SetPos(infoPtr, (INT)lParam, FALSE, TRUE);
1528
1529 case WM_CREATE:
1531
1532 case WM_DESTROY:
1533 return PAGER_Destroy (infoPtr);
1534
1535 case WM_SIZE:
1536 return PAGER_Size (infoPtr, (INT)wParam, (short)LOWORD(lParam), (short)HIWORD(lParam));
1537
1538 case WM_NCPAINT:
1539 return PAGER_NCPaint (infoPtr, (HRGN)wParam);
1540
1541 case WM_STYLECHANGED:
1542 return PAGER_StyleChanged(infoPtr, wParam, (LPSTYLESTRUCT)lParam);
1543
1544 case WM_NCCALCSIZE:
1545 return PAGER_NCCalcSize (infoPtr, wParam, (LPRECT)lParam);
1546
1547 case WM_NCHITTEST:
1548 return PAGER_NCHitTest (infoPtr, (short)LOWORD(lParam), (short)HIWORD(lParam));
1549
1550 case WM_MOUSEMOVE:
1551 if (infoPtr->bForward && infoPtr->hwndChild)
1553 return PAGER_MouseMove (infoPtr, (INT)wParam, (short)LOWORD(lParam), (short)HIWORD(lParam));
1554
1555 case WM_LBUTTONDOWN:
1556 return PAGER_LButtonDown (infoPtr, (INT)wParam, (short)LOWORD(lParam), (short)HIWORD(lParam));
1557
1558 case WM_LBUTTONUP:
1559 return PAGER_LButtonUp (infoPtr, (INT)wParam, (short)LOWORD(lParam), (short)HIWORD(lParam));
1560
1561 case WM_ERASEBKGND:
1562 return PAGER_EraseBackground (infoPtr, (HDC)wParam);
1563
1564 case WM_TIMER:
1565 return PAGER_Timer (infoPtr, (INT)wParam);
1566
1567 case WM_NOTIFYFORMAT:
1568 return PAGER_NotifyFormat (infoPtr, lParam);
1569
1570 case WM_NOTIFY:
1571 return PAGER_Notify (infoPtr, (NMHDR *)lParam);
1572
1573 case WM_COMMAND:
1574 return SendMessageW (infoPtr->hwndNotify, uMsg, wParam, lParam);
1575
1576 default:
1577 return DefWindowProcW (hwnd, uMsg, wParam, lParam);
1578 }
1579}
1580
1581
1582VOID
1584{
1585 WNDCLASSW wndClass;
1586
1587 ZeroMemory (&wndClass, sizeof(WNDCLASSW));
1588 wndClass.style = CS_GLOBALCLASS;
1589 wndClass.lpfnWndProc = PAGER_WindowProc;
1590 wndClass.cbClsExtra = 0;
1591 wndClass.cbWndExtra = sizeof(PAGER_INFO *);
1592 wndClass.hCursor = LoadCursorW (0, (LPWSTR)IDC_ARROW);
1593 wndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1);
1595
1596 RegisterClassW (&wndClass);
1597}
1598
1599
1600VOID
1602{
1604}
#define DCX_USESTYLE
Definition: GetDCEx.c:10
unsigned int dir
Definition: maze.c:112
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:71
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define ARRAY_SIZE(A)
Definition: main.h:20
#define FIXME(fmt,...)
Definition: precomp.h:53
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
BOOL Str_SetPtrWtoA(LPSTR *lppDest, LPCWSTR lpSrc) DECLSPEC_HIDDEN
#define NO_ERROR
Definition: dderror.h:5
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
VOID PAGER_Register(void)
Definition: pager.c:1583
static INT PAGER_GetScrollRange(PAGER_INFO *infoPtr, BOOL calc_size)
Definition: pager.c:296
static LRESULT PAGER_GetButtonState(const PAGER_INFO *infoPtr, INT btn)
Definition: pager.c:187
static LRESULT PAGER_ForwardMouse(PAGER_INFO *infoPtr, BOOL bFwd)
Definition: pager.c:177
static LRESULT PAGER_FmtLines(const PAGER_INFO *infoPtr)
Definition: pager.c:574
#define REPEAT_DELAY
Definition: pager.c:97
static LRESULT PAGER_StyleChanged(PAGER_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lpss)
Definition: pager.c:1025
static LRESULT PAGER_NotifyFormat(PAGER_INFO *infoPtr, INT command)
Definition: pager.c:1044
static void PAGER_PositionChildWnd(PAGER_INFO *infoPtr)
Definition: pager.c:251
static void PAGER_CalcSize(PAGER_INFO *infoPtr)
Definition: pager.c:230
static LRESULT PAGER_LButtonDown(PAGER_INFO *infoPtr, INT keys, INT x, INT y)
Definition: pager.c:873
static void PAGER_DrawButton(HDC hdc, COLORREF clrBk, RECT rc, BOOL horz, BOOL topLeft, INT btnState)
Definition: pager.c:139
static COLORREF PAGER_GetBkColor(const PAGER_INFO *infoPtr)
Definition: pager.c:223
static void PAGER_Scroll(PAGER_INFO *infoPtr, INT dir)
Definition: pager.c:523
static void PAGER_UpdateBtns(PAGER_INFO *infoPtr, INT scrollRange, BOOL hideGrayBtns)
Definition: pager.c:329
static LRESULT PAGER_MouseMove(PAGER_INFO *infoPtr, INT keys, INT x, INT y)
Definition: pager.c:758
static LRESULT PAGER_SendConvertedNotify(PAGER_INFO *infoPtr, NMHDR *hdr, UINT *mask, UINT requiredMask, WCHAR **text, INT *textMax, DWORD flags)
Definition: pager.c:1144
#define INITIAL_DELAY
Definition: pager.c:96
static INT PAGER_GetPos(const PAGER_INFO *infoPtr)
Definition: pager.c:202
static INT PAGER_SetButtonSize(PAGER_INFO *infoPtr, INT iButtonSize)
Definition: pager.c:490
static INT PAGER_HitTest(const PAGER_INFO *infoPtr, const POINT *pt)
Definition: pager.c:711
static LRESULT PAGER_LButtonUp(PAGER_INFO *infoPtr, INT keys, INT x, INT y)
Definition: pager.c:937
static LRESULT PAGER_EraseBackground(const PAGER_INFO *infoPtr, HDC hdc)
Definition: pager.c:990
static LRESULT PAGER_SetPos(PAGER_INFO *infoPtr, INT newPos, BOOL fromBtnPress, BOOL calc_size)
Definition: pager.c:388
static UINT PAGER_GetAnsiNtfCode(UINT code)
Definition: pager.c:1061
conversion_flags
Definition: pager.c:101
@ CONVERT_RECEIVE
Definition: pager.c:105
@ ZERO_SEND
Definition: pager.c:111
@ SEND_EMPTY_IF_NULL
Definition: pager.c:107
@ SET_NULL_IF_NO_MASK
Definition: pager.c:109
@ CONVERT_SEND
Definition: pager.c:103
static LRESULT PAGER_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
Definition: pager.c:593
#define TIMERID1
Definition: pager.c:94
static LRESULT PAGER_NCHitTest(const PAGER_INFO *infoPtr, INT x, INT y)
Definition: pager.c:743
static void PAGER_GetButtonRects(const PAGER_INFO *infoPtr, RECT *prcTopLeft, RECT *prcBottomRight, BOOL bClientCoords)
Definition: pager.c:115
static LRESULT PAGER_SetChild(PAGER_INFO *infoPtr, HWND hwndChild)
Definition: pager.c:504
VOID PAGER_Unregister(void)
Definition: pager.c:1601
static LRESULT PAGER_NCPaint(const PAGER_INFO *infoPtr, HRGN hRgn)
Definition: pager.c:686
static LRESULT PAGER_NCCalcSize(PAGER_INFO *infoPtr, WPARAM wParam, LPRECT lpRect)
Definition: pager.c:640
static INT PAGER_GetBorder(const PAGER_INFO *infoPtr)
Definition: pager.c:216
static LRESULT PAGER_Timer(PAGER_INFO *infoPtr, INT nTimerId)
Definition: pager.c:954
static BOOL PAGER_AdjustBuffer(PAGER_INFO *infoPtr, INT size)
Definition: pager.c:1114
static LRESULT PAGER_Destroy(PAGER_INFO *infoPtr)
Definition: pager.c:631
static WCHAR * PAGER_ConvertText(WCHAR **text)
Definition: pager.c:1128
static LRESULT PAGER_RecalcSize(PAGER_INFO *infoPtr)
Definition: pager.c:425
static COLORREF PAGER_SetBkColor(PAGER_INFO *infoPtr, COLORREF clrBk)
Definition: pager.c:457
static INT PAGER_GetButtonSize(const PAGER_INFO *infoPtr)
Definition: pager.c:209
static LRESULT PAGER_Size(PAGER_INFO *infoPtr, INT type, INT x, INT y)
Definition: pager.c:1009
static INT PAGER_SetBorder(PAGER_INFO *infoPtr, INT iBorder)
Definition: pager.c:476
static LRESULT PAGER_Notify(PAGER_INFO *infoPtr, NMHDR *hdr)
Definition: pager.c:1201
static void PAGER_RestoreText(WCHAR **text, WCHAR *oldText)
Definition: pager.c:1136
static LRESULT WINAPI PAGER_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: pager.c:1477
#define TIMERID2
Definition: pager.c:95
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
#define MultiByteToWideChar
Definition: compat.h:110
#define lstrlenW
Definition: compat.h:750
const WCHAR * text
Definition: package.c:1794
#define pt(x, y)
Definition: drawing.c:79
r parent
Definition: btrfs.c:3010
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
size_t bufferSize
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLsizeiptr size
Definition: glext.h:5919
GLenum GLint GLuint mask
Definition: glext.h:6028
GLbitfield flags
Definition: glext.h:7161
HFONT tf
Definition: icontest.c:17
char hdr[14]
Definition: iptest.cpp:33
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
static HRGN hRgn
Definition: mapping.c:33
#define min(a, b)
Definition: monoChain.cc:55
unsigned int UINT
Definition: ndis.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define WS_MINIMIZE
Definition: pedump.c:622
#define NM_RELEASEDCAPTURE
Definition: commctrl.h:141
#define PGB_TOPORLEFT
Definition: commctrl.h:4518
#define TVN_ENDLABELEDITA
Definition: commctrl.h:3716
#define TVN_SELCHANGINGW
Definition: commctrl.h:3651
#define TTN_GETDISPINFOA
Definition: commctrl.h:1877
#define PGF_INVISIBLE
Definition: commctrl.h:4512
#define LVN_GETDISPINFOA
Definition: commctrl.h:3158
#define TVN_ITEMEXPANDEDW
Definition: commctrl.h:3707
#define PGS_VERT
Definition: commctrl.h:4507
#define DTN_WMKEYDOWNW
Definition: commctrl.h:4399
#define PGF_SCROLLDOWN
Definition: commctrl.h:4563
#define TVN_BEGINRDRAGW
Definition: commctrl.h:3711
#define LVN_ODFINDITEMW
Definition: commctrl.h:3150
#define PGM_SETPOS
Definition: commctrl.h:4542
#define TVN_SETDISPINFOW
Definition: commctrl.h:3662
#define HDI_TEXT
Definition: commctrl.h:704
#define LVFI_STRING
Definition: commctrl.h:2442
#define TVIF_TEXT
Definition: commctrl.h:3271
#define HDN_ITEMDBLCLICKA
Definition: commctrl.h:843
#define PGM_GETBUTTONSTATE
Definition: commctrl.h:4554
#define HDN_BEGINTRACKA
Definition: commctrl.h:847
#define PGM_GETBORDER
Definition: commctrl.h:4539
#define LVFI_SUBSTRING
Definition: commctrl.h:2443
#define TVN_ITEMEXPANDINGA
Definition: commctrl.h:3704
#define TTN_GETDISPINFOW
Definition: commctrl.h:1878
#define HDN_ITEMCHANGEDW
Definition: commctrl.h:840
#define CBEN_ENDEDITW
Definition: commctrl.h:3881
#define TVN_BEGINLABELEDITA
Definition: commctrl.h:3714
#define LVN_GETINFOTIPA
Definition: commctrl.h:3227
#define HDFT_ISSTRING
Definition: commctrl.h:642
#define PGM_SETBUTTONSIZE
Definition: commctrl.h:4548
#define LVN_SETDISPINFOW
Definition: commctrl.h:3161
#define PGF_HOT
Definition: commctrl.h:4516
#define CBEN_DRAGBEGINA
Definition: commctrl.h:3885
#define LVN_GETINFOTIPW
Definition: commctrl.h:3228
#define DTN_USERSTRINGA
Definition: commctrl.h:4378
#define PGM_SETBKCOLOR
Definition: commctrl.h:4530
#define TVN_GETINFOTIPW
Definition: commctrl.h:3720
#define TVN_SELCHANGEDW
Definition: commctrl.h:3653
#define PGM_SETCHILD
Definition: commctrl.h:4521
#define TVN_BEGINRDRAGA
Definition: commctrl.h:3710
#define CBEN_ENDEDITA
Definition: commctrl.h:3880
#define PGF_SCROLLRIGHT
Definition: commctrl.h:4565
#define CBEIF_TEXT
Definition: commctrl.h:3791
#define HDN_ENDTRACKW
Definition: commctrl.h:850
#define TBN_GETBUTTONINFOW
Definition: commctrl.h:1343
#define PGN_CALCSIZE
Definition: commctrl.h:4585
#define TVN_ITEMEXPANDEDA
Definition: commctrl.h:3706
#define LVN_INCREMENTALSEARCHA
Definition: commctrl.h:3168
#define DTN_USERSTRINGW
Definition: commctrl.h:4379
#define PGF_SCROLLLEFT
Definition: commctrl.h:4564
#define PGM_GETPOS
Definition: commctrl.h:4545
#define HDN_ITEMCHANGINGA
Definition: commctrl.h:837
#define LVN_BEGINLABELEDITA
Definition: commctrl.h:3140
#define PGF_SCROLLUP
Definition: commctrl.h:4562
#define LVN_INCREMENTALSEARCHW
Definition: commctrl.h:3169
#define HDN_ITEMCLICKA
Definition: commctrl.h:841
#define CBEN_GETDISPINFOA
Definition: commctrl.h:3876
#define HDN_ENDTRACKA
Definition: commctrl.h:849
#define HDN_ITEMDBLCLICKW
Definition: commctrl.h:844
#define TVN_GETDISPINFOW
Definition: commctrl.h:3660
#define DTN_WMKEYDOWNA
Definition: commctrl.h:4398
#define TVN_SELCHANGINGA
Definition: commctrl.h:3650
#define HDN_TRACKW
Definition: commctrl.h:852
#define LVN_ENDLABELEDITW
Definition: commctrl.h:3143
#define DTN_FORMATW
Definition: commctrl.h:4419
#define LVN_SETDISPINFOA
Definition: commctrl.h:3160
#define LVN_BEGINLABELEDITW
Definition: commctrl.h:3141
#define PGS_AUTOSCROLL
Definition: commctrl.h:4509
#define PGF_GRAYED
Definition: commctrl.h:4514
#define TVN_BEGINDRAGW
Definition: commctrl.h:3709
#define HDN_ITEMCHANGINGW
Definition: commctrl.h:838
#define LVN_ENDLABELEDITA
Definition: commctrl.h:3142
#define TVN_DELETEITEMA
Definition: commctrl.h:3712
#define TBN_GETBUTTONINFOA
Definition: commctrl.h:1306
#define DTN_FORMATQUERYW
Definition: commctrl.h:4441
#define PGM_GETBKCOLOR
Definition: commctrl.h:4533
#define HDN_GETDISPINFOA
Definition: commctrl.h:853
#define TBN_GETINFOTIPA
Definition: commctrl.h:1341
#define LVIF_TEXT
Definition: commctrl.h:2314
#define HDN_GETDISPINFOW
Definition: commctrl.h:854
#define HDN_DIVIDERDBLCLICKW
Definition: commctrl.h:846
#define PGM_FORWARDMOUSE
Definition: commctrl.h:4527
#define TVN_BEGINDRAGA
Definition: commctrl.h:3708
#define WC_PAGESCROLLERW
Definition: commctrl.h:4502
#define TVN_GETDISPINFOA
Definition: commctrl.h:3659
#define LVN_ODFINDITEMA
Definition: commctrl.h:3149
#define TVN_ITEMEXPANDINGW
Definition: commctrl.h:3705
#define HDN_BEGINTRACKW
Definition: commctrl.h:848
#define HDI_FILTER
Definition: commctrl.h:711
#define TVN_BEGINLABELEDITW
Definition: commctrl.h:3715
#define LVN_GETDISPINFOW
Definition: commctrl.h:3159
#define PGF_CALCWIDTH
Definition: commctrl.h:4587
#define DTN_FORMATQUERYA
Definition: commctrl.h:4440
#define TBN_GETINFOTIPW
Definition: commctrl.h:1342
#define PGF_CALCHEIGHT
Definition: commctrl.h:4588
#define DTN_FORMATA
Definition: commctrl.h:4418
#define HDN_TRACKA
Definition: commctrl.h:851
#define CBEN_GETDISPINFOW
Definition: commctrl.h:3883
#define TVN_SELCHANGEDA
Definition: commctrl.h:3652
#define HDN_ITEMCHANGEDA
Definition: commctrl.h:839
#define TVN_SETDISPINFOA
Definition: commctrl.h:3661
#define PGF_NORMAL
Definition: commctrl.h:4513
#define PGS_HORZ
Definition: commctrl.h:4508
#define HDN_ITEMCLICKW
Definition: commctrl.h:842
#define PGS_DRAGNDROP
Definition: commctrl.h:4510
#define PGB_BOTTOMORRIGHT
Definition: commctrl.h:4519
#define PGN_SCROLL
Definition: commctrl.h:4560
#define HDN_DIVIDERDBLCLICKA
Definition: commctrl.h:845
#define PGM_GETBUTTONSIZE
Definition: commctrl.h:4551
#define PGM_SETBORDER
Definition: commctrl.h:4536
#define TVN_ENDLABELEDITW
Definition: commctrl.h:3717
#define TVN_DELETEITEMW
Definition: commctrl.h:3713
#define PGM_RECALCSIZE
Definition: commctrl.h:4524
#define PGF_DEPRESSED
Definition: commctrl.h:4515
#define TVN_GETINFOTIPA
Definition: commctrl.h:3719
#define CBEN_DRAGBEGINW
Definition: commctrl.h:3886
#define WM_NOTIFY
Definition: richedit.h:61
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE(s)
Definition: solgame.cpp:4
& rect
Definition: startmenu.cpp:1413
char szText[CBEMAXSTRLEN]
Definition: commctrl.h:3908
WCHAR szText[CBEMAXSTRLEN]
Definition: commctrl.h:3902
char szText[CBEMAXSTRLEN]
Definition: commctrl.h:3927
int iNewSelection
Definition: commctrl.h:3926
int iNewSelection
Definition: commctrl.h:3918
WCHAR szText[CBEMAXSTRLEN]
Definition: commctrl.h:3919
COMBOBOXEXITEMW ceItem
Definition: commctrl.h:3869
DWORD dwFlag
Definition: commctrl.h:4592
RECT rcParent
Definition: commctrl.h:4576
int iScroll
Definition: commctrl.h:4580
NMHDR hdr
Definition: commctrl.h:4574
WCHAR * pwszBuffer
Definition: pager.c:87
BOOL bUnicode
Definition: pager.c:74
COLORREF clrBk
Definition: pager.c:76
INT TLbtnState
Definition: pager.c:84
BOOL bForward
Definition: pager.c:82
BOOL bCapture
Definition: pager.c:83
INT nButtonSize
Definition: pager.c:78
INT direction
Definition: pager.c:86
HWND hwndSelf
Definition: pager.c:71
INT nPos
Definition: pager.c:79
INT nHeight
Definition: pager.c:81
DWORD dwStyle
Definition: pager.c:75
HWND hwndChild
Definition: pager.c:72
INT BRbtnState
Definition: pager.c:85
INT nBufferSize
Definition: pager.c:88
HWND hwndNotify
Definition: pager.c:73
INT nBorder
Definition: pager.c:77
INT nWidth
Definition: pager.c:80
UINT mask
Definition: commctrl.h:684
LPWSTR pszText
Definition: commctrl.h:686
UINT type
Definition: commctrl.h:693
void * pvFilter
Definition: commctrl.h:694
LPCWSTR lpszClassName
Definition: winuser.h:3196
HBRUSH hbrBackground
Definition: winuser.h:3194
int cbClsExtra
Definition: winuser.h:3189
UINT style
Definition: winuser.h:3187
WNDPROC lpfnWndProc
Definition: winuser.h:3188
int cbWndExtra
Definition: winuser.h:3190
HCURSOR hCursor
Definition: winuser.h:3193
Definition: inflate.c:139
LVITEMW item
Definition: commctrl.h:3184
LPCWSTR psz
Definition: commctrl.h:2462
LPWSTR pszText
Definition: commctrl.h:2370
int cchTextMax
Definition: commctrl.h:2371
UINT mask
Definition: commctrl.h:2365
WCHAR szDisplay[64]
Definition: commctrl.h:4433
LPWSTR pszText
Definition: commctrl.h:901
UINT_PTR idFrom
Definition: winuser.h:3169
UINT code
Definition: winuser.h:3170
HWND hwndFrom
Definition: winuser.h:3168
HDITEMW * pitem
Definition: commctrl.h:891
LVFINDINFOW lvfi
Definition: commctrl.h:3106
LPWSTR pszText
Definition: commctrl.h:1452
TVITEMW itemNew
Definition: commctrl.h:3643
TVITEMW itemOld
Definition: commctrl.h:3642
char szText[80]
Definition: commctrl.h:1903
HINSTANCE hinst
Definition: commctrl.h:1904
HINSTANCE hinst
Definition: commctrl.h:1913
WCHAR szText[80]
Definition: commctrl.h:1912
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
DWORD styleNew
Definition: winuser.h:3704
DWORD styleOld
Definition: winuser.h:3703
TVITEMW item
Definition: commctrl.h:3677
UINT mask
Definition: commctrl.h:3321
LPWSTR pszText
Definition: commctrl.h:3325
int cchTextMax
Definition: commctrl.h:3326
#define max(a, b)
Definition: svc.c:63
uint32_t DWORD_PTR
Definition: typedefs.h:65
int32_t INT
Definition: typedefs.h:58
#define HIWORD(l)
Definition: typedefs.h:247
int ret
#define ZeroMemory
Definition: winbase.h:1743
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
DWORD COLORREF
Definition: windef.h:300
#define WINAPI
Definition: msvc.h:6
BOOL WINAPI SetWindowOrgEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
Definition: coord.c:532
BOOL WINAPI OffsetWindowOrgEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
Definition: coord.c:912
HWND WINAPI SetCapture(_In_ HWND hWnd)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_ERASEBKGND
Definition: winuser.h:1636
DWORD WINAPI GetSysColor(_In_ int)
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define SWP_NOACTIVATE
Definition: winuser.h:1253
#define DFC_SCROLL
Definition: winuser.h:475
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
#define GetWindowLongPtrW
Definition: winuser.h:4840
HDC WINAPI GetWindowDC(_In_opt_ HWND)
#define SWP_FRAMECHANGED
Definition: winuser.h:1251
#define EM_FMTLINES
Definition: winuser.h:1997
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890
#define DCX_WINDOW
Definition: winuser.h:2124
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CREATE
Definition: winuser.h:1619
BOOL WINAPI DrawFrameControl(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define DFCS_FLAT
Definition: winuser.h:510
#define WM_SIZE
Definition: winuser.h:1622
#define SWP_NOMOVE
Definition: winuser.h:1255
#define WM_COMMAND
Definition: winuser.h:1751
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
#define DFCS_INACTIVE
Definition: winuser.h:502
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define IDC_ARROW
Definition: winuser.h:695
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:3032
#define WM_NCHITTEST
Definition: winuser.h:1697
#define SWP_NOSIZE
Definition: winuser.h:1256
#define WM_MOUSEMOVE
Definition: winuser.h:1786
HDC WINAPI GetDCEx(_In_opt_ HWND, _In_opt_ HRGN, _In_ DWORD)
HWND WINAPI GetCapture(void)
Definition: message.c:2881
#define RDW_ERASE
Definition: winuser.h:1222
#define WM_LBUTTONDOWN
Definition: winuser.h:1787
#define NF_REQUERY
Definition: winuser.h:2472
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2442
#define DFCS_SCROLLUP
Definition: winuser.h:489
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define HWND_TOP
Definition: winuser.h:1218
#define WM_TIMER
Definition: winuser.h:1753
#define RDW_FRAME
Definition: winuser.h:1223
#define HTCLIENT
Definition: winuser.h:2486
#define WM_LBUTTONUP
Definition: winuser.h:1788
HWND WINAPI GetParent(_In_ HWND)
#define CS_GLOBALCLASS
Definition: winuser.h:660
#define HTTRANSPARENT
Definition: winuser.h:2484
HWND WINAPI WindowFromPoint(_In_ POINT)
#define GWLP_ID
Definition: winuser.h:871
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define WM_DESTROY
Definition: winuser.h:1620
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
#define DFCS_SCROLLLEFT
Definition: winuser.h:491
#define DFCS_SCROLLRIGHT
Definition: winuser.h:492
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define DFCS_SCROLLDOWN
Definition: winuser.h:490
#define SWP_NOZORDER
Definition: winuser.h:1258
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define SetWindowLongPtrW
Definition: winuser.h:5366
#define NFR_UNICODE
Definition: winuser.h:2470
#define WM_NCCALCSIZE
Definition: winuser.h:1696
#define GWL_STYLE
Definition: winuser.h:863
#define DFCS_PUSHED
Definition: winuser.h:503
#define RDW_INVALIDATE
Definition: winuser.h:1225
#define NF_QUERY
Definition: winuser.h:2471
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define COLOR_BTNFACE
Definition: winuser.h:939
#define WM_NCPAINT
Definition: winuser.h:1698
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:815
const char * LPCSTR
Definition: xmlstorage.h:183
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
char CHAR
Definition: xmlstorage.h:175