[KERNEL32]
[reactos.git] / reactos / dll / win32 / user32 / windows / input.c
1 /*
2 * ReactOS kernel
3 * Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19 /*
20 * PROJECT: ReactOS user32.dll
21 * FILE: dll/win32/user32/windows/input.c
22 * PURPOSE: Input
23 * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
24 * UPDATE HISTORY:
25 * 09-05-2001 CSH Created
26 */
27
28 /* INCLUDES ******************************************************************/
29
30 #include <user32.h>
31
32 #include <wine/debug.h>
33 WINE_DEFAULT_DEBUG_CHANNEL(user32);
34
35 /* GLOBALS *******************************************************************/
36
37
38
39 /* FUNCTIONS *****************************************************************/
40
41
42 /*
43 * @implemented
44 */
45 BOOL
46 WINAPI
47 DragDetect(
48 HWND hWnd,
49 POINT pt)
50 {
51 #if 0
52 return NtUserDragDetect(hWnd, pt);
53 #else
54 MSG msg;
55 RECT rect;
56 POINT tmp;
57 ULONG dx = GetSystemMetrics(SM_CXDRAG);
58 ULONG dy = GetSystemMetrics(SM_CYDRAG);
59
60 rect.left = pt.x - dx;
61 rect.right = pt.x + dx;
62 rect.top = pt.y - dy;
63 rect.bottom = pt.y + dy;
64
65 SetCapture(hWnd);
66
67 for (;;)
68 {
69 while (
70 PeekMessageW(&msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE) ||
71 PeekMessageW(&msg, 0, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)
72 )
73 {
74 if (msg.message == WM_LBUTTONUP)
75 {
76 ReleaseCapture();
77 return FALSE;
78 }
79 if (msg.message == WM_MOUSEMOVE)
80 {
81 tmp.x = LOWORD(msg.lParam);
82 tmp.y = HIWORD(msg.lParam);
83 if (!PtInRect(&rect, tmp))
84 {
85 ReleaseCapture();
86 return TRUE;
87 }
88 }
89 if (msg.message == WM_KEYDOWN)
90 {
91 if (msg.wParam == VK_ESCAPE)
92 {
93 ReleaseCapture();
94 return TRUE;
95 }
96 }
97 }
98 WaitMessage();
99 }
100 return 0;
101 #endif
102 }
103
104
105 /*
106 * @implemented
107 */
108 BOOL WINAPI
109 EnableWindow(HWND hWnd,
110 BOOL bEnable)
111 {
112 // This will soon be moved to win32k.
113 BOOL Update;
114 LONG Style = GetWindowLongPtrW(hWnd, GWL_STYLE);
115 /* check if updating is needed */
116 UINT bIsDisabled = (Style & WS_DISABLED);
117 Update = bIsDisabled;
118
119 if (bEnable)
120 {
121 Style &= ~WS_DISABLED;
122 }
123 else
124 {
125 Update = !bIsDisabled;
126
127 SendMessageW( hWnd, WM_CANCELMODE, 0, 0);
128
129 /* Remove keyboard focus from that window if it had focus */
130 if (hWnd == GetFocus())
131 {
132 SetFocus(NULL);
133 }
134 Style |= WS_DISABLED;
135 }
136
137 NtUserSetWindowLong(hWnd, GWL_STYLE, Style, FALSE);
138
139 if (Update)
140 {
141 SendMessageW(hWnd, WM_ENABLE, (LPARAM)bEnable, 0);
142 }
143 // Return nonzero if it was disabled, or zero if it wasn't:
144 return bIsDisabled;
145 }
146
147
148 /*
149 * @implemented
150 */
151 SHORT WINAPI
152 GetAsyncKeyState(int vKey)
153 {
154 if (vKey < 0 || vKey > 256)
155 return 0;
156 return (SHORT) NtUserGetAsyncKeyState((DWORD) vKey);
157 }
158
159
160 /*
161 * @implemented
162 */
163 HKL WINAPI
164 GetKeyboardLayout(DWORD idThread)
165 {
166 return (HKL)NtUserCallOneParam((DWORD_PTR) idThread, ONEPARAM_ROUTINE_GETKEYBOARDLAYOUT);
167 }
168
169
170 /*
171 * @implemented
172 */
173 UINT WINAPI
174 GetKBCodePage(VOID)
175 {
176 return GetOEMCP();
177 }
178
179
180 /*
181 * @implemented
182 */
183 int WINAPI
184 GetKeyNameTextA(LONG lParam,
185 LPSTR lpString,
186 int nSize)
187 {
188 LPWSTR intermediateString =
189 HeapAlloc(GetProcessHeap(),0,nSize * sizeof(WCHAR));
190 int ret = 0;
191 UINT wstrLen = 0;
192 BOOL defChar = FALSE;
193
194 if( !intermediateString ) return 0;
195 ret = GetKeyNameTextW(lParam,intermediateString,nSize);
196 if( ret == 0 ) { lpString[0] = 0; return 0; }
197
198 wstrLen = wcslen( intermediateString );
199 ret = WideCharToMultiByte(CP_ACP, 0,
200 intermediateString, wstrLen,
201 lpString, nSize, ".", &defChar );
202 lpString[ret] = 0;
203 HeapFree(GetProcessHeap(),0,intermediateString);
204
205 return ret;
206 }
207
208 /*
209 * @implemented
210 */
211 int WINAPI
212 GetKeyNameTextW(LONG lParam,
213 LPWSTR lpString,
214 int nSize)
215 {
216 return NtUserGetKeyNameText( lParam, lpString, nSize );
217 }
218
219
220 /*
221 * @implemented
222 */
223 SHORT WINAPI
224 GetKeyState(int nVirtKey)
225 {
226 return (SHORT) NtUserGetKeyState((DWORD) nVirtKey);
227 }
228
229
230 /*
231 * @implemented
232 */
233 BOOL WINAPI
234 GetKeyboardLayoutNameA(LPSTR pwszKLID)
235 {
236 WCHAR buf[KL_NAMELENGTH];
237
238 if (GetKeyboardLayoutNameW(buf))
239 return WideCharToMultiByte( CP_ACP, 0, buf, -1, pwszKLID, KL_NAMELENGTH, NULL, NULL ) != 0;
240 return FALSE;
241 }
242
243
244 /*
245 * @implemented
246 */
247 BOOL WINAPI
248 GetKeyboardLayoutNameW(LPWSTR pwszKLID)
249 {
250 return NtUserGetKeyboardLayoutName( pwszKLID );
251 }
252
253
254 /*
255 * @implemented
256 */
257 int WINAPI
258 GetKeyboardType(int nTypeFlag)
259 {
260 return (int)NtUserCallOneParam((DWORD_PTR) nTypeFlag, ONEPARAM_ROUTINE_GETKEYBOARDTYPE);
261 }
262
263
264 /*
265 * @implemented
266 */
267 BOOL WINAPI
268 GetLastInputInfo(PLASTINPUTINFO plii)
269 {
270 return NtUserGetLastInputInfo(plii);
271 }
272
273
274 /*
275 * @implemented
276 */
277 HKL WINAPI
278 LoadKeyboardLayoutA(LPCSTR pwszKLID,
279 UINT Flags)
280 {
281 return NtUserLoadKeyboardLayoutEx( NULL, 0, NULL, NULL, NULL,
282 strtoul(pwszKLID, NULL, 16),
283 Flags);
284 }
285
286
287 /*
288 * @implemented
289 */
290 HKL WINAPI
291 LoadKeyboardLayoutW(LPCWSTR pwszKLID,
292 UINT Flags)
293 {
294 // Look at revision 25596 to see how it's done in windows.
295 // We will do things our own way. Also be compatible too!
296 return NtUserLoadKeyboardLayoutEx( NULL, 0, NULL, NULL, NULL,
297 wcstoul(pwszKLID, NULL, 16),
298 Flags);
299 }
300
301
302 /*
303 * @implemented
304 */
305 UINT WINAPI
306 MapVirtualKeyA(UINT uCode,
307 UINT uMapType)
308 {
309 return MapVirtualKeyExA( uCode, uMapType, GetKeyboardLayout( 0 ) );
310 }
311
312
313 /*
314 * @implemented
315 */
316 UINT WINAPI
317 MapVirtualKeyExA(UINT uCode,
318 UINT uMapType,
319 HKL dwhkl)
320 {
321 return MapVirtualKeyExW( uCode, uMapType, dwhkl );
322 }
323
324
325 /*
326 * @implemented
327 */
328 UINT WINAPI
329 MapVirtualKeyExW(UINT uCode,
330 UINT uMapType,
331 HKL dwhkl)
332 {
333 return NtUserMapVirtualKeyEx( uCode, uMapType, 0, dwhkl );
334 }
335
336
337 /*
338 * @implemented
339 */
340 UINT WINAPI
341 MapVirtualKeyW(UINT uCode,
342 UINT uMapType)
343 {
344 return MapVirtualKeyExW( uCode, uMapType, GetKeyboardLayout( 0 ) );
345 }
346
347
348 /*
349 * @implemented
350 */
351 DWORD WINAPI
352 OemKeyScan(WORD wOemChar)
353 {
354 WCHAR p;
355 SHORT Vk;
356 UINT Scan;
357
358 MultiByteToWideChar(CP_OEMCP, 0, (PCSTR)&wOemChar, 1, &p, 1);
359 Vk = VkKeyScanW(p);
360 Scan = MapVirtualKeyW((Vk & 0x00ff), 0);
361 if(!Scan) return -1;
362 /*
363 Page 450-1, MS W2k SuperBible by SAMS. Return, low word has the
364 scan code and high word has the shift state.
365 */
366 return ((Vk & 0xff00) << 8) | Scan;
367 }
368
369
370 /*
371 * @implemented
372 */
373 BOOL WINAPI
374 SetDoubleClickTime(UINT uInterval)
375 {
376 return (BOOL)NtUserSystemParametersInfo(SPI_SETDOUBLECLICKTIME,
377 uInterval,
378 NULL,
379 0);
380 }
381
382
383 /*
384 * @implemented
385 */
386 BOOL
387 WINAPI
388 SwapMouseButton(
389 BOOL fSwap)
390 {
391 return NtUserSwapMouseButton(fSwap);
392 }
393
394
395 /*
396 * @implemented
397 */
398 int WINAPI
399 ToAscii(UINT uVirtKey,
400 UINT uScanCode,
401 CONST PBYTE lpKeyState,
402 LPWORD lpChar,
403 UINT uFlags)
404 {
405 return ToAsciiEx(uVirtKey, uScanCode, lpKeyState, lpChar, uFlags, 0);
406 }
407
408
409 /*
410 * @implemented
411 */
412 int WINAPI
413 ToAsciiEx(UINT uVirtKey,
414 UINT uScanCode,
415 CONST PBYTE lpKeyState,
416 LPWORD lpChar,
417 UINT uFlags,
418 HKL dwhkl)
419 {
420 WCHAR UniChars[2];
421 int Ret, CharCount;
422
423 Ret = ToUnicodeEx(uVirtKey, uScanCode, lpKeyState, UniChars, 2, uFlags, dwhkl);
424 CharCount = (Ret < 0 ? 1 : Ret);
425 WideCharToMultiByte(CP_ACP, 0, UniChars, CharCount, (LPSTR) lpChar, 2, NULL, NULL);
426
427 return Ret;
428 }
429
430
431 /*
432 * @implemented
433 */
434 int WINAPI
435 ToUnicode(UINT wVirtKey,
436 UINT wScanCode,
437 CONST PBYTE lpKeyState,
438 LPWSTR pwszBuff,
439 int cchBuff,
440 UINT wFlags)
441 {
442 return ToUnicodeEx( wVirtKey, wScanCode, lpKeyState, pwszBuff, cchBuff,
443 wFlags, 0 );
444 }
445
446
447 /*
448 * @implemented
449 */
450 int WINAPI
451 ToUnicodeEx(UINT wVirtKey,
452 UINT wScanCode,
453 CONST PBYTE lpKeyState,
454 LPWSTR pwszBuff,
455 int cchBuff,
456 UINT wFlags,
457 HKL dwhkl)
458 {
459 return NtUserToUnicodeEx( wVirtKey, wScanCode, lpKeyState, pwszBuff, cchBuff,
460 wFlags, dwhkl );
461 }
462
463
464
465 /*
466 * @implemented
467 */
468 SHORT WINAPI
469 VkKeyScanA(CHAR ch)
470 {
471 WCHAR wChar;
472
473 if (IsDBCSLeadByte(ch)) return -1;
474
475 MultiByteToWideChar(CP_ACP, 0, &ch, 1, &wChar, 1);
476 return VkKeyScanW(wChar);
477 }
478
479
480 /*
481 * @implemented
482 */
483 SHORT WINAPI
484 VkKeyScanExA(CHAR ch,
485 HKL dwhkl)
486 {
487 WCHAR wChar;
488
489 if (IsDBCSLeadByte(ch)) return -1;
490
491 MultiByteToWideChar(CP_ACP, 0, &ch, 1, &wChar, 1);
492 return VkKeyScanExW(wChar, dwhkl);
493 }
494
495
496 /*
497 * @implemented
498 */
499 SHORT WINAPI
500 VkKeyScanExW(WCHAR ch,
501 HKL dwhkl)
502 {
503 return (SHORT) NtUserVkKeyScanEx(ch, dwhkl, TRUE);
504 }
505
506
507 /*
508 * @implemented
509 */
510 SHORT WINAPI
511 VkKeyScanW(WCHAR ch)
512 {
513 return (SHORT) NtUserVkKeyScanEx(ch, 0, FALSE);
514 }
515
516
517 /*
518 * @implemented
519 */
520 VOID
521 WINAPI
522 keybd_event(
523 BYTE bVk,
524 BYTE bScan,
525 DWORD dwFlags,
526 ULONG_PTR dwExtraInfo)
527
528
529 {
530 INPUT Input;
531
532 Input.type = INPUT_KEYBOARD;
533 Input.ki.wVk = bVk;
534 Input.ki.wScan = bScan;
535 Input.ki.dwFlags = dwFlags;
536 Input.ki.time = 0;
537 Input.ki.dwExtraInfo = dwExtraInfo;
538
539 NtUserSendInput(1, &Input, sizeof(INPUT));
540 }
541
542
543 /*
544 * @implemented
545 */
546 VOID
547 WINAPI
548 mouse_event(
549 DWORD dwFlags,
550 DWORD dx,
551 DWORD dy,
552 DWORD dwData,
553 ULONG_PTR dwExtraInfo)
554 {
555 INPUT Input;
556
557 Input.type = INPUT_MOUSE;
558 Input.mi.dx = dx;
559 Input.mi.dy = dy;
560 Input.mi.mouseData = dwData;
561 Input.mi.dwFlags = dwFlags;
562 Input.mi.time = 0;
563 Input.mi.dwExtraInfo = dwExtraInfo;
564
565 NtUserSendInput(1, &Input, sizeof(INPUT));
566 }
567
568
569 /***********************************************************************
570 * get_key_state
571 */
572 static WORD get_key_state(void)
573 {
574 WORD ret = 0;
575
576 if (GetSystemMetrics( SM_SWAPBUTTON ))
577 {
578 if (GetAsyncKeyState(VK_RBUTTON) & 0x80) ret |= MK_LBUTTON;
579 if (GetAsyncKeyState(VK_LBUTTON) & 0x80) ret |= MK_RBUTTON;
580 }
581 else
582 {
583 if (GetAsyncKeyState(VK_LBUTTON) & 0x80) ret |= MK_LBUTTON;
584 if (GetAsyncKeyState(VK_RBUTTON) & 0x80) ret |= MK_RBUTTON;
585 }
586 if (GetAsyncKeyState(VK_MBUTTON) & 0x80) ret |= MK_MBUTTON;
587 if (GetAsyncKeyState(VK_SHIFT) & 0x80) ret |= MK_SHIFT;
588 if (GetAsyncKeyState(VK_CONTROL) & 0x80) ret |= MK_CONTROL;
589 if (GetAsyncKeyState(VK_XBUTTON1) & 0x80) ret |= MK_XBUTTON1;
590 if (GetAsyncKeyState(VK_XBUTTON2) & 0x80) ret |= MK_XBUTTON2;
591 return ret;
592 }
593
594 static void CALLBACK TrackMouseEventProc(HWND hwndUnused, UINT uMsg, UINT_PTR idEvent,
595 DWORD dwTime)
596 {
597 POINT pos;
598 POINT posClient;
599 HWND hwnd;
600 INT hoverwidth = 0, hoverheight = 0;
601 RECT client;
602 PUSER32_TRACKINGLIST ptracking_info;
603
604 ptracking_info = & User32GetThreadData()->tracking_info;
605
606 GetCursorPos(&pos);
607 hwnd = WindowFromPoint(pos);
608
609 SystemParametersInfoW(SPI_GETMOUSEHOVERWIDTH, 0, &hoverwidth, 0);
610 SystemParametersInfoW(SPI_GETMOUSEHOVERHEIGHT, 0, &hoverheight, 0);
611
612 /* see if this tracking event is looking for TME_LEAVE and that the */
613 /* mouse has left the window */
614 if (ptracking_info->tme.dwFlags & TME_LEAVE)
615 {
616 if (ptracking_info->tme.hwndTrack != hwnd)
617 {
618 if (ptracking_info->tme.dwFlags & TME_NONCLIENT)
619 {
620 PostMessageW(ptracking_info->tme.hwndTrack, WM_NCMOUSELEAVE, 0, 0);
621 }
622 else
623 {
624 PostMessageW(ptracking_info->tme.hwndTrack, WM_MOUSELEAVE, 0, 0);
625 }
626
627 /* remove the TME_LEAVE flag */
628 ptracking_info->tme.dwFlags &= ~TME_LEAVE;
629 }
630 else
631 {
632 GetClientRect(hwnd, &client);
633 MapWindowPoints(hwnd, NULL, (LPPOINT)&client, 2);
634 if (PtInRect(&client, pos))
635 {
636 if (ptracking_info->tme.dwFlags & TME_NONCLIENT)
637 {
638 PostMessageW(ptracking_info->tme.hwndTrack, WM_NCMOUSELEAVE, 0, 0);
639 /* remove the TME_LEAVE flag */
640 ptracking_info->tme.dwFlags &= ~TME_LEAVE;
641 }
642 }
643 else
644 {
645 if (!(ptracking_info->tme.dwFlags & TME_NONCLIENT))
646 {
647 PostMessageW(ptracking_info->tme.hwndTrack, WM_MOUSELEAVE, 0, 0);
648 /* remove the TME_LEAVE flag */
649 ptracking_info->tme.dwFlags &= ~TME_LEAVE;
650 }
651 }
652 }
653 }
654
655 /* see if we are tracking hovering for this hwnd */
656 if (ptracking_info->tme.dwFlags & TME_HOVER)
657 {
658 /* has the cursor moved outside the rectangle centered around pos? */
659 if ((abs(pos.x - ptracking_info->pos.x) > (hoverwidth / 2.0)) ||
660 (abs(pos.y - ptracking_info->pos.y) > (hoverheight / 2.0)))
661 {
662 /* record this new position as the current position and reset */
663 /* the iHoverTime variable to 0 */
664 ptracking_info->pos = pos;
665 }
666 else
667 {
668 posClient.x = pos.x;
669 posClient.y = pos.y;
670 ScreenToClient(hwnd, &posClient);
671
672 if (ptracking_info->tme.dwFlags & TME_NONCLIENT)
673 {
674 PostMessageW(ptracking_info->tme.hwndTrack, WM_NCMOUSEHOVER,
675 get_key_state(), MAKELPARAM( posClient.x, posClient.y ));
676 }
677 else
678 {
679 PostMessageW(ptracking_info->tme.hwndTrack, WM_MOUSEHOVER,
680 get_key_state(), MAKELPARAM( posClient.x, posClient.y ));
681 }
682
683 /* stop tracking mouse hover */
684 ptracking_info->tme.dwFlags &= ~TME_HOVER;
685 }
686 }
687
688 /* stop the timer if the tracking list is empty */
689 if (!(ptracking_info->tme.dwFlags & (TME_HOVER | TME_LEAVE)))
690 {
691 KillTimer(0, ptracking_info->timer);
692 RtlZeroMemory(ptracking_info,sizeof(USER32_TRACKINGLIST));
693 }
694 }
695
696
697 /***********************************************************************
698 * TrackMouseEvent [USER32]
699 *
700 * Requests notification of mouse events
701 *
702 * During mouse tracking WM_MOUSEHOVER or WM_MOUSELEAVE events are posted
703 * to the hwnd specified in the ptme structure. After the event message
704 * is posted to the hwnd, the entry in the queue is removed.
705 *
706 * If the current hwnd isn't ptme->hwndTrack the TME_HOVER flag is completely
707 * ignored. The TME_LEAVE flag results in a WM_MOUSELEAVE message being posted
708 * immediately and the TME_LEAVE flag being ignored.
709 *
710 * PARAMS
711 * ptme [I,O] pointer to TRACKMOUSEEVENT information structure.
712 *
713 * RETURNS
714 * Success: non-zero
715 * Failure: zero
716 *
717 */
718 /*
719 * @implemented
720 */
721 BOOL
722 WINAPI
723 TrackMouseEvent(
724 LPTRACKMOUSEEVENT ptme)
725 {
726 HWND hwnd;
727 POINT pos;
728 DWORD hover_time;
729 PUSER32_TRACKINGLIST ptracking_info;
730
731 TRACE("%lx, %lx, %p, %lx\n", ptme->cbSize, ptme->dwFlags, ptme->hwndTrack, ptme->dwHoverTime);
732
733 if (ptme->cbSize != sizeof(TRACKMOUSEEVENT)) {
734 WARN("wrong TRACKMOUSEEVENT size from app\n");
735 SetLastError(ERROR_INVALID_PARAMETER);
736 return FALSE;
737 }
738
739 ptracking_info = & User32GetThreadData()->tracking_info;
740
741 /* fill the TRACKMOUSEEVENT struct with the current tracking for the given hwnd */
742 if (ptme->dwFlags & TME_QUERY )
743 {
744 *ptme = ptracking_info->tme;
745 ptme->cbSize = sizeof(TRACKMOUSEEVENT);
746
747 return TRUE; /* return here, TME_QUERY is retrieving information */
748 }
749
750 if (!IsWindow(ptme->hwndTrack))
751 {
752 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
753 return FALSE;
754 }
755
756 hover_time = ptme->dwHoverTime;
757
758 /* if HOVER_DEFAULT was specified replace this with the systems current value */
759 if (hover_time == HOVER_DEFAULT || hover_time == 0)
760 {
761 SystemParametersInfoW(SPI_GETMOUSEHOVERTIME, 0, &hover_time, 0);
762 }
763
764 GetCursorPos(&pos);
765 hwnd = WindowFromPoint(pos);
766
767 if (ptme->dwFlags & ~(TME_CANCEL | TME_HOVER | TME_LEAVE | TME_NONCLIENT))
768 {
769 FIXME("Unknown flag(s) %08lx\n", ptme->dwFlags & ~(TME_CANCEL | TME_HOVER | TME_LEAVE | TME_NONCLIENT));
770 }
771
772 if (ptme->dwFlags & TME_CANCEL)
773 {
774 if (ptracking_info->tme.hwndTrack == ptme->hwndTrack)
775 {
776 ptracking_info->tme.dwFlags &= ~(ptme->dwFlags & ~TME_CANCEL);
777
778 /* if we aren't tracking on hover or leave remove this entry */
779 if (!(ptracking_info->tme.dwFlags & (TME_HOVER | TME_LEAVE)))
780 {
781 KillTimer(0, ptracking_info->timer);
782 RtlZeroMemory(ptracking_info,sizeof(USER32_TRACKINGLIST));
783 }
784 }
785 } else {
786 if (ptme->hwndTrack == hwnd)
787 {
788 /* Adding new mouse event to the tracking list */
789 ptracking_info->tme = *ptme;
790 ptracking_info->tme.dwHoverTime = hover_time;
791
792 /* Initialize HoverInfo variables even if not hover tracking */
793 ptracking_info->pos = pos;
794
795 if (!ptracking_info->timer)
796 {
797 ptracking_info->timer = SetTimer(0, 0, hover_time, TrackMouseEventProc);
798 }
799 }
800 }
801
802 return TRUE;
803
804 }
805
806 /* EOF */