Advertisement
Lorenzo501
Nov 14th, 2024
1
0
Never
This is comment for paste Time Saver (Thunderbird snippets and XML)
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 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:
  2. HandleCreatedOutlookEvent(hWinEventHook, event, hWnd, *)
  3. {
  4. static outlookIsBeingLoaded := false
  5.  
  6. ; Most windowing functions that are given a pure HWND will also work while it's hidden (dunno if it matters here but still)
  7. try shouldExecute := WinGetClass(hWnd) = "Olk Host" && !outlookIsBeingLoaded
  8.  
  9. if (shouldExecute ?? false)
  10. {
  11. outlookIsBeingLoaded := true
  12. WinSetTransparent(0, hWnd)
  13. ComCall(5, tbl, "Ptr", hWnd) ; Calls tbl.DeleteTab(winId), which deletes a tab from the TaskbarList
  14. DllCall("UnhookWinEvent", "Ptr", hWinEventHook)
  15.  
  16. ; while (!WinExist("- Outlook ahk_exe olk.exe")) ; Minimum delay for the minimize to work
  17. ; WinSetTransparent(0, hWnd) ; Making Outlook temporarily transparent (multiple times because it doesn't always work)
  18.  
  19. ; WinSetTransparent(0, hWnd) ; Making Outlook temporarily transparent (again in case the loop above didn't already succeed)
  20. WinWait("- Outlook ahk_exe olk.exe") ; Minimum delay for the minimize to work
  21. 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
  22. WinMinimize(hWnd)
  23. WinSetTransparent("Off", hWnd)
  24. ComCall(4, tbl, "Ptr", hWnd) ; Calls tbl.AddTab(winId), which adds a tab to the TaskbarList
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement