AliOzturk Posted June 9, 2012 Share Posted June 9, 2012 Hello this is somehow a continuation of my previous thread.Issue/Question 1#WinActive - Is it not working or am i'm doing something wrong?I tried the provided test code :If WinActive("[CLASS:Notepad]") Then MsgBox(0, "", "Window was active") EndIfbut i didn't receive any msgbox.Then i tried with my own code :If WinActive("[CLASS:Notepad]") Then WinSetState("[CLASS:Notepad]", "", @SW_MINIMIZE) Sleep(1000) WinSetState("[CLASS:Notepad]", "", @SW_MAXIMIZE) EndIfand still same result, nothing happends - whats wrong?Issue/Question 2#When using WinSetState to SetState to @SW_MAXIMIZE it doesn't go into this window.Like if i wanted a quick way to open and write into Notepad then i want it to open so i can start typing without need of clicking on it to like .. focus it.Example : Try open up notepad and then click somewhere else than on the notepad.or its pretty much like WinSetOnTopIssue/Question 2#Is it possible to check if @SW_MAXIMIZE = true then execute a command and make an else function?For example: (not working i know, just an example)if "WinSetState("[CLASS:Notepad]", "", @SW_MAXIMIZE)" = true then Sleep(1000) else MsgBox(.....) EndIf Link to comment Share on other sites More sharing options...
JohnOne Posted June 9, 2012 Share Posted June 9, 2012 Issue #3 You opened a new thread on the same subject you already have open and current. 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...
AliOzturk Posted June 9, 2012 Author Share Posted June 9, 2012 (edited) Issue #3You opened a new thread on the same subject you already have open and current.Sorry but it didn't seem active so i just decided to add this issue to this thread. As i already was creating the thread. Edited June 9, 2012 by nacon Link to comment Share on other sites More sharing options...
mike9900 Posted June 9, 2012 Share Posted June 9, 2012 Issue #1 Is the notepad window active when the code is ran? Try this If WinActivate("[CLASS:Notepad]") Then WinSetState("[CLASS:Notepad]", "", @SW_MINIMIZE) Sleep(1000) WinSetState("[CLASS:Notepad]", "", @SW_MAXIMIZE) EndIf Or put a sleep in before WinActive to give you some time to make the notepad window active.... Issue #2 You need to use WinGetState. Use something like this $value = WinGetState("[CLASS:Notepad]") if BitAnd($value, 32) then MsgBox(0,"WinSize","Notepad window is maximized") else MsgBox(0,"WinSize","Notepad window is not maximized") EndIf 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