Jump to content

ANYGUI.au3


quaizywabbit
 Share

Recommended Posts

sorry i havent been around to follow up on this......havent been messing with autoit much...

anyone who wants to take over keeping this updated or changed to function better with the current and beta releases is just fine with me......

got other fish to fry.....

glad to see the concept wasnt a total waste of time...

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

  • 4 weeks later...

sorry i havent been around to follow up on this......havent been messing with autoit much...

anyone who wants to take over keeping this updated or changed to function better with the current and beta releases is just fine with me......

got other fish to fry.....

glad to see the concept wasnt a total waste of time...

it is most assuredly not a waste of time bud :D I use this udf quite a bit to add additional functionality to my companies programs when they "forget" to add additional things we want lol

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Link to comment
Share on other sites

  • 3 weeks later...

sorry i havent been around to follow up on this......havent been messing with autoit much...

anyone who wants to take over keeping this updated or changed to function better with the current and beta releases is just fine with me......

got other fish to fry.....

glad to see the concept wasnt a total waste of time...

Is it possible for this to respond to window resize events of the parent window? Ie when the parent window is resized, expand/contract the control embeded?

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Link to comment
Share on other sites

I wanted to embed a ListView using the UDF instead of the built in guictrl* ones. So had to change some features:

;===============================================================================
; Function Name:    _TargetaddListViewUDF()
;===============================================================================
Func _TargetaddListViewUDF($text, $PosX, $PosY, $SizeX, $SizeY, $style = -1, $exstyle = -1, $coInIT = False, $LocTargethWnd = 0)
    If Not ($LocTargethWnd = 0) Then $TargethWnd = $LocTargethWnd
    Local $a[3]
    $a[2] = _TargetaddChild($text, $PosX, $PosY, $SizeX, $SizeY, $TargethWnd)
    $a[0] = _GUICtrlListView_Create($a[2], $text, 0, 0, $SizeX-5, $SizeY - 2, $style, $exstyle, $coInIT)
    $a[1] = $a[0]
    If $a[2] = 0 Or $a[0] = 0 Or $a[1] = "" Then
        SetError(1)
        Return 0
    Else
        Return $a
    EndIf
EndFunc

That will allow you to embed that in there. To get the proper control to be able to add image lists, columns, etc:

$MyListView = _TargetaddListViewUDF("", 2, 2, 300, 300, BitOR($LVS_REPORT, $LVS_SINGLESEL, $LVS_SHOWSELALWAYS), BitOR($LVS_EX_DOUBLEBUFFER, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $WS_EX_STATICEDGE), True, $targetctl)
$MyListView = $MyListView[1]

That should make it to where it responds to even the co-init commadns for the UDF listview.

The reason for: $MyListView = $MyListView[1] is so that you can set the actual variable to the user created control. Thus, you can use it inside of image lists, search functions, etc. If you want to use controlListview(*) to manage the list view, as well, you have to make it look at the parent control created from:

$targetctl = _GuiTarget("TARGETWINDOW", 1, "", $handle)

Hope that helps someone :D

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Link to comment
Share on other sites

Is it possible for this to respond to window resize events of the parent window? Ie when the parent window is resized, expand/contract the control embeded?

I don't know about resizing but you could respond to the window being redrawn using Siao's shell hooking udf. Then you could check to see if the window size had changed.

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 don't know about resizing but you could respond to the window being redrawn using Siao's shell hooking udf. Then you could check to see if the window size had changed.

Thanks much! I was able to accomplish this by monitoring the $handle (initial window target control)'s size, and compare the values on each call. Now, thankfully, when the height or width is changed, the actual control is resized. I did have to realize, that the embedded control is actually 2 controlls: The desired control, and it's container. So, i had to pull the container handle as well. This is found as a[2] when creating the control, so if you set the values for the handle after the control is created, you can then interact with both the container and control. Example:

$Array = _TargetAddDraglist("", 2, 92, 238, $pos[3]-92, BitOR($LVS_REPORT, $LVS_SINGLESEL, $LVS_SHOWSELALWAYS), BitOR($LVS_EX_DOUBLEBUFFER, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $WS_EX_STATICEDGE), True, $targetctl)
$Control = $Array [1]
$Container = $Array [2]

Then you can change the size of it with a simple control move command:

$pos = WinGetPos($handle)
    If $pos[2] <> $parentW Then
        $parentW = $pos[2]
        resetwin($pos[0], $pos[1], $pos[2], $pos[3])
    EndIf
    If $pos[3] <> $parentH Then
        $parentH = $pos[3]
        resetwin($pos[0], $pos[1], $pos[2], $pos[3])
    EndIf


    ControlMove($handle, "", $Control , 2, 0, 238, $pos[3] -92)
    ControlMove($handle, "", $Container , 2, 92, 238, $pos[3]-92)

Note, before the mainloop, the Parent handle width and height are set to a variable, and then just compared. Believe it or not, it doesn't add anything to the cpu usage here, even with a continuous read of wingetpos(). As that's the case, i decided not to hook the app. This works wonderfully.

It's important to realize the movement of these windows. The $container, is the one that responds to the parent window X/Y coordinents. So when the window moves, you want to set the new size/position of that container relative to the window size.

The $control, as pulled, is referenced to the CONTAINER size, not the window size, hence why top value is 0, when you resize.

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Link to comment
Share on other sites

  • 2 years later...

Hi,

I have modified ANYGUIv2.8.au3 so that it works again.

Only changes are:

;$sztext = _GUICtrlListGetText($nID, $dragIdx)
$sztext = _GUICtrlListBox_GetText($nID, $dragIdx)
;_GUICtrlListDeleteItem($nID, $dragIdx)
_GUICtrlListBox_DeleteString($nID, $dragIdx)
;_GUICtrlListInsertItem($nID, $sztext, $dragIdto)
_GUICtrlListBox_InsertString($nID, $sztext, $dragIdto)
;_GUICtrlListSelectIndex($nID, $dragIdto)
_GUICtrlListBox_SetCurSel($nID, $dragIdto)

The following script now works (to remove title bar from existing notepad window):

#include "ANYGUIv2.8.au3"

Opt ("WinTitleMatchMode", 4)
$xh = WinGetHandle("Untitled - Notepad")
$Style = 0x00C00000
$ExStyle = -1
$result = _TargetStyle("unset", 1, $Style, $ExStyle, $xh)

Btw the includes are:

#include <GUIconstants.au3>
#include <WindowsConstants.au3>
#include <GUIListBox.au3>

Thanks and enjoy.

ANYGUIv2.8.au3

Edited by sensalim
Link to comment
Share on other sites

  • 2 years later...

Hi. I use the ANYGUI in my program to create new buttons. But every time i activate this function in a new window, the buttons that are created in a previous window that is open, don´t work anymore. How i can reactivate the buttons when i go back to work in a previous window without recreate the buttons every time ? Regards.

Link to comment
Share on other sites

  • 1 year later...

Getting errors:

>Running AU3Check (3.3.14.2)  from:C:\Program Files\AutoIt3  input:C:\Users\Bert\AutoIt3.My\AnyGui\ANYGUIv2.8.au3
"C:\Users\Bert\AutoIt3.My\AnyGui\ANYGUIv2.8.au3"(3,10) : error: can't open include file "guilist.au3".
#include "guilist.au3"
~~~~~~~~~^
"C:\Users\Bert\AutoIt3.My\AnyGui\ANYGUIv2.8.au3"(1071,49) : error: _GUICtrlListGetText(): undefined function.
                $sztext = _GUICtrlListGetText($nID, $dragIdx)
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
....

"C:\Users\Bert\AutoIt3.My\AnyGui\ANYGUIv2.8.au3"(1074,44) : error: _GUICtrlListSelectIndex(): undefined function.
                _GUICtrlListSelectIndex($nID, $dragIdto)
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Bert\AutoIt3.My\AnyGui\ANYGUIv2.8.au3 - 5 error(s), 0 warning(s)
!>13:14:30 AU3Check ended. Press F4 to jump to next error.rc:2
+>13:14:30 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 3.907

so where can i find GuiList.au3? This

is no possible solution for me, as i need to use Drag&Drop.

Edited by AutoBert
Link to comment
Share on other sites

  • 3 years later...

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