Delamite Posted December 30, 2021 Share Posted December 30, 2021 So I have a program that if it's the selected window any keystrokes open a command line. The same goes for another program that I run side by side, but the issue is typing in both manually whereas I'd like to have autoit detect whether I'm using either window and subsequently when typing a command line (only alpha non-numeric), the script will detect, copy, and enter it into the non-active window; and vice versa. Is this possible? I have many other windows open including chat, email, etc that I don't want to confuse auto-it with typing in general. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 30, 2021 Moderators Share Posted December 30, 2021 Moved to the appropriate forum, as the Developer General Discussion forum very clearly states: Quote General development and scripting discussions. Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums. Moderation Team Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Nine Posted December 30, 2021 Share Posted December 30, 2021 @DelamiteIt is possible but the way to achieve it will depends on various conditions. There is multiple ways to send keystrokes (or data) to a particular windows (Control*, _SendMessage, etc). To capture a keystroke, there is _IsPressed, HotKeySet, windows hooks to kb, etc. Again, it will depends on what you want to perform, the type of windows, the information you want to send/capture, etc. To get a better answer, you will need to provide much more information. And of course (the most important part), a first attempt script. “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) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
ad777 Posted December 30, 2021 Share Posted December 30, 2021 (edited) you can detect 2 window:or more using: Local $add While 1 For $i = 1 To WinList()[0][0] Local $list = WinList() if $list[$i][0] = "Untitled - Notepad" Then $add &= $i &";"&"pid:"&WinGetProcess( $list[$i][1])&@CRLF EndIf Next MsgBox(0,'You Have DETECT 2 Window(handle)',$add) $add = "" WEnd Edited December 30, 2021 by ad777 iam ِAutoit programmer. best thing in life is to use your Brain to Achieve everything you want. 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