TwoBeAss Posted January 9, 2019 Posted January 9, 2019 Hi Everybody, i have a small WinActivate script wich is doing nothing more then activate a window and send a keypress... I noticed that this script is not working if i have my actual focus in a typing field with a blinking curor (Browser adress bar, notepad, word, chatwindow etc...) If i change my focus to something else where i am not able to type, the script is working.. WinActivate("[CLASS:MyWindowClass]") Opt("SendKeyDownDelay", 800) Send("x") Any suggestions ?
Nine Posted January 9, 2019 Posted January 9, 2019 tested with notepad and got no problem in all situation. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
TwoBeAss Posted January 9, 2019 Author Posted January 9, 2019 very strange.. after posting this article, i wasnt able to reproduce this behaviour either :/ I will have an eye on this... thanks for testing @Nine
gyaani Posted January 25, 2019 Posted January 25, 2019 Getting same behaviour. Window comes to top, but doesn't have focus. (title bar is greyed out. Keys don't get sent) $hwnd1 = WinGetHandle("[ACTIVE]") Sleep(300) $hwnd2 = _WinAPI_GetWindow ($hwnd1, $GW_HWNDNEXT ) Send ("SomeKeys") Sleep(300) WinActivate($hwnd2) Sleep(300) WinWaitActive($hWnd2) reports that the window was activated. WinSetState($hWnd2, "", @SW_SHOW) WinSetState($hWnd2, "", @SW_RESTORE ) WinSetState($hWnd2, "", @SW_ENABLE ) Windows 8.1 . UAC disabled. Added #RequireAdmin . Using a high contrast windows theme. Tried with multiple windows, notepad2, autoit help file. What else can be tried ?
Nine Posted January 25, 2019 Posted January 25, 2019 Since we don't know what windows are $hWnd1 and $hWnd2, it is kind of hard to test this script. I would suggest you make a full executable script with 2 run functions. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
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