Exit Posted February 8, 2016 Share Posted February 8, 2016 (edited) I want to trap a tray notification from Bluestacks/WhatsApp. Here is my code OnAutoItExitRegister("_Exit") Func _Exit() If IsDeclared("@exitCode") Then MsgBox(262144, Default, "Exit", 3) Exit EndFunc ;==>_Exit If Not HotKeySet("{ESC}", "_Exit") Then Exit MsgBox(16 + 262144, Default, "Script cancelled due to HotKey ESC already defined. ", 5) MsgBox(262144, Default, "Start", 1) While Sleep(1000) Beep(500, 100) ; next line has german string "Neue Benachrichtigung". change it if not running german version of windows If WinExists("[class:Windows.UI.Core.CoreWindow;title:Neue Benachrichtigung]") Then ExitLoop WEnd Beep(1000, 1000) MsgBox(262144, Default, "Window found", 0) The code does not show the "Window found" message even when the tray notify message appears. When I omit the ";title:Neue Benachrichtigung" the "found" message appears at once even when there is no notification window. Do you know of another method to read the notification Windows of other applications? Edited February 8, 2016 by Exit App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Danyfirex Posted February 8, 2016 Share Posted February 8, 2016 I think You can do this if just want to know it exist a notification of bluestack. #include <GUIConstantsEx.au3> #include <WinAPIEx.au3> Global $BlueStackPID = ProcessExists("Bluestacks.exe") ;the corrcet process name I dont know what it is. :S Example() Func Example() Local $hGUI = GUICreate('An(other) example by guinness - 2013', Default, Default) GUISetState(@SW_SHOW, $hGUI) GUIRegisterMsg(_WinAPI_RegisterWindowMessage('SHELLHOOK'), 'WM_SHELLHOOK') _WinAPI_RegisterShellHookWindow($hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd _WinAPI_DeregisterShellHookWindow($hGUI) GUIDelete($hGUI) EndFunc ;==>Example Func WM_SHELLHOOK($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg Local $sTitle = WinGetTitle($lParam) Local $iPID=0 $iPID = _WinAPI_GetWindowThreadProcessId($hWnd, $iPID) If $wParam = $HSHELL_REDRAW And $sTitle = "Notificación nueva" and $iPID = $BlueStackPID Then ConsoleWrite("BlueStack Notification!!!" & @CRLF) EndIf EndFunc ;==>WM_SHELLHOOK If you want to check the text "whatsapp" you must combine with this. Saludos Exit 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Exit Posted February 9, 2016 Author Share Posted February 9, 2016 20 hours ago, Danyfirex said: GUIRegisterMsg(_WinAPI_RegisterWindowMessage('SHELLHOOK'), 'WM_SHELLHOOK') _WinAPI_RegisterShellHookWindow($hGUI) Thanks! This was the missing link. I'll come back with my final Version. App: Au3toCmd UDF: _SingleScript() 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