Sign in to follow this  
Followers 0
cdr

Anygui button does not always show

5 posts in this topic

I'm using anygui to add a button to an external app. The window is something that is opened dozens of times, so the button needs to be added every time. I based my code mainly on examples I've seen here.

The problem is that the button does not always become visible when @SW_SHOW is set. Maybe 1 out of 4 times it will not become visible. The button will still be there though and will become visible if it is clicked or the app window is activated.

Sometimes you even see a flicker where the button appears and then immediately disappears. It seems like it's missing the repaint in the app window or something.

Right now I'm using WinActivate to force the app window to redraw after I put the button on, but it introduces a visible delay in the button being added and even then the button still doesn't show maybe 1 in 50 times. I'd very much like to get it to show up in the first place like it should.

My add button code:

Func _addButton( $targetName )

$targetHandle = _GuiTarget( $targetName )

$myButton = _TargetaddButton ( "Copy", $x, $y, w, $h, "", "", $targetHandle )

GUISetState(@SW_SHOW, $myButton[2])

GUICtrlSetOnEvent( $myButton[0], "_copyButtonPressed" )

WinActivate( $targetHandle )

EndFunc

Any suggestions?

Share this post


Link to post
Share on other sites



Mind sharing the applications name so maybe we could reproduce it? I've personally never had this happen.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Mind sharing the applications name so maybe we could reproduce it? I've personally never had this happen.

ClearQuest forms. I might see if I can reproduce it in any other apps if I get a chance.

Also worth nothing is that it will show fine every time if I run it on pre-existing windows - it's only when I add the button right after the app window is created that I get problems.

Share this post


Link to post
Share on other sites

I also have trouble in a "custom application" here @ work to use the anygui UDF's.

It won't let me add anything.

The problem seems to be that this application does not accept a child window. ($WS_CHILD)

almost all UDF's inside anygui.au3 use the _TargetaddChild UDF :

...
Func _TargetaddChild($text, $PosX, $PosY, $SizeX, $SizeY, $LocTargethWnd = 0);
    If not ($LocTargethWnd = 0) Then $TargethWnd = $LocTargethWnd
    Local $a = GUICreate($text, $SizeX, $SizeY, $PosX, $PosY, $WS_CHILD, -1, $TargethWnd)
    If $a = 0 Then SetError(1)
    Return $a
EndFunc   ;==>_TargetaddChild
...
oÝ÷ Ùh^ëzZqïÛ¶Ó~H!È,?Ûo&ôߥ

I can add objects to the application.

Maybe this works for you too ?


D2charkeeper = No more 'expired characters' in D2.File Date Changer = Change the file date(s), attributes and the filename case of multiple files @ once.Updater_full = Copy/Update your autoitscripts, pictures, .mp3, .avi etc ... subdirs from your PC to your memory stick or to your external harddisk. Now with scheduling and logging.Questmapper

Share this post


Link to post
Share on other sites

Unfortunately, that seems to be a completely different problem.

Not to mention that $WS_POPUP and $WS_CHILD are completely different - if you use $WS_POPUP, the window you add won't even be inside the parent window you want it in.

I also have trouble in a "custom application" here @ work to use the anygui UDF's.

It won't let me add anything.

The problem seems to be that this application does not accept a child window. ($WS_CHILD)

almost all UDF's inside anygui.au3 use the _TargetaddChild UDF :

When I replace the $WS_CHILD by $WS_POPUP :

I can add objects to the application.

Maybe this works for you too ?

Share this post


Link to post
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
Sign in to follow this  
Followers 0