Jump to content

Windows Status Variable


Champak
 Share

Recommended Posts

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

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

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 by Champak
Link to comment
Share on other sites

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

@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

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

  • 3 weeks later...

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

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 by evilertoaster
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...