Caleb7 Posted March 1, 2019 Share Posted March 1, 2019 I need to read windows push notifications, but I'm at a loss. I've captured them with this code, however I cannot find any controls inside the window to read. #include <APISysConstants.au3> #include <WinAPISysWin.au3> Global $gui = GUICreate( '' ) GUIRegisterMsg( _WinAPI_RegisterWindowMessage( "SHELLHOOK" ), "WM_SHELLHOOK" ) _WinAPI_RegisterShellHookWindow( $gui ) OnAutoItExitRegister('OnAutoItExit') While 1 Sleep( 10 ) WEnd Func WM_SHELLHOOK( $hWnd, $iMsg, $wParam, $lParam ) #forceref $iMsg Switch $hWnd Case $gui Local $title = WinGetTitle( $lParam ) Switch $wParam Case $HSHELL_REDRAW If IsString( $title ) Then If $title == "New notification" Then Local $data = "" ; ?? ConsoleWrite( "Notification: " & $data & @CRLF ) EndIf EndIf EndSwitch EndSwitch EndFunc Func OnAutoItExit() _WinAPI_DeregisterShellHookWindow($gui) EndFunc LarsJ 1 Link to comment Share on other sites More sharing options...
LarsJ Posted March 1, 2019 Share Posted March 1, 2019 You need UI Automation code to automate such a window Earthshine 1 Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
Caleb7 Posted March 1, 2019 Author Share Posted March 1, 2019 2 hours ago, LarsJ said: You need UI Automation code to automate such a window I get script error when trying to create code with this image <-- look Link to comment Share on other sites More sharing options...
LarsJ Posted March 1, 2019 Share Posted March 1, 2019 Are you using the correct version of CUIAutomation2.au3 dated 2018-01-12 from the Includes folder? Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
Caleb7 Posted March 1, 2019 Author Share Posted March 1, 2019 4 minutes ago, LarsJ said: Are you using the correct version of CUIAutomation2.au3 dated 2018-01-12 from the Includes folder? Yes, I found out it was because the notification window only lasts 5 seconds and the program requires the window to remain open to make code for it. Anyways, I increated the notification time to 5 mins so the window stays open, then tried to create code. Everything I created from UI Automation was unable to run with script errors, tons of them. Can't seem to get it to work following the guide on your post. Link to comment Share on other sites More sharing options...
LarsJ Posted March 1, 2019 Share Posted March 1, 2019 Read How-to-topic number 15 more carefully. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
drrehak Posted January 12, 2022 Share Posted January 12, 2022 hi, I am also trying to accomplish this. Would I also create a While..Wend statement if using UI Automation? 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