By the way. Seems use the library COM
newIcon:="E:\go-top.ico" ;16x16 icon file
WinGet, ExStyle, ExStyle, ahk_id %winID%
if (ExStyle & 0x8) ; 0x8 is WS_EX_TOPMOST.
soundbeep ;just for debugging
WinSet, alwaysontop,off,ahk_id %winID%
SendMessage, 0x80, 0, 0,, ahk_id %winID% ; (0x80 is WM_SETICON).
WinSet, alwaysontop,on,ahk_id %winID%
hIcon := DllCall("LoadImage", uint, 0, str, newIcon,uint, 1, int, 0, int, 0, uint, 0x10)
SendMessage, 0x80, 0, hIcon,, ahk_id %winID% ; (0x80 is WM_SETICON).
I was trying this afternoon to obtain the COM library for facebook logins, but the links were broken.....
I tell for DllCall. I am not sure of course. ....