Page 1 of 1

How to chang the SplashText's text

Posted: 08 Apr 2019, 06:33
by songdg
I want the SplashText stay on and showing the changing contents of clipboard.

Re: How to chang the SplashText's text

Posted: 08 Apr 2019, 07:12
by Odlanir

Code: Select all

SplashTextOn, , , % Clipboard
SetTimer, RefreshSplash, 500 ; 500 is arbirary, choose the delay you prefer
return

RefreshSplash:
    SplashTextOn, , , % Clipboard
return

Re: How to chang the SplashText's text

Posted: 08 Apr 2019, 09:08
by jeeswg
Here's another approach:

Code: Select all

#Persistent
OnClipboardChange("SplashClipboard")

SplashClipboard()
{
	SplashTextOn,,, % Clipboard
}

Re: How to chang the SplashText's text

Posted: 08 Apr 2019, 11:54
by songdg
Thanks, I want to use ControlSetText, but I don't know how to use it.

Re: How to chang the SplashText's text  Topic is solved

Posted: 09 Apr 2019, 01:55
by garry
example with GUI

Code: Select all

#Warn
setworkingdir,%a_scriptdir%
Gui,1: -DPIScale
SS_REALSIZECONTROL := 0x40
Gui,1:Color,Black,Black
Gui, Font,s12 cYellow ,Lucida Console 
Gui,add,edit,x10 y10  w1100 h590 vED1  -vscroll -border -E0x200,
Gui,add,text,x0 y0 w0 vT1 ,
GuiControl, Focus,T1
Gui, Show,x10 y10 w1150 h600,TEST
E0x200 = WS_EX_CLIENTEDGE
RETURN
Guiclose:
exitapp

OnClipboardChange:
If (A_EventInfo=1)
 ControlSetText,edit1,%clipboard%, ahk_class AutoHotkeyGUI
return

Re: How to chang the SplashText's text

Posted: 09 Apr 2019, 03:23
by jeeswg
Perhaps you want something like this. In this case you need to use WinSetTitle, not ControlSetText.

Code: Select all

#Persistent
OnClipboardChange("SplashClipboard")

SplashClipboard()
{
	static hWnd := 0
	if !hWnd
	{
		SplashTextOn,,, % Clipboard
		vScriptPID := DllCall("kernel32\GetCurrentProcessId", "UInt")
		WinGet, hWnd, ID, % "ahk_class AutoHotkey2 ahk_pid " vScriptPID
	}
	WinSetTitle, % "ahk_id " hWnd,, % Clipboard
}

Re: How to chang the SplashText's text

Posted: 09 Apr 2019, 21:52
by songdg
garry wrote:
09 Apr 2019, 01:55
example with GUI

Code: Select all

#Warn
setworkingdir,%a_scriptdir%
Gui,1: -DPIScale
SS_REALSIZECONTROL := 0x40
Gui,1:Color,Black,Black
Gui, Font,s12 cYellow ,Lucida Console 
Gui,add,edit,x10 y10  w1100 h590 vED1  -vscroll -border -E0x200,
Gui,add,text,x0 y0 w0 vT1 ,
GuiControl, Focus,T1
Gui, Show,x10 y10 w1150 h600,TEST
E0x200 = WS_EX_CLIENTEDGE
RETURN
Guiclose:
exitapp

OnClipboardChange:
If (A_EventInfo=1)
 ControlSetText,edit1,%clipboard%, ahk_class AutoHotkeyGUI
return
Thanks, how to let the gui stay on top.

Re: How to chang the SplashText's text

Posted: 09 Apr 2019, 22:00
by songdg
jeeswg wrote:
09 Apr 2019, 03:23
Perhaps you want something like this. In this case you need to use WinSetTitle, not ControlSetText.

Code: Select all

#Persistent
OnClipboardChange("SplashClipboard")

SplashClipboard()
{
	static hWnd := 0
	if !hWnd
	{
		SplashTextOn,,, % Clipboard
		vScriptPID := DllCall("kernel32\GetCurrentProcessId", "UInt")
		WinGet, hWnd, ID, % "ahk_class AutoHotkey2 ahk_pid " vScriptPID
	}
	WinSetTitle, % "ahk_id " hWnd,, % Clipboard
}
You're right, I want a small window at corner and stay on top to show the progress.

Re: How to chang the SplashText's text

Posted: 10 Apr 2019, 03:31
by garry
Thanks, how to let the gui stay on top.
added
GUI alwaysontop, if minimized show GUI when clipboard has changed , quit script with ESC ( or GuiClose)

Code: Select all

#Warn
setworkingdir,%a_scriptdir%
Gui,1: +AlwaysOnTop  
Gui,1: -DPIScale
SS_REALSIZECONTROL := 0x40
Gui,1:Color,Black,Black
Gui, Font,s12 cYellow ,Lucida Console 
Gui,add,edit,x10 y10  w1100 h590 vED1  -vscroll -border -E0x200,
Gui,add,text,x0 y0 w0 vT1 ,
GuiControl, Focus,T1
Gui, Show,x10 y10 w1150 h600,TEST
E0x200 = WS_EX_CLIENTEDGE
RETURN
esc::exitapp
Guiclose:
exitapp
OnClipboardChange:
If (A_EventInfo=1)
 {
 Gui, Show,
 ControlSetText,edit1,%clipboard%, ahk_class AutoHotkeyGUI
 }
return

Re: How to chang the SplashText's text

Posted: 11 Apr 2019, 05:31
by songdg
garry wrote:
10 Apr 2019, 03:31
Thanks, how to let the gui stay on top.
added
GUI alwaysontop, if minimized show GUI when clipboard has changed , quit script with ESC ( or GuiClose)

Code: Select all

#Warn
setworkingdir,%a_scriptdir%
Gui,1: +AlwaysOnTop  
Gui,1: -DPIScale
SS_REALSIZECONTROL := 0x40
Gui,1:Color,Black,Black
Gui, Font,s12 cYellow ,Lucida Console 
Gui,add,edit,x10 y10  w1100 h590 vED1  -vscroll -border -E0x200,
Gui,add,text,x0 y0 w0 vT1 ,
GuiControl, Focus,T1
Gui, Show,x10 y10 w1150 h600,TEST
E0x200 = WS_EX_CLIENTEDGE
RETURN
esc::exitapp
Guiclose:
exitapp
OnClipboardChange:
If (A_EventInfo=1)
 {
 Gui, Show,
 ControlSetText,edit1,%clipboard%, ahk_class AutoHotkeyGUI
 }
return
Thank you very much!