Link something like toaster popup to specific window

Get help with using AutoHotkey and its commands and hotkeys
smbs
Posts: 48
Joined: 27 Feb 2014, 11:07

Link something like toaster popup to specific window

18 Jun 2017, 17:06

I want to create a toaster popup in a specific window at for instance top left corner that will move with the window if window is moved or resized.
Is this possible?
Many thanx
User avatar
Exaskryz
Posts: 2690
Joined: 17 Oct 2015, 20:28

Re: Link something like toaster popup to specific window

18 Jun 2017, 17:27

This is how I manage moving a window, though I think a better way was shared on the forums.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

smbs
Posts: 48
Joined: 27 Feb 2014, 11:07

Re: Link something like toaster popup to specific window

20 Jun 2017, 14:22

Many thanx u set me on the right road and I sorted it out
FanaticGuru
Posts: 803
Joined: 30 Sep 2013, 22:25

Re: Link something like toaster popup to specific window

20 Jun 2017, 16:44

Below is an example of setting a window as a parent of a Gui.

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus

This will make a button on an Excel window that will then move, minimize, maximize, etc. with the parent window.

The key is DllCall("SetParent", "uint", Gui_Hwnd, "uint", Win_Hwnd).

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts

AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon

Google Search, Dictionary, Thesaurus - Quickly Get Information from Specific Web Resources

[Function] Timer - Create and Manage Timers
smbs
Posts: 48
Joined: 27 Feb 2014, 11:07

Re: Link something like toaster popup to specific window

04 Jul 2017, 02:49

Many thanx again but is there a way of giving background colors and font color?
FanaticGuru
Posts: 803
Joined: 30 Sep 2013, 22:25

Re: Link something like toaster popup to specific window

05 Jul 2017, 11:55

smbs wrote:Many thanx again but is there a way of giving background colors and font color?
The same as you would for any GUI.

There is a Font and Color option for GUIs.

Code: [Select all] [Download] GeSHi © Codebox Plus

	Gui,MyGUI:Color, 202020 ;background color
Gui,MyGUI:Font, c5C5CF0 s17 wbold, Arial ; font color, size, weight, style


There are several toaster type notification scripts on the forum. Most of them make the notification popup in a location on the screen but they could probably be modified to tied to an existing window. I remember CornerNotify as one. There might be newer better ones, not sure, but a search should be able to find something.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts

AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon

Google Search, Dictionary, Thesaurus - Quickly Get Information from Specific Web Resources

[Function] Timer - Create and Manage Timers
smbs
Posts: 48
Joined: 27 Feb 2014, 11:07

Re: Link something like toaster popup to specific window

26 Jul 2017, 08:48

FG
Sorry --never saw your post regarding colors
Your suggestions

Code: [Select all] [Download] GeSHi © Codebox Plus

	Gui,MyGUI:Color, 202020 ;background color
Gui,MyGUI:Font, c5C5CF0 s17 wbold, Arial ; font color, size, weight, style

Does not seem to work unless I am missing something
Have searched the forum and found this in an old post--- see code below

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


How can I implement above code into your script you posted and change the background and font colors of the GUI?
FanaticGuru
Posts: 803
Joined: 30 Sep 2013, 22:25

Re: Link something like toaster popup to specific window

26 Jul 2017, 10:14

smbs wrote:FG
Sorry --never saw your post regarding colors
Your suggestions

Code: [Select all] [Download] GeSHi © Codebox Plus

	Gui,MyGUI:Color, 202020 ;background color
Gui,MyGUI:Font, c5C5CF0 s17 wbold, Arial ; font color, size, weight, style

Does not seem to work unless I am missing something

I misspoke. Font and Color does not work with buttons. Buttons are special and Windows does most of the work in creating them and uses the default colors of the theme of the window.

The code you show tries to get around this by making a button, setting its background to transparent, and then putting another Gui with a colored progress bar under it to simulate a background.

This is not a great solution but it is one of the simpler ones. There are a ton of post on the forums about making pretty buttons. Another common work around is to create a picture of a button and use Gui, Add, Picture and then make the picture respond to mouse clicks.

But your original post was about a toaster popup, if you don't actually need a button, then you can just use a text Gui. I only used a button as an example because it is what I had in one of my scripts that I could easily copy and paste to show how to "link" a Gui to a window.

This will add a simple text box with green background and red text.

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus


FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts

AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon

Google Search, Dictionary, Thesaurus - Quickly Get Information from Specific Web Resources

[Function] Timer - Create and Manage Timers
smbs
Posts: 48
Joined: 27 Feb 2014, 11:07

Re: Link something like toaster popup to specific window

26 Jul 2017, 10:34

Many thanx thats exactly what I needed

Return to “Ask For Help”

Who is online

Users browsing this forum: Bad husband, Class1, DarkKitten, geekgarage, Rastahammer and 41 guests