Adding a simple GUI to display clipboard contents on desktop Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Xproplayer
Posts: 24
Joined: 12 Feb 2017, 23:26

Adding a simple GUI to display clipboard contents on desktop

13 Oct 2018, 21:48

Hi all,

My clipboard changes very often and I'd like to be able to see whats in it. How easy would it be to write a simple permanent GUI that could stay on the desktop and display the current contents. If its not possible to use a hook / realtime update perhaps a 1 second polling rate could work? Just a spitball idea, feel free to point me in the right direction instead of sample / complete code if you please. Cheers
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Adding a simple GUI to display clipboard contents on desktop  Topic is solved

13 Oct 2018, 23:13

Code: Select all

Gui New, +AlwaysOnTop, Clip Viewer
Gui Add, Edit, w300 R10 ReadOnly +HWNDhEdit
Gui Show, AutoSize

OnClipboardChange("Update")

Update(type) {
	global hEdit

	if (type != 2)
		GuiControl Text, % hEdit, % Clipboard
}

GuiClose:
	ExitApp
Xproplayer
Posts: 24
Joined: 12 Feb 2017, 23:26

Re: Adding a simple GUI to display clipboard contents on desktop

14 Oct 2018, 15:31

swagfag wrote:
13 Oct 2018, 23:13

Code: Select all

Gui New, +AlwaysOnTop, Clip Viewer
Gui Add, Edit, w300 R10 ReadOnly +HWNDhEdit
Gui Show, AutoSize

OnClipboardChange("Update")

Update(type) {
	global hEdit

	if (type != 2)
		GuiControl Text, % hEdit, % Clipboard
}

GuiClose:
	ExitApp
This seems to auto close when opened. Also is it possible to make it non minimizeable and persist in tray instead of in taskbar?
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Adding a simple GUI to display clipboard contents on desktop

15 Oct 2018, 11:44

yeah it autocloses. ive deleted the hotkey i used to test it with and forgot to add the #Persistent directive, so u can go ahead and do that
u can add the +ToolWindow option to the GUI to get rid of the taskbar icon
iPhilip
Posts: 822
Joined: 02 Oct 2013, 12:21

Re: Adding a simple GUI to display clipboard contents on desktop

15 Oct 2018, 12:08

Hi Xproplayer,

These minor changes should address your concerns:

Code: Select all

Gui New, +AlwaysOnTop +Owner -MinimizeBox, Clip Viewer
Gui Add, Edit, w300 R10 ReadOnly +HWNDhEdit
Gui Show, AutoSize
OnClipboardChange("Update")
Return

Update(type) {
	global hEdit

	if (type != 2)
		GuiControl Text, % hEdit, % Clipboard
}

GuiClose:
	ExitApp
Cheers!
Windows 10 Pro (64 bit) - AutoHotkey v2.0+ (Unicode 64-bit)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada, ntepa and 212 guests