ia85 Posted September 27, 2014 Share Posted September 27, 2014 Hi, Im new to AutoIT. I know it should be simple but i cant get it to work , can someone please write the complete scripts ? 1.trying to make a window return to be on top of other windows. this should be looped every 2 seconds as long as the window is open. 2.trying to make a window (notepad for example) return to be on top of other windows, be in focus for receiving key strikes to a text box. this should be looped every 2 seconds as long as the window is open. thanks! Link to comment Share on other sites More sharing options...
JohnOne Posted September 27, 2014 Share Posted September 27, 2014 Hi Welcome Try it yourself. WinSetOnTop AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 27, 2014 Moderators Share Posted September 27, 2014 ia85,Welcome to the AutoIt forums. We do not write code to order here - we help you get your code working. Think of the old saying: "Give a man a fish, you feed him for a day; give a man a net and you feed him forever". We try to be net makers and repairers, not fishmongers.So I suggest you take a look at AutoIt's excellent Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) as this will help you enormously. You should also look at this excellent tutorial - you will find other tutorials in the Wiki (the link is at the top of the page). There are even video tutorials on YouTube if you prefer watching to reading. As JohnOne has suggested, I would start with WinSetOnTop, WinExists, Send & Sleep - that should get you most of what you want. Just post your code (see here how to do it) even if it does not work and we will help you lick it into shape. M23 EKY32 1 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...
EKY32 Posted September 27, 2014 Share Posted September 27, 2014 Gentle men, I'm really impressed with your interactive with new people around here. Thank you from the heart. [font="'trebuchet ms', helvetica, sans-serif;"]Please mark the answer of your question if you found it.[/font] Link to comment Share on other sites More sharing options...
Solution ia85 Posted September 28, 2014 Author Solution Share Posted September 28, 2014 ok, so i took the tutorials and managed to make actual progress - thanks for your guidance ! it only needed 3 commands, but it works great. i used a while loop that is always true, WinActivate, Sleep this is my first code: While 1 WinActivate("[CLASS:Notepad]", "") Sleep(2000) WEnd any ideas on how to replace the Sleep command and use a more elegant command on order to keep the window in focus ? Link to comment Share on other sites More sharing options...
Xandy Posted September 29, 2014 Share Posted September 29, 2014 (edited) This code will replace 'sleep()' so that your script does not lockup or halt during the sleep() command.You can process other information, instead of idling (sleeping) with this code. $timer_len= 2*60*1000;set the timer for two min $timer= timerinit();start the timer While 1 if timerdiff($timer)>= $timer_len then;check the timer $timer= timerinit();reset timer WinActivate("[CLASS:Notepad]", "");do that thing endif WEnd.I'm not sure about the elegant focus.You could use a handle to only activate a specific notepad window. Is that what you want? Edited September 29, 2014 by Xandy ia85 1 Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
JohnOne Posted September 29, 2014 Share Posted September 29, 2014 Well done ia85, ia85 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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