hendrikhe Posted November 2, 2020 Share Posted November 2, 2020 Hello, I am trying to create a small tool which alerts me when I receive a message from Skype for Business. You know sometimes you simple miss a conversation... I need to know when the message windows pops up: If message window active Then play a very loud sound EndIF Usually I would use WinActive() function, however it requires a title. And this doenst work, because the title is the name of the person messaging me, and can change every time. Is it possible to check if a Class "LyncTabFrameHostWindowClass" is active? Link to comment Share on other sites More sharing options...
Danp2 Posted November 2, 2020 Share Posted November 2, 2020 57 minutes ago, hendrikhe said: Usually I would use WinActive() function, however it requires a title. And this doenst work, because the title is the name of the person messaging me, and can change every time. Actually, this is incorrect. See the help file entry for Winactive, then check the description of the Title parameter. Notice the part where it say "See title special definition"? Click that and it will take you to the Window Titles and Text (Advanced) entry. Read the section with the heading "Advanced Window Descriptions" for details on how to use things like window class to identify a window. Also, if you look at the example under the WinActive help file entry, it shows how to use Class with WinActive. Loc 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
hendrikhe Posted November 3, 2020 Author Share Posted November 3, 2020 Than Danp2 , you are right. Here my solution for others who might have the same idea/question: #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> #include <Array.au3> #include <Sound.au3> while 1 $x = WinExists("[CLASS:LyncTabFrameHostWindowClass]", "") $y = WinExists("Skype for Business Notification", "") if $x or $y Then SoundPlay(@WindowsDir & "\media\tada.wav", 1) EndIf ;MsgBox($MB_SYSTEMMODAL, "Stdout Read:", $x) sleep(500) WEnd Link to comment Share on other sites More sharing options...
JockoDundee Posted November 3, 2020 Share Posted November 3, 2020 3 hours ago, hendrikhe said: Here my solution for others who might have the same idea/question: Seems kinda obnoxious, 2 tada’s per second, no way to make it stop without closing the very message you want to read. May I suggest: While WinWait("[CLASS:LyncTabFrameHostWindowClass]", "") SoundPlay(@WindowsDir & "\media\tada.wav", 1) WinWaitClose("[CLASS:LyncTabFrameHostWindowClass]", "") WEnd Code hard, but don’t hard code... Link to comment Share on other sites More sharing options...
hendrikhe Posted November 5, 2020 Author Share Posted November 5, 2020 thnx, good idea Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now