Jump to content

ANYGUI.au3


quaizywabbit
 Share

Recommended Posts

For those of you who like to manipulate other program windows:

05 MAR, 2007 ANYGUIv2.8 ANYGUIv2.8.au3

modified _GuiTarget( ) to accept array in ControlId parameter to specify x/y CLIENTcoords of point in control

(for those pesky .Net controls where controlid/classnameNN change frequently)

for example:

Dim $coords[2] 
$coords[0] = 200  ;point x to check in CLIENT COORDS
$coords[1] = 29;point y to check in CLIENT COORDS
WinActivate("Edit Database Item")
$Ctrltarget = _GuiTarget("Edit Database Item", "", "", $coords)
Edited by quaizywabbit
[u]Do more with pre-existing apps![/u]ANYGUIv2.8
Link to comment
Share on other sites

i was trying to do this a few minutes ago, good job! :)

edit: i tryed it, but i can't get it to work :D here is my code

_GuiTarget ( "My Test" )
_TargetAddButton ( "Test", 3, 3, 50, 30 )
Edited by Xenogis

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

yes

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

why isn't GUISetState(@SW_SHOW) in the functions?

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

Yay, i got it to work. This is awesome.

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

you might want to set everything up using arrays and doing lots of ReDimming that way we can control multiple things with a msg loop

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

you can't, the functions don't return anything

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

No you dont.

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

Doesn't that parameter make sense, though? Don't you think it's important enough that each function gets it? I mean, in a library which creates controls on 3rd-party windows, I kind of expect there to be a parameter in the function allowing me to specify what window I want to add to.

Link to comment
Share on other sites

To embed a control into another window, I expect to make 1 function call and that's it. None of this GuiTarget() garbage. No fooling with global variables. Each function stand-alone and with no dependancies.

Link to comment
Share on other sites

How would you do it Valik? I think he's going for the same kind of thing as 'GUICreate,' and then adding controls.

I'd rather do his way then specifying a window each time?

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

i prefer the targeting to speed up writing it but it would be extremely simple to do it without

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

you still don't have GuiShow() in the functions :)

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

oops i wasnt thinking i ment GuiSetState()

edit: grammer error

Edited by Xenogis

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

here's an example use...not perfect, but all controls and child windows show ok;

<{POST_SNAPBACK}>

Here's my attempt at modifying the previous example to work with the new parameters and parameter order... please feel free to correct anything I've misunderstood.

Dale

#region Hoster demo addbutton
opt ("WinTitleMatchMode", 2)
#include <ANYGUI.au3>
#include <GUIConstants.au3>; must be included in main script for GUI Functions to work
Dim $myVar1, $myVarB1, $myVarB2, $myVarB3, $myVarB4, $myVarB5, $myVarB6, $myVarC1
Run('C:\Program Files\Micro Technology Unlimited\Hoster Demo\Hoster-demo.exe')
Sleep(8000)
WinActivate("Dialog")
ControlClick("Dialog", "Demo", 1); clears demo dialog box
WinSetState(" - Hoster", "", @SW_MAXIMIZE)
Sleep(2000)

ControlMove("Hoster", "", 1017, 20, 239, 700, 463)
$myVar1 = _GuiTarget("Hoster", "", "", 59648);<===Target is control on main application.
$myVarB1 = _TargetAddButton("Test", 750, 20, 100, 50, "", "", $myVar1)
GUISetState(@SW_SHOW)
$myVarB2 = _TargetAddButton("Test", 860,20, 100, 50, "", "", $myVar1)
GUISetState(@SW_SHOW)
$myVarB3 = _TargetAddButton("Test", 750,80, 100, 50, "", "", $myVar1)
GUISetState(@SW_SHOW)
$myVarB4 = _TargetAddButton("Test", 860,80, 100, 50, "", "", $myVar1)
GUISetState(@SW_SHOW)
$myVarB5 = _TargetAddButton("Test", 750,140, 100, 50, "", "", $myVar1)
GUISetState(@SW_SHOW)
$myVarB6 = _TargetAddButton("Test", 860,140, 100, 50, "", "", $myVar1)
GUISetState(@SW_SHOW)
$myVarC1 = _TargetChildCreate("Testing", 730, 200, 300, 600, $myVar1)
GUISetBkColor(0xff00)
GUISetState(@SW_SHOW)

While WinExists($myVar1)
      Sleep(100)
      If Not WinExists($myVar1) Then
         Exit
      EndIf
  WEnd
  _EndTarget()
  
#endregion

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

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...