Advertisement
This is comment for paste
Time Saver (Thunderbird snippets and XML)
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if the similar feature that I made for Outlook ever shows its window visibly loading for awhile at computer startup, then I'll need to use the commented code below:
- HandleCreatedOutlookEvent(hWinEventHook, event, hWnd, *)
- {
- static outlookIsBeingLoaded := false
- ; Most windowing functions that are given a pure HWND will also work while it's hidden (dunno if it matters here but still)
- try shouldExecute := WinGetClass(hWnd) = "Olk Host" && !outlookIsBeingLoaded
- if (shouldExecute ?? false)
- {
- outlookIsBeingLoaded := true
- WinSetTransparent(0, hWnd)
- ComCall(5, tbl, "Ptr", hWnd) ; Calls tbl.DeleteTab(winId), which deletes a tab from the TaskbarList
- DllCall("UnhookWinEvent", "Ptr", hWinEventHook)
- ; while (!WinExist("- Outlook ahk_exe olk.exe")) ; Minimum delay for the minimize to work
- ; WinSetTransparent(0, hWnd) ; Making Outlook temporarily transparent (multiple times because it doesn't always work)
- ; WinSetTransparent(0, hWnd) ; Making Outlook temporarily transparent (again in case the loop above didn't already succeed)
- WinWait("- Outlook ahk_exe olk.exe") ; Minimum delay for the minimize to work
- Sleep(2000) ; Extra delay to make sure that outlook has fully loaded before minimizing it and then outlook won't have to load once the user activates it
- WinMinimize(hWnd)
- WinSetTransparent("Off", hWnd)
- ComCall(4, tbl, "Ptr", hWnd) ; Calls tbl.AddTab(winId), which adds a tab to the TaskbarList
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement