ReactOS 0.4.15-dev-8241-g63935f8
tooltips.c
Go to the documentation of this file.
1/*
2 * Tool tip control
3 *
4 * Copyright 1998, 1999 Eric Kohl
5 * Copyright 2004 Robert Shearman
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 *
21 * NOTES
22 *
23 * This code was audited for completeness against the documented features
24 * of Comctl32.dll version 6.0 on Sep. 08, 2004, by Robert Shearman.
25 *
26 * Unless otherwise noted, we believe this code to be complete, as per
27 * the specification mentioned above.
28 * If you discover missing features or bugs please note them below.
29 *
30 * TODO:
31 * - Custom draw support.
32 * - Animation.
33 * - Links.
34 * - Messages:
35 * o TTM_ADJUSTRECT
36 * o TTM_GETTITLEA
37 * o TTM_GETTTILEW
38 * o TTM_POPUP
39 * - Styles:
40 * o TTS_NOANIMATE
41 * o TTS_NOFADE
42 * o TTS_CLOSE
43 *
44 * Testing:
45 * - Run tests using Waite Group Windows95 API Bible Volume 2.
46 * The second cdrom (chapter 3) contains executables activate.exe,
47 * curtool.exe, deltool.exe, enumtools.exe, getinfo.exe, getiptxt.exe,
48 * hittest.exe, needtext.exe, newrect.exe, updtext.exe and winfrpt.exe.
49 *
50 * Timer logic.
51 *
52 * One important point to remember is that tools don't necessarily get
53 * a WM_MOUSEMOVE once the cursor leaves the tool, an example is when
54 * a tool sets TTF_IDISHWND (i.e. an entire window is a tool) because
55 * here WM_MOUSEMOVEs only get sent when the cursor is inside the
56 * client area. Therefore the only reliable way to know that the
57 * cursor has left a tool is to keep a timer running and check the
58 * position every time it expires. This is the role of timer
59 * ID_TIMERLEAVE.
60 *
61 *
62 * On entering a tool (detected in a relayed WM_MOUSEMOVE) we start
63 * ID_TIMERSHOW, if this times out and we're still in the tool we show
64 * the tip. On showing a tip we start both ID_TIMERPOP and
65 * ID_TIMERLEAVE. On hiding a tooltip we kill ID_TIMERPOP.
66 * ID_TIMERPOP is restarted on every relayed WM_MOUSEMOVE. If
67 * ID_TIMERPOP expires the tool is hidden and ID_TIMERPOP is killed.
68 * ID_TIMERLEAVE remains running - this is important as we need to
69 * determine when the cursor leaves the tool.
70 *
71 * When ID_TIMERLEAVE expires or on a relayed WM_MOUSEMOVE if we're
72 * still in the tool do nothing (apart from restart ID_TIMERPOP if
73 * this is a WM_MOUSEMOVE) (ID_TIMERLEAVE remains running). If we've
74 * left the tool and entered another one then hide the tip and start
75 * ID_TIMERSHOW with time ReshowTime and kill ID_TIMERLEAVE. If we're
76 * outside all tools hide the tip and kill ID_TIMERLEAVE. On Relayed
77 * mouse button messages hide the tip but leave ID_TIMERLEAVE running,
78 * this again will let us keep track of when the cursor leaves the
79 * tool.
80 *
81 *
82 * infoPtr->nTool is the tool the mouse was on on the last relayed MM
83 * or timer expiry or -1 if the mouse was not on a tool.
84 *
85 * infoPtr->nCurrentTool is the tool for which the tip is currently
86 * displaying text for or -1 if the tip is not shown. Actually this
87 * will only ever be infoPtr-nTool or -1, so it could be changed to a
88 * BOOL.
89 *
90 */
91
92
93
94#include <stdarg.h>
95#include <string.h>
96
97#include "windef.h"
98#include "winbase.h"
99#include "wine/unicode.h"
100#include "wingdi.h"
101#include "winuser.h"
102#include "winnls.h"
103#include "commctrl.h"
104#include "comctl32.h"
105#include "wine/debug.h"
106
108
110
111typedef struct
112{
123
124
125typedef struct
126{
128 WCHAR szTipText[INFOTIPSIZE];
139 INT nTool; /* tool that mouse was on on last relayed mouse move */
149
152
153#define ID_TIMERSHOW 1 /* show delay timer */
154#define ID_TIMERPOP 2 /* auto pop timer */
155#define ID_TIMERLEAVE 3 /* tool leave timer */
156
157
158#define TOOLTIPS_GetInfoPtr(hWindow) ((TOOLTIPS_INFO *)GetWindowLongPtrW (hWindow, 0))
159
160/* offsets from window edge to start of text */
161#define NORMAL_TEXT_MARGIN 2
162#define BALLOON_TEXT_MARGIN (NORMAL_TEXT_MARGIN+8)
163/* value used for CreateRoundRectRgn that specifies how much
164 * each corner is curved */
165#ifdef __REACTOS__
166#define BALLOON_ROUNDEDNESS 16
167#define BALLOON_STEMHEIGHT 18
168#define BALLOON_STEMWIDTH 18
169#define BALLOON_STEMINDENT 16
170#else
171#define BALLOON_ROUNDEDNESS 20
172#define BALLOON_STEMHEIGHT 13
173#define BALLOON_STEMWIDTH 10
174#define BALLOON_STEMINDENT 20
175#endif // __REACTOS__
176
177#define BALLOON_ICON_TITLE_SPACING 8 /* horizontal spacing between icon and title */
178#define BALLOON_TITLE_TEXT_SPACING 8 /* vertical spacing between icon/title and main text */
179#define ICON_HEIGHT 16
180#define ICON_WIDTH 16
181
182#define MAX_TEXT_SIZE_A 80 /* maximum retrieving text size by ANSI message */
183
184static LRESULT CALLBACK
186
187
189{
190 if (isW)
191 return str == LPSTR_TEXTCALLBACKW;
192 else
193 return (LPCSTR)str == LPSTR_TEXTCALLBACKA;
194}
195
196static inline UINT_PTR
198{
199 UINT i;
200 for (i = 0; i <= TTI_ERROR; i++)
201 if (hTooltipIcons[i] == hIcon)
202 return i;
203 return (UINT_PTR)hIcon;
204}
205
206static void
208{
209 NONCLIENTMETRICSW nclm;
210
211 infoPtr->clrBk = comctl32_color.clrInfoBk;
213
214 DeleteObject (infoPtr->hFont);
215 nclm.cbSize = sizeof(nclm);
216 SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, sizeof(nclm), &nclm, 0);
217 infoPtr->hFont = CreateFontIndirectW (&nclm.lfStatusFont);
218
219 DeleteObject (infoPtr->hTitleFont);
220 nclm.lfStatusFont.lfWeight = FW_BOLD;
221 infoPtr->hTitleFont = CreateFontIndirectW (&nclm.lfStatusFont);
222}
223
224/* Custom draw routines */
225static void
227 HDC hdc, const RECT *rcBounds, UINT uFlags)
228{
229 ZeroMemory(lpnmttcd, sizeof(NMTTCUSTOMDRAW));
230 lpnmttcd->uDrawFlags = uFlags;
231 lpnmttcd->nmcd.hdr.hwndFrom = infoPtr->hwndSelf;
232 lpnmttcd->nmcd.hdr.code = NM_CUSTOMDRAW;
233 if (infoPtr->nCurrentTool != -1) {
234 TTTOOL_INFO *toolPtr = &infoPtr->tools[infoPtr->nCurrentTool];
235 lpnmttcd->nmcd.hdr.idFrom = toolPtr->uId;
236 }
237 lpnmttcd->nmcd.hdc = hdc;
238 lpnmttcd->nmcd.rc = *rcBounds;
239 /* FIXME - dwItemSpec, uItemState, lItemlParam */
240}
241
242static inline DWORD
244{
246 lpnmttcd->nmcd.dwDrawStage = dwDrawStage;
247
248 TRACE("Notifying stage %d, flags %x, id %x\n", lpnmttcd->nmcd.dwDrawStage,
249 lpnmttcd->uDrawFlags, lpnmttcd->nmcd.hdr.code);
250
252 0, (LPARAM)lpnmttcd);
253
254 TRACE("Notify result %x\n", (unsigned int)result);
255
256 return result;
257}
258
259static void
261{
262 RECT rc;
263 INT oldBkMode;
264 HFONT hOldFont;
265 HBRUSH hBrush;
267 HRGN hRgn = NULL;
268 DWORD dwStyle = GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE);
269 NMTTCUSTOMDRAW nmttcd;
270 DWORD cdmode;
271
272 if (infoPtr->nMaxTipWidth > -1)
276 GetClientRect (infoPtr->hwndSelf, &rc);
277
278 hBrush = CreateSolidBrush(infoPtr->clrBk);
279
280 oldBkMode = SetBkMode (hdc, TRANSPARENT);
281 SetTextColor (hdc, infoPtr->clrText);
282 hOldFont = SelectObject (hdc, infoPtr->hFont);
283
284 /* Custom draw - Call PrePaint once initial properties set up */
285 /* Note: Contrary to MSDN, CDRF_SKIPDEFAULT still draws a tooltip */
286 TOOLTIPS_customdraw_fill(infoPtr, &nmttcd, hdc, &rc, uFlags);
287 cdmode = TOOLTIPS_notify_customdraw(CDDS_PREPAINT, &nmttcd);
288 uFlags = nmttcd.uDrawFlags;
289
290 if (dwStyle & TTS_BALLOON)
291 {
292 /* create a region to store result into */
293 hRgn = CreateRectRgn(0, 0, 0, 0);
294
295 GetWindowRgn(infoPtr->hwndSelf, hRgn);
296
297 /* fill the background */
298 FillRgn(hdc, hRgn, hBrush);
299 DeleteObject(hBrush);
300 hBrush = NULL;
301 }
302 else
303 {
304 /* fill the background */
305 FillRect(hdc, &rc, hBrush);
306 DeleteObject(hBrush);
307 hBrush = NULL;
308 }
309
310 if ((dwStyle & TTS_BALLOON) || infoPtr->pszTitle)
311 {
312 /* calculate text rectangle */
313 rc.left += (BALLOON_TEXT_MARGIN + infoPtr->rcMargin.left);
314 rc.top += (BALLOON_TEXT_MARGIN + infoPtr->rcMargin.top);
315 rc.right -= (BALLOON_TEXT_MARGIN + infoPtr->rcMargin.right);
316 rc.bottom -= (BALLOON_TEXT_MARGIN + infoPtr->rcMargin.bottom);
317 if(infoPtr->bToolBelow) rc.top += BALLOON_STEMHEIGHT;
318
319 if (infoPtr->pszTitle)
320 {
321 RECT rcTitle = {rc.left, rc.top, rc.right, rc.bottom};
322 int height;
323 BOOL icon_present;
324 HFONT prevFont;
325
326 /* draw icon */
327 icon_present = infoPtr->hTitleIcon &&
328 DrawIconEx(hdc, rc.left, rc.top, infoPtr->hTitleIcon,
330 if (icon_present)
332
333 rcTitle.bottom = rc.top + ICON_HEIGHT;
334
335 /* draw title text */
336 prevFont = SelectObject (hdc, infoPtr->hTitleFont);
337 height = DrawTextW(hdc, infoPtr->pszTitle, -1, &rcTitle, DT_BOTTOM | DT_SINGLELINE | DT_NOPREFIX);
338 SelectObject (hdc, prevFont);
340 }
341 }
342 else
343 {
344 /* calculate text rectangle */
345 rc.left += (NORMAL_TEXT_MARGIN + infoPtr->rcMargin.left);
346 rc.top += (NORMAL_TEXT_MARGIN + infoPtr->rcMargin.top);
347 rc.right -= (NORMAL_TEXT_MARGIN + infoPtr->rcMargin.right);
348 rc.bottom -= (NORMAL_TEXT_MARGIN + infoPtr->rcMargin.bottom);
349 }
350
351 /* draw text */
352#ifdef __REACTOS__
354#endif
355 DrawTextW (hdc, infoPtr->szTipText, -1, &rc, uFlags);
356
357 /* Custom draw - Call PostPaint after drawing */
358 if (cdmode & CDRF_NOTIFYPOSTPAINT) {
360 }
361
362 /* be polite and reset the things we changed in the dc */
363 SelectObject (hdc, hOldFont);
364 SetBkMode (hdc, oldBkMode);
365
366 if (dwStyle & TTS_BALLOON)
367 {
368 /* frame region because default window proc doesn't do it */
371
373 FrameRgn(hdc, hRgn, hBrush, width, height);
374 }
375
376 if (hRgn)
378}
379
380static void TOOLTIPS_GetDispInfoA(const TOOLTIPS_INFO *infoPtr, TTTOOL_INFO *toolPtr, WCHAR *buffer)
381{
382 NMTTDISPINFOA ttnmdi;
383
384 /* fill NMHDR struct */
385 ZeroMemory (&ttnmdi, sizeof(NMTTDISPINFOA));
386 ttnmdi.hdr.hwndFrom = infoPtr->hwndSelf;
387 ttnmdi.hdr.idFrom = toolPtr->uId;
388 ttnmdi.hdr.code = TTN_GETDISPINFOA; /* == TTN_NEEDTEXTA */
389 ttnmdi.lpszText = ttnmdi.szText;
390 ttnmdi.uFlags = toolPtr->uFlags;
391 ttnmdi.lParam = toolPtr->lParam;
392
393 TRACE("hdr.idFrom = %lx\n", ttnmdi.hdr.idFrom);
394 SendMessageW(toolPtr->hwnd, WM_NOTIFY, toolPtr->uId, (LPARAM)&ttnmdi);
395
396 if (IS_INTRESOURCE(ttnmdi.lpszText)) {
397 LoadStringW(ttnmdi.hinst, LOWORD(ttnmdi.lpszText),
399 if (ttnmdi.uFlags & TTF_DI_SETITEM) {
400 toolPtr->hinst = ttnmdi.hinst;
401 toolPtr->lpszText = (LPWSTR)ttnmdi.lpszText;
402 }
403 }
404 else if (ttnmdi.lpszText == 0) {
405 buffer[0] = '\0';
406 }
407 else if (ttnmdi.lpszText != LPSTR_TEXTCALLBACKA) {
409 if (ttnmdi.uFlags & TTF_DI_SETITEM) {
410 toolPtr->hinst = 0;
411 toolPtr->lpszText = NULL;
412 Str_SetPtrW(&toolPtr->lpszText, buffer);
413 }
414 }
415 else {
416 ERR("recursive text callback\n");
417 buffer[0] = '\0';
418 }
419
420#ifndef __REACTOS_
421 /* no text available - try calling parent instead as per native */
422 /* FIXME: Unsure if SETITEM should save the value or not */
423 if (buffer[0] == 0x00) {
424
425 SendMessageW(GetParent(toolPtr->hwnd), WM_NOTIFY, toolPtr->uId, (LPARAM)&ttnmdi);
426
427 if (IS_INTRESOURCE(ttnmdi.lpszText)) {
428 LoadStringW(ttnmdi.hinst, LOWORD(ttnmdi.lpszText),
430 } else if (ttnmdi.lpszText &&
431 ttnmdi.lpszText != LPSTR_TEXTCALLBACKA) {
432 Str_GetPtrAtoW(ttnmdi.lpszText, buffer, INFOTIPSIZE);
433 }
434 }
435#endif
436}
437
438static void TOOLTIPS_GetDispInfoW(const TOOLTIPS_INFO *infoPtr, TTTOOL_INFO *toolPtr, WCHAR *buffer)
439{
440 NMTTDISPINFOW ttnmdi;
441
442 /* fill NMHDR struct */
443 ZeroMemory (&ttnmdi, sizeof(NMTTDISPINFOW));
444 ttnmdi.hdr.hwndFrom = infoPtr->hwndSelf;
445 ttnmdi.hdr.idFrom = toolPtr->uId;
446 ttnmdi.hdr.code = TTN_GETDISPINFOW; /* == TTN_NEEDTEXTW */
447 ttnmdi.lpszText = ttnmdi.szText;
448 ttnmdi.uFlags = toolPtr->uFlags;
449 ttnmdi.lParam = toolPtr->lParam;
450
451 TRACE("hdr.idFrom = %lx\n", ttnmdi.hdr.idFrom);
452 SendMessageW(toolPtr->hwnd, WM_NOTIFY, toolPtr->uId, (LPARAM)&ttnmdi);
453
454 if (IS_INTRESOURCE(ttnmdi.lpszText)) {
455 LoadStringW(ttnmdi.hinst, LOWORD(ttnmdi.lpszText),
457 if (ttnmdi.uFlags & TTF_DI_SETITEM) {
458 toolPtr->hinst = ttnmdi.hinst;
459 toolPtr->lpszText = ttnmdi.lpszText;
460 }
461 }
462 else if (ttnmdi.lpszText == 0) {
463 buffer[0] = '\0';
464 }
465 else if (ttnmdi.lpszText != LPSTR_TEXTCALLBACKW) {
467 if (ttnmdi.uFlags & TTF_DI_SETITEM) {
468 toolPtr->hinst = 0;
469 toolPtr->lpszText = NULL;
470 Str_SetPtrW(&toolPtr->lpszText, buffer);
471 }
472 }
473 else {
474 ERR("recursive text callback\n");
475 buffer[0] = '\0';
476 }
477
478#ifndef __REACTOS__
479 /* no text available - try calling parent instead as per native */
480 /* FIXME: Unsure if SETITEM should save the value or not */
481 if (buffer[0] == 0x00) {
482
483 SendMessageW(GetParent(toolPtr->hwnd), WM_NOTIFY, toolPtr->uId, (LPARAM)&ttnmdi);
484
485 if (IS_INTRESOURCE(ttnmdi.lpszText)) {
486 LoadStringW(ttnmdi.hinst, LOWORD(ttnmdi.lpszText),
488 } else if (ttnmdi.lpszText &&
489 ttnmdi.lpszText != LPSTR_TEXTCALLBACKW) {
490 Str_GetPtrW(ttnmdi.lpszText, buffer, INFOTIPSIZE);
491 }
492 }
493#endif
494
495}
496
497static void
499{
500 TTTOOL_INFO *toolPtr = &infoPtr->tools[nTool];
501
502 if (IS_INTRESOURCE(toolPtr->lpszText)) {
503 /* load a resource */
504 TRACE("load res string %p %x\n",
505 toolPtr->hinst, LOWORD(toolPtr->lpszText));
506 if (!LoadStringW (toolPtr->hinst, LOWORD(toolPtr->lpszText), buffer, INFOTIPSIZE))
507 buffer[0] = '\0';
508 }
509 else if (toolPtr->lpszText) {
510 if (toolPtr->lpszText == LPSTR_TEXTCALLBACKW) {
511 if (toolPtr->bNotifyUnicode)
512 TOOLTIPS_GetDispInfoW(infoPtr, toolPtr, buffer);
513 else
514 TOOLTIPS_GetDispInfoA(infoPtr, toolPtr, buffer);
515 }
516 else {
517 /* the item is a usual (unicode) text */
519 }
520 }
521 else {
522 /* no text available */
523 buffer[0] = '\0';
524 }
525
526 if (!(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & TTS_NOPREFIX)) {
527 WCHAR *ptrW;
528 if ((ptrW = strchrW(buffer, '\t')))
529 *ptrW = 0;
530 }
531
532 TRACE("%s\n", debugstr_w(buffer));
533}
534
535
536static void
538{
539 HDC hdc;
540 HFONT hOldFont;
543 RECT rc = {0, 0, 0, 0};
544 SIZE title = {0, 0};
545
546 if (infoPtr->nMaxTipWidth > -1) {
547 rc.right = infoPtr->nMaxTipWidth;
549 }
550 if (style & TTS_NOPREFIX)
552 TRACE("%s\n", debugstr_w(infoPtr->szTipText));
553
554 hdc = GetDC (infoPtr->hwndSelf);
555 if (infoPtr->pszTitle)
556 {
557 RECT rcTitle = {0, 0, 0, 0};
558 TRACE("title %s\n", debugstr_w(infoPtr->pszTitle));
559 if (infoPtr->hTitleIcon)
560 {
561 title.cx = ICON_WIDTH;
562 title.cy = ICON_HEIGHT;
563 }
564 if (title.cx != 0) title.cx += BALLOON_ICON_TITLE_SPACING;
565 hOldFont = SelectObject (hdc, infoPtr->hTitleFont);
566 DrawTextW(hdc, infoPtr->pszTitle, -1, &rcTitle, DT_SINGLELINE | DT_NOPREFIX | DT_CALCRECT);
567 SelectObject (hdc, hOldFont);
568 title.cy = max(title.cy, rcTitle.bottom - rcTitle.top) + BALLOON_TITLE_TEXT_SPACING;
569 title.cx += (rcTitle.right - rcTitle.left);
570 }
571 hOldFont = SelectObject (hdc, infoPtr->hFont);
572#ifdef __REACTOS__
574#endif
575 DrawTextW (hdc, infoPtr->szTipText, -1, &rc, uFlags);
576 SelectObject (hdc, hOldFont);
577 ReleaseDC (infoPtr->hwndSelf, hdc);
578
579 if ((style & TTS_BALLOON) || infoPtr->pszTitle)
580 {
581 lpSize->cx = max(rc.right - rc.left, title.cx) + 2*BALLOON_TEXT_MARGIN +
582 infoPtr->rcMargin.left + infoPtr->rcMargin.right;
583 lpSize->cy = title.cy + rc.bottom - rc.top + 2*BALLOON_TEXT_MARGIN +
584 infoPtr->rcMargin.bottom + infoPtr->rcMargin.top +
586 }
587 else
588 {
589 lpSize->cx = rc.right - rc.left + 2*NORMAL_TEXT_MARGIN +
590 infoPtr->rcMargin.left + infoPtr->rcMargin.right;
591 lpSize->cy = rc.bottom - rc.top + 2*NORMAL_TEXT_MARGIN +
592 infoPtr->rcMargin.bottom + infoPtr->rcMargin.top;
593 }
594}
595
596
597static void
598TOOLTIPS_Show (TOOLTIPS_INFO *infoPtr, BOOL track_activate)
599{
600 TTTOOL_INFO *toolPtr;
601 HMONITOR monitor;
602 MONITORINFO mon_info;
603 RECT rect;
604 SIZE size;
605 NMHDR hdr;
606 int ptfx = 0;
608 INT nTool, current;
609
610 if (track_activate)
611 {
612 if (infoPtr->nTrackTool == -1)
613 {
614 TRACE("invalid tracking tool %d\n", infoPtr->nTrackTool);
615 return;
616 }
617 nTool = infoPtr->nTrackTool;
618 }
619 else
620 {
621 if (infoPtr->nTool == -1)
622 {
623 TRACE("invalid tool %d\n", infoPtr->nTool);
624 return;
625 }
626 nTool = infoPtr->nTool;
627 }
628
629 TRACE("Show tooltip pre %d, %p\n", nTool, infoPtr->hwndSelf);
630
631 current = infoPtr->nCurrentTool;
632 if (!track_activate)
633 infoPtr->nCurrentTool = infoPtr->nTool;
634
635 TOOLTIPS_GetTipText (infoPtr, nTool, infoPtr->szTipText);
636
637 if (infoPtr->szTipText[0] == '\0')
638 {
639 infoPtr->nCurrentTool = current;
640 return;
641 }
642
643 toolPtr = &infoPtr->tools[nTool];
644 TOOLTIPS_CalcTipSize (infoPtr, &size);
645
646 TRACE("Show tooltip %d, %s, size %d x %d\n", nTool, debugstr_w(infoPtr->szTipText),
647 size.cx, size.cy);
648
649 if (track_activate && (toolPtr->uFlags & TTF_TRACK))
650 {
651 rect.left = infoPtr->xTrackPos;
652 rect.top = infoPtr->yTrackPos;
653 ptfx = rect.left;
654
655 if (toolPtr->uFlags & TTF_CENTERTIP)
656 {
657 rect.left -= (size.cx / 2);
658 if (!(style & TTS_BALLOON))
659 rect.top -= (size.cy / 2);
660 }
661 if (!(infoPtr->bToolBelow = (infoPtr->yTrackPos + size.cy <= GetSystemMetrics(SM_CYSCREEN))))
662 rect.top -= size.cy;
663
664 if (!(toolPtr->uFlags & TTF_ABSOLUTE))
665 {
666 if (style & TTS_BALLOON)
667 rect.left -= BALLOON_STEMINDENT;
668 else
669 {
670 RECT rcTool;
671
672 if (toolPtr->uFlags & TTF_IDISHWND)
673 GetWindowRect ((HWND)toolPtr->uId, &rcTool);
674 else
675 {
676 rcTool = toolPtr->rect;
677 MapWindowPoints (toolPtr->hwnd, NULL, (LPPOINT)&rcTool, 2);
678 }
679
680 /* smart placement */
681 if ((rect.left + size.cx > rcTool.left) && (rect.left < rcTool.right) &&
682 (rect.top + size.cy > rcTool.top) && (rect.top < rcTool.bottom))
683 rect.left = rcTool.right;
684 }
685 }
686 }
687 else
688 {
689 if (toolPtr->uFlags & TTF_CENTERTIP)
690 {
691 RECT rc;
692
693 if (toolPtr->uFlags & TTF_IDISHWND)
694 GetWindowRect ((HWND)toolPtr->uId, &rc);
695 else {
696 rc = toolPtr->rect;
697 MapWindowPoints (toolPtr->hwnd, NULL, (LPPOINT)&rc, 2);
698 }
699 rect.left = (rc.left + rc.right - size.cx) / 2;
700 if (style & TTS_BALLOON)
701 {
702 ptfx = rc.left + ((rc.right - rc.left) / 2);
703
704 /* CENTERTIP ballon tooltips default to below the field
705 * if they fit on the screen */
707 {
708 rect.top = rc.top - size.cy;
709 infoPtr->bToolBelow = FALSE;
710 }
711 else
712 {
713 infoPtr->bToolBelow = TRUE;
714 rect.top = rc.bottom;
715 }
716 rect.left = max(0, rect.left - BALLOON_STEMINDENT);
717 }
718 else
719 {
720 rect.top = rc.bottom + 2;
721 infoPtr->bToolBelow = TRUE;
722 }
723 }
724 else
725 {
727 if (style & TTS_BALLOON)
728 {
729 ptfx = rect.left;
730 if(rect.top - size.cy >= 0)
731 {
732 rect.top -= size.cy;
733 infoPtr->bToolBelow = FALSE;
734 }
735 else
736 {
737 infoPtr->bToolBelow = TRUE;
738 rect.top += 20;
739 }
740 rect.left = max(0, rect.left - BALLOON_STEMINDENT);
741 }
742 else
743 {
744 rect.top += 20;
745 infoPtr->bToolBelow = TRUE;
746 }
747 }
748 }
749
750 TRACE("pos %d - %d\n", rect.left, rect.top);
751
752 rect.right = rect.left + size.cx;
753 rect.bottom = rect.top + size.cy;
754
755 /* check position */
756
757 monitor = MonitorFromRect( &rect, MONITOR_DEFAULTTOPRIMARY );
758 mon_info.cbSize = sizeof(mon_info);
759 GetMonitorInfoW( monitor, &mon_info );
760
761#ifdef __REACTOS__
762 if (rect.right > mon_info.rcMonitor.right)
763 {
766 if (rect.right > mon_info.rcMonitor.right)
767 {
768 rect.left -= (rect.right - mon_info.rcMonitor.right);
769 rect.right = mon_info.rcMonitor.right;
770 }
771 }
772
773 if (rect.left < mon_info.rcMonitor.left)
774 {
775 rect.right += abs(rect.left);
776 rect.left = 0;
777 }
778
779 if (rect.bottom > mon_info.rcMonitor.bottom)
780 {
781 RECT rc;
782 if (toolPtr->uFlags & TTF_IDISHWND)
783 {
784 GetWindowRect((HWND)toolPtr->uId, &rc);
785 }
786 else
787 {
788 rc = toolPtr->rect;
789 MapWindowPoints(toolPtr->hwnd, NULL, (LPPOINT)&rc, 2);
790 }
791 rect.bottom = rc.top - 2;
792 rect.top = rect.bottom - size.cy;
793 }
794#else
795 if( rect.right > mon_info.rcWork.right ) {
796 rect.left -= rect.right - mon_info.rcWork.right + 2;
797 rect.right = mon_info.rcWork.right - 2;
798 }
799 if (rect.left < mon_info.rcWork.left) rect.left = mon_info.rcWork.left;
800
801 if( rect.bottom > mon_info.rcWork.bottom ) {
802 RECT rc;
803
804 if (toolPtr->uFlags & TTF_IDISHWND)
805 GetWindowRect ((HWND)toolPtr->uId, &rc);
806 else {
807 rc = toolPtr->rect;
808 MapWindowPoints (toolPtr->hwnd, NULL, (LPPOINT)&rc, 2);
809 }
810 rect.bottom = rc.top - 2;
811 rect.top = rect.bottom - size.cy;
812 }
813#endif // __REACTOS__
814
817
818 if (style & TTS_BALLOON)
819 {
820 HRGN hRgn;
821 HRGN hrStem;
822 POINT pts[3];
823
824 ptfx -= rect.left;
825
826 if(infoPtr->bToolBelow)
827 {
828 pts[0].x = ptfx;
829 pts[0].y = 0;
830#ifdef __REACTOS__
831 pts[1].x = max(BALLOON_STEMINDENT, ptfx - BALLOON_STEMWIDTH);
832#else
833 pts[1].x = max(BALLOON_STEMINDENT, ptfx - (BALLOON_STEMWIDTH / 2));
834#endif
835 pts[1].y = BALLOON_STEMHEIGHT;
836 pts[2].x = pts[1].x + BALLOON_STEMWIDTH;
837 pts[2].y = pts[1].y;
838 if(pts[2].x > (rect.right - rect.left) - BALLOON_STEMINDENT)
839 {
840 pts[2].x = (rect.right - rect.left) - BALLOON_STEMINDENT;
841 pts[1].x = pts[2].x - BALLOON_STEMWIDTH;
842 }
843 }
844 else
845 {
846#ifdef __REACTOS__
847 pts[0].x = max(BALLOON_STEMINDENT, ptfx - BALLOON_STEMWIDTH);
848#else
849 pts[0].x = max(BALLOON_STEMINDENT, ptfx - (BALLOON_STEMWIDTH / 2));
850#endif
851 pts[0].y = (rect.bottom - rect.top) - BALLOON_STEMHEIGHT;
852 pts[1].x = pts[0].x + BALLOON_STEMWIDTH;
853 pts[1].y = pts[0].y;
854 pts[2].x = ptfx;
855 pts[2].y = (rect.bottom - rect.top);
856 if(pts[1].x > (rect.right - rect.left) - BALLOON_STEMINDENT)
857 {
858 pts[1].x = (rect.right - rect.left) - BALLOON_STEMINDENT;
859 pts[0].x = pts[1].x - BALLOON_STEMWIDTH;
860 }
861 }
862
863 hrStem = CreatePolygonRgn(pts, ARRAY_SIZE(pts), ALTERNATE);
864
866 (infoPtr->bToolBelow ? BALLOON_STEMHEIGHT : 0),
867 rect.right - rect.left,
868#ifdef __REACTOS__
869 (infoPtr->bToolBelow ? rect.bottom - rect.top : rect.bottom - rect.top - BALLOON_STEMHEIGHT + 1),
870#else
871 (infoPtr->bToolBelow ? rect.bottom - rect.top : rect.bottom - rect.top - BALLOON_STEMHEIGHT),
872#endif
874
875 CombineRgn(hRgn, hRgn, hrStem, RGN_OR);
876 DeleteObject(hrStem);
877
878 SetWindowRgn(infoPtr->hwndSelf, hRgn, FALSE);
879 /* we don't free the region handle as the system deletes it when
880 * it is no longer needed */
881 }
882
883 SetWindowPos (infoPtr->hwndSelf, NULL, rect.left, rect.top,
884 rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER | SWP_NOACTIVATE);
885
886 hdr.hwndFrom = infoPtr->hwndSelf;
887 hdr.idFrom = toolPtr->uId;
888 hdr.code = TTN_SHOW;
889 SendMessageW (toolPtr->hwnd, WM_NOTIFY, toolPtr->uId, (LPARAM)&hdr);
890
891 SetWindowPos (infoPtr->hwndSelf, HWND_TOPMOST, 0, 0, 0, 0,
893
894 /* repaint the tooltip */
895 InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
896 UpdateWindow(infoPtr->hwndSelf);
897
898 if (!track_activate)
899 {
900 SetTimer (infoPtr->hwndSelf, ID_TIMERPOP, infoPtr->nAutoPopTime, 0);
901 TRACE("timer 2 started\n");
902 SetTimer (infoPtr->hwndSelf, ID_TIMERLEAVE, infoPtr->nReshowTime, 0);
903 TRACE("timer 3 started\n");
904 }
905}
906
907
908static void
910{
911 TTTOOL_INFO *toolPtr;
912 NMHDR hdr;
913
914 TRACE("Hide tooltip %d, %p.\n", infoPtr->nCurrentTool, infoPtr->hwndSelf);
915
916 if (infoPtr->nCurrentTool == -1)
917 return;
918
919 toolPtr = &infoPtr->tools[infoPtr->nCurrentTool];
920 KillTimer (infoPtr->hwndSelf, ID_TIMERPOP);
921
922 hdr.hwndFrom = infoPtr->hwndSelf;
923 hdr.idFrom = toolPtr->uId;
924 hdr.code = TTN_POP;
925 SendMessageW (toolPtr->hwnd, WM_NOTIFY, toolPtr->uId, (LPARAM)&hdr);
926
927 infoPtr->nCurrentTool = -1;
928
929 SetWindowPos (infoPtr->hwndSelf, HWND_TOP, 0, 0, 0, 0,
931}
932
933
934static void
936{
937 TOOLTIPS_Show(infoPtr, TRUE);
938}
939
940
941static void
943{
944 TTTOOL_INFO *toolPtr;
945 NMHDR hdr;
946
947 TRACE("hide tracking tooltip %d\n", infoPtr->nTrackTool);
948
949 if (infoPtr->nTrackTool == -1)
950 return;
951
952 toolPtr = &infoPtr->tools[infoPtr->nTrackTool];
953
954 hdr.hwndFrom = infoPtr->hwndSelf;
955 hdr.idFrom = toolPtr->uId;
956 hdr.code = TTN_POP;
957 SendMessageW (toolPtr->hwnd, WM_NOTIFY, toolPtr->uId, (LPARAM)&hdr);
958
959 SetWindowPos (infoPtr->hwndSelf, HWND_TOP, 0, 0, 0, 0,
961}
962
963/* Structure layout is the same for TTTOOLINFOW and TTTOOLINFOA,
964 this helper is used in both cases. */
965static INT
966TOOLTIPS_GetToolFromInfoT (const TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *lpToolInfo)
967{
968 TTTOOL_INFO *toolPtr;
969 UINT nTool;
970
971 for (nTool = 0; nTool < infoPtr->uNumTools; nTool++) {
972 toolPtr = &infoPtr->tools[nTool];
973
974 if (!(toolPtr->uFlags & TTF_IDISHWND) &&
975 (lpToolInfo->hwnd == toolPtr->hwnd) &&
976 (lpToolInfo->uId == toolPtr->uId))
977 return nTool;
978 }
979
980 for (nTool = 0; nTool < infoPtr->uNumTools; nTool++) {
981 toolPtr = &infoPtr->tools[nTool];
982
983 if ((toolPtr->uFlags & TTF_IDISHWND) &&
984 (lpToolInfo->uId == toolPtr->uId))
985 return nTool;
986 }
987
988 return -1;
989}
990
991
992static INT
994{
995 TTTOOL_INFO *toolPtr;
996 UINT nTool;
997
998 for (nTool = 0; nTool < infoPtr->uNumTools; nTool++) {
999 toolPtr = &infoPtr->tools[nTool];
1000
1001 if (!(toolPtr->uFlags & TTF_IDISHWND)) {
1002 if (hwnd != toolPtr->hwnd)
1003 continue;
1004 if (!PtInRect (&toolPtr->rect, *lpPt))
1005 continue;
1006 return nTool;
1007 }
1008 }
1009
1010 for (nTool = 0; nTool < infoPtr->uNumTools; nTool++) {
1011 toolPtr = &infoPtr->tools[nTool];
1012
1013 if (toolPtr->uFlags & TTF_IDISHWND) {
1014 if ((HWND)toolPtr->uId == hwnd)
1015 return nTool;
1016 }
1017 }
1018
1019 return -1;
1020}
1021
1022static inline void
1024{
1025 const TTTOOL_INFO *toolPtr = &infoPtr->tools[index];
1026
1027 ti->uFlags = toolPtr->uFlags;
1028 ti->hwnd = toolPtr->hwnd;
1029 ti->uId = toolPtr->uId;
1030 ti->rect = toolPtr->rect;
1031 ti->hinst = toolPtr->hinst;
1032
1033 if (ti->lpszText) {
1034 if (toolPtr->lpszText == NULL ||
1035 IS_INTRESOURCE(toolPtr->lpszText) ||
1036 toolPtr->lpszText == LPSTR_TEXTCALLBACKW)
1037 ti->lpszText = toolPtr->lpszText;
1038 else if (isW)
1039 strcpyW (ti->lpszText, toolPtr->lpszText);
1040 else
1041 /* ANSI version, the buffer is maximum 80 bytes without null. */
1042 WideCharToMultiByte(CP_ACP, 0, toolPtr->lpszText, -1,
1044 }
1045
1046 if (ti->cbSize >= TTTOOLINFOW_V2_SIZE)
1047 ti->lParam = toolPtr->lParam;
1048
1049 /* lpReserved is intentionally not set. */
1050}
1051
1052static BOOL
1054{
1055 HWND hwndActive = GetActiveWindow ();
1056 if (!hwndActive)
1057 return FALSE;
1058 if (hwndActive == hwnd)
1059 return TRUE;
1060 return IsChild (hwndActive, hwnd);
1061}
1062
1063
1064static INT
1065TOOLTIPS_CheckTool (const TOOLTIPS_INFO *infoPtr, BOOL bShowTest)
1066{
1067 POINT pt;
1068 HWND hwndTool;
1069 INT nTool;
1070
1071 GetCursorPos (&pt);
1072 hwndTool = (HWND)SendMessageW (infoPtr->hwndSelf, TTM_WINDOWFROMPOINT, 0, (LPARAM)&pt);
1073 if (hwndTool == 0)
1074 return -1;
1075
1076 ScreenToClient (hwndTool, &pt);
1077 nTool = TOOLTIPS_GetToolFromPoint (infoPtr, hwndTool, &pt);
1078 if (nTool == -1)
1079 return -1;
1080
1081 if (!(GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TTS_ALWAYSTIP) && bShowTest)
1082 {
1083 TTTOOL_INFO *ti = &infoPtr->tools[nTool];
1084 HWND hwnd = (ti->uFlags & TTF_IDISHWND) ? (HWND)ti->uId : ti->hwnd;
1085
1087 {
1088 TRACE("not active: hwnd %p, parent %p, active %p\n",
1090 return -1;
1091 }
1092 }
1093
1094 TRACE("tool %d\n", nTool);
1095
1096 return nTool;
1097}
1098
1099
1100static LRESULT
1102{
1103 infoPtr->bActive = activate;
1104
1105 TRACE("activate %d\n", activate);
1106
1107 if (!(infoPtr->bActive) && (infoPtr->nCurrentTool != -1))
1108 TOOLTIPS_Hide (infoPtr);
1109
1110 return 0;
1111}
1112
1113
1114static LRESULT
1116{
1117 TTTOOL_INFO *toolPtr;
1118 INT nResult;
1119
1120 if (!ti) return FALSE;
1121
1122 TRACE("add tool (%p) %p %ld%s\n", infoPtr->hwndSelf, ti->hwnd, ti->uId,
1123 (ti->uFlags & TTF_IDISHWND) ? " TTF_IDISHWND" : "");
1124
1125 if (ti->cbSize > TTTOOLINFOW_V3_SIZE && isW)
1126 return FALSE;
1127
1128 if (infoPtr->uNumTools == 0) {
1129 infoPtr->tools = Alloc (sizeof(TTTOOL_INFO));
1130 toolPtr = infoPtr->tools;
1131 }
1132 else {
1133 TTTOOL_INFO *oldTools = infoPtr->tools;
1134 infoPtr->tools =
1135 Alloc (sizeof(TTTOOL_INFO) * (infoPtr->uNumTools + 1));
1136 memcpy (infoPtr->tools, oldTools,
1137 infoPtr->uNumTools * sizeof(TTTOOL_INFO));
1138 Free (oldTools);
1139 toolPtr = &infoPtr->tools[infoPtr->uNumTools];
1140 }
1141
1142 infoPtr->uNumTools++;
1143
1144 /* copy tool data */
1145 toolPtr->uFlags = ti->uFlags;
1146 toolPtr->uInternalFlags = (ti->uFlags & (TTF_SUBCLASS | TTF_IDISHWND));
1147 toolPtr->hwnd = ti->hwnd;
1148 toolPtr->uId = ti->uId;
1149 toolPtr->rect = ti->rect;
1150 toolPtr->hinst = ti->hinst;
1151
1152 if (ti->cbSize >= TTTOOLINFOW_V1_SIZE) {
1153 if (IS_INTRESOURCE(ti->lpszText)) {
1154 TRACE("add string id %x\n", LOWORD(ti->lpszText));
1155 toolPtr->lpszText = ti->lpszText;
1156 }
1157 else if (ti->lpszText) {
1159 TRACE("add CALLBACK\n");
1160 toolPtr->lpszText = LPSTR_TEXTCALLBACKW;
1161 }
1162 else if (isW) {
1163 INT len = lstrlenW (ti->lpszText);
1164 TRACE("add text %s\n", debugstr_w(ti->lpszText));
1165 toolPtr->lpszText = Alloc ((len + 1)*sizeof(WCHAR));
1166 strcpyW (toolPtr->lpszText, ti->lpszText);
1167 }
1168 else {
1169 INT len = MultiByteToWideChar(CP_ACP, 0, (LPSTR)ti->lpszText, -1, NULL, 0);
1170 TRACE("add text \"%s\"\n", debugstr_a((char *)ti->lpszText));
1171 toolPtr->lpszText = Alloc (len * sizeof(WCHAR));
1172 MultiByteToWideChar(CP_ACP, 0, (LPSTR)ti->lpszText, -1, toolPtr->lpszText, len);
1173 }
1174 }
1175 }
1176
1177 if (ti->cbSize >= TTTOOLINFOW_V2_SIZE)
1178 toolPtr->lParam = ti->lParam;
1179
1180 /* install subclassing hook */
1181 if (toolPtr->uInternalFlags & TTF_SUBCLASS) {
1182 if (toolPtr->uInternalFlags & TTF_IDISHWND) {
1184 (DWORD_PTR)infoPtr->hwndSelf);
1185 }
1186 else {
1188 (DWORD_PTR)infoPtr->hwndSelf);
1189 }
1190 TRACE("subclassing installed\n");
1191 }
1192
1193 nResult = SendMessageW (toolPtr->hwnd, WM_NOTIFYFORMAT,
1194 (WPARAM)infoPtr->hwndSelf, NF_QUERY);
1195 if (nResult == NFR_ANSI) {
1196 toolPtr->bNotifyUnicode = FALSE;
1197 TRACE(" -- WM_NOTIFYFORMAT returns: NFR_ANSI\n");
1198 } else if (nResult == NFR_UNICODE) {
1199 toolPtr->bNotifyUnicode = TRUE;
1200 TRACE(" -- WM_NOTIFYFORMAT returns: NFR_UNICODE\n");
1201 } else {
1202 TRACE (" -- WM_NOTIFYFORMAT returns: %d\n", nResult);
1203 }
1204
1205 return TRUE;
1206}
1207
1208static void TOOLTIPS_ResetSubclass (const TTTOOL_INFO *toolPtr)
1209{
1210 /* Reset subclassing data. */
1211 if (toolPtr->uInternalFlags & TTF_SUBCLASS)
1212 SetWindowSubclass(toolPtr->uInternalFlags & TTF_IDISHWND ? (HWND)toolPtr->uId : toolPtr->hwnd,
1213 TOOLTIPS_SubclassProc, 1, 0);
1214}
1215
1216static LRESULT
1218{
1219 TTTOOL_INFO *toolPtr;
1220 INT nTool;
1221
1222 if (!ti) return 0;
1223 if (isW && ti->cbSize > TTTOOLINFOW_V2_SIZE &&
1225 return 0;
1226 if (infoPtr->uNumTools == 0)
1227 return 0;
1228
1229 nTool = TOOLTIPS_GetToolFromInfoT (infoPtr, ti);
1230
1231 TRACE("tool %d\n", nTool);
1232
1233 if (nTool == -1)
1234 return 0;
1235
1236 /* make sure the tooltip has disappeared before deleting it */
1237 TOOLTIPS_Hide(infoPtr);
1238
1239 /* delete text string */
1240 toolPtr = &infoPtr->tools[nTool];
1241 if (toolPtr->lpszText) {
1242 if ( (toolPtr->lpszText != LPSTR_TEXTCALLBACKW) &&
1243 !IS_INTRESOURCE(toolPtr->lpszText) )
1244 Free (toolPtr->lpszText);
1245 }
1246
1247 TOOLTIPS_ResetSubclass (toolPtr);
1248
1249 /* delete tool from tool list */
1250 if (infoPtr->uNumTools == 1) {
1251 Free (infoPtr->tools);
1252 infoPtr->tools = NULL;
1253 }
1254 else {
1255 TTTOOL_INFO *oldTools = infoPtr->tools;
1256 infoPtr->tools =
1257 Alloc (sizeof(TTTOOL_INFO) * (infoPtr->uNumTools - 1));
1258
1259 if (nTool > 0)
1260 memcpy (&infoPtr->tools[0], &oldTools[0],
1261 nTool * sizeof(TTTOOL_INFO));
1262
1263 if (nTool < infoPtr->uNumTools - 1)
1264 memcpy (&infoPtr->tools[nTool], &oldTools[nTool + 1],
1265 (infoPtr->uNumTools - nTool - 1) * sizeof(TTTOOL_INFO));
1266
1267 Free (oldTools);
1268 }
1269
1270 /* update any indices affected by delete */
1271
1272 /* destroying tool that mouse was on on last relayed mouse move */
1273 if (infoPtr->nTool == nTool)
1274 /* -1 means no current tool (0 means first tool) */
1275 infoPtr->nTool = -1;
1276 else if (infoPtr->nTool > nTool)
1277 infoPtr->nTool--;
1278
1279 if (infoPtr->nTrackTool == nTool)
1280 /* -1 means no current tool (0 means first tool) */
1281 infoPtr->nTrackTool = -1;
1282 else if (infoPtr->nTrackTool > nTool)
1283 infoPtr->nTrackTool--;
1284
1285 if (infoPtr->nCurrentTool == nTool)
1286 /* -1 means no current tool (0 means first tool) */
1287 infoPtr->nCurrentTool = -1;
1288 else if (infoPtr->nCurrentTool > nTool)
1289 infoPtr->nCurrentTool--;
1290
1291 infoPtr->uNumTools--;
1292
1293 return 0;
1294}
1295
1296static LRESULT
1298 BOOL isW)
1299{
1300 if (!ti || ti->cbSize < TTTOOLINFOW_V1_SIZE)
1301 return FALSE;
1302 if (uIndex >= infoPtr->uNumTools)
1303 return FALSE;
1304
1305 TRACE("index=%u\n", uIndex);
1306
1307 TOOLTIPS_CopyInfoT (infoPtr, uIndex, ti, isW);
1308
1309 return TRUE;
1310}
1311
1312static LRESULT
1313TOOLTIPS_GetBubbleSize (const TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *lpToolInfo)
1314{
1315 INT nTool;
1316 SIZE size;
1317
1318 if (lpToolInfo == NULL)
1319 return FALSE;
1320 if (lpToolInfo->cbSize < TTTOOLINFOW_V1_SIZE)
1321 return FALSE;
1322
1323 nTool = TOOLTIPS_GetToolFromInfoT (infoPtr, lpToolInfo);
1324 if (nTool == -1) return 0;
1325
1326 TRACE("tool %d\n", nTool);
1327
1328 TOOLTIPS_CalcTipSize (infoPtr, &size);
1329 TRACE("size %d x %d\n", size.cx, size.cy);
1330
1331 return MAKELRESULT(size.cx, size.cy);
1332}
1333
1334static LRESULT
1336{
1337 if (ti) {
1338 if (ti->cbSize < TTTOOLINFOW_V1_SIZE)
1339 return FALSE;
1340
1341 if (infoPtr->nCurrentTool != -1)
1342 TOOLTIPS_CopyInfoT (infoPtr, infoPtr->nCurrentTool, ti, isW);
1343 }
1344
1345 return infoPtr->nCurrentTool != -1;
1346}
1347
1348
1349static LRESULT
1351{
1352 switch (duration) {
1353 case TTDT_RESHOW:
1354 return infoPtr->nReshowTime;
1355
1356 case TTDT_AUTOPOP:
1357 return infoPtr->nAutoPopTime;
1358
1359 case TTDT_INITIAL:
1360 case TTDT_AUTOMATIC: /* Apparently TTDT_AUTOMATIC returns TTDT_INITIAL */
1361 return infoPtr->nInitialTime;
1362
1363 default:
1364 WARN("Invalid duration flag %x\n", duration);
1365 break;
1366 }
1367
1368 return -1;
1369}
1370
1371
1372static LRESULT
1374{
1375 if (rect)
1376 *rect = infoPtr->rcMargin;
1377
1378 return 0;
1379}
1380
1381
1382static inline LRESULT
1384{
1385 return infoPtr->nMaxTipWidth;
1386}
1387
1388
1389static LRESULT
1391{
1392 INT nTool;
1393
1394 if (!ti) return 0;
1395 if (ti->cbSize < TTTOOLINFOW_V1_SIZE)
1396 return 0;
1397
1398 nTool = TOOLTIPS_GetToolFromInfoT (infoPtr, ti);
1399 if (nTool == -1) return 0;
1400
1401 if (infoPtr->tools[nTool].lpszText == NULL)
1402 return 0;
1403
1404 if (isW) {
1405 ti->lpszText[0] = '\0';
1406 TOOLTIPS_GetTipText(infoPtr, nTool, ti->lpszText);
1407 }
1408 else {
1410
1411 /* NB this API is broken, there is no way for the app to determine
1412 what size buffer it requires nor a way to specify how long the
1413 one it supplies is. According to the test result, it's up to
1414 80 bytes by the ANSI version. */
1415
1416 buffer[0] = '\0';
1417 TOOLTIPS_GetTipText(infoPtr, nTool, buffer);
1420 }
1421
1422 return 0;
1423}
1424
1425
1426static inline LRESULT
1428{
1429 return infoPtr->clrBk;
1430}
1431
1432
1433static inline LRESULT
1435{
1436 return infoPtr->clrText;
1437}
1438
1439
1440static inline LRESULT
1442{
1443 return infoPtr->uNumTools;
1444}
1445
1446
1447static LRESULT
1449{
1450 INT nTool;
1451 HWND hwnd;
1452
1453 if (!ti) return FALSE;
1454 if (ti->cbSize < TTTOOLINFOW_V1_SIZE)
1455 return FALSE;
1456 if (infoPtr->uNumTools == 0)
1457 return FALSE;
1458
1459 nTool = TOOLTIPS_GetToolFromInfoT (infoPtr, ti);
1460 if (nTool == -1)
1461 return FALSE;
1462
1463 TRACE("tool %d\n", nTool);
1464
1465 hwnd = ti->hwnd;
1466 TOOLTIPS_CopyInfoT (infoPtr, nTool, ti, isW);
1467 ti->hwnd = hwnd;
1468
1469 return TRUE;
1470}
1471
1472
1473static LRESULT
1475 BOOL isW)
1476{
1477 INT nTool;
1478
1479 if (lptthit == 0)
1480 return FALSE;
1481
1482 nTool = TOOLTIPS_GetToolFromPoint (infoPtr, lptthit->hwnd, &lptthit->pt);
1483 if (nTool == -1)
1484 return FALSE;
1485
1486 TRACE("tool %d\n", nTool);
1487
1488 /* copy tool data */
1489 if (lptthit->ti.cbSize >= TTTOOLINFOW_V1_SIZE)
1490 TOOLTIPS_CopyInfoT (infoPtr, nTool, &lptthit->ti, isW);
1491
1492 return TRUE;
1493}
1494
1495
1496static LRESULT
1498{
1499 INT nTool;
1500
1501 if (!ti) return 0;
1502 if (ti->cbSize < TTTOOLINFOW_V1_SIZE)
1503 return FALSE;
1504
1505 nTool = TOOLTIPS_GetToolFromInfoT (infoPtr, ti);
1506
1507 TRACE("nTool = %d, rect = %s\n", nTool, wine_dbgstr_rect(&ti->rect));
1508
1509 if (nTool == -1) return 0;
1510
1511 infoPtr->tools[nTool].rect = ti->rect;
1512
1513 return 0;
1514}
1515
1516
1517static inline LRESULT
1519{
1520 TOOLTIPS_Hide (infoPtr);
1521
1522 return 0;
1523}
1524
1525
1526static LRESULT
1528{
1529 POINT pt;
1530 INT nOldTool;
1531
1532 if (!lpMsg) {
1533 ERR("lpMsg == NULL\n");
1534 return 0;
1535 }
1536
1537 switch (lpMsg->message) {
1538 case WM_LBUTTONDOWN:
1539 case WM_LBUTTONUP:
1540 case WM_MBUTTONDOWN:
1541 case WM_MBUTTONUP:
1542 case WM_RBUTTONDOWN:
1543 case WM_RBUTTONUP:
1544 TOOLTIPS_Hide (infoPtr);
1545 break;
1546
1547 case WM_MOUSEMOVE:
1548 pt.x = (short)LOWORD(lpMsg->lParam);
1549 pt.y = (short)HIWORD(lpMsg->lParam);
1550 nOldTool = infoPtr->nTool;
1551 infoPtr->nTool = TOOLTIPS_GetToolFromPoint(infoPtr, lpMsg->hwnd,
1552 &pt);
1553 TRACE("tool (%p) %d %d %d\n", infoPtr->hwndSelf, nOldTool,
1554 infoPtr->nTool, infoPtr->nCurrentTool);
1555 TRACE("WM_MOUSEMOVE (%p %s)\n", infoPtr->hwndSelf, wine_dbgstr_point(&pt));
1556
1557 if (infoPtr->nTool != nOldTool) {
1558 if(infoPtr->nTool == -1) { /* Moved out of all tools */
1559 TOOLTIPS_Hide(infoPtr);
1560 KillTimer(infoPtr->hwndSelf, ID_TIMERLEAVE);
1561 } else if (nOldTool == -1) { /* Moved from outside */
1562 if(infoPtr->bActive) {
1563 SetTimer(infoPtr->hwndSelf, ID_TIMERSHOW, infoPtr->nInitialTime, 0);
1564 TRACE("timer 1 started\n");
1565 }
1566 } else { /* Moved from one to another */
1567 TOOLTIPS_Hide (infoPtr);
1568 KillTimer(infoPtr->hwndSelf, ID_TIMERLEAVE);
1569 if(infoPtr->bActive) {
1570 SetTimer (infoPtr->hwndSelf, ID_TIMERSHOW, infoPtr->nReshowTime, 0);
1571 TRACE("timer 1 started\n");
1572 }
1573 }
1574 } else if(infoPtr->nCurrentTool != -1) { /* restart autopop */
1575 KillTimer(infoPtr->hwndSelf, ID_TIMERPOP);
1576 SetTimer(infoPtr->hwndSelf, ID_TIMERPOP, infoPtr->nAutoPopTime, 0);
1577 TRACE("timer 2 restarted\n");
1578 } else if(infoPtr->nTool != -1 && infoPtr->bActive) {
1579 /* previous show attempt didn't result in tooltip so try again */
1580 SetTimer(infoPtr->hwndSelf, ID_TIMERSHOW, infoPtr->nInitialTime, 0);
1581 TRACE("timer 1 started\n");
1582 }
1583 break;
1584 }
1585
1586 return 0;
1587}
1588
1589
1590static LRESULT
1592{
1593 switch (duration) {
1594 case TTDT_AUTOMATIC:
1595 if (nTime <= 0)
1596 nTime = GetDoubleClickTime();
1597 infoPtr->nReshowTime = nTime / 5;
1598 infoPtr->nAutoPopTime = nTime * 10;
1599 infoPtr->nInitialTime = nTime;
1600 break;
1601
1602 case TTDT_RESHOW:
1603 if(nTime < 0)
1604 nTime = GetDoubleClickTime() / 5;
1605 infoPtr->nReshowTime = nTime;
1606 break;
1607
1608 case TTDT_AUTOPOP:
1609 if(nTime < 0)
1610 nTime = GetDoubleClickTime() * 10;
1611 infoPtr->nAutoPopTime = nTime;
1612 break;
1613
1614 case TTDT_INITIAL:
1615 if(nTime < 0)
1616 nTime = GetDoubleClickTime();
1617 infoPtr->nInitialTime = nTime;
1618 break;
1619
1620 default:
1621 WARN("Invalid duration flag %x\n", duration);
1622 break;
1623 }
1624
1625 return 0;
1626}
1627
1628
1629static LRESULT
1631{
1632 if (rect)
1633 infoPtr->rcMargin = *rect;
1634
1635 return 0;
1636}
1637
1638
1639static inline LRESULT
1641{
1642 INT nTemp = infoPtr->nMaxTipWidth;
1643
1644 infoPtr->nMaxTipWidth = MaxWidth;
1645
1646 return nTemp;
1647}
1648
1649
1650static inline LRESULT
1652{
1653 infoPtr->clrBk = clrBk;
1654
1655 return 0;
1656}
1657
1658
1659static inline LRESULT
1661{
1662 infoPtr->clrText = clrText;
1663
1664 return 0;
1665}
1666
1667
1668static LRESULT
1669TOOLTIPS_SetTitleT (TOOLTIPS_INFO *infoPtr, UINT_PTR uTitleIcon, LPCWSTR pszTitle,
1670 BOOL isW)
1671{
1672 UINT size;
1673
1674 TRACE("hwnd = %p, title = %s, icon = %p\n", infoPtr->hwndSelf, debugstr_w(pszTitle),
1675 (void*)uTitleIcon);
1676
1677 Free(infoPtr->pszTitle);
1678
1679 if (pszTitle)
1680 {
1681 if (isW)
1682 {
1683 size = (strlenW(pszTitle)+1)*sizeof(WCHAR);
1684 infoPtr->pszTitle = Alloc(size);
1685 if (!infoPtr->pszTitle)
1686 return FALSE;
1687 memcpy(infoPtr->pszTitle, pszTitle, size);
1688 }
1689 else
1690 {
1691 size = sizeof(WCHAR)*MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pszTitle, -1, NULL, 0);
1692 infoPtr->pszTitle = Alloc(size);
1693 if (!infoPtr->pszTitle)
1694 return FALSE;
1695 MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pszTitle, -1, infoPtr->pszTitle, size/sizeof(WCHAR));
1696 }
1697 }
1698 else
1699 infoPtr->pszTitle = NULL;
1700
1701 if (uTitleIcon <= TTI_ERROR)
1702 infoPtr->hTitleIcon = hTooltipIcons[uTitleIcon];
1703 else
1704 infoPtr->hTitleIcon = CopyIcon((HICON)uTitleIcon);
1705
1706 TRACE("icon = %p\n", infoPtr->hTitleIcon);
1707
1708 return TRUE;
1709}
1710
1711
1712static LRESULT
1714{
1715 TTTOOL_INFO *toolPtr;
1716 INT nTool;
1717
1718 if (!ti) return 0;
1719 if (ti->cbSize < TTTOOLINFOW_V1_SIZE)
1720 return 0;
1721
1722 nTool = TOOLTIPS_GetToolFromInfoT (infoPtr, ti);
1723 if (nTool == -1) return 0;
1724
1725 TRACE("tool %d\n", nTool);
1726
1727 toolPtr = &infoPtr->tools[nTool];
1728
1729 /* copy tool data */
1730 toolPtr->uFlags = ti->uFlags;
1731 toolPtr->hwnd = ti->hwnd;
1732 toolPtr->uId = ti->uId;
1733 toolPtr->rect = ti->rect;
1734 toolPtr->hinst = ti->hinst;
1735
1736 if (IS_INTRESOURCE(ti->lpszText)) {
1737 TRACE("set string id %x\n", LOWORD(ti->lpszText));
1738 toolPtr->lpszText = ti->lpszText;
1739 }
1740 else {
1742 toolPtr->lpszText = LPSTR_TEXTCALLBACKW;
1743 else {
1744 if ( (toolPtr->lpszText) &&
1745 !IS_INTRESOURCE(toolPtr->lpszText) ) {
1746 if( toolPtr->lpszText != LPSTR_TEXTCALLBACKW)
1747 Free (toolPtr->lpszText);
1748 toolPtr->lpszText = NULL;
1749 }
1750 if (ti->lpszText) {
1751 if (isW) {
1752 INT len = lstrlenW (ti->lpszText);
1753 toolPtr->lpszText = Alloc ((len+1)*sizeof(WCHAR));
1754 strcpyW (toolPtr->lpszText, ti->lpszText);
1755 }
1756 else {
1758 -1, NULL, 0);
1759 toolPtr->lpszText = Alloc (len * sizeof(WCHAR));
1761 toolPtr->lpszText, len);
1762 }
1763 }
1764 }
1765 }
1766
1767 if (ti->cbSize >= TTTOOLINFOW_V2_SIZE)
1768 toolPtr->lParam = ti->lParam;
1769
1770 if (infoPtr->nCurrentTool == nTool)
1771 {
1772 TOOLTIPS_GetTipText (infoPtr, infoPtr->nCurrentTool, infoPtr->szTipText);
1773
1774 if (infoPtr->szTipText[0] == 0)
1775 TOOLTIPS_Hide(infoPtr);
1776 else
1777 TOOLTIPS_Show (infoPtr, FALSE);
1778 }
1779
1780 return 0;
1781}
1782
1783
1784static LRESULT
1785TOOLTIPS_TrackActivate (TOOLTIPS_INFO *infoPtr, BOOL track_activate, const TTTOOLINFOA *ti)
1786{
1787 if (track_activate) {
1788
1789 if (!ti) return 0;
1790 if (ti->cbSize < TTTOOLINFOA_V1_SIZE)
1791 return FALSE;
1792
1793 /* activate */
1794 infoPtr->nTrackTool = TOOLTIPS_GetToolFromInfoT (infoPtr, (const TTTOOLINFOW*)ti);
1795 if (infoPtr->nTrackTool != -1) {
1796 TRACE("activated\n");
1797 infoPtr->bTrackActive = TRUE;
1798 TOOLTIPS_TrackShow (infoPtr);
1799 }
1800 }
1801 else {
1802 /* deactivate */
1803 TOOLTIPS_TrackHide (infoPtr);
1804
1805 infoPtr->bTrackActive = FALSE;
1806 infoPtr->nTrackTool = -1;
1807
1808 TRACE("deactivated\n");
1809 }
1810
1811 return 0;
1812}
1813
1814
1815static LRESULT
1817{
1818 infoPtr->xTrackPos = (INT)LOWORD(coord);
1819 infoPtr->yTrackPos = (INT)HIWORD(coord);
1820
1821 if (infoPtr->bTrackActive) {
1822 TRACE("[%d %d]\n",
1823 infoPtr->xTrackPos, infoPtr->yTrackPos);
1824
1825 TOOLTIPS_TrackShow (infoPtr);
1826 }
1827
1828 return 0;
1829}
1830
1831
1832static LRESULT
1834{
1835 if (infoPtr->nCurrentTool != -1)
1836 UpdateWindow (infoPtr->hwndSelf);
1837
1838 return 0;
1839}
1840
1841
1842static LRESULT
1844{
1845 TTTOOL_INFO *toolPtr;
1846 INT nTool;
1847
1848 if (!ti) return 0;
1849 if (ti->cbSize < TTTOOLINFOW_V1_SIZE)
1850 return FALSE;
1851
1852 nTool = TOOLTIPS_GetToolFromInfoT (infoPtr, ti);
1853 if (nTool == -1)
1854 return 0;
1855
1856 TRACE("tool %d\n", nTool);
1857
1858 toolPtr = &infoPtr->tools[nTool];
1859
1860 /* copy tool text */
1861 toolPtr->hinst = ti->hinst;
1862
1863 if (IS_INTRESOURCE(ti->lpszText)){
1864 toolPtr->lpszText = ti->lpszText;
1865 }
1866 else if (ti->lpszText) {
1868 toolPtr->lpszText = LPSTR_TEXTCALLBACKW;
1869 else {
1870 if ( (toolPtr->lpszText) &&
1871 !IS_INTRESOURCE(toolPtr->lpszText) ) {
1872 if( toolPtr->lpszText != LPSTR_TEXTCALLBACKW)
1873 Free (toolPtr->lpszText);
1874 toolPtr->lpszText = NULL;
1875 }
1876 if (ti->lpszText) {
1877 if (isW) {
1878 INT len = lstrlenW (ti->lpszText);
1879 toolPtr->lpszText = Alloc ((len+1)*sizeof(WCHAR));
1880 strcpyW (toolPtr->lpszText, ti->lpszText);
1881 }
1882 else {
1884 -1, NULL, 0);
1885 toolPtr->lpszText = Alloc (len * sizeof(WCHAR));
1887 toolPtr->lpszText, len);
1888 }
1889 }
1890 }
1891 }
1892
1893 if(infoPtr->nCurrentTool == -1) return 0;
1894 /* force repaint */
1895 if (infoPtr->bActive)
1896 TOOLTIPS_Show (infoPtr, FALSE);
1897 else if (infoPtr->bTrackActive)
1898 TOOLTIPS_Show (infoPtr, TRUE);
1899
1900 return 0;
1901}
1902
1903
1904static LRESULT
1906{
1907 TOOLTIPS_INFO *infoPtr;
1908
1909 /* allocate memory for info structure */
1910 infoPtr = Alloc (sizeof(TOOLTIPS_INFO));
1911 SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
1912
1913 /* initialize info structure */
1914 infoPtr->bActive = TRUE;
1915 infoPtr->bTrackActive = FALSE;
1916
1917 infoPtr->nMaxTipWidth = -1;
1918 infoPtr->nTool = -1;
1919 infoPtr->nCurrentTool = -1;
1920 infoPtr->nTrackTool = -1;
1921 infoPtr->hwndSelf = hwnd;
1922
1923 /* initialize colours and fonts */
1925
1927
1929
1930 return 0;
1931}
1932
1933
1934static LRESULT
1936{
1937 TTTOOL_INFO *toolPtr;
1938 UINT i;
1939
1940 /* free tools */
1941 if (infoPtr->tools) {
1942 for (i = 0; i < infoPtr->uNumTools; i++) {
1943 toolPtr = &infoPtr->tools[i];
1944 if (toolPtr->lpszText) {
1945 if ( (toolPtr->lpszText != LPSTR_TEXTCALLBACKW) &&
1946 !IS_INTRESOURCE(toolPtr->lpszText) )
1947 {
1948 Free (toolPtr->lpszText);
1949 toolPtr->lpszText = NULL;
1950 }
1951 }
1952
1953 TOOLTIPS_ResetSubclass (toolPtr);
1954 }
1955
1956 Free (infoPtr->tools);
1957 }
1958
1959 /* free title string */
1960 Free (infoPtr->pszTitle);
1961 /* free title icon if not a standard one */
1963 DeleteObject(infoPtr->hTitleIcon);
1964
1965 /* delete fonts */
1966 DeleteObject (infoPtr->hFont);
1967 DeleteObject (infoPtr->hTitleFont);
1968
1969 /* free tool tips info data */
1970 SetWindowLongPtrW(infoPtr->hwndSelf, 0, 0);
1971 Free (infoPtr);
1972
1973 return 0;
1974}
1975
1976
1977static inline LRESULT
1979{
1980 return (LRESULT)infoPtr->hFont;
1981}
1982
1983
1984static LRESULT
1986{
1987 TOOLTIPS_Hide (infoPtr);
1988
1989 return 0;
1990}
1991
1992
1993static LRESULT
1995{
1996 DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
1997 DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE);
1998
1999 dwStyle &= ~(WS_CHILD | /*WS_MAXIMIZE |*/ WS_BORDER | WS_DLGFRAME);
2000 dwStyle |= (WS_POPUP | WS_BORDER | WS_CLIPSIBLINGS);
2001
2002 /* WS_BORDER only draws a border round the window rect, not the
2003 * window region, therefore it is useless to us in balloon mode */
2004 if (dwStyle & TTS_BALLOON) dwStyle &= ~WS_BORDER;
2005
2006 SetWindowLongW (hwnd, GWL_STYLE, dwStyle);
2007
2008 dwExStyle |= WS_EX_TOOLWINDOW;
2009 SetWindowLongW (hwnd, GWL_EXSTYLE, dwExStyle);
2010
2011 return TRUE;
2012}
2013
2014
2015static LRESULT
2017{
2018 INT nTool = (infoPtr->bTrackActive) ? infoPtr->nTrackTool : infoPtr->nTool;
2019
2020 TRACE(" nTool=%d\n", nTool);
2021
2022 if ((nTool > -1) && (nTool < infoPtr->uNumTools)) {
2023 if (infoPtr->tools[nTool].uFlags & TTF_TRANSPARENT) {
2024 TRACE("-- in transparent mode\n");
2025 return HTTRANSPARENT;
2026 }
2027 }
2028
2029 return DefWindowProcW (infoPtr->hwndSelf, WM_NCHITTEST, wParam, lParam);
2030}
2031
2032
2033static LRESULT
2035{
2036#ifdef __REACTOS__
2037 TTTOOL_INFO *toolPtr = infoPtr->tools;
2038 LRESULT nResult;
2039
2040 TRACE("infoPtr=%p wParam=%lx lParam=%p\n", infoPtr, wParam, (PVOID)lParam);
2041
2042 if (lParam == NF_QUERY) {
2043 if (toolPtr->bNotifyUnicode) {
2044 return NFR_UNICODE;
2045 } else {
2046 return NFR_ANSI;
2047 }
2048 }
2049 else if (lParam == NF_REQUERY) {
2050 nResult = SendMessageW (toolPtr->hwnd, WM_NOTIFYFORMAT,
2051 (WPARAM)infoPtr->hwndSelf, (LPARAM)NF_QUERY);
2052 if (nResult == NFR_ANSI) {
2053 toolPtr->bNotifyUnicode = FALSE;
2054 TRACE(" -- WM_NOTIFYFORMAT returns: NFR_ANSI\n");
2055 } else if (nResult == NFR_UNICODE) {
2056 toolPtr->bNotifyUnicode = TRUE;
2057 TRACE(" -- WM_NOTIFYFORMAT returns: NFR_UNICODE\n");
2058 } else {
2059 TRACE (" -- WM_NOTIFYFORMAT returns: error!\n");
2060 }
2061 return nResult;
2062 }
2063#else
2064 FIXME ("hwnd=%p wParam=%lx lParam=%lx\n", infoPtr->hwndSelf, wParam, lParam);
2065#endif
2066
2067 return 0;
2068}
2069
2070
2071static LRESULT
2073{
2074 HDC hdc;
2075 PAINTSTRUCT ps;
2076
2077 hdc = (hDC == NULL) ? BeginPaint (infoPtr->hwndSelf, &ps) : hDC;
2078 TOOLTIPS_Refresh (infoPtr, hdc);
2079 if (!hDC)
2080 EndPaint (infoPtr->hwndSelf, &ps);
2081 return 0;
2082}
2083
2084
2085static LRESULT
2087{
2088 LOGFONTW lf;
2089
2090 if(!GetObjectW(hFont, sizeof(lf), &lf))
2091 return 0;
2092
2093 DeleteObject (infoPtr->hFont);
2094 infoPtr->hFont = CreateFontIndirectW(&lf);
2095
2096 DeleteObject (infoPtr->hTitleFont);
2097 lf.lfWeight = FW_BOLD;
2098 infoPtr->hTitleFont = CreateFontIndirectW(&lf);
2099
2100 if (redraw && infoPtr->nCurrentTool != -1)
2101 FIXME("full redraw needed\n");
2102
2103 return 0;
2104}
2105
2106/******************************************************************
2107 * TOOLTIPS_GetTextLength
2108 *
2109 * This function is called when the tooltip receive a
2110 * WM_GETTEXTLENGTH message.
2111 *
2112 * returns the length, in characters, of the tip text
2113 */
2114static inline LRESULT
2116{
2117 return strlenW(infoPtr->szTipText);
2118}
2119
2120/******************************************************************
2121 * TOOLTIPS_OnWMGetText
2122 *
2123 * This function is called when the tooltip receive a
2124 * WM_GETTEXT message.
2125 * wParam : specifies the maximum number of characters to be copied
2126 * lParam : is the pointer to the buffer that will receive
2127 * the tip text
2128 *
2129 * returns the number of characters copied
2130 */
2131static LRESULT
2133{
2134 LRESULT res;
2135
2136 if(!size)
2137 return 0;
2138
2139 res = min(strlenW(infoPtr->szTipText)+1, size);
2140 memcpy(pszText, infoPtr->szTipText, res*sizeof(WCHAR));
2141 pszText[res-1] = '\0';
2142 return res-1;
2143}
2144
2145static LRESULT
2147{
2148 INT nOldTool;
2149
2150 TRACE("timer %d (%p) expired\n", iTimer, infoPtr->hwndSelf);
2151
2152 switch (iTimer) {
2153 case ID_TIMERSHOW:
2154 KillTimer (infoPtr->hwndSelf, ID_TIMERSHOW);
2155 nOldTool = infoPtr->nTool;
2156 if ((infoPtr->nTool = TOOLTIPS_CheckTool (infoPtr, TRUE)) == nOldTool)
2157 TOOLTIPS_Show (infoPtr, FALSE);
2158 break;
2159
2160 case ID_TIMERPOP:
2161 TOOLTIPS_Hide (infoPtr);
2162 break;
2163
2164 case ID_TIMERLEAVE:
2165 nOldTool = infoPtr->nTool;
2166 infoPtr->nTool = TOOLTIPS_CheckTool (infoPtr, FALSE);
2167 TRACE("tool (%p) %d %d %d\n", infoPtr->hwndSelf, nOldTool,
2168 infoPtr->nTool, infoPtr->nCurrentTool);
2169 if (infoPtr->nTool != nOldTool) {
2170 if(infoPtr->nTool == -1) { /* Moved out of all tools */
2171 TOOLTIPS_Hide(infoPtr);
2172 KillTimer(infoPtr->hwndSelf, ID_TIMERLEAVE);
2173 } else if (nOldTool == -1) { /* Moved from outside */
2174 ERR("How did this happen?\n");
2175 } else { /* Moved from one to another */
2176 TOOLTIPS_Hide (infoPtr);
2177 KillTimer(infoPtr->hwndSelf, ID_TIMERLEAVE);
2178 if(infoPtr->bActive) {
2179 SetTimer (infoPtr->hwndSelf, ID_TIMERSHOW, infoPtr->nReshowTime, 0);
2180 TRACE("timer 1 started!\n");
2181 }
2182 }
2183 }
2184 break;
2185
2186 default:
2187 ERR("Unknown timer id %d\n", iTimer);
2188 break;
2189 }
2190 return 0;
2191}
2192
2193
2194static LRESULT
2196{
2198
2199 return 0;
2200}
2201
2202
2203static LRESULT CALLBACK
2205{
2206 TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr ((HWND)dwRef);
2207 MSG msg;
2208
2209 switch (message)
2210 {
2211 case WM_MOUSEMOVE:
2212 case WM_LBUTTONDOWN:
2213 case WM_LBUTTONUP:
2214 case WM_MBUTTONDOWN:
2215 case WM_MBUTTONUP:
2216 case WM_RBUTTONDOWN:
2217 case WM_RBUTTONUP:
2218 if (infoPtr)
2219 {
2220 msg.hwnd = hwnd;
2221 msg.message = message;
2222 msg.wParam = wParam;
2223 msg.lParam = lParam;
2224 TOOLTIPS_RelayEvent(infoPtr, &msg);
2225 }
2226 break;
2227 case WM_NCDESTROY:
2229 break;
2230 default:
2231 break;
2232 }
2233
2235}
2236
2237
2238static LRESULT CALLBACK
2240{
2242
2243 TRACE("hwnd=%p msg=%x wparam=%lx lParam=%lx\n", hwnd, uMsg, wParam, lParam);
2244 if (!infoPtr && (uMsg != WM_CREATE) && (uMsg != WM_NCCREATE))
2245 return DefWindowProcW (hwnd, uMsg, wParam, lParam);
2246 switch (uMsg)
2247 {
2248 case TTM_ACTIVATE:
2249 return TOOLTIPS_Activate (infoPtr, (BOOL)wParam);
2250
2251 case TTM_ADDTOOLA:
2252 case TTM_ADDTOOLW:
2253 return TOOLTIPS_AddToolT (infoPtr, (LPTTTOOLINFOW)lParam, uMsg == TTM_ADDTOOLW);
2254
2255 case TTM_DELTOOLA:
2256 case TTM_DELTOOLW:
2257 return TOOLTIPS_DelToolT (infoPtr, (LPTOOLINFOW)lParam,
2258 uMsg == TTM_DELTOOLW);
2259 case TTM_ENUMTOOLSA:
2260 case TTM_ENUMTOOLSW:
2262 uMsg == TTM_ENUMTOOLSW);
2263 case TTM_GETBUBBLESIZE:
2264 return TOOLTIPS_GetBubbleSize (infoPtr, (LPTTTOOLINFOW)lParam);
2265
2269 uMsg == TTM_GETCURRENTTOOLW);
2270
2271 case TTM_GETDELAYTIME:
2272 return TOOLTIPS_GetDelayTime (infoPtr, (DWORD)wParam);
2273
2274 case TTM_GETMARGIN:
2275 return TOOLTIPS_GetMargin (infoPtr, (LPRECT)lParam);
2276
2277 case TTM_GETMAXTIPWIDTH:
2278 return TOOLTIPS_GetMaxTipWidth (infoPtr);
2279
2280 case TTM_GETTEXTA:
2281 case TTM_GETTEXTW:
2282 return TOOLTIPS_GetTextT (infoPtr, (LPTTTOOLINFOW)lParam,
2283 uMsg == TTM_GETTEXTW);
2284
2285 case TTM_GETTIPBKCOLOR:
2286 return TOOLTIPS_GetTipBkColor (infoPtr);
2287
2289 return TOOLTIPS_GetTipTextColor (infoPtr);
2290
2291 case TTM_GETTOOLCOUNT:
2292 return TOOLTIPS_GetToolCount (infoPtr);
2293
2294 case TTM_GETTOOLINFOA:
2295 case TTM_GETTOOLINFOW:
2296 return TOOLTIPS_GetToolInfoT (infoPtr, (LPTTTOOLINFOW)lParam,
2297 uMsg == TTM_GETTOOLINFOW);
2298
2299 case TTM_HITTESTA:
2300 case TTM_HITTESTW:
2301 return TOOLTIPS_HitTestT (infoPtr, (LPTTHITTESTINFOW)lParam,
2302 uMsg == TTM_HITTESTW);
2303 case TTM_NEWTOOLRECTA:
2304 case TTM_NEWTOOLRECTW:
2305 return TOOLTIPS_NewToolRectT (infoPtr, (LPTTTOOLINFOW)lParam);
2306
2307 case TTM_POP:
2308 return TOOLTIPS_Pop (infoPtr);
2309
2310 case TTM_RELAYEVENT:
2311 return TOOLTIPS_RelayEvent (infoPtr, (LPMSG)lParam);
2312
2313 case TTM_SETDELAYTIME:
2314 return TOOLTIPS_SetDelayTime (infoPtr, (DWORD)wParam, (INT)LOWORD(lParam));
2315
2316 case TTM_SETMARGIN:
2317 return TOOLTIPS_SetMargin (infoPtr, (LPRECT)lParam);
2318
2319 case TTM_SETMAXTIPWIDTH:
2320 return TOOLTIPS_SetMaxTipWidth (infoPtr, (INT)lParam);
2321
2322 case TTM_SETTIPBKCOLOR:
2323 return TOOLTIPS_SetTipBkColor (infoPtr, (COLORREF)wParam);
2324
2326 return TOOLTIPS_SetTipTextColor (infoPtr, (COLORREF)wParam);
2327
2328 case TTM_SETTITLEA:
2329 case TTM_SETTITLEW:
2330 return TOOLTIPS_SetTitleT (infoPtr, (UINT_PTR)wParam, (LPCWSTR)lParam,
2331 uMsg == TTM_SETTITLEW);
2332
2333 case TTM_SETTOOLINFOA:
2334 case TTM_SETTOOLINFOW:
2335 return TOOLTIPS_SetToolInfoT (infoPtr, (LPTTTOOLINFOW)lParam,
2336 uMsg == TTM_SETTOOLINFOW);
2337
2338 case TTM_TRACKACTIVATE:
2340
2341 case TTM_TRACKPOSITION:
2342 return TOOLTIPS_TrackPosition (infoPtr, lParam);
2343
2344 case TTM_UPDATE:
2345 return TOOLTIPS_Update (infoPtr);
2346
2347 case TTM_UPDATETIPTEXTA:
2348 case TTM_UPDATETIPTEXTW:
2350 uMsg == TTM_UPDATETIPTEXTW);
2351
2353 return (LRESULT)WindowFromPoint (*((LPPOINT)lParam));
2354
2355 case WM_CREATE:
2356 return TOOLTIPS_Create (hwnd);
2357
2358 case WM_DESTROY:
2359 return TOOLTIPS_Destroy (infoPtr);
2360
2361 case WM_ERASEBKGND:
2362 /* we draw the background in WM_PAINT */
2363 return 0;
2364
2365 case WM_GETFONT:
2366 return TOOLTIPS_GetFont (infoPtr);
2367
2368 case WM_GETTEXT:
2369 return TOOLTIPS_OnWMGetText (infoPtr, wParam, (LPWSTR)lParam);
2370
2371 case WM_GETTEXTLENGTH:
2372 return TOOLTIPS_GetTextLength (infoPtr);
2373
2374 case WM_LBUTTONDOWN:
2375 case WM_LBUTTONUP:
2376 case WM_MBUTTONDOWN:
2377 case WM_MBUTTONUP:
2378 case WM_RBUTTONDOWN:
2379 case WM_RBUTTONUP:
2380 case WM_MOUSEMOVE:
2381 return TOOLTIPS_MouseMessage (infoPtr);
2382
2383 case WM_NCCREATE:
2384 return TOOLTIPS_NCCreate (hwnd);
2385
2386 case WM_NCHITTEST:
2387 return TOOLTIPS_NCHitTest (infoPtr, wParam, lParam);
2388
2389 case WM_NOTIFYFORMAT:
2390 return TOOLTIPS_NotifyFormat (infoPtr, wParam, lParam);
2391
2392 case WM_PRINTCLIENT:
2393 case WM_PAINT:
2394 return TOOLTIPS_Paint (infoPtr, (HDC)wParam);
2395
2396 case WM_SETFONT:
2397 return TOOLTIPS_SetFont (infoPtr, (HFONT)wParam, LOWORD(lParam));
2398
2399 case WM_SYSCOLORCHANGE:
2401 return 0;
2402
2403 case WM_TIMER:
2404 return TOOLTIPS_Timer (infoPtr, (INT)wParam);
2405
2406 case WM_WININICHANGE:
2407 return TOOLTIPS_WinIniChange (infoPtr);
2408
2409 default:
2410 if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
2411 ERR("unknown msg %04x wp=%08lx lp=%08lx\n",
2412 uMsg, wParam, lParam);
2413 return DefWindowProcW (hwnd, uMsg, wParam, lParam);
2414 }
2415}
2416
2417
2418VOID
2420{
2421 WNDCLASSW wndClass;
2422
2423 ZeroMemory (&wndClass, sizeof(WNDCLASSW));
2426 wndClass.cbClsExtra = 0;
2427 wndClass.cbWndExtra = sizeof(TOOLTIPS_INFO *);
2428 wndClass.hCursor = LoadCursorW (0, (LPWSTR)IDC_ARROW);
2429 wndClass.hbrBackground = 0;
2430 wndClass.lpszClassName = TOOLTIPS_CLASSW;
2431
2432 RegisterClassW (&wndClass);
2433
2441}
2442
2443
2444VOID
2446{
2447 int i;
2448 for (i = TTI_INFO; i <= TTI_ERROR; i++)
2451}
static HDC hDC
Definition: 3dtext.c:33
Arabic default style
Definition: afstyles.h:94
static const char * wine_dbgstr_point(const POINT *ppt)
Definition: atltest.h:138
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
#define msg(x)
Definition: auth_time.c:54
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define ALTERNATE
Definition: constants.h:278
#define index(s, c)
Definition: various.h:29
HFONT hFont
Definition: main.c:53
#define ARRAY_SIZE(A)
Definition: main.h:33
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
#define FIXME(fmt,...)
Definition: debug.h:114
#define WARN(fmt,...)
Definition: debug.h:115
#define ERR(fmt,...)
Definition: debug.h:113
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
BOOL COMCTL32_IsReflectedMessage(UINT uMsg) DECLSPEC_HIDDEN
Definition: commctrl.c:1748
#define IDI_TT_WARN_SM
Definition: comctl32.h:107
#define IDI_TT_ERROR_SM
Definition: comctl32.h:108
VOID COMCTL32_RefreshSysColors(void) DECLSPEC_HIDDEN
Definition: commctrl.c:1586
INT Str_GetPtrAtoW(LPCSTR lpSrc, LPWSTR lpDest, INT nMaxLen) DECLSPEC_HIDDEN
#define IDI_TT_INFO_SM
Definition: comctl32.h:106
INT WINAPI Str_GetPtrW(LPCWSTR, LPWSTR, INT)
Definition: string.c:204
COMCTL32_SysColor comctl32_color
Definition: commctrl.c:82
HMODULE COMCTL32_hModule
Definition: commctrl.c:79
BOOL WINAPI SetWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uIDSubclass, DWORD_PTR dwRef)
Definition: commctrl.c:1261
BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uID)
Definition: commctrl.c:1390
LRESULT WINAPI DefSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: commctrl.c:1496
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
UINT uFlags
Definition: api.c:59
BOOL WINAPI Str_SetPtrW(LPWSTR *lppDest, LPCWSTR lpSrc)
Definition: string.c:236
#define BALLOON_TEXT_MARGIN
Definition: tooltips.c:162
static LRESULT TOOLTIPS_SetDelayTime(TOOLTIPS_INFO *infoPtr, DWORD duration, INT nTime)
Definition: tooltips.c:1591
#define MAX_TEXT_SIZE_A
Definition: tooltips.c:182
static void TOOLTIPS_Hide(TOOLTIPS_INFO *infoPtr)
Definition: tooltips.c:909
static LRESULT TOOLTIPS_SetTipBkColor(TOOLTIPS_INFO *infoPtr, COLORREF clrBk)
Definition: tooltips.c:1651
static INT TOOLTIPS_GetToolFromPoint(const TOOLTIPS_INFO *infoPtr, HWND hwnd, const POINT *lpPt)
Definition: tooltips.c:993
static LRESULT TOOLTIPS_Destroy(TOOLTIPS_INFO *infoPtr)
Definition: tooltips.c:1935
#define BALLOON_STEMHEIGHT
Definition: tooltips.c:172
static LRESULT TOOLTIPS_GetCurrentToolT(const TOOLTIPS_INFO *infoPtr, TTTOOLINFOW *ti, BOOL isW)
Definition: tooltips.c:1335
static LRESULT TOOLTIPS_UpdateTipTextT(TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
Definition: tooltips.c:1843
static UINT_PTR TOOLTIPS_GetTitleIconIndex(HICON hIcon)
Definition: tooltips.c:197
static LRESULT TOOLTIPS_DelToolT(TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
Definition: tooltips.c:1217
#define ID_TIMERSHOW
Definition: tooltips.c:153
static LRESULT TOOLTIPS_Update(TOOLTIPS_INFO *infoPtr)
Definition: tooltips.c:1833
#define TOOLTIPS_GetInfoPtr(hWindow)
Definition: tooltips.c:158
static void TOOLTIPS_CalcTipSize(const TOOLTIPS_INFO *infoPtr, LPSIZE lpSize)
Definition: tooltips.c:537
#define BALLOON_STEMWIDTH
Definition: tooltips.c:173
#define BALLOON_STEMINDENT
Definition: tooltips.c:174
static void TOOLTIPS_GetTipText(const TOOLTIPS_INFO *infoPtr, INT nTool, WCHAR *buffer)
Definition: tooltips.c:498
static LRESULT TOOLTIPS_GetToolCount(const TOOLTIPS_INFO *infoPtr)
Definition: tooltips.c:1441
static LRESULT TOOLTIPS_SetTipTextColor(TOOLTIPS_INFO *infoPtr, COLORREF clrText)
Definition: tooltips.c:1660
static void TOOLTIPS_Show(TOOLTIPS_INFO *infoPtr, BOOL track_activate)
Definition: tooltips.c:598
static LRESULT TOOLTIPS_AddToolT(TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
Definition: tooltips.c:1115
static LRESULT TOOLTIPS_WinIniChange(TOOLTIPS_INFO *infoPtr)
Definition: tooltips.c:2195
static LRESULT CALLBACK TOOLTIPS_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: tooltips.c:2239
static LRESULT TOOLTIPS_Activate(TOOLTIPS_INFO *infoPtr, BOOL activate)
Definition: tooltips.c:1101
static LRESULT TOOLTIPS_GetToolInfoT(const TOOLTIPS_INFO *infoPtr, TTTOOLINFOW *ti, BOOL isW)
Definition: tooltips.c:1448
static LRESULT TOOLTIPS_NotifyFormat(TOOLTIPS_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
Definition: tooltips.c:2034
#define ID_TIMERPOP
Definition: tooltips.c:154
static LRESULT TOOLTIPS_GetTextT(const TOOLTIPS_INFO *infoPtr, TTTOOLINFOW *ti, BOOL isW)
Definition: tooltips.c:1390
static LRESULT TOOLTIPS_TrackPosition(TOOLTIPS_INFO *infoPtr, LPARAM coord)
Definition: tooltips.c:1816
static LRESULT TOOLTIPS_GetTipTextColor(const TOOLTIPS_INFO *infoPtr)
Definition: tooltips.c:1434
static void TOOLTIPS_Refresh(const TOOLTIPS_INFO *infoPtr, HDC hdc)
Definition: tooltips.c:260
#define ICON_WIDTH
Definition: tooltips.c:180
static void TOOLTIPS_InitSystemSettings(TOOLTIPS_INFO *infoPtr)
Definition: tooltips.c:207
static LRESULT TOOLTIPS_GetTipBkColor(const TOOLTIPS_INFO *infoPtr)
Definition: tooltips.c:1427
static void TOOLTIPS_customdraw_fill(const TOOLTIPS_INFO *infoPtr, NMTTCUSTOMDRAW *lpnmttcd, HDC hdc, const RECT *rcBounds, UINT uFlags)
Definition: tooltips.c:226
static BOOL TOOLTIPS_IsCallbackString(LPCWSTR str, BOOL isW)
Definition: tooltips.c:188
static LRESULT TOOLTIPS_OnWMGetText(const TOOLTIPS_INFO *infoPtr, WPARAM size, LPWSTR pszText)
Definition: tooltips.c:2132
static LRESULT TOOLTIPS_GetTextLength(const TOOLTIPS_INFO *infoPtr)
Definition: tooltips.c:2115
static LRESULT TOOLTIPS_Pop(TOOLTIPS_INFO *infoPtr)
Definition: tooltips.c:1518
#define BALLOON_ROUNDEDNESS
Definition: tooltips.c:171
static LRESULT TOOLTIPS_Paint(const TOOLTIPS_INFO *infoPtr, HDC hDC)
Definition: tooltips.c:2072
#define NORMAL_TEXT_MARGIN
Definition: tooltips.c:161
static void TOOLTIPS_ResetSubclass(const TTTOOL_INFO *toolPtr)
Definition: tooltips.c:1208
#define ICON_HEIGHT
Definition: tooltips.c:179
VOID TOOLTIPS_Register(void)
Definition: tooltips.c:2419
static LRESULT TOOLTIPS_SetToolInfoT(TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
Definition: tooltips.c:1713
static BOOL TOOLTIPS_IsWindowActive(HWND hwnd)
Definition: tooltips.c:1053
static LRESULT TOOLTIPS_NewToolRectT(TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti)
Definition: tooltips.c:1497
static LRESULT TOOLTIPS_GetFont(const TOOLTIPS_INFO *infoPtr)
Definition: tooltips.c:1978
static LRESULT TOOLTIPS_SetFont(TOOLTIPS_INFO *infoPtr, HFONT hFont, BOOL redraw)
Definition: tooltips.c:2086
static INT TOOLTIPS_GetToolFromInfoT(const TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *lpToolInfo)
Definition: tooltips.c:966
static LRESULT TOOLTIPS_Timer(TOOLTIPS_INFO *infoPtr, INT iTimer)
Definition: tooltips.c:2146
static void TOOLTIPS_CopyInfoT(const TOOLTIPS_INFO *infoPtr, INT index, TTTOOLINFOW *ti, BOOL isW)
Definition: tooltips.c:1023
static void TOOLTIPS_TrackHide(const TOOLTIPS_INFO *infoPtr)
Definition: tooltips.c:942
static LRESULT TOOLTIPS_GetMargin(const TOOLTIPS_INFO *infoPtr, RECT *rect)
Definition: tooltips.c:1373
static INT TOOLTIPS_CheckTool(const TOOLTIPS_INFO *infoPtr, BOOL bShowTest)
Definition: tooltips.c:1065
static LRESULT TOOLTIPS_RelayEvent(TOOLTIPS_INFO *infoPtr, LPMSG lpMsg)
Definition: tooltips.c:1527
static LRESULT TOOLTIPS_NCHitTest(const TOOLTIPS_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
Definition: tooltips.c:2016
#define BALLOON_TITLE_TEXT_SPACING
Definition: tooltips.c:178
static DWORD TOOLTIPS_notify_customdraw(DWORD dwDrawStage, NMTTCUSTOMDRAW *lpnmttcd)
Definition: tooltips.c:243
static void TOOLTIPS_TrackShow(TOOLTIPS_INFO *infoPtr)
Definition: tooltips.c:935
static LRESULT TOOLTIPS_SetMaxTipWidth(TOOLTIPS_INFO *infoPtr, INT MaxWidth)
Definition: tooltips.c:1640
static LRESULT TOOLTIPS_HitTestT(const TOOLTIPS_INFO *infoPtr, LPTTHITTESTINFOW lptthit, BOOL isW)
Definition: tooltips.c:1474
static LRESULT TOOLTIPS_GetDelayTime(const TOOLTIPS_INFO *infoPtr, DWORD duration)
Definition: tooltips.c:1350
static LRESULT TOOLTIPS_EnumToolsT(const TOOLTIPS_INFO *infoPtr, UINT uIndex, TTTOOLINFOW *ti, BOOL isW)
Definition: tooltips.c:1297
static void TOOLTIPS_GetDispInfoW(const TOOLTIPS_INFO *infoPtr, TTTOOL_INFO *toolPtr, WCHAR *buffer)
Definition: tooltips.c:438
static HICON hTooltipIcons[TTI_ERROR+1]
Definition: tooltips.c:109
VOID TOOLTIPS_Unregister(void)
Definition: tooltips.c:2445
static LRESULT TOOLTIPS_SetMargin(TOOLTIPS_INFO *infoPtr, const RECT *rect)
Definition: tooltips.c:1630
static LRESULT TOOLTIPS_MouseMessage(TOOLTIPS_INFO *infoPtr)
Definition: tooltips.c:1985
static LRESULT TOOLTIPS_GetBubbleSize(const TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *lpToolInfo)
Definition: tooltips.c:1313
static LRESULT TOOLTIPS_NCCreate(HWND hwnd)
Definition: tooltips.c:1994
#define ID_TIMERLEAVE
Definition: tooltips.c:155
static LRESULT TOOLTIPS_GetMaxTipWidth(const TOOLTIPS_INFO *infoPtr)
Definition: tooltips.c:1383
static LRESULT CALLBACK TOOLTIPS_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uId, DWORD_PTR dwRef)
Definition: tooltips.c:2204
static void TOOLTIPS_GetDispInfoA(const TOOLTIPS_INFO *infoPtr, TTTOOL_INFO *toolPtr, WCHAR *buffer)
Definition: tooltips.c:380
#define BALLOON_ICON_TITLE_SPACING
Definition: tooltips.c:177
static LRESULT TOOLTIPS_Create(HWND hwnd)
Definition: tooltips.c:1905
static LRESULT TOOLTIPS_TrackActivate(TOOLTIPS_INFO *infoPtr, BOOL track_activate, const TTTOOLINFOA *ti)
Definition: tooltips.c:1785
static LRESULT TOOLTIPS_SetTitleT(TOOLTIPS_INFO *infoPtr, UINT_PTR uTitleIcon, LPCWSTR pszTitle, BOOL isW)
Definition: tooltips.c:1669
#define CP_ACP
Definition: compat.h:109
HANDLE HWND
Definition: compat.h:19
#define CALLBACK
Definition: compat.h:35
#define WideCharToMultiByte
Definition: compat.h:111
#define MultiByteToWideChar
Definition: compat.h:110
#define lstrcpynW
Definition: compat.h:738
#define lstrlenW
Definition: compat.h:750
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
#define pt(x, y)
Definition: drawing.c:79
#define WM_APP
Definition: eventvwr.h:73
#define abs(i)
Definition: fconv.c:206
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
pKey DeleteObject()
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLsizeiptr size
Definition: glext.h:5919
GLuint res
Definition: glext.h:9613
GLuint buffer
Definition: glext.h:5915
GLuint coord
Definition: glext.h:9511
GLuint index
Definition: glext.h:6031
GLenum GLsizei len
Definition: glext.h:6722
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 i
Definition: glfuncs.h:248
char hdr[14]
Definition: iptest.cpp:33
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
if(dx< 0)
Definition: linetemp.h:194
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
struct task_struct * current
Definition: linux.c:32
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:92
static HICON
Definition: imagelist.c:84
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static HRGN hRgn
Definition: mapping.c:33
#define min(a, b)
Definition: monoChain.cc:55
HICON hIcon
Definition: msconfig.c:44
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
HMONITOR WINAPI MonitorFromRect(LPCRECT, DWORD)
unsigned int UINT
Definition: ndis.h:50
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
#define WS_BORDER
Definition: pedump.c:625
#define WS_POPUP
Definition: pedump.c:616
#define WS_DLGFRAME
Definition: pedump.c:626
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define INT
Definition: polytest.cpp:20
static char title[]
Definition: ps.c:92
#define TTM_SETDELAYTIME
Definition: commctrl.h:1785
#define TTM_NEWTOOLRECTA
Definition: commctrl.h:1790
#define TTM_ACTIVATE
Definition: commctrl.h:1784
#define TTN_GETDISPINFOA
Definition: commctrl.h:1872
#define TTDT_RESHOW
Definition: commctrl.h:1775
#define TTM_GETMAXTIPWIDTH
Definition: commctrl.h:1820
#define TTN_POP
Definition: commctrl.h:1875
#define TTN_SHOW
Definition: commctrl.h:1874
#define TTM_SETTOOLINFOA
Definition: commctrl.h:1797
#define TTN_GETDISPINFOW
Definition: commctrl.h:1873
#define LPSTR_TEXTCALLBACKW
Definition: commctrl.h:2380
#define TTM_GETCURRENTTOOLW
Definition: commctrl.h:1810
#define TTM_GETTIPTEXTCOLOR
Definition: commctrl.h:1818
#define TTM_RELAYEVENT
Definition: commctrl.h:1792
#define TTM_DELTOOLA
Definition: commctrl.h:1788
#define LPTOOLINFOW
Definition: commctrl.h:1713
#define TTDT_AUTOPOP
Definition: commctrl.h:1776
#define LPSTR_TEXTCALLBACKA
Definition: commctrl.h:2381
#define TTM_DELTOOLW
Definition: commctrl.h:1789
#define TTM_GETMARGIN
Definition: commctrl.h:1822
#define TTM_GETTOOLINFOA
Definition: commctrl.h:1794
#define TTF_DI_SETITEM
Definition: commctrl.h:1772
#define TTM_GETTEXTW
Definition: commctrl.h:1803
#define TOOLTIPS_CLASSW
Definition: commctrl.h:1707
#define TTTOOLINFOW_V1_SIZE
Definition: commctrl.h:1721
#define TTM_GETDELAYTIME
Definition: commctrl.h:1816
#define TTM_POP
Definition: commctrl.h:1823
#define TTM_ADDTOOLA
Definition: commctrl.h:1786
#define CDRF_NOTIFYPOSTPAINT
Definition: commctrl.h:274
#define TTDT_AUTOMATIC
Definition: commctrl.h:1774
#define TTI_NONE
Definition: commctrl.h:1779
#define TTM_ENUMTOOLSA
Definition: commctrl.h:1807
#define TTTOOLINFOW_V3_SIZE
Definition: commctrl.h:1725
#define TTM_NEWTOOLRECTW
Definition: commctrl.h:1791
#define INFOTIPSIZE
Definition: commctrl.h:124
#define TTM_SETTITLEW
Definition: commctrl.h:1828
#define NM_CUSTOMDRAW
Definition: commctrl.h:137
#define TTM_ENUMTOOLSW
Definition: commctrl.h:1808
#define TTM_TRACKPOSITION
Definition: commctrl.h:1813
#define TTF_IDISHWND
Definition: commctrl.h:1764
#define TTM_UPDATE
Definition: commctrl.h:1824
#define TTF_SUBCLASS
Definition: commctrl.h:1767
#define TTM_GETTOOLCOUNT
Definition: commctrl.h:1806
#define TTM_ADDTOOLW
Definition: commctrl.h:1787
#define TTF_CENTERTIP
Definition: commctrl.h:1765
#define TTS_ALWAYSTIP
Definition: commctrl.h:1757
#define TTM_WINDOWFROMPOINT
Definition: commctrl.h:1811
#define TTM_UPDATETIPTEXTA
Definition: commctrl.h:1804
#define TTI_INFO
Definition: commctrl.h:1780
#define TTM_GETCURRENTTOOLA
Definition: commctrl.h:1809
#define TTM_GETTIPBKCOLOR
Definition: commctrl.h:1817
#define TTM_SETMARGIN
Definition: commctrl.h:1821
#define TTF_TRANSPARENT
Definition: commctrl.h:1770
#define CDDS_PREPAINT
Definition: commctrl.h:280
#define TTM_UPDATETIPTEXTW
Definition: commctrl.h:1805
#define TTF_ABSOLUTE
Definition: commctrl.h:1769
#define TTM_SETTIPBKCOLOR
Definition: commctrl.h:1814
#define TTM_SETTOOLINFOW
Definition: commctrl.h:1798
#define TTM_SETTITLEA
Definition: commctrl.h:1827
#define TTM_SETTIPTEXTCOLOR
Definition: commctrl.h:1815
#define CDDS_POSTPAINT
Definition: commctrl.h:281
#define TTS_NOPREFIX
Definition: commctrl.h:1758
#define TTI_ERROR
Definition: commctrl.h:1782
#define TTM_HITTESTA
Definition: commctrl.h:1800
#define TTF_TRACK
Definition: commctrl.h:1768
#define TTM_TRACKACTIVATE
Definition: commctrl.h:1812
#define TTM_GETTOOLINFOW
Definition: commctrl.h:1795
#define TTI_WARNING
Definition: commctrl.h:1781
#define TTM_GETBUBBLESIZE
Definition: commctrl.h:1825
#define TTM_GETTEXTA
Definition: commctrl.h:1802
#define TTTOOLINFOA_V1_SIZE
Definition: commctrl.h:1720
#define TTDT_INITIAL
Definition: commctrl.h:1777
#define TTTOOLINFOW_V2_SIZE
Definition: commctrl.h:1723
#define TTM_SETMAXTIPWIDTH
Definition: commctrl.h:1819
#define TTS_BALLOON
Definition: commctrl.h:1761
#define TTM_HITTESTW
Definition: commctrl.h:1801
void redraw(int x, int y, int cx, int cy)
Definition: qtewin.cpp:1248
#define strchrW(s, c)
Definition: unicode.h:40
#define strlenW(s)
Definition: unicode.h:34
#define strcpyW(d, s)
Definition: unicode.h:35
#define WM_PRINTCLIENT
Definition: richedit.h:70
#define WM_NOTIFY
Definition: richedit.h:61
const WCHAR * str
#define TRACE(s)
Definition: solgame.cpp:4
& rect
Definition: startmenu.cpp:1413
COLORREF clrInfoText
Definition: comctl32.h:181
COLORREF clrInfoBk
Definition: comctl32.h:180
LONG lfWeight
Definition: dimm.idl:63
INT nMaxTipWidth
Definition: tooltips.c:138
INT nReshowTime
Definition: tooltips.c:142
INT nTrackTool
Definition: tooltips.c:141
HICON hTitleIcon
Definition: tooltips.c:148
COLORREF clrBk
Definition: tooltips.c:132
BOOL bActive
Definition: tooltips.c:129
BOOL bToolBelow
Definition: tooltips.c:146
UINT uNumTools
Definition: tooltips.c:131
HFONT hFont
Definition: tooltips.c:134
INT nAutoPopTime
Definition: tooltips.c:143
RECT rcMargin
Definition: tooltips.c:145
INT nCurrentTool
Definition: tooltips.c:140
INT nInitialTime
Definition: tooltips.c:144
HWND hwndSelf
Definition: tooltips.c:127
TTTOOL_INFO * tools
Definition: tooltips.c:150
COLORREF clrText
Definition: tooltips.c:133
LPWSTR pszTitle
Definition: tooltips.c:147
HFONT hTitleFont
Definition: tooltips.c:135
BOOL bTrackActive
Definition: tooltips.c:130
WCHAR szTipText[INFOTIPSIZE]
Definition: tooltips.c:128
UINT_PTR uId
Definition: tooltips.c:117
UINT uFlags
Definition: tooltips.c:113
UINT uInternalFlags
Definition: tooltips.c:114
BOOL bNotifyUnicode
Definition: tooltips.c:116
HINSTANCE hinst
Definition: tooltips.c:119
RECT rect
Definition: tooltips.c:118
LPARAM lParam
Definition: tooltips.c:121
LPWSTR lpszText
Definition: tooltips.c:120
HWND hwnd
Definition: tooltips.c:115
TTTOOLINFOW ti
Definition: commctrl.h:1866
LPCWSTR lpszClassName
Definition: winuser.h:3185
HBRUSH hbrBackground
Definition: winuser.h:3183
int cbClsExtra
Definition: winuser.h:3178
UINT style
Definition: winuser.h:3176
WNDPROC lpfnWndProc
Definition: winuser.h:3177
int cbWndExtra
Definition: winuser.h:3179
HCURSOR hCursor
Definition: winuser.h:3182
Definition: tftpd.h:60
RECT rcMonitor
Definition: winuser.h:3785
DWORD cbSize
Definition: winuser.h:3784
UINT message
Definition: winuser.h:3115
HWND hwnd
Definition: winuser.h:3114
LPARAM lParam
Definition: winuser.h:3117
UINT_PTR idFrom
Definition: winuser.h:3158
UINT code
Definition: winuser.h:3159
HWND hwndFrom
Definition: winuser.h:3157
NMCUSTOMDRAW nmcd
Definition: commctrl.h:313
char szText[80]
Definition: commctrl.h:1898
HINSTANCE hinst
Definition: commctrl.h:1899
HINSTANCE hinst
Definition: commctrl.h:1908
WCHAR szText[80]
Definition: commctrl.h:1907
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
LONG cx
Definition: windef.h:334
LONG cy
Definition: windef.h:335
HINSTANCE hinst
Definition: commctrl.h:1745
UINT_PTR uId
Definition: commctrl.h:1743
LPARAM lParam
Definition: commctrl.h:1747
LPWSTR lpszText
Definition: commctrl.h:1746
#define max(a, b)
Definition: svc.c:63
else
Definition: tritemp.h:161
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
uint32_t DWORD_PTR
Definition: typedefs.h:65
int32_t INT
Definition: typedefs.h:58
#define HIWORD(l)
Definition: typedefs.h:247
static const WCHAR isW[]
Definition: lex.c:62
#define ZeroMemory
Definition: winbase.h:1712
_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
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI FrameRgn(_In_ HDC, _In_ HRGN, _In_ HBRUSH, _In_ int, _In_ int)
#define FW_BOLD
Definition: wingdi.h:378
HRGN WINAPI CreatePolygonRgn(_In_reads_(cPoint) const POINT *pptl, _In_ int cPoint, _In_ int iMode)
HRGN WINAPI CreateRoundRectRgn(_In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
#define DI_NORMAL
Definition: wingdi.h:72
int WINAPI CombineRgn(_In_opt_ HRGN hrgnDest, _In_opt_ HRGN hrgnSrc1, _In_opt_ HRGN hrgnSrc2, _In_ int fnCombineMode)
#define TRANSPARENT
Definition: wingdi.h:950
#define RGN_OR
Definition: wingdi.h:359
int WINAPI FillRgn(_In_ HDC, _In_ HRGN, _In_ HBRUSH)
Definition: painting.c:183
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:918
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
#define WM_PAINT
Definition: winuser.h:1620
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_ERASEBKGND
Definition: winuser.h:1625
HWND WINAPI GetActiveWindow(void)
Definition: winpos.c:138
#define WM_GETTEXTLENGTH
Definition: winuser.h:1619
#define SWP_NOACTIVATE
Definition: winuser.h:1242
#define DT_NOPREFIX
Definition: winuser.h:537
#define SM_CYEDGE
Definition: winuser.h:1009
#define DT_EXTERNALLEADING
Definition: winuser.h:533
#define COLOR_WINDOWFRAME
Definition: winuser.h:919
#define SM_CYSCREEN
Definition: winuser.h:960
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HWND_TOPMOST
Definition: winuser.h:1208
#define SM_CXEDGE
Definition: winuser.h:1008
#define IMAGE_ICON
Definition: winuser.h:212
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CREATE
Definition: winuser.h:1608
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
int WINAPI GetWindowRgn(_In_ HWND, _In_ HRGN)
int WINAPI SetWindowRgn(_In_ HWND, _In_opt_ HRGN, _In_ BOOL)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define DT_SINGLELINE
Definition: winuser.h:540
HICON WINAPI CopyIcon(_In_ HICON)
Definition: cursoricon.c:2042
#define SWP_NOMOVE
Definition: winuser.h:1244
#define WM_WININICHANGE
Definition: winuser.h:1630
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2234
#define IDC_ARROW
Definition: winuser.h:687
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2701
#define WM_NCHITTEST
Definition: winuser.h:1686
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
#define WM_RBUTTONUP
Definition: winuser.h:1780
BOOL WINAPI AdjustWindowRectEx(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL, _In_ DWORD)
#define SWP_NOSIZE
Definition: winuser.h:1245
#define WM_MOUSEMOVE
Definition: winuser.h:1775
#define WM_GETTEXT
Definition: winuser.h:1618
#define CS_DBLCLKS
Definition: winuser.h:651
#define WM_LBUTTONDOWN
Definition: winuser.h:1776
#define NF_REQUERY
Definition: winuser.h:2461
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1626
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2136
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
#define WM_GETFONT
Definition: winuser.h:1651
UINT WINAPI GetDoubleClickTime(void)
Definition: ntwrapper.h:314
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define WM_NCCREATE
Definition: winuser.h:1683
#define WM_RBUTTONDOWN
Definition: winuser.h:1779
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define HWND_TOP
Definition: winuser.h:1207
#define MAKELRESULT(l, h)
Definition: winuser.h:4010
BOOL WINAPI IsChild(_In_ HWND, _In_ HWND)
#define WM_SETFONT
Definition: winuser.h:1650
#define WM_TIMER
Definition: winuser.h:1742
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define DT_WORDBREAK
Definition: winuser.h:544
BOOL WINAPI DrawIconEx(_In_ HDC, _In_ int, _In_ int, _In_ HICON, _In_ int, _In_ int, _In_ UINT, _In_opt_ HBRUSH, _In_ UINT)
Definition: cursoricon.c:2059
BOOL WINAPI UpdateWindow(_In_ HWND)
#define SWP_SHOWWINDOW
Definition: winuser.h:1248
HDC WINAPI GetDC(_In_opt_ HWND)
#define SM_CXDLGFRAME
Definition: winuser.h:966
#define WM_LBUTTONUP
Definition: winuser.h:1777
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
HWND WINAPI GetParent(_In_ HWND)
#define DT_BOTTOM
Definition: winuser.h:525
#define CS_GLOBALCLASS
Definition: winuser.h:652
#define NFR_ANSI
Definition: winuser.h:2458
#define SWP_HIDEWINDOW
Definition: winuser.h:1241
#define WM_NCDESTROY
Definition: winuser.h:1684
#define CS_SAVEBITS
Definition: winuser.h:657
#define HTTRANSPARENT
Definition: winuser.h:2473
HWND WINAPI WindowFromPoint(_In_ POINT)
#define WM_USER
Definition: winuser.h:1895
#define SM_CYDLGFRAME
Definition: winuser.h:968
#define WM_DESTROY
Definition: winuser.h:1609
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
BOOL WINAPI GetMonitorInfoW(_In_ HMONITOR, _Inout_ LPMONITORINFO)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define SWP_NOZORDER
Definition: winuser.h:1247
#define DT_EXPANDTABS
Definition: winuser.h:532
#define DT_CALCRECT
Definition: winuser.h:526
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define SetWindowLongPtrW
Definition: winuser.h:5355
#define NFR_UNICODE
Definition: winuser.h:2459
#define WM_MBUTTONUP
Definition: winuser.h:1783
#define GWL_STYLE
Definition: winuser.h:852
#define MAKEINTRESOURCE
Definition: winuser.h:591
int WINAPI GetSystemMetrics(_In_ int)
#define NF_QUERY
Definition: winuser.h:2460
#define WM_MBUTTONDOWN
Definition: winuser.h:1782
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define GWL_EXSTYLE
Definition: winuser.h:851
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2084
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
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185