Timer when cursor inside GUI

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
scriptor2016
Posts: 862
Joined: 21 Dec 2015, 02:34

Timer when cursor inside GUI

21 Jun 2019, 00:10

Hello :)

I have a GUI that notifies the user via a tooltip whenever the cursor is inside of it. And, when the cursor leaves the GUI, the tooltip also notifies of the exit.

Here is what I would like to try:

I have 4 keystrokes: x, e, m, s

The instant the cursor enters inside the GUI, a tooltip will appear, which would say 'X'

If the cursor has been inside the GUI for 1 second, then the tooltip changes to 'E'.

If the cursor has been inside the GUI for 2 seconds, then the tooltip changes to 'M'.

Finally, if the cursor has been inside the GUI for 3 seconds, the tooltip changes to 'S'.

After 4 seconds, the tooltips would repeat over and over again until the cursor has exited the GUI, at which point the loop would start over again the next time the cursor re-enters the GUI.


And the last part - if the cursor exits the GUI at between 1 and 2 seconds (as an example), then the script would send keystroke E to the active window, and this is because at between the 1 and 2 second mark, the tooltip was displaying 'E'.

As another example, if the cursor exits the GUI at between 3 and 4 seconds, it would send keystroke 'S' because at between 3 and 4 seconds the tooltip is displaying 'S'.

I think I have made this sound much more complicated than it probably is - I have accomplished this type of script using a mouse button (while getkeystate "f", "P") for example, and it works with keys and mouse buttons - but I want this to work while the cursor is hovering ontop of the GUI.

Am I looking at some kind of a timer to achieve this?





Code: Select all

#SingleInstance force

Gui,mygui:new
Gui,mygui: +AlwaysOnTop +HwndGameListhwnd
Gui,mygui:add,text,w50 h50,MYGUI
Gui,mygui:show
OnMessage(0x200, "msgHandler")
OnMessage(0x2A3, "msgHandler")
return

msgHandler(wParam, lParam, msg, hwnd)
{
    static isTracking 
    if msg = 0x200
    {
     if !isTracking
     tooltip, CURSOR IS INSIDE THE GUI
     isTracking := setMouseLeaveTracking(hwnd)
    }
	
    else if msg = 0x2A3
    {
     tooltip, CURSOR IS OUTSIDE THE GUI
	 isTracking := False
    }
    return 
}

setMouseLeaveTracking(hwnd)
{
    static v 
    if !v
    {
        VarSetCapacity(v, size := A_Ptrsize = 8 ? 24 : 16, 0)
        NumPut(size, v, 0, "UInt")            ; cbSize
        NumPut(0x00000002, v, 4, "UInt")    ; dwFlags (TME_LEAVE)
        NumPut(hwnd, v, 8, "Ptr")          ; HWND
        NumPut(0, v, A_Ptrsize = 8 ? 16 : 12, "UInt")            ; dwHoverTime (ignored) 
    }
    return  DllCall("TrackMouseEvent", "Ptr", &v) ; Non-zero on success
}
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Timer when cursor inside GUI

21 Jun 2019, 05:18

I can't tell what this is doing:

Code: Select all

setMouseLeaveTracking(hwnd)
{
    static v 
    if !v
    {
        VarSetCapacity(v, size := A_Ptrsize = 8 ? 24 : 16, 0)
        NumPut(size, v, 0, "UInt")            ; cbSize
        NumPut(0x00000002, v, 4, "UInt")    ; dwFlags (TME_LEAVE)
        NumPut(hwnd, v, 8, "Ptr")          ; HWND
        NumPut(0, v, A_Ptrsize = 8 ? 16 : 12, "UInt")            ; dwHoverTime (ignored) 
    }
    return  DllCall("TrackMouseEvent", "Ptr", &v) ; Non-zero on success
}
So I just went with my hacky style. Not pretty, but it gets the job done.

Code: Select all

#SingleInstance,Force
CoordMode,Mouse,Screen
global GuiHwnd,WX,WY,WW,WH
Gui,1:+AlwaysOnTop -Caption +hwndGuiHwnd
Gui,1:Color,252525
Gui,1:Font,cWhite s12 ,Segoe UI
Gui,1:Add,Text,x0 y0 w150 h50 Center gMoveWindow,Click/Drag`nto move
Gui,1:Show,% "x" A_ScreenWidth-200 " y50 w150 h50 NA",Test
WingetPos,wx,wy,ww,wh,ahk_Id %GuiHwnd%
SetTimer,Watch_Mouse,200
return
GuiClose:
GuiContextMenu:
Esc::
	ExitApp
MoveWindow(){
	SetTimer,Watch_Mouse,off
	PostMessage,0xA1,2
	While(GetKeystate("LButton"))
		Sleep,10
	WingetPos,wx,wy,ww,wh,ahk_Id %GuiHwnd%
	SetTimer,Watch_Mouse,On
}
Watch_Mouse(){
	static StartTime,isActive,Tips
	MouseGetPos,mx,my
	if(mx<=wx+ww&&mx>=wx&&my<=wy+wh&&my>=wy&&!isActive){
		StartTime:=A_TickCount
		isActive:=1
	}else if(mx<=wx+ww&&mx>=wx&&my<=wy+wh&&my>=wy&&isActive){
		((A_TickCount-StartTime)//4000>=1)?(StartTime:=A_TickCount,Tips:="X"):((A_TickCount-StartTime)//3000>=1)?(Tips:="S"):((A_TickCount-StartTime)//2000>=1)?(Tips:="M"):((A_TickCount-StartTime)//1000>=1)?(Tips:="E"):(Tips:="X")
		Tooltip,% Tips
	}else if(isActive)	{
		Tooltip,
		TrayTip,,Sending: " %Tips% "
		soundbeep,500
		isActive:=0
	}
}
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Timer when cursor inside GUI

21 Jun 2019, 09:30

Here it is implement into your existing msgHandler

Code: Select all


#SingleInstance,Force
global isActive,Tips
Gui,mygui:new
Gui,mygui: +AlwaysOnTop +HwndGameListhwnd
Gui,mygui:add,text,w50 h50,MYGUI
Gui,mygui:show
OnMessage(0x200, "msgHandler")
OnMessage(0x2A3, "msgHandler")
return
myguiGuiClose:
myguiGuiContextMenu:
Esc::
	ExitApp
Watch_Mouse(){
	static StartTime
	if(!isActive){
		StartTime:=A_TickCount
		isActive:=1
	}else if(isActive){
		((A_TickCount-StartTime)//4000>=1)?(StartTime:=A_TickCount,Tips:="X"):((A_TickCount-StartTime)//3000>=1)?(Tips:="S"):((A_TickCount-StartTime)//2000>=1)?(Tips:="M"):((A_TickCount-StartTime)//1000>=1)?(Tips:="E"):(Tips:="X")
		Tooltip,% Tips
	}
}
msgHandler(wParam, lParam, msg, hwnd){
    static isTracking 
    if(msg = 0x200){
		if !isTracking
			SetTimer,Watch_Mouse,10
		isTracking := setMouseLeaveTracking(hwnd)
    }
    else if(msg = 0x2A3){
		SetTimer,Watch_Mouse,Off
		ToolTip,
		isTracking:=0,isActive:=0
		SoundBeep,500
		TrayTip,,Sending: " %Tips% "
    }
}
setMouseLeaveTracking(hwnd)
{
    static v 
    if !v
    {
        VarSetCapacity(v, size := A_Ptrsize = 8 ? 24 : 16, 0)
        NumPut(size, v, 0, "UInt")            ; cbSize
        NumPut(0x00000002, v, 4, "UInt")    ; dwFlags (TME_LEAVE)
        NumPut(hwnd, v, 8, "Ptr")          ; HWND
        NumPut(0, v, A_Ptrsize = 8 ? 16 : 12, "UInt")            ; dwHoverTime (ignored) 
    }
    return  DllCall("TrackMouseEvent", "Ptr", &v) ; Non-zero on success
}

scriptor2016
Posts: 862
Joined: 21 Dec 2015, 02:34

Re: Timer when cursor inside GUI

21 Jun 2019, 10:00

Hi hellbent! Thanks so much for this!! I will check this out right now

I have to run right now (gotta get to work) but I will be back on later tonight and I will then reply to this :)
scriptor2016
Posts: 862
Joined: 21 Dec 2015, 02:34

Re: Timer when cursor inside GUI

21 Jun 2019, 23:27

Hey Hellbent, this is awesome!!! As of late I've been trying to find ways to send keystrokes without any mousebuttons, keyboard keys, or clicking on any GUIs. This particular script will send a keystroke by just hovering ontop of the GUI - exactly what I'm looking for at the moment.


I have a question - how can we make this so that every time the tooltip changes, it also soundbeeps?

I've added in the "Soundbeep" command, but unfortunately it beeps constantly, as if it were in a loop.

Can it be made to beep just once whenever the tooltip changes (while the cursor is hovering on the GUI) ?

(Or better yet, play a different sound each time it changes - for example, play sound1 at the 1 second mark, play sound2 at the 2 second mark, play sound3 at the 3 second mark, etc)

Try this out, you'll see what I mean:

Code: Select all

#SingleInstance,Force
global isActive,Tips
Gui,mygui:new
Gui,mygui: +AlwaysOnTop +HwndGameListhwnd
Gui,mygui:add,text,w250 h50,MYGUI
Gui,mygui:show
OnMessage(0x200, "msgHandler")
OnMessage(0x2A3, "msgHandler")
return





myguiGuiClose:
myguiGuiContextMenu:
Esc::
ExitApp
return
	



	
Watch_Mouse(){
static StartTime
if(!isActive)
{
StartTime:=A_TickCount
isActive:=1
}

else if(isActive)
{
((A_TickCount-StartTime)//4000>=1)?(StartTime:=A_TickCount,Tips:="X"):((A_TickCount-StartTime)//3000>=1)?(Tips:="S"):((A_TickCount-StartTime)//2000>=1)?(Tips:="M"):((A_TickCount-StartTime)//1000>=1)?(Tips:="E"):(Tips:="X")
Tooltip,% Tips
Soundbeep ;This is beeping repeatedly. How can we have this beep just once whenever the tooltip changes (each second) ?
}
}
return





msgHandler(wParam, lParam, msg, hwnd){
    static isTracking 
    if(msg = 0x200){
		if !isTracking
			SetTimer,Watch_Mouse,10
		isTracking := setMouseLeaveTracking(hwnd)
    }
    else if(msg = 0x2A3){
		SetTimer,Watch_Mouse,Off
		ToolTip,
		isTracking:=0,isActive:=0
		SoundBeep,500
		TrayTip,,Sending: " %Tips% "
		sendinput, %Tips%
    }
}
setMouseLeaveTracking(hwnd)
{
    static v 
    if !v
    {
        VarSetCapacity(v, size := A_Ptrsize = 8 ? 24 : 16, 0)
        NumPut(size, v, 0, "UInt")            ; cbSize
        NumPut(0x00000002, v, 4, "UInt")    ; dwFlags (TME_LEAVE)
        NumPut(hwnd, v, 8, "Ptr")          ; HWND
        NumPut(0, v, A_Ptrsize = 8 ? 16 : 12, "UInt")            ; dwHoverTime (ignored) 
    }
    return  DllCall("TrackMouseEvent", "Ptr", &v) ; Non-zero on success
}

User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Timer when cursor inside GUI

22 Jun 2019, 00:18

scriptor2016 wrote:
21 Jun 2019, 23:27
I have a question - how can we make this so that every time the tooltip changes, it also soundbeeps?
Here this should do it.

Code: Select all


#SingleInstance,Force
CoordMode,Mouse,Screen
global isActive,Tips
Gui,mygui:new
Gui,mygui: +AlwaysOnTop +HwndGameListhwnd
Gui,mygui:add,text,w50 h50,MYGUI
Gui,mygui:show
OnMessage(0x200, "msgHandler")
OnMessage(0x2A3, "msgHandler")
return
myguiGuiClose:
myguiGuiContextMenu:
Esc::
	ExitApp
Watch_Mouse(){
	static StartTime,Hz,NewTip,OldTip
	if(!isActive){
		StartTime:=A_TickCount
		isActive:=1
		OldTip:=""
	}else if(isActive){
		((A_TickCount-StartTime)//4000>=1)?(StartTime:=A_TickCount,Tips:="X",Hz:=500,NewTip:=1):((A_TickCount-StartTime)//3000>=1)?(Tips:="S",Hz:=600,NewTip:=2):((A_TickCount-StartTime)//2000>=1)?(Tips:="M",Hz:=700,NewTip:=3):((A_TickCount-StartTime)//1000>=1)?(Tips:="E",Hz:=800,NewTip:=4):(Tips:="X",Hz:=500,NewTip:=1)
		Tooltip,% Tips
		if(NewTip!=OldTip){
			OldTip:=NewTip
			SoundBeep,% Hz
		}
	}
}
msgHandler(wParam, lParam, msg, hwnd){
    static isTracking 
    if(msg = 0x200){
		if !isTracking
			SetTimer,Watch_Mouse,10
		isTracking := setMouseLeaveTracking(hwnd)
    }else if(msg = 0x2A3){
		SetTimer,Watch_Mouse,Off
		ToolTip,
		isTracking:=0,isActive:=0
		;~ SoundBeep,500
		TrayTip,,Sending: " %Tips% "
    }
}
setMouseLeaveTracking(hwnd)
{
    static v 
    if !v
    {
        VarSetCapacity(v, size := A_Ptrsize = 8 ? 24 : 16, 0)
        NumPut(size, v, 0, "UInt")            ; cbSize
        NumPut(0x00000002, v, 4, "UInt")    ; dwFlags (TME_LEAVE)
        NumPut(hwnd, v, 8, "Ptr")          ; HWND
        NumPut(0, v, A_Ptrsize = 8 ? 16 : 12, "UInt")            ; dwHoverTime (ignored) 
    }
    return  DllCall("TrackMouseEvent", "Ptr", &v) ; Non-zero on success
}
Perhaps you can help me out with something.

Can you explain (step by step) what is happening here

Code: Select all

setMouseLeaveTracking(hwnd)
{
    static v 
    if !v
    {
        VarSetCapacity(v, size := A_Ptrsize = 8 ? 24 : 16, 0)
        NumPut(size, v, 0, "UInt")            ; cbSize
        NumPut(0x00000002, v, 4, "UInt")    ; dwFlags (TME_LEAVE)
        NumPut(hwnd, v, 8, "Ptr")          ; HWND
        NumPut(0, v, A_Ptrsize = 8 ? 16 : 12, "UInt")            ; dwHoverTime (ignored) 
    }
    return  DllCall("TrackMouseEvent", "Ptr", &v) ; Non-zero on success
}
scriptor2016
Posts: 862
Joined: 21 Dec 2015, 02:34

Re: Timer when cursor inside GUI

22 Jun 2019, 00:24

I really wish I could, but this is going to make me look like an idiot because I have no idea, but it's a function that I believe was written by a user named RHCP, and the link to the topic should be here:


https://autohotkey.com/board/topic/120763-wm-mousemove-how/

Hopefully you can find more info at that link.


To be honest, if we were to compare AHK knowledge, I would be a 1 and you would be a 10- your code looks far more intelligent than an average level :)
scriptor2016
Posts: 862
Joined: 21 Dec 2015, 02:34

Re: Timer when cursor inside GUI

22 Jun 2019, 00:42

And thanks again - this works PERFECTLY. When the cursor is over the GUI, it rotates through the 4 keystroke options. When the loop reaches the desired keystroke that you would like to send, just move the cursor outside of the GUI and it will send that keystroke to the active window.


You could actually use this for a custom-type of keyboard: enter all 26 letters for the alphabet, and while the cursor is ontop of the GUI, it will loop through all 26 letters and when the loop reaches the letter you want, just hover the cursor away from the GUI and it sends that letter to the active window. Instead of soundbeeps for each new tooltip (at the one-second intervals), I have instead used text-to-speech, so when the cursor is hovering over the GUI, you will hear "A... B.... C... D.... and so on, all through the alphabet). Just listen for the letter you need and then hover the cursor off of the GUI.

Of course, this creates problems for those letters deeper in the alphabet, because it's going to take forever for the loop to reach them lol. Guess I'll have to come up with some ideas for that.
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Timer when cursor inside GUI

22 Jun 2019, 02:12

scriptor2016 wrote:
22 Jun 2019, 00:24
I really wish I could, but this is going to make me look like an idiot because I have no idea, but it's a function that I believe was written by a user named RHCP, and the link to the topic should be here:


https://autohotkey.com/board/topic/120763-wm-mousemove-how/

Hopefully you can find more info at that link.


To be honest, if we were to compare AHK knowledge, I would be a 1 and you would be a 10- your code looks far more intelligent than an average level :)
Ok there wasn't much to go on from that thread, but I was able to do some google searches to piece together most of the info I needed.

I'm not clear on a few things, but I do have a much better understanding of whats going on.

Code: Select all

;https://autohotkey.com/board/topic/120763-wm-mousemove-how/
setMouseLeaveTracking(hwnd)
{
	;https://docs.microsoft.com/en-us/windows/desktop/api/winuser/ns-winuser-tagtrackmouseevent
	;https://docs.microsoft.com/en-us/windows/desktop/api/winuser/ns-winuser-tagtrackmouseevent
	;https://www.autohotkey.com/docs/commands/NumPut.htm
	;https://www.autohotkey.com/docs/commands/VarSetCapacity.htm
    static v 
    if !v
    {
		;~ msgbox, here
        VarSetCapacity(v, size := A_Ptrsize = 8 ? 24 : 16, 0)   ;<----- if the ptr size is 8, set capacity to 24 bytes, else set it to 16 bytes
        NumPut(size, v, 0, "UInt")     ;<--------- the size in bytes of the TRACKMOUSEEVENT structure (cbsize)  ; Here it looks like it is offset 0 bytes and based on the offset of the next NumPut, it needs 4 bytes
        NumPut(0x00000002, v, 4, "UInt") ;<------------- The service requested (dwflag TME_LEAVE) The caller wants leave notification. ; Once again it looks to need 4 bytes
        NumPut(hwnd, v, 8, "Ptr")  ;<-------------- The handle to the control or window. Depending on A_Ptrsize, this will need 4-8 bytes
        NumPut(0, v, A_Ptrsize = 8 ? 16 : 12, "UInt") ; dwHoverTime (ignored) (Value 0???) ; This one is odd, each time a "UInt" was added, it took 4 bytes. This time it takes 4 or 8? What?? 
    }
    return  DllCall("TrackMouseEvent", "Ptr", &v) ; Non-zero on success
}

One thing that is unclear is why the last Numput needs either 4 or 8 bytes? every other "UInt" needed 4 bytes but the last one is either 4-8?
scriptor2016
Posts: 862
Joined: 21 Dec 2015, 02:34

Re: Timer when cursor inside GUI

22 Jun 2019, 02:27

The ON_MESSAGE paramters used in this code are

OnMessage(0x200, "msgHandler")
OnMessage(0x2A3, "msgHandler")

...The one thing I noticed with the function in this script is that while the cursor is hovering over the GUI, it repeatedly sends the commands (tooltips in this case) even if the cursor not moving (it's like an endless loop, until the the cursor is hovered away from the GUI)

..but the same ON_MESSAGE parameters when used without this function seems to require that the cursor is constantly moving while hovering over the GUI in order to repeatedly send the commands - but when the cursor is held still, then the commands stop being sent, until the cursor moves again, at which point the commands are sent yet again.

I could be wrong on this, but it looks like this is what happening when compared to some of my other archived code.

Maybe this sheds some light on it?
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Timer when cursor inside GUI

22 Jun 2019, 02:50

scriptor2016 wrote:
22 Jun 2019, 02:27
Maybe this sheds some light on it?
Unfortunately no.

I have gone over the TRACKMOUSEEVENT structure document so I know what's going on with the message. But now I want to know how to write it.

I'm not the type to just copy and paste code (sometimes I will, but normally I need to know how to code from scratch).
The problem I am having is in how this is working

Code: Select all

 VarSetCapacity(v, size := A_Ptrsize = 8 ? 24 : 16, 0)  
 NumPut(size, v, 0, "UInt")    
 NumPut(0x00000002, v, 4, "UInt")
 NumPut(hwnd, v, 8, "Ptr")  
 NumPut(0, v, A_Ptrsize = 8 ? 16 : 12, "UInt") 
If you look closely you can see that the capacity of v is set to either 24 bytes or 16 bytes depending on the variable A_Ptrsize .
I suspect that this is a 32 vs 64 bit thing.

Moving on you can see that Size fills bytes 0-3 and is of type "UInt" (4 bytes)
Next 0x00000002 is added and fills bytes 4-7 and is of type "UInt" (4 bytes)
Next hwnd fills either bytes 8-11 or bytes 8-15 and is of type "Ptr"
Lastly, the DWord (dwHoverTime) will fill either from byte 12 or from byte 16 (Depending on the amount of bytes hwnd needed). And is of type "UInt"

That's where the problem is. Every other time there was a "UInt" type it needed 4 bytes. This time it needs 4 or 8 bytes???
So it goes either
From Byte 16-23 (8 bytes)
or
From Byte 12-15 (4 bytes)

So why is a "UInt" 4-8 bytes here and only 4 the other two times? How do I know what I should use if I was trying to do this myself?


***Edit***
Btw,
This

Code: Select all

 if(msg = 0x200){
		if !isTracking
			SetTimer,Watch_Mouse,10
		isTracking := setMouseLeaveTracking(hwnd)
    }

Should be

Code: Select all

 if(msg = 0x200){
		if !isTracking	
		{
			SetTimer,Watch_Mouse,10
			isTracking := setMouseLeaveTracking(hwnd)
		}
    }

As far as I can tell anyway.
just me
Posts: 9482
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Timer when cursor inside GUI

22 Jun 2019, 03:36

@Hellbent:

Per default, the size of a structure is aligned to a multiple of the size of its largest field.

Code: Select all

typedef struct tagTRACKMOUSEEVENT {
  DWORD cbSize;
  DWORD dwFlags;
  HWND  hwndTrack;
  DWORD dwHoverTime;
} TRACKMOUSEEVENT, *LPTRACKMOUSEEVENT;
In a 64-bit environment, the largest field of the struct is HWND hwndtrack, a pointer-sized field of 8 bytes. So the size of the structure is

Code: Select all

DWORD   4 bytes
DWORD   4 bytes
HWND    8 bytes
DWORD   4 bytes
Padding 4 bytes
---------------
       24 bytes = 3 * 8
The DWORD (UInt) type is 4 bytes on 32 as well as 64 bit. So NumPut(0, v, A_Ptrsize = 8 ? 16 : 12, "UInt") will write 4 bytes in both cases.
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Timer when cursor inside GUI

22 Jun 2019, 04:33

@just me

Thank you :thumbup:

I was able to look up padding and I found this.

Code: Select all

// size is 24, d need align to 8, then round to multiple of 8 (double's size),
struct stu_f {
    int i;
    double d;
    char c;
};
Do the same rules apply here?

So for example if this was the struct

Code: Select all

DWORD   	4 bytes
Padding  	4 bytes   ;<------------ extra padding
HWND	8 bytes
DWORD	4 bytes
Padding  	4 bytes
just me
Posts: 9482
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Timer when cursor inside GUI

22 Jun 2019, 04:47

Yes!
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Timer when cursor inside GUI

22 Jun 2019, 05:09

@just me

Thanks man, you Rock! :thumbup:
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Timer when cursor inside GUI

22 Jun 2019, 05:29

I'd summarise it like this. Cheers.

Code: Select all

typedef struct tagTRACKMOUSEEVENT {
  DWORD cbSize;
  DWORD dwFlags;
  HWND  hwndTrack;
  DWORD dwHoverTime;
} TRACKMOUSEEVENT, *LPTRACKMOUSEEVENT;

32-bit sizes: 4 + 4 + 4 + 4 = 16
64-bit sizes: 4 + 4 + 8 + 4(+4) = 24 [where '(+4)' is padding]

32-bit offsets: 0, 4, 8, 12
64-bit offsets: 0, 4, 8, 16

overall size should be a multiple of the biggest parameter (use padding at end if necessary)
a param should appear at an offset that is a multiple of its size
jeeswg's DllCall and structs tutorial - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=63708
list of structs with parameters (sizes and types) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=74&t=30497
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: kshitij90 and 347 guests