Jump to content

CTL refresh issue


gsb
 Share

Recommended Posts

I have a small ctl that mainly consists of an IE instance and a couple of buttons.

It is resizable, but when minimized and then restored, the text that should show does not until:

1) more content is sent,

2) the control is resized, or

3) the content (blank) is 'clicked' upon.

It is like the IE control does not 'wake up' when restored and needs a kick by the user.

Is their any 'kick' that I can program in as an 'onRestore' type event to force a refresh of the CTL?

I have searched and come up dry. :whistle:

gsb

"Did you ever stop to think? ...and forget to restart!"
Link to comment
Share on other sites

  • Moderators

Are we supposed to guess at this? A mysterious app with a mysterious control that is mysteriously is not refreshing...

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.

Link to comment
Share on other sites

  • Moderators

See if this may give you some insight... doesn't look exactly like what you are doing, but if I understand what you are trying it might be close.

http://www.autoitscript.com/forum/index.ph...st&p=310179

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.

Link to comment
Share on other sites

SmOke_N,

Ah... I see your point I think, but that is not my problem I think.

The control has 3 states (or so I am trying...)

1) open, visible and running,

2) closed, not showing and inactive but leaving the tray icon for re-activation, and

3) minimized to the program tray and still active/running.

First two are working fine.

Third works also BUT when I restore the control from the program tray the content is blank, like it does not refresh.

As I said above, a click on the content or resizing the control (drag to resize) seems to kick it awake and the data reappears fine.

It is this 'glitch' of an initial blank screen upon a restore from the program tray that I am trying to fix.

I added the code:

GUISetOnEvent($GUI_EVENT_RESTORE, "_Refresh")

...and the function:

Func _Refresh()

;;; ???

EndFunc

...to test some recovery/workarounds.

Like I thought if I changed the control or window size by one px it would refresh.

But I am too new to AutoIt3 and can find no way to tell the current size.

If I had the current size I could use GUISetCoord to reset it +1px, sleep and set it back.

Something like that seems a possible workaround barring a better solution.

Any ideas would appreciated.

Thanks again for your time and help.

gsb

"Did you ever stop to think? ...and forget to restart!"
Link to comment
Share on other sites

Ok found what I needed.

Works perfectly now ... though a but of a kludge.

Func _Refresh()

$size=WinGetPos("gsbTrace");

WinMove("gsbTrace","",$size[0],$size[1],$size[2]+1,$size[3]+1)

Sleep(1)

WinMove("gsbTrace","",$size[0],$size[1],$size[2],$size[3])

EndFunc

gsb

Edited by gsb
"Did you ever stop to think? ...and forget to restart!"
Link to comment
Share on other sites

Make the window active, wait for it to be active, get the now active window coordinates, now that it's active send an ENTER key--

or move the mouse pointer and perform a click. It will amaze your friends. Or scare them? Not certain.

Link to comment
Share on other sites

Thanks a6m1n0,

...but the above code works well.

See, the problem is a bit complicated I think.

The main control needing refreshed is an IE instance with a remote HTML page loaded.

That HTML page is simply a wrapper to an embedded Flash (SWF) full browser movie.

The movie is simply a dynamic, auto scrolling text field that gets written to from another browser window, even when minimized.

The best solution would be to send the embedded Flash Player an "onresize" event as though it was coming from the browser.

Sadly, I can not figure out how to send such an event to the FP.

So the workaround above, to physically resize the window forcing it to send the resize event to the FP works good enough.

It is a sufficient "kick-in-the-side" to make the movie refresh the text field's content for proper display.

...just what I needed.

Thanks all!

gsb

Edited by gsb
"Did you ever stop to think? ...and forget to restart!"
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...