This script will display infos about the taskbar buttons in the order
from left to right. Here I only show 0-based index, 0-based command
identifier, handle of the corresponding window, and the string of the
buttons.

Notice that some buttons have 0 for hWnd. They are hidden buttons
provided only for the Button-Grouping feature in XP.

And, I didn't provide any specific mechanism for rearranging the
buttons as there would be so many special cases. I think the user
himself could manage it himself to his need, using TB_MOVEBUTTON message.

--------------------- TaskButtons.PowerPro ----------------------------
local hWndTB,hProc,pVM,nCount,sString,xString

hWndTB=Word(Win.ChildHandlelist("Taskbar","c=ToolbarWindow32"),-1)

hProc=dll.call("OpenProcess|ui i ui";;+
,0x38,0,Win.Handle("Taskbar").GetProcessId)
pVM=dll.call("VirtualAllocEx|ui ui i ui ui",hProc,0,20,0x1000,0x4)

tb=dll.create_struct("i i uc uc c c ui i")
tb.set_member_names("iBitmap","idCommand","fsState","fsStyle","","";;+
,"hWnd","iString")

nCount=hWndTB.SendMessage(1048,0,0) // TB_BUTTONCOUNT

for(local i=0;i<nCount;i++)
hWndTB.SendMessage(1047,i,pVM) // TB_GETBUTTON
dll.call("ReadProcessMemory|ui ui t* i i",hProc,pVM,tb,20,0)
dll.call("ReadProcessMemory|ui ui ui i i";;+
,hProc,tb.hWnd,tb.get_pointer(7),4,0)
dll.call("ReadProcessMemory|ui ui s+ i
i",hProc,tb.iString,"xString",272,0)
dll.call("Cdecl|wsprintf|s+ s- s+","sString","%S","xString")

win.debug(i,tb.idCommand,tb.hWnd,sString)
endfor

/* nFrom, nTo are 0 based indices
hWndTB.SendMessage(1106,nFrom,nTo) // TB_MOVEBUTTON
*/

dll.call("VirtualFreeEx|ui ui i i",hProc,pVM,0,0x8000)
dll.call("CloseHandle|ui",hProc)
quit
-----------------------------------------------------------------------

Sean




Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/power-pro/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to