sidewalk6 Posted December 17, 2006 Share Posted December 17, 2006 first, the auto it instructions say, in a control function you can replace ControlID with ClassNameNN Control Handle or Text, but I can't get it to work with either, am I doing something wrong? Do you have to change an option to get it to recognize other identifiers? I use SciTE and it only recognizes numbers as valid. second... is something like this possible... dim $check1 = WinExists("Connected") if $check1 = 1 Then Global $table = "Connected" If $check1 =0 Then Global $window = "Online" EndIf EndIf WinActivate($window) Or am I barking up the wrong tree? Link to comment Share on other sites More sharing options...
Zedna Posted December 17, 2006 Share Posted December 17, 2006 Look at Opt("WinTitleMatchMode") in the HelpFile. Maybe it's your problem ... Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
sidewalk6 Posted December 17, 2006 Author Share Posted December 17, 2006 (edited) first, the auto it instructions say, in a control function you can replace ControlID with ClassNameNN Control Handle or Text, but I can't get it to work with either, am I doing something wrong? Do you have to change an option to get it to recognize other identifiers? I use SciTE and it only recognizes numbers as valid.second... is something like this possible...dim $check1 = WinExists("Connected")if $check1 = 1 ThenGlobal $window= "Connected"If $check1 =0 Then Global $window = "Online"EndIfEndIfWinActivate($window)Or am I barking up the wrong tree?TitleMatching isn't my problem... with Control commands it dosn't seem to recognize anything but ControlID, though the manual says you can use Control Handle or ControlNameNNwith that bit of code, I'm trying to set a window name as a variable, then use that varible to identify its coorosponding window in a functionthere was still an error in the first bit I posted the $table should have been $window, I changed it in the reply, the reply is what I'm trying to doreally the problem lies with winactivate($window) Edited December 17, 2006 by sidewalk6 Link to comment Share on other sites More sharing options...
tAKTelapis Posted December 17, 2006 Share Posted December 17, 2006 (edited) I think this is what your trying to achieve with your example. You can declare variables as global if you want (i guess), but this should work. I moved the WinActivate INSIDE the IF statements, otherwise it would attempt to activate nothing. $check1 = WinExists("connected") If $check1 = 1 Then $window = "connected" WinActivate($window) ElseIf $check1 = 0 Then $window = "online" WinActivate($window) EndIf Edited December 17, 2006 by tAKTelapis Link to comment Share on other sites More sharing options...
sidewalk6 Posted December 17, 2006 Author Share Posted December 17, 2006 I think this is what your trying to achieve with your example. You can declare variables as global if you want (i guess), but this should work. I moved the WinActivate INSIDE the IF statements, otherwise it would attempt to activate nothing. $check1 = WinExists("connected") If $check1 = 1 Then $table = "connected" ElseIf $check1 = 0 Then $window = "online" WinActivate($window) EndIf Yea, I goofed up before... I want to acheive something like this.. winactivate($var) and the $var being either a window called "connected" or "Online" is that possible or do $var have to be numbers only? Link to comment Share on other sites More sharing options...
tAKTelapis Posted December 17, 2006 Share Posted December 17, 2006 you can set a variable to be anything text / numerical. $var = "1" will return "1" $var = "connected" will return connected a good way to check: MsgBox(0, "test", $var) will produce a popup giving you the value of $var Link to comment Share on other sites More sharing options...
sidewalk6 Posted December 17, 2006 Author Share Posted December 17, 2006 (edited) oops Edited December 17, 2006 by sidewalk6 Link to comment Share on other sites More sharing options...
sidewalk6 Posted December 17, 2006 Author Share Posted December 17, 2006 you can set a variable to be anything text / numerical.$var = "1"will return "1"$var = "connected"will return connecteda good way to check:MsgBox(0, "test", $var)will produce a popup giving you the value of $varso then, winactivate($var) should work and activate window "Online" if $var is set to = "Online"?should it be Dim $var = "Online" or Dim $Var = Online ? 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