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