1 (изменено: serzh82saratov, 2013-11-16 22:12:12)

Тема: AHK: Добавить свой пункт в всплывающий список кнопки панели задач

http://savepic.net/3884775.png


Возможно ли добавить свой пункт в окно ahk_class DV2ControlHost ahk_exe explorer.exe принадлежащее кнопке в панели задач скрипта AHK.

По вопросам возмездной помощи пишите на E-Mail: serzh82saratov@mail.ru Telegram: https://t.me/sergiol982
Win10x64 AhkSpy, Hotkey, ClockGui

2

Re: AHK: Добавить свой пункт в всплывающий список кнопки панели задач

Нашёл такую тему - SetTaskbarProgress. Поправил для использования без библиотеки Com:


Gui, Font, s15
Gui, Add, Text,, % "This GUI should show a progress bar on its taskbar button.`n"
                 . "It will demonstrate the four different progress states:`n"
                 . "(N)ormal, (P)aused, (E)rror and (I)ndeterminate."
Gui, Show        ; Show the window and taskbar button.
Gui, +LastFound  ; SetTaskbarProgress will use this window.
Loop
{
    progress_states=NPE
    Loop, Parse, progress_states
    {
        SetTaskbarProgress(0, A_LoopField)
        Loop 50 {
            SetTaskbarProgress(A_Index*2)
            Sleep 50
        }
        Sleep 1000
        Loop 50 {
            SetTaskbarProgress(100-A_Index*2)
            Sleep 50
        }
        SetTaskbarProgress(0)
        Sleep 1000
    }
    SetTaskbarProgress("I")
    Sleep 4000
}

; SetTaskbarProgress  -  Requires Windows 7.
;
; pct    -  A number between 0 and 100 or a state value (see below).
; state  -  "N" (normal), "P" (paused), "E" (error) or "I" (indeterminate).
;           If omitted (and pct is a number), the state is not changed.
; hwnd   -  The ID of the window which owns the taskbar button.
;           If omitted, the Last Found Window is used.
;
 
SetTaskbarProgress(pct, state="", hwnd="")
{
    static tbl, s0:=0, sI:=1, sN:=2, sE:=4, sP:=8
    if !tbl 
        tbl := ComObjCreate( "{56FDF344-FD6D-11d0-958A-006097C9A090}", "{ea1afb91-9e28-4b86-90e9-9e9f8a5eefaf}")  
    if hwnd =
        hwnd := WinExist()
    if pct is not number
        state := pct, pct := ""
    else if (pct = 0 && state="")
        state := 0, pct := ""
    if state in 0,I,N,E,P   ; ITaskbarList3::SetProgressState
        DllCall(NumGet(NumGet(tbl+0)+40), "uint", tbl, "uint", hwnd, "uint", s%state%)
    if pct !=               ; ITaskbarList3::SetProgressValue
        DllCall(NumGet(NumGet(tbl+0)+36), "uint", tbl, "uint", hwnd, "int64", pct*10, "int64", 1000)
}
Return

Так понимаю что использование ITaskbarList3::ThumbBarAddButtons method должно добавлять пункт. Кто нибудь знает как использовать ThumbBarAddButtons, и оно ли?

По вопросам возмездной помощи пишите на E-Mail: serzh82saratov@mail.ru Telegram: https://t.me/sergiol982
Win10x64 AhkSpy, Hotkey, ClockGui