pau31

Windows 10 Traytips

11 posts in this topic

Hello everyone,

I've just upgraded my SO to Windows 10 and I've noticed that the function TrayTip() generates this different type of message:

Captura.thumb.PNG.4a3884259d957eebed31ed

The problem is that one traytip command does not immediately dismiss the previous one, so it takes forever. I've also tried this: 

To clear a balloon tip that is being displayed, call another tip with an empty text string (and any title).

TrayTip("", "A different tray tip.", 5)

But it doesn't work :/

Anyone has been throught this problem? Or can you recommend me an alternative way to inform the user about the status of a script?

Thank you very much!

Share this post


Link to post
Share on other sites



Hi, i know it's been a while, but im very interested in the solution for this, because i have the same problem.

Here's what i tried so far without success:
 

TrayTip('test', 'testing', 5, 1)
Sleep(1000)
ConsoleWrite('Lets do this - '&@MSEC&@CRLF)
WinClose('[CLASS:Windows.UI.Core.CoreWindow]')
WinKill("[CLASS:Windows.UI.Core.CoreWindow]")
WinClose('New notification')
WinKill('New notification')
TrayTip('', '', 0)
ConsoleWrite('Killed? - '&@MSEC&@CRLF)
Sleep(7000)

Info tool outputs those 2 fields, but they dont work with these functions.


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

 

Share this post


Link to post
Share on other sites

You could try creating your own UDF for TrayTip using the MSDN reference. Good luck with that, it doesn't look to fun. Could also try ControlClick? Make your own UDF for TrayTip (Like _TrayTipWin10) that will check to see if a notification is currently present, close it, then call TrayTip.

You could also use ToolTip instead or create a GUI with an edit box in it that you can append to or a label that you can overwrite with debugging info

Share this post


Link to post
Share on other sites

Yes, doesn't look fun, and i don't have enough knowlegde to do it. On a side note WinWaitActive also doesn't detect it, controlclick won't detect the place to click, so it has to be made from scratch, its something new to autoit.


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

 

Share this post


Link to post
Share on other sites

This page in msdn has code on hiding the toasts, what can i do with it? I got a general idea on the dll calls and such, but not a pro on it.


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

 

Share this post


Link to post
Share on other sites

You'd have to create your own toast notification UDF that's going to do some DLL calls. I know C++ pretty well but I don't know enough about dll calls to create a class, set values, and call the toast display/hide functions.

Melba made some toast notification example that might help if you don't want to use windows toast

And it looks like someone suggested disabling the tray icon for the script and then re-enable it (Since notifications will not be displayed if there's no tray icon).

This works on windows 7, you might want to use a timer instead of just sleep

_TrayTip("Title 1", "First test notification", 5)

_TrayTip("Title 2", "Second test notification", 2)

Func _TrayTip(Const ByRef $sTitle, Const ByRef $sMsg, Const ByRef $iTimeout, Const $iOption = 0)
    Local $hwnd_timer

    TrayTip($sTitle, $sMsg, $iTimeout, $iOption)

    $hwnd_timer = TimerInit()
    While (($iTimeout * 1000) - TimerDiff($hwnd_timer) > 0)
        Sleep(10)
    WEnd

    Opt("trayiconhide", 1);Momentarily hides AutoIt Tray Icon as TrayTip cannot function without a tray icon.
    Opt("trayiconhide", 0);Re-enables AutoIt Tray Icon.
EndFunc

You could Adlibregister/deregister to check a global timer instead of keeping the script stuck in the _TrayTip function

Share this post


Link to post
Share on other sites

I've used melba's toasts in the past, i'll probably use 'em again, now, in terms of disabling the toasts and stuff, you have the option for it, by opening the action center and clicking the notification, to "disable all notifications for this application" or whatever. I just wanted to be able to delete a previous toast to update the information faster, as of now it doesn't and each toast has a long timeout, i did discover that killing "shellexperiencehost.exe" the toast goes away, the problem is that whenever another one is called, the one that comes up was the last one "killed", not the new one.

ProcessExplorer shows this exe, it's kinda hidden.

Untitled.png


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

 

Share this post


Link to post
Share on other sites

Hi, im not sure you got the issue, but i'll try to explain again, using traytips in autoit outputs these windows notifications that, take forever to go away, and don't update fast as say, a tooltip, you can output like 3 traytips in 3 seconds, 1 per second, but the time for windows to show you the actual/last traytip is going to be like 10 seconds, can't precise, but seems forever, and the notifications pile up in action center.. Basically it doesn't work as in windows 7, just try it and see.


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

 

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Maybe using a different means to communicate information to the user? Check if your use of TrayTip follows these guidelines:

 

See the Notifications and Notification Area sections of the Windows User Experience Interaction Guidelines for best practices in the use of notifications and the notification area. The goal is to provide user benefit through appropriate use of notifications, without being annoying or distracting.

The notification area is not for critical information that must be acted on immediately. It is also not intended for quick program or command access. As of Windows 7, much of that functionality is best accomplished through an application's taskbar button.

Windows 7 allows a user to suppress all notifications from an application if they choose, so thoughtful notification design and use will incline the user to allow your application to continue to display them. Notifications are an interruption; ensure that they are worth it.

Windows 7 introduces the concept of "quiet time". Quiet time is defined as the first hour after a new user logs into his or her account either for the first time or for the first time after an operating system upgrade or clean installation. This time is set aside to allow the user to explore and familiarize themselves with the new environment without the distraction of notifications. During this time, most notifications should not be sent or shown. Exceptions include feedback that the user would expect to see in response to a user action, such as when he or she plugs in a USB device or prints a document. API specifics of regarding quiet time are discussed later in this topic.

If not, I'd suggest using a MsgBox or similar. 

Edited by hydranix

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

I created a kind of toast, similar to the windows one, but this one can be called many times, and will override the previous one.

 

 

Capture.PNG

Edited by careca

Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • BBs19
      By BBs19
      Features:
      Create modern looking borderless and resizable GUIs with control buttons (Close,Maximize/Restore,Minimize, Fullscreen, Menu) True borderless, resizeable GUI with full support for aerosnap etc. Many color schemes/themes included. See MetroThemes.au3 for more details. 3 type of Windows 8/10 style buttons. Modern checkboxes, radios, toggles and progressbar. All buttons, checkboxes etc. have hover effects! Windows 10 style modern MsgBox. Windows 10/Android style menu that slides in from left. Windows 10 style right click menu
      Example(Image): 

      Hover effect of the control buttons:

      Windows 10-Style MsgBox:

      Windows 10/Android-Style menu:

      Credits: @UEZ, for the function to create buttons with text using GDIPlus. @binhnx for his SSCtrlHover UDF
      Version 5.0 - Changelog - 03.09.2017
      New features:
      Hover effects, minimize,maximize,restore and other GUI effects are now working natively, there is no need to call any function in a loop. This also allows the hover effects to work if the main script is paused due to "Sleep, Msgbox etc." The hover effects now work slightly faster and create less CPU usage, however the startup time of the main script is slightly increased. Thanks to @binhnx for his SSCtrlHover UDF. Maximize, Minimize, Fullscreen and Restore buttons now work natively, meaning you don't need to set actions for them manually.  If you prefer handling the buttons manually, then you can disable this by setting "$ControlBtnsAutoMode = False" Added _Metro_CreateButtonEx2 -> Creates a slightly rounded button without a frame around. Hovering changes the button color to a lighter color. Added _Metro_CreateCheckboxEx2 -> Creates a modern round checkbox. Added _Metro_CreateRadioEx -> Creates a metro style radio with colored checkmark. Added "_Metro_RightClickMenu" an easy to use rightclick menu. You can use this with listviews or anything else. Check out the example for a demo of the rightclick menu and how to implement it. -> Rightclick on Button3 to show the menu. Added multiple new themes with flat colors and updated the old themes. Check out the example for a demo with all themes by pressing the menu button -> Themes Demo Improvements:
      You can now delete all controls that have hover effects(buttons, checkboxes etc.) using GUICtrlDelete($ControlHandle). This will also automatically release all resources and remove the control from the global array. Many other optimizations,changes and bugfixes.  
      Download UDF with example:
       
       
    • VIP
      By VIP
      I can not do anything with any user in the "Local Users Group"
      I tried from my account but I could not change my password (ie set new password)!
      But I was able to activate the Administrator account and I logged into the Administrator account and still could not do anything with my account! But I can set the password and disable the Administrator account from my account or Administrator.
      Any ideas? (Ignore the click on the Sign-in option in the Change Accout settings.)
       

    • dreivilo47
      By dreivilo47
      When I want to test Example 1 of Function _IECreate (AutoIt Help File), I see that function _IECreate doesn't work in Windows 10.
      Syntax Check (Ctrl+F5) gives no errors.
       
      Example 1:
      ; Create a browser window and navigate to a website #include <IE.au3> Local $oIE = _IECreate("www.autoitscript.com")  
      The error I receive with F5 (Tools, Go) in SciTE:

    • Chaym
      By Chaym
      Does AutoIT supported  in Windows 10 OS (x64)?
      After installing AutoIT in x64 OS and recompiling code,
      I get a lot of error messages...
       
    • kristo
      By kristo
      The DriveGetDrive command returned all drives (option "ALL") for years now and my program could always rely on that function. Suddenly a drive letter that was created with the subst command does not appear in the list of drives anymore. And it clearly did, because I used to react to a certain subst command by reacting to new or revoked (subst /D) drive letters.
      Why is that? I think this a bug because there's no way left to list ALL drive letters anymore.
      And why should I use an API command for that when this was already built in for years?