marko29 Posted January 10, 2011 Posted January 10, 2011 (edited) It brings the window to the front but it doesnt give the focus to a window, for example if you winactivate() notepad to the front and if you press ALT then ENTER it doesnt trigger File menuoption. Probably because window still has no focus and the title bar is still grayed out. So as result i cant use WinActivate() then apply keyboard presses on the Notepad(for example) I usually dont ask for alot of help due to programming experience in other languages Autoit is really amazingly simple and smooth language so it feels bit silly to get stuck with something like this Edited January 10, 2011 by marko29
JoHanatCent Posted January 10, 2011 Posted January 10, 2011 it doesnt give the focus to a window How do you open Notepad? Does this not work for you? #Include <Array.au3>; Neede to display the Array Run("notepad") WinWait("Untitled - Notepad", "", 8) If WinExists("[CLASS:Notepad]") Then MsgBox(0, "Found you", "Notepad Window exists!", 1) Else MsgBox(0, '', 'Could not find NotePad') exit EndIf WinActivate("Untitled - Notepad") Send("Hallo my NotePad" & @CRLF) For $i = 1000 To 1100 Send($i & @CRLF) Next $var = WinList("Untitled - Notepad", "") _ArrayDisplay($var, "Have " & $var[0][0] & " Windows that exist")
water Posted January 10, 2011 Posted January 10, 2011 What language do you use (english, german ...) for your windows? I once had a problem with a notepad example caused by the different title when running a german windows. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
marko29 Posted January 10, 2011 Author Posted January 10, 2011 And looky look all of sudden it now works on 32bit Windows 7, yesterday i was breaking my head with this and WinMenuSelectItem on vista 64 Any thoughts on this? Btw thanks for help
marko29 Posted January 10, 2011 Author Posted January 10, 2011 (edited) Actually now it all works on 64 vista as well, i feel stupid, no idea what was blocking it but something probably did as i had alot of stuff opened Edited January 10, 2011 by marko29
marko29 Posted January 10, 2011 Author Posted January 10, 2011 (edited) Actually i see now what the problem was, in the example file from autoit there is an error: WinMenuSelectItem("[CLASS:Notepad]make sure this empty char doesnt exist ", "", "&File", "Page Set&up..." ) If you use this it wont select notepad because of empty char on the end of "[CLASS:Notepad](THIS EMPTY SPACE HERE)" though "[CLASS:Notepad]" works fine Same goes if you use titlename and leave empty char on the end. So i believe the option to get rid of errors like this is to change something in the general option function(forgot its name) Btw the problem with winactivate was that i was activating the control inside window, not the actual window i needed to activate but i was doing this because it is really hard to get handle of this window, still trying to fix this.. Edited January 10, 2011 by marko29
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