Modify

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#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 Changed 10 years ago by Jpm

  • Resolution set to No Bug
  • Status changed from new to closed

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

comment:2 Changed 10 years ago by BrewManNH

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 Changed 10 years ago by MrCreatoR

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.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.