ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

Focus-Unfocus and let me link

<< < (3/6) > >>

Contro:
Take a look at this script.  It changes the program icon to show when topmost is set.
http://www.autohotkey.com/board/topic/94627-button-for-always-on-top/?hl=%2Btitlebar+%2Bbutton#entry596565
-MilesAhead (January 13, 2014, 05:08 PM)
--- End quote ---

running to try
 :-*

Contro:
By the way. Seems use the library COM


--- ---f4::
newIcon:="E:\go-top.ico"  ;16x16 icon file

WinGet, winID,id,A

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).
    return
    }
else
    {
    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).
    }
return


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. ....

 :-[

Contro:
I don't see changes with the script above truly .... :(

MilesAhead:
I don't see changes with the script above truly .... :(
-Contro (January 13, 2014, 05:32 PM)
--- End quote ---

It changes the system menu icon(left corner of title bar) but of course you must use a path to a real .ico file. It probably doesn't check for errors as it's just a bare shell.

Edit: I ran it on my system using desktop.ico as the icon and it changed the system menu icon for me.


--- ---
f4::
newIcon:="C:\Program Files\AutoHotkey\Scripts\Desktop.ico"

WinGet, winID,id,A

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).
    return
    }
else
    {
    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).
    }
return

Contro:
Owwww. I was looking for the COM library, but seems is in Autohotkey_L from several years ago.

Running to try Miles.
Can i use any ico file ?

 :P

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version