Modify

#2733 closed Bug (No Bug)

WM_SETCURSOR doesn't pass $wParam as handle after using GUICtrlSetCursor

Reported by: MrCreatoR Owned by:
Milestone: Component: AutoIt
Version: 3.3.10.2 Severity: None
Keywords: Cc:

Description

Here is an example that shows the problem:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$hGui = GUICreate('Test ' & @AutoItVersion, 200, 150)
$iLbl = GUICtrlCreateLabel('Test GUICtrlSetCursor', 20, 40, 160, 20)
$hLbl = GUICtrlGetHandle($iLbl)

GUISetState()
GUIRegisterMsg($WM_SETCURSOR, 'WM_SETCURSOR')
GUICtrlSetCursor($iLbl, 0) ;Comment this line to see the difference

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func WM_SETCURSOR($hWnd, $iMsg, $wParam, $lParam)
	Switch $wParam
		Case $hLbl
            ConsoleWrite('$wParam = $hLbl? ' & ($wParam = $hLbl) & @LF)
	EndSwitch
	
    Return $GUI_RUNDEFMSG
EndFunc

Environment(Language:0419 Keyboard:00000409 OS:WIN_7/ CPU:X64 OS:X64)

On AutoIt versions below 3.3.10.2 there was no problem.

Attachments (0)

Change History (3)

comment:1 by Jpm, on Jun 6, 2014 at 6:15:55 AM

Resolution: No Bug
Status: newclosed

In fact it does.
But if you rad the MSDN doc it is the handle to the Windows not to the control

comment:2 by BrewManNH, on Jun 13, 2014 at 5:04:19 PM

I think the point being made was that when you don't use GUICtrlSetCursor in the exact same script, $wParam will return the label's handle when the cursor is over it. When you use GUICtrlSetCursor you never see that information.

comment:3 by MrCreatoR, on Aug 9, 2014 at 9:24:02 PM

if you rad the MSDN doc it is the handle to the Windows not to the control

Then why this behaviour was changed only since 3.3.10.2, on earlier versions it was always the control handle, not the window.

And why it should be the window handle, we have it in $hWnd parameter.
I think something was changed in GUICtrlSetCursor because this affecting the wm_setcursor message.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.