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

    • brodillo
      By brodillo
      Hello, I've experience using automation anywhere. Now I want to learn Auto It for my automatization projects.
      I've tried to implement an example using calculator program in Windows 10.
      When I used au3Info program to identify  an escefific zone in the calc window , au3info always return the same advanced class  [CLASS:ApplicationFrameInputSinkWindow; INSTANCE:1] 
      Is there a restriction for windows 10?
      See my little script
       
      Run("Calc.exe")
      WinWaitActive("Calculadora")
      WinActive("Calculadora")
      $old="0"
      $new="1020"
      $controlNumber="[CLASS:ApplicationFrameInputSinkWindow; INSTANCE:1]"
      ControlSetText("Calculadora","",$controlNumber,$new)
      ControlSend("Calculadora","",$controlNumber,$new)
       
      I've tried using controlSetText and ControlSend.
       
      Thank you for your help
       
    • DLS
      By DLS
      I have a working script that changes the core affinity and process priority of multiples of a specific application I have running.  
      I have that part figured out.

      I would like to make a little modification to it.

      Windows10 introduced virtual desktops.  I am trying to have different core affinity and priority of processes on the visible and non-visible desktops.  
      What I need is a bool function that could be described as IsWindowOnCurrentDesktop($hWnd).  I have searched the winAPI.au3 but I do not believe anything like that exists built it.
      I have searched multiple places before asking for help. I found a Microsoft supplied example of the function I need using C#, but I am unfamiliar with C# to a degree that I cannot port the system call over.
      https://blogs.msdn.microsoft.com/winsdk/2015/09/10/virtual-desktop-switching-in-windows-10/
      Help is appreciated but not expected.  Thanks in advanced.   In the meantime I will be learning C# syntax and class structure.
    • therks
      By therks
      Does anybody know how I would go about getting the window title bar colour on Windows 10? I tried using _WinAPI_GetSysColor, and manually reading the registry (HKCU\Control Panel\Colors, ActiveTitle) but in either case I get the same (0x99B4D1, wrong) result.
      RegRead('HKCU\Control Panel\Colors', 'ActiveTitle') ; Returns 153 180 209 (aka 99B4D1) _WinAPI_GetSysColor ($COLOR_ACTIVECAPTION) ; Returns 0xD1B499 (aka 99B4D1)  
    • therks
      By therks
      As the title says, does anyone know of a way to open the Windows 10 action center using AutoIt. Maybe via rundll or some other applet?
      My intention is to just hide the normal icon, then have an AutoIt system tray icon that will open the action center on click. And I can't just send the Win+A hotkey because I have it disabled. 
      Thanks for reading.
    • TMelanson
      By TMelanson
      Hi folks,
      I'm hoping someone can help me out here.
      Background:
      I have the need to run a program with admin credentials (#RequireAdmin), and then get the SID of the locally logged in account. Not the admin account.
      If you look at the attached script, Line 16 uses the @UserName variable and returns the SID for the admin account I used to launch the app.
      I want to use line 17 which passes the result of the _GetUsername function which is a username using  ($UserName) to the WMIService.
      I'm getting " The requested action with this object has failed.:" error message.
      Any suggestions would be appreciated!
       
      test1.au3