starlitsky Posted July 24, 2018 Share Posted July 24, 2018 I use the WinExists() try to catch the error message from the system, my OS is Windows 10. I use Autoit Window Info can see the TrayTip's title and some information, but TrayTip seems not the window... so I can't use WinExists() to catch it. Have any function can catch the TrayTip on win10? Link to comment Share on other sites More sharing options...
Danp2 Posted July 24, 2018 Share Posted July 24, 2018 Google search can be your friend. Here's one example -- Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
starlitsky Posted July 24, 2018 Author Share Posted July 24, 2018 1 minute ago, Danp2 said: Google search can be your friend. Here's one example -- I try it. but the problem still... Link to comment Share on other sites More sharing options...
starlitsky Posted July 24, 2018 Author Share Posted July 24, 2018 35 minutes ago, Danp2 said: Google search can be your friend. Here's one example -- #include <GUIConstantsEx.au3> #include <WinAPIEx.au3> Global $PID = ProcessExists("winword.exe") MsgBox(0, "check", $PID) Example() Func Example() Local $hGUI = GUICreate('Test 2018', 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 = "新通知" and $iPID = $PID Then ConsoleWrite($lParam & "Notification shows!" & @CRLF) EndIf EndFunc ;==>WM_SHELLHOOK Maybe my modify have some error, this code can work for anyone? Or it occurs a problem just with Chinese? The GUI window has shown, but even the notification appears, GUI just show nothing. Link to comment Share on other sites More sharing options...
starlitsky Posted July 24, 2018 Author Share Posted July 24, 2018 Maybe my modify have some error, this code can work for anyone? Or it occurs a problem just with Chinese? The GUI window has shown, but even the notification appears, GUI just show nothing. Global $PID = ProcessExists("winword.exe") 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 = "新通知" And $iPID = $PID Then ConsoleWrite($lParam & "Notification shows!" & @CRLF) EndIf EndFunc ;==>WM_SHELLHOOK 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