Is there something like GetProgressValue?

Just starting out? Need help? Post your questions and find answers here.
User avatar
Michael Vogel
Addict
Addict
Posts: 2666
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Is there something like GetProgressValue?

Post by Michael Vogel »

It is possible to set a progress indicator for icons in the systray using SetProgressValue (Windows only). But I'd like to observe an external program and would like to check it's progress. I'll be able to find the specific window handle easily, but is there a trick to get the progress count?
User avatar
RSBasic
Moderator
Moderator
Posts: 1218
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: Is there something like GetProgressValue?

Post by RSBasic »

Code: Select all

Debug SendMessage_(Handle, #PBM_GETPOS, 0, 0)
Image
Image
User avatar
Michael Vogel
Addict
Addict
Posts: 2666
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: Is there something like GetProgressValue?

Post by Michael Vogel »

Not sure if I made something wrong - was just a quick shot - but I don't get any values for now...
...seems that I was to optimistic about how easy I will catch the right handle :wink:

Tried to get the right child by FindWindow_"Shell_traywnd","") but failed also :?

Code: Select all


#FullProgress=1
#ProgressMaximum=100
#Status=0
#PBM_GETPOS=1032

DataSection
	CLSID_TaskBarList:
	Data.l $56FDF344
	Data.w $FD6D, $11D0
	Data.b $95, $8A, $00, $60, $97, $C9, $A0, $90

	IID_ITaskBarList3:
	Data.l $ea1afb91
	Data.w $9e28,$4b86
	Data.b $90,$E9,$9e,$9f,$8a,$5e,$ef,$af

EndDataSection

Interface ITaskbarList3 Extends ITaskbarList2
	SetProgressValue.i(hWnd.i,ullCompleted.q,ullTotal.q)
	SetProgressState.i(hWnd.i,tbpFlags.l)
	RegisterTab.i(hWndTab.i,hWndMDI.i)
	UnregisterTab.i(hWndTab.i)
	SetTabOrder.i(hWndTab.i,hWndInsertBefore.i)
	SetTabActive.i(hWndTab.i,hWndMDI.i,tbatFlags.l)
	ThumbBarAddButtons.i(hWnd.i,cButtons.l,*pButton)
	ThumbBarUpdateButtons.i(hWnd.i,cButtons.l,*pButton)
	ThumbBarSetImageList.i(hWnd.i,himl.i)
	SetOverlayIcon.i(hWnd.i,hIcon.i,pszDescription$)
	SetThumbnailTooltip.i(hWnd.i,pszTip$)
	SetThumbnailClip.i(hWnd.i,*prcClip)
EndInterface

Global TaskbarProgress.ITaskbarList3

OpenWindow(#Status,0,0,100,100,"Test")
AddWindowTimer(#Status,0,100)
TextGadget(0,0,0,100,100,"-")

CoInitialize_(#Null)
CoCreateInstance_(?CLSID_TaskBarList,#Null,1,?IID_ITaskBarList3,@TaskbarProgress)
If TaskbarProgress
	TaskbarProgress\HrInit()
	TaskbarProgress\SetProgressValue(WindowID(#Status),#ProgressMaximum,#ProgressMaximum)
	TaskbarProgress\SetProgressState(WindowID(#Status),#tbpf_indeterminate)
EndIf

Repeat
	Select WaitWindowEvent()
	Case #PB_Event_Timer
		n+1
		If TaskbarProgress
			TaskbarProgress\SetProgressValue(WindowID(#Status),n,#ProgressMaximum)
		EndIf
		
		handle=FindWindow_(0,"Test")
		Debug SendMessage_(Handle,#PBM_GETPOS,0,0)
		
	Case #PB_Event_CloseWindow,#WM_CHAR
		End
	EndSelect
ForEver
User avatar
RSBasic
Moderator
Moderator
Posts: 1218
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: Is there something like GetProgressValue?

Post by RSBasic »

Ah, you mean ITaskbarList3. I first thought of ProgressBarGadget. Unfortunately, I can't find anything about GetProgressBarValue.
Image
Image
User avatar
Michael Vogel
Addict
Addict
Posts: 2666
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: Is there something like GetProgressValue?

Post by Michael Vogel »

Sorry for the confusion.
I'd like to snoop the progress value from another windows program so I will be able to react (like doing a shutdown, showing a big countdown,...)

I tried to get around with getwindow(...,child/next), but never got useful handles to work with.
fryquez
Enthusiast
Enthusiast
Posts: 362
Joined: Mon Dec 21, 2015 8:12 pm

Re: Is there something like GetProgressValue?

Post by fryquez »

The right handle is the easy thing:

Code: Select all

TaskbandHWND = GetProp_(FindWindow_(@"Shell_TrayWnd", 0), @"TaskbandHWND")
But I doubt there will be a easy way to get the progress value.
User avatar
Michael Vogel
Addict
Addict
Posts: 2666
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: Is there something like GetProgressValue?

Post by Michael Vogel »

fryquez wrote:The right handle is the easy thing...
Not bad, I had a look at the handles here using Microsoft Inspect and your result is a good one - and I fear you are right that there's no chance to get the wanted value as there's no indication for a progress value in all the listed properties.
Post Reply