How to Create layered windows- Hellbent's PopupWindow Class and GDIP
Channel: AUTOHOTKEY Gurus
Date: 23/09/2021

Want to create layered windows with AutoHotkey?  Hellbent joins me in this tutorial on using his PopupWindow class.  It's a great way to create layered windows using the GDIP library.

You can get all the files used & mentioned in this video here: https://the-Automator.com/PopupWindow

TLDR: The video demonstrates how to create and customize windows in Python GUI, draw and display images, and use Windows API programming to create interactive GUIs with simple code and easy-to-follow syntax.

1. 00:00 📝 A new tool for working with layered windows in programming reduces code and allows for quick prototyping.
 1.1 Hellbent and Joe from the Automator discuss adding cool functionality to the Windows Snipping Tool and share a new tool with viewers.
 1.2 The speaker created a simple class for working with layered windows that allows for quick prototyping and reduces the amount of code needed to set up a layered window.
 1.3 To use the gdi plus library in AutoHotkey, include it at the top of your script or type out the full path to the library.
 1.4 The lecture covers the basics of using classes in programming for organization and sharing information, and the speaker provides a link to a helper function and emphasizes that using classes is easier than writing them.
 1.5 The function returns a pointer to a token which doesn't need to be shut down as AutoHotkey does its own cleanup.
 1.6 Use the built-in tool in the class to clipboard methods and call pop-up window helper with a hotkey.

2. 10:26 🖼️ Creating and customizing windows in Python GUI, including painting the background and updating the window, demonstrated through changing the color and drawing a bitmap image.
 2.1 Create a new window, give it a name, show the window, and confirm that the image is in the clipboard before pasting it.
 2.2 Creating a new window in Python GUI involves painting the background, updating the window, and naming the window for manual interaction.
 2.3 Creating windows in Python returns an object with various properties that can be customized, and the gdip stuff sets up the GUI and creates a layered window.
 2.4 The class simplifies typing by allowing the user to create an object and use methods to act on it, demonstrated through changing the color of a window.
 2.5 In Windows 8 or higher, you can use a second window as a child to move things together, but in Windows 7, the only option is to use owner name and calculate the new position every time.
 2.6 The speaker demonstrated how to draw a bitmap image from a file using the gdip functions tool.

3. 20:41 👨‍💻 Use gdip to draw and display images in a window, dispose of bitmaps after use, and learn about messages for more control over coding.
 3.1 The speaker uses gdip to draw a bitmap in a window and gets the size of the image using functions from gdip.
 3.2 The speaker used the gdi library to get the width and height of an image and used it to center the window and display the image.
 3.3 To save memory, dispose of bitmaps after use unless they need to be kept for later use.
 3.4 The speaker creates a new window draw with a bitmap to update and show the window, and uses layered windows to create a tool, and discusses the importance of detecting user clicks.
 3.5 Using messages is the simplest way to move a window in AutoHotkey, and learning about messages can provide more control over coding, but it can be a bit of a rabbit hole.
 3.6 Learn how to use the left mouse button down message to call a function with four parameters when clicked on a GUI.

4. 31:17 👨‍💻 Understanding function parameters, monitoring GUI object clicks, and using post message and send message in Windows API programming.
 4.1 The speaker explains the parameters that get passed to a function and how to parse them by looking at the message that triggered the function.
 4.2 Multiple messages can be combined to go to the same function by parsing the value of messages, and there are better ways to use the parameters being passed.
 4.3 The speaker demonstrates how to monitor every single time a user clicks on a GUI object by binding the window object to a function.
 4.4 The speaker discusses using if statements and handles to get the tooltip and window handle in order to move the window.
 4.5 Post message and send message are two ways of sending a message, with a subtle difference between them, but one of them waits for a return.
 4.6 The code is 0x a1,2 and it encounters a specific condition.

5. 38:59 👨‍💻 Learn how to create interactive GUIs and detect mouse clicks using AutoHotkey.


6. 52:04 👨‍💻 Understanding objects and dot notation is powerful in programming and can completely change how you program over time
7. 01:10:46 📢 The speaker encountered beeps during the lecture

8. 01:21:00 👨‍💻 Learn how to create GUIs, animate graphics, and manipulate windows in Python with simple code and easy-to-follow syntax