Modify

Opened 2 months ago

Closed 13 days ago

#4056 closed Feature Request (Completed)

MakePoints addition to WinAPIConv.au3

Reported by: MattyD Owned by: Jpm
Milestone: 3.3.19.0 Component: Standard UDFs
Version: Severity: None
Keywords: Cc:

Description

Just a suggestion for an addition to.

  • WinAPIConv.au3
  • and Structures_Constants.au3 (tagPOINTS)

Many WM messages receive mouse coordinates in lparam, which can sometimes have negative values. I figure approximating the makepoints macro could help in handling this.

https://learn.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-makepoints

#include <WinAPIConv.au3>

;tagPoints is short;short, tagPoint is long;long.
Global Const $tagPoints = "struct;short X;short Y;endstruct"

$lParam = 0x0000FFFF ;-e.g. returned by WM_ messages
$tPoints = _WinAPI_MakePoints($lParam)

ConsoleWrite(StringFormat("MakePoints: %d, %d\r\n", $tPoints.X, $tPoints.Y))
ConsoleWrite(StringFormat("Lo/Hi Word: %d, %d\r\n", _WinAPI_LoWord($lParam), _WinAPI_HiWord($lParam)))

Func _WinAPI_MakePoints($iValue)
	Local $tPoints = DllStructCreate($tagPoints)
	DllStructSetData($tPoints, 1, _WinAPI_LoWord($iValue))
	DllStructSetData($tPoints, 2, _WinAPI_HiWord($iValue))
	Return $tPoints
EndFunc

Attachments (0)

Change History (1)

comment:1 Changed 13 days ago by Jpm

  • Milestone set to 3.3.19.0
  • Owner set to Jpm
  • Resolution set to Completed
  • Status changed from new to closed

Added by revision [13191] in version: 3.3.19.0

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 owner will remain Jpm.
Author


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

 
Note: See TracTickets for help on using tickets.