Progress - Show / Hide Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Albireo
Posts: 1756
Joined: 16 Oct 2013, 13:53

Progress - Show / Hide

22 Feb 2019, 14:05

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
hd0202
Posts: 183
Joined: 04 Oct 2013, 03:07
Location: Germany near Cologne

Re: Progress - Show / Hide

23 Feb 2019, 00:37

my suggestion:
replace "Progress Hide" with "Progress off"
remove "Progress Show"

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

Hubert
just me
Posts: 9458
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Progress - Show / Hide  Topic is solved

23 Feb 2019, 04:19

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
Albireo
Posts: 1756
Joined: 16 Oct 2013, 13:53

Re: Progress - Show / Hide

23 Feb 2019, 12:04

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"?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], ht55cd3 and 261 guests