Champak Posted January 14, 2008 Share Posted January 14, 2008 I did not do a search for this because I suspect the results would be overwhelming. Anyway, is it possible in anyway to have the Windows activity as a variable. It seems the regular way doesn't work. Ex. $WinExists = IniRead(....) Why? Because I have an option in my app that allows the user to choose if they want certain functions to work while the window is active or while generally exists....this is pertinent and useful to this particular app. Thanks. Link to comment Share on other sites More sharing options...
martin Posted January 14, 2008 Share Posted January 14, 2008 I did not do a search for this because I suspect the results would be overwhelming. Anyway, is it possible in anyway to have the Windows activity as a variable. It seems the regular way doesn't work. Ex. $WinExists = IniRead(....) Why? Because I have an option in my app that allows the user to choose if they want certain functions to work while the window is active or while generally exists....this is pertinent and useful to this particular app. Thanks.I'm not sure I understand what you want to do. If you want to find the state of a window then you can do something like $wstate = WinGetState($gui1) if @error = 0 then $wexists = BitAnd($wstate,1) = 1 $Wvisible = BitAnd($wstate,2) = 2 $wenabled = BitAnd($wstate,4) = 4 . . endif Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Champak Posted January 15, 2008 Author Share Posted January 15, 2008 (edited) I'm 3/4 asleep right now so I don't know if you showed me exactly what I need, so let me try to explain it a little clearer. My GUI gives someone the option of setting how it detects a certain applications window...whether it is WinActive or WinExists---this is saved in an ini file. When they run the GUI, it reads the ini file for WinExists or WinActive which should look like this: If $winactivity("application") then ..... EndIf But I get some type of error saying I can't have that as a variable. Is there some other way I can do this, or is what you showed me what I need to do?....it doesn't seem like it. Thanks Edited January 15, 2008 by Champak Link to comment Share on other sites More sharing options...
Xandl Posted January 15, 2008 Share Posted January 15, 2008 Hello, I think $winactivity("application") should be winactivity("application"). Something starting with $ will be interpreted as variable, not as function call. ciao Xandl Link to comment Share on other sites More sharing options...
Xenobiologist Posted January 15, 2008 Share Posted January 15, 2008 Hi, you can use Execute like Execute("MsgBox('64', 'Titel', 'Text', 3)") or tanslate the vaule and do If then else in the code. So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Champak Posted January 16, 2008 Author Share Posted January 16, 2008 @Xandl How I have it is the right way I need it. Xenobiologist I don't think "Execute" will work (I've never used that before note) because the "IF" function is going to be around 15 lines, not 1. I also have never done this "translate" you are talking about. How do I translate a variable? And why would I need to do that anyway (besides this instance here)? I thought a variable is read like the actual word or whatever was there. Link to comment Share on other sites More sharing options...
Champak Posted January 16, 2008 Author Share Posted January 16, 2008 The error I'm getting is when I execute the application after the script is compiled...so the program will work except when I call this function. the error is an AutoIt error:L -:Error: Error in expression Link to comment Share on other sites More sharing options...
Xenobiologist Posted January 16, 2008 Share Posted January 16, 2008 Hi, can you show a little example, please. So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Champak Posted January 22, 2008 Author Share Posted January 22, 2008 Hi, there is nothing major in the code, it is simply as follows:$winactivity = "WinExists";This var is changed in the settings by the user to different detection schemes. If $winactivity("Microsoft") Then MsgBox(0,1,1) EndIfThat throws an expression error.Thanks Link to comment Share on other sites More sharing options...
Champak Posted February 6, 2008 Author Share Posted February 6, 2008 Last call...Anyone????????????????????????/ Link to comment Share on other sites More sharing options...
Bowmore Posted February 6, 2008 Share Posted February 6, 2008 Hi, there is nothing major in the code, it is simply as follows: $winactivity = "WinExists";This var is changed in the settings by the user to different detection schemes. If $winactivity("Microsoft") Then MsgBox(0,1,1) EndIfoÝ÷ Ù8Z¶Øk£ìië,Þ®º+N§Ïêº^ §ì¨º·(uëhjëh×6$winactivity = "WinExists";This var is changed in the settings by the user to different detection schemes. If $winactivity = "Microsoft" Then MsgBox(0,1,1) EndIf "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook Link to comment Share on other sites More sharing options...
Champak Posted February 7, 2008 Author Share Posted February 7, 2008 That's brilliant. You have to be a certified genius to post such an asinine and useless response. Link to comment Share on other sites More sharing options...
evilertoaster Posted February 7, 2008 Share Posted February 7, 2008 (edited) hum well still not to clear on what you're trying to do. This will read a command from an .ini file and run whichever one is specified. The syntax will only work for things like WinActive, or WinExists which have 1 argument. $WinStatus=IniRead(@ScriptDir&"\config.ini","Settings","WindowsState","WinActive") $result=Execute($WinStatus&"('Microsoft')") MsgBox(0,"Return value",$result) Edited February 7, 2008 by evilertoaster Link to comment Share on other sites More sharing options...
Champak Posted February 8, 2008 Author Share Posted February 8, 2008 This does pretty much what I wanted. The only thing is I have to change the "IF" to look for a "1" or a "0". I never came across that "Execute" function before...at first I was wondering what the hell this code was suppose to do. Thanks. 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