Jump to content

ANYGUI.au3


quaizywabbit
 Share

Recommended Posts

I try to run the calculator and the notepad examples and the only thing I can see is the calculator and the notepad, nothing more.

When I run the script is like I am running an script that open notepad or calculator, there is not any gui or buttons ....

Link to comment
Share on other sites

I try to run the calculator and the notepad examples and the only thing I can see is the calculator and the notepad, nothing more.

When I run the script is like I am running an script that open notepad or calculator, there is not any gui or buttons ....

<{POST_SNAPBACK}>

Some of these examples refer to the original version ie(#include <ANYGUI.au3>)

or (#include <ANYGUIv2.1.au3>)

the version is now (#include <ANYGUIv2.2.au3>

more than likely this is why it wasn't working.

Edited by quaizywabbit
[u]Do more with pre-existing apps![/u]ANYGUIv2.8
Link to comment
Share on other sites

#include <guiconstants.au3>
#include <ANYGUIv2.2.au3>
Run ( "calc" )
WinWait ( "Calculator" )
$Pos = WinGetPos ( "Calculator" )
WinMove ( "Calculator", '', (@DesktopWidth-$Pos[2])/2, (@DesktopHeight-$Pos[3])/2, $Pos[2] + 47, $Pos[3] )
_GuiTarget ( "Calculator", 1 )
$Quit = _TargetAddButton ( "Quit", $Pos[2]-10, 37, 50, 29 )
$Quit = $Quit[0]
GUISetState ( )
_TargetAddLabel ( "Notepad", $Pos[2]-10, 66, 50, 18 )
GUISetState ( )
_TargetAddEdit ( "", $Pos[2]-10, 84, 50, 115 )
GUISetState ( )
While 1
    $msg = GUIGetMsg ( )
    If $msg = $Quit Then Exit
    If Not WinExists ( "Calculator" ) Then Exit
WEnd

Func OnAutoItExit()
    ProcessClose ( "calc.exe" )
EndFunc

This is the code, but only show the calculator, like if you run it noemally.

Link to comment
Share on other sites

I just ran the code you posted, and the controls did show up (quit button, Edit control, etc..)

try the Notepad example( i fixed the versioning on it)

#include <ANYGUIv2.2.au3>
#include <guiconstants.au3>
Run("notepad.exe")
Sleep(1000)
WinSetState("Untitled - Notepad", "", @SW_MAXIMIZE)
$Targetwindow = _GuiTarget ("Untitled - Notepad", 1); mode 1 set so all '_Targetadd(s) go to this window
_setwindow()
Func _setwindow()
    ControlMove($Targetwindow, "", 15, 0, 0, 800, 500);resize Edit1 control so everything fits
$btn1 = _TargetaddButton ( "Button1", 30, 550, 100, 50);
GUISetState(@SW_SHOW);
$btn2 = _TargetaddButton ( "Button2", 150, 550, 100, 50);
GUISetState(@SW_SHOW);
$Child = _TargetaddChild ("Test", 810, 0, 205, 500);
GUISetBkColor(0xff000);
$label1 = GUICtrlCreateLabel("Child Window", 60, 0, 100, 30)
$btn3 = GUICtrlCreateButton("Button3", 52, 35, 100, 50);
$grp1 = GUICtrlCreateGroup("Testing", 20, 90, 165, 200);
$radio1 = GUICtrlCreateRadio("A", 95, 120);
$radio2 = GUICtrlCreateRadio("B", 95, 180);
$radio3 = GUICtrlCreateRadio("C", 95, 240);
$Date = GUICtrlCreateDate("My Calender", 20, 300, 165, 180);
GUISetState(@SW_SHOW);
$tab = _TargetaddTab (300, 500, 715, 210);
$tab1 = GUICtrlCreateTabItem("First");
$tab2 = GUICtrlCreateTabItem("Second");
$tab3 = GUICtrlCreateTabItem("Third");
GUISetState(@SW_SHOW)
EndFunc
While WinExists($Targetwindow)
   $msg = GUIGetMsg(1)
   If $msg[0] = $GUI_EVENT_CLOSE Then Exit
   If $msg[0] = $GUI_EVENT_RESTORE or $GUI_EVENT_RESIZED then _setwindow()

   If Not WinExists($Targetwindow) Then Exit
   Sleep(50)
WEnd

edited the original example so it stays updated after resizing or restoring....

Edited by quaizywabbit
[u]Do more with pre-existing apps![/u]ANYGUIv2.8
Link to comment
Share on other sites

I just ran the code you posted, and the controls did show up (quit button, Edit control, etc..)

try the Notepad example( i fixed the versioning on it)

#include <ANYGUIv2.2.au3>
#include <guiconstants.au3>
Run("notepad.exe")
Sleep(1000)
WinSetState("Untitled - Notepad", "", @SW_MAXIMIZE)
$Targetwindow = _GuiTarget ("Untitled - Notepad", 1); mode 1 set so all '_Targetadd(s) go to this window
_setwindow()
Func _setwindow()
    ControlMove($Targetwindow, "", 15, 0, 0, 800, 500);resize Edit1 control so everything fits
$btn1 = _TargetaddButton ( "Button1", 30, 550, 100, 50);
GUISetState(@SW_SHOW);
$btn2 = _TargetaddButton ( "Button2", 150, 550, 100, 50);
GUISetState(@SW_SHOW);
$Child = _TargetaddChild ("Test", 810, 0, 205, 500);
GUISetBkColor(0xff000);
$label1 = GUICtrlCreateLabel("Child Window", 60, 0, 100, 30)
$btn3 = GUICtrlCreateButton("Button3", 52, 35, 100, 50);
$grp1 = GUICtrlCreateGroup("Testing", 20, 90, 165, 200);
$radio1 = GUICtrlCreateRadio("A", 95, 120);
$radio2 = GUICtrlCreateRadio("B", 95, 180);
$radio3 = GUICtrlCreateRadio("C", 95, 240);
$Date = GUICtrlCreateDate("My Calender", 20, 300, 165, 180);
GUISetState(@SW_SHOW);
$tab = _TargetaddTab (300, 500, 715, 210);
$tab1 = GUICtrlCreateTabItem("First");
$tab2 = GUICtrlCreateTabItem("Second");
$tab3 = GUICtrlCreateTabItem("Third");
GUISetState(@SW_SHOW)
EndFunc
While WinExists($Targetwindow)
   $msg = GUIGetMsg(1)
   If $msg[0] = $GUI_EVENT_CLOSE Then Exit
   If $msg[0] = $GUI_EVENT_RESTORE or $GUI_EVENT_RESIZED then _setwindow()

   If Not WinExists($Targetwindow) Then Exit
   Sleep(50)
WEnd

edited the original example so it stays updated after resizing or restoring....

<{POST_SNAPBACK}>

I have tried it, but nothing, I don't know what happen, the icon of the script is showed but only the notepad is showed in the screen :dance::whistle:
Link to comment
Share on other sites

7 Aug, 2005: Version 2.3

Renamed _TargetSetStyle() to _TargetStyle()

Changed action verbs to "set", "unset", and "replace" When verb is 0 or left blank, it returns the current Styles/Exstyles for the 'target'

updated first post...

Edited by quaizywabbit
[u]Do more with pre-existing apps![/u]ANYGUIv2.8
Link to comment
Share on other sites

10 Aug, 2005 V2.5

added "toggle" to _TargetStyle() (see 1st post)

a stand-alone version of _TargetStyle() is available HERE

I named it _TargetQueryStyles()

any ideas for a better name are welcomed..... :whistle:

Edited by quaizywabbit
[u]Do more with pre-existing apps![/u]ANYGUIv2.8
Link to comment
Share on other sites

a basic example using "toggle" in _TargetStyle()

note the DllCall's to 'GetMenu' and 'SetMenu' for restoring the original menu.(THANKS VALIK!! :whistle: )

#include <ANYGUIv2.5.au3>
#include <guiconstants.au3>
Run("notepad.exe")
WinWait("Untitled - Notepad")
$Targetwindow = _GuiTarget ("Untitled - Notepad", 1); mode 1 set ($Targetwindow is Global)
$menu = DllCall("user32.dll", "hwnd", "GetMenu", "hwnd", $Targetwindow)
Sleep(2000)
For $i = 1 to 20
_TargetStyle("toggle", 1, BitOR( $WS_CHILD, $WS_SYSMENU, $WS_CAPTION))
Sleep(2000)
_TargetStyle("toggle", 1, BitOR( $WS_CHILD, $WS_SYSMENU, $WS_CAPTION))
DllCall("user32.dll", "int", "SetMenu", "hwnd", $Targetwindow, "hwnd", $menu[0])
Sleep(2000)
$i = $i + 1
Next

While WinExists($Targetwindow)
   $msg = GUIGetMsg()
If Not WinExists($Targetwindow) Then Exit
   Sleep(50)
WEnd
Edited by quaizywabbit
[u]Do more with pre-existing apps![/u]ANYGUIv2.8
Link to comment
Share on other sites

impeccable Code my friend truely sublime to read :(

packed with programming goodies..

jim warrington would be proud of autoit3, dang im proud of autoit3.

in fact imm reiterate my support for autoit by allowing Devloper Access to my COmputer for Development OF or Testing OF Autoit3 and beta autoit (most Current as soon as it comes out...

i HAVE 5 CAL's FOR a WINDOW 2003 Sever and beyond that im kinda restricted..:D

if u have knowledge about setting up 2003 server pls PM or Email me i kinda know what im doing... :whistle: i just need some info From u... ie user names :u set u own pass upon entry.. : and which times u would like to connect : the time thing will be resticted to That time only unless u PM ME... i Can install SCite as i have yet to.. primalscript 3.1 is installed.. PERL is INSTALLED... IIS GOING TO REMOVED.. Jscript.NET2.0 VB.NET2.0 C#.NET2.0.. CAn Setup a Mail Server..

Can Get Any needed Includes.. :"> :dance: Might install PHP :/

as u can see i want this to be a pure development a production server for many languages.. but autoit is my favorite :dance: So ANYONE of more than 9 months With true Interestes in developing Server SIDE CODE PLS contact me..

Edited by WSCPorts
http://www.myclanhosting.com/defiasVisit Join and contribute to a soon to be leader in Custumized tools development in [C# .Net 1.1 ~ 2.0/C/C++/MFC/AutoIt3/Masm32]
Link to comment
Share on other sites

12 Aug, 2005 ANYGUIv2.6

added -

_WinMenuGetHandle()

_WinMenuSetState()

see 1st post

here's an updated example use:

#include <ANYGUIv2.6.au3>
#include <guiconstants.au3>
Run("notepad.exe")
WinWait("Untitled - Notepad")
$Targetwindow = _GuiTarget ("Untitled - Notepad", 1)
$menu = _WinMenuSetState($Targetwindow, "hide"); self-explanatory
Sleep(12000)
Local $i
Do
    _TargetStyle ("toggle", 1, BitOR($WS_CHILD, $WS_SYSMENU, $WS_CAPTION)); Child in, Sysmenu and Caption out
    Sleep(2000)
    _TargetStyle ("toggle", 1, BitOR($WS_CHILD, $WS_SYSMENU, $WS_CAPTION), $WS_EX_TOOLWINDOW);Sysmenu and Caption in, Child out (will alternate between Toolwindow and Normal when not in Child mode)
    _WinMenuSetState($menu);show menu
    Sleep(2000)
    $i = $i + 1
Until $i = 20
Sleep(4000)
_WinMenuSetState($menu, "hide"); just use initial variable here
Sleep(2000)
_WinMenuSetState($menu);show it again
While WinExists($Targetwindow)
    $msg = GUIGetMsg()
    If Not WinExists($Targetwindow) Then Exit
    Sleep(50)
WEnd
Edited by quaizywabbit
[u]Do more with pre-existing apps![/u]ANYGUIv2.8
Link to comment
Share on other sites

  • 3 months later...

it takes me to a blank page, i've tried it at least 20 times... lol think you can upload it somewhere else for me? i REALLY need this, REALLY bad

Edit: ok... now this almost seems useless lol... i open getright to see if that works, and it downloads like 10 .zip's, so i just try the one that says 2.6 and... its just got one, single, 50kb .au3 that when run, does nothing, period... nothing at all... and it doesnt come with instructions on how to get it to work, so.... wtf? lol B) lil help here?

Edited by TK_Incorperate
Link to comment
Share on other sites

First, read ANYGUI. Each function is documented. Then, read this whole topic and try a couple of the examples in this topic......

ANYGUI is a collection of functions(ie. library) that allow users to add controls to existing applications and modify styles/exstyles of any control/window.

[u]Do more with pre-existing apps![/u]ANYGUIv2.8
Link to comment
Share on other sites

  • 3 weeks later...

Hi quaizywabbit,

i've had a look at the doc, but i can't realize a button or icon in excel. :lmao:

Can you give me a short example (yes, i've seen the calculator example ...).

:P

Thx

Jens

First, read ANYGUI. Each function is documented. Then, read this whole topic and try a couple of the examples in this topic......

ANYGUI is a collection of functions(ie. library) that allow users to add controls to existing applications and modify styles/exstyles of any control/window.

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