No help?
I've been trying to change the call to GetIconInfo to GetIconInfoEx (
http://msdn.microsoft.com/en-us/library/ms648071(VS.85).aspx ) but I can't get it to work. It should include more information and maybe a disk link to the Icon being used.
This is my code I use for testing and is working fine, but there is no value that's always the same when the cursor Icon is the same.
Code:
Loop
{
Sleep 1000
VarSetCapacity(mi, 20, 0)
mi := Chr(20)
DllCall("GetCursorInfo", "Uint", &mi)
bShow := NumGet(mi, 4)
hCursor := NumGet(mi, 8)
xCursor := NumGet(mi,12)
yCursor := NumGet(mi,16)
VarSetCapacity(ni, 20, 0)
DllCall("GetIconInfo", "Uint", hCursor, "Uint", &ni)
xHotspot := NumGet(ni, 4)
yHotspot := NumGet(ni, 8)
hBMMask := NumGet(ni,12)
hBMColor := NumGet(ni,16)
TrayTip, test, hBMMask = %hBMMask%`nxHotspot = %xHotspot%`nyHotspot = %yHotspot%`nhBMColor = %hBMColor%`nhCursor = %hCursor%`nbShow = %bShow%, 10
}
Then I have tried the following change to the second block of code:
Code:
VarSetCapacity(ni, 28, 0)
DllCall("GetIconInfo", "Uint", hCursor, "Uint", &ni)
xHotspot := NumGet(ni, 4)
yHotspot := NumGet(ni, 8)
hBMMask := NumGet(ni,12)
hBMColor := NumGet(ni,16)
wResID := NumGet(ni,20)
szModName := NumGet(ni,24)
szResName := NumGet(ni,28)
TrayTip, test, hBMMask = %hBMMask%`nxHotspot = %xHotspot%`nyHotspot = %yHotspot%`nhBMColor = %hBMColor%`nhCursor = %hCursor%`nbShow = %bShow%`nwResID = %wResID%`nszModName = %szModName%`nszResName = %szResName%, 10
Now the Structure I get back should be IconInfoEx (
http://msdn.microsoft.com/en-us/library/ms648053(VS.85).aspx ) instead of IconInfo (
http://msdn.microsoft.com/en-us/library/ms648052(VS.85).aspx ).
I'm no expert using DllCall or understanding msdn, so if someone that have tried this could rig the code to work propperly, it might contain a value that does not change when the mouse Icon is something specific?
I can see that the way I extract information out of the IconInfoEx is wrong since the values are no longer presented in the same way, but I cant figure out how to address this.