Page 1 of 1

Progress - Show / Hide

Posted: 22 Feb 2019, 14:05
by Albireo
In the AHK-help Progress I can read ... is the word SHOW, the window is shown if it is currently hidden
But, how to Hide the progress window?
I've tried "Hide", and the progress window disappeared, but when I use the Progress Show command, does the window not have the same content.

Code: Select all

#SingleInstance force

Loops = 10
Progress b w380, `n`n, `n	; Initiate the Progress window
Loop %Loops%
{	Percent := Ceil((A_Index / Loops)*100)
	Progress %Percent%, % "Now the number ( " A_Index " of " Loops " ) is handled", Progress Hide or Show, Progress test!
	Sleep 500
	Progress Hide
	Sleep 1000
	Progress Show
}
Progress off

ESC::
	MsgBox 64, Row %A_LineNumber% -> %A_ScriptName%, The Program is ended!, 1
	ExitApp
Return

Re: Progress - Show / Hide

Posted: 23 Feb 2019, 00:37
by hd0202
my suggestion:
replace "Progress Hide" with "Progress off"
remove "Progress Show"

but I do not know why the first occurrence has no title ???

Hubert

Re: Progress - Show / Hide  Topic is solved

Posted: 23 Feb 2019, 04:19
by just me
Progress wrote:Window Size, Position, and Behavior

Hide: The window will be initially hidden. Use Progress Show or SplashImage Show to show it later.
Seemingly you have to take that literally.

Code: Select all

#NoEnv
#SingleInstance force
Loops = 10
ProgressTitle := "Progress_" . A_Now
Progress b w380, `n`n, `n, %ProgressTitle%	; Initiate the Progress window
WinWait, %ProgressTitle%
ProgressHwnd := WinExist()
Loop %Loops%
{
   Percent := Ceil((A_Index / Loops)*100)
   Progress, %Percent%, % "Now the number ( " A_Index " of " Loops " ) is handled", Progress Hide or Show, Progress test!
   Sleep 2000
   ; Progress, Hide
   WinHide, ahk_id %ProgressHwnd%
   Sleep 2000
   Progress, Show
}
Progress, Off

ESC::
	MsgBox 64, Row %A_LineNumber% -> %A_ScriptName%, The Program is ended!, 1
	ExitApp
Return

Re: Progress - Show / Hide

Posted: 23 Feb 2019, 12:04
by Albireo
Thank you! (Why didn't I think of this solution?)
Should be something about this in the AHK help file, in conjunction with "Progress Show"?