Minimizing and Maximizing a program that is in the System Tray
Channel: AUTOHOTKEY Gurus
Date: 2021-11-04

I wanted to have a hotkey to bring up PushBullet.  Unfortunately the program isn't minimized, it is in the system tray.  While talking to Jean Lalonde we realized I don't need to close it to the system tray. Then I can minimize and maximize it!   

I also talk through how to take the code and make it into an AutoHotkey funciton

You can get the code here: https://gist.github.com/c8f42de134b5ffb3211bba3fcf972ff9
TLDR: Collaboration, automation, and clear communication are key to optimizing code and improving efficiency in AutoHotkey.

1. 00:00 💡 Share your work with others to gain new perspectives and solve problems, like the author did with a shrunken tool in the system tray.
 1.1 Talk about what you're working on with others to think differently and vocalize your problem to solve it, as demonstrated by the author's experience with maximizing a shrunken tool in the system tray.

2. 01:11 💻 Create a function in auto hotkey to improve efficiency and easily identify window titles with a tool like Pushbullet Pro.
 2.1 Learn how to create a function in auto hotkey to avoid rewriting code and improve efficiency.
 2.2 The speaker demonstrated how to use a tool to easily identify the window title of a specific application, such as Pushbullet Pro.

3. 02:38 💻 Check window status with "when get" command and use variable "win status" to restore (-1) or minimize (0) window.
 3.1 Get the status using the "when get" command and store it in a variable called "win status" to take certain actions based on the returned number.
 3.2 The variable with a value of minus one indicates that the window should be restored, while a value of zero indicates that it should be minimized.

4. 04:20 💻 Use a hotkey to automate text messages and copy/paste between computer and phone with Pushbullet, but be aware that closing the tool requires extra steps to bring it back up; create a function to simplify code and replicate similar tools.
 4.1 The speaker discusses using a hotkey to bring up a tool for automating text messages through Pushbullet, which also allows for copying and pasting between a computer and phone, but notes that closing the tool sends it to the system tray and requires extra steps to bring it back up.
 4.2 Create a function to avoid messy code and easily replicate similar tools by identifying constants and passing them as parameters.

5. 05:53 📝 Testing apps incrementally is easier than troubleshooting later.
 5.1 Create a variable called "window title" and adapt it to a function by baby stepping through and changing the code to look for a variable instead of text.
 5.2 Testing apps incrementally is easier than troubleshooting later.

6. 07:46 📝 Defining a function with a window title parameter allows for easy calling and potential use of a return statement.
 6.1 Create a function called "toggle visibility" with one parameter, the window title, to break away from the program name.
 6.2 Defining a function doesn't do anything until it's called, and copying and pasting the function into a variable allows for easy calling and potential use of a return statement.

7. 09:23 💻 Write code that is easy to understand and optimize for future use by communicating with others and using clear, concise language.
 7.1 Talk to others about your code and write it in a way that you can optimize it for future use.

8. 11:00 💡 AutoHotkey is a useful tool for creating simple GUIs, and Udemy offers affordable courses to learn more.
 8.1 Use a simple GUI in AutoHotkey and check out Udemy courses to learn more for around $12.