Changeset 121 for trunk/src


Ignore:
Timestamp:
Jun 28, 2008, 12:18:38 AM (17 years ago)
Author:
lpino
Message:

(Display.java) - Implemented getCursorControl method

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/Display.java

    r106 r121  
    673673 * </ul>
    674674 */
    675 //@@TODO (dmik) using WinQueryCursorInfo (lpino): 
    676 //public Control getCursorControl () {
    677 //    checkDevice ();
    678 //    POINT pt = new POINT ();
    679 //    if (!OS.GetCursorPos (pt)) return null;
    680 //    return findControl (OS.WindowFromPoint (pt));
    681 //}
     675
     676public Control getCursorControl () {
     677    checkDevice ();
     678    POINTL pt = new POINTL ();
     679    CURSORINFO cursor = new CURSORINFO();
     680    if (!OS.WinQueryCursorInfo(OS.HWND_DESKTOP, cursor)) return null;
     681    pt.x = cursor.x;
     682    pt.y = cursor.y;
     683    return findControl (OS.WinWindowFromPoint (OS.HWND_DESKTOP, pt, true));
     684}
    682685
    683686/**
Note: See TracChangeset for help on using the changeset viewer.