How to chang the SplashText's text Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
songdg
Posts: 88
Joined: 04 Oct 2017, 20:04

How to chang the SplashText's text

08 Apr 2019, 06:33

I want the SplashText stay on and showing the changing contents of clipboard.
Odlanir
Posts: 531
Joined: 20 Oct 2016, 08:20

Re: How to chang the SplashText's text

08 Apr 2019, 07:12

Code: Select all

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

RefreshSplash:
    SplashTextOn, , , % Clipboard
return
____________________________________________________________________________
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode
User avatar
jeeswg
Posts: 6816
Joined: 19 Dec 2016, 01:58
Location: UK

Re: How to chang the SplashText's text

08 Apr 2019, 09:08

Here's another approach:

Code: Select all

#Persistent
OnClipboardChange("SplashClipboard")

SplashClipboard()
{
	SplashTextOn,,, % Clipboard
}
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
songdg
Posts: 88
Joined: 04 Oct 2017, 20:04

Re: How to chang the SplashText's text

08 Apr 2019, 11:54

Thanks, I want to use ControlSetText, but I don't know how to use it.
garry
Posts: 1885
Joined: 22 Dec 2013, 12:50

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

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
User avatar
jeeswg
Posts: 6816
Joined: 19 Dec 2016, 01:58
Location: UK

Re: How to chang the SplashText's text

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
}
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
songdg
Posts: 88
Joined: 04 Oct 2017, 20:04

Re: How to chang the SplashText's text

09 Apr 2019, 21:52

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.
songdg
Posts: 88
Joined: 04 Oct 2017, 20:04

Re: How to chang the SplashText's text

09 Apr 2019, 22:00

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.
garry
Posts: 1885
Joined: 22 Dec 2013, 12:50

Re: How to chang the SplashText's text

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
songdg
Posts: 88
Joined: 04 Oct 2017, 20:04

Re: How to chang the SplashText's text

11 Apr 2019, 05:31

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!

Return to “Ask For Help”

Who is online

Users browsing this forum: flyingDman, Google [Bot], TAC109 and 181 guests