Hi sgp,

Regarding your question about Opera.

I thought my reply may have gone unnoticed, so I'm posting it again in 
case other ppl find it useful. This time I've revised it, now you can 
use any icon resource (exe, dll, ico...).


; changes the window icons of all windows matching the given caption list
; small icon is for the window itself, big icon is for Alt-Tab list
; be nice, I'm not an expert at dll-plugin/Win32 :)
; usage:
; @ChangeWindowIcon(<PP_style_caption_list>, <resource_path> [, 
small_icon_idx[, big_icon_idx]])
; [EMAIL PROTECTED]("=win32pad", 
?"%windir%\System32\shell32.dll", 44, 44)
; [EMAIL PROTECTED]("*some title*", 
?"C:\somepath\some.ico", 3, 3)
; you can omit icon indices, in that case the first icon in the file is used
@ChangeWindowIcon
    args _cl, _icon_path, _icon_idx_sml, _icon_idx_big
    if(not _icon_path or not file.validpath(_icon_path))do
        MessageBox("ok warning", "You have to supply a valid icon path 
("++_icon_path++")", "@ChangeWindowIcon")
        quit(1)
    endif
    if(_cl eq "")do
        MessageBox("ok warning", "You have to supply a valid caption 
list ("++_cl++")", "@ChangeWindowIcon")
        quit(1)
    endif
    if(not _icon_idx_sml)
        _icon_idx_sml = 0
    if(not _icon_idx_big)
        _icon_idx_big = 0

    local dll_status, _icon_handle, _handles, i
    local WM_SETICON = 0x80
    local ICON_SMALL = 0
    local ICON_BIG = 1

    _handles = win.handlelist(_cl)
    for(i = 1; i <= word(_handles, 0); i++)
        _icon_handle = dll.call("shell32.dll|ExtractIconA|l s l", 
word(_handles, i), _icon_path, _icon_idx_sml)
        dll.call("SendMessage|l l l l", word(_handles, i), WM_SETICON, 
ICON_SMALL, _icon_handle)
        _icon_handle = dll.call("shell32.dll|ExtractIconA|l s l", 
word(_handles, i), _icon_path, _icon_idx_big)
        dll.call("SendMessage|l l l l", word(_handles, i), WM_SETICON, 
ICON_BIG, _icon_handle)
    endfor
    quit

Reply via email to