Sign in to follow this  
Followers 0
thetwistedpanda

GUI Annoyance w/ IE applet

8 posts in this topic

#1 ·  Posted (edited)

I've been running into a little annoying problem since I started working on a client for a java web game. Whenever my window looses focus to any object (whether it be a window, message box, or simply minimizing the program), it produces a rather ugly white blotch which doesn't go away willingly.

Here's a slice of code to reproduce the problem I get using an embedded IE window:

#include <GUIConstants.au3>
#include <IE.au3>
$GUI_Parent = GUICreate("Annoyance", 454, 344, Default, Default)
$Parent_IE = ObjCreate("Shell.Explorer.2")
$Parent_ActiveX = GUICtrlCreateObj($Parent_IE, 5, 5, 444, 334)

_IENavigate($Parent_IE, "http://wild.fiends.com/DCourt/Game.stm")
$oApplet = _IETagNameGetCollection($Parent_IE, "applet", 0)
$oApplet.scrollIntoView ()
$Parent_IE.document.body.scroll = "no"
GUISetstate()

MsgBox(0, "Making The Uglyness", "Close Me (Not a 100% Chance of Reproducing)")
While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then Exit
WEnd

I've been using $WS_EX_TOPMOST on the GUI with the embedded window to prevent other windows from stealing focus, and WinSetOnTop ($GUI, "", 0) / WinSetOnTop ($GUI, "", 1) when I want to use a message box, but both of these methods are rather unsatisfactory... Other parts of the gui (such as the menu) still produce the ugly blotches.

Is there an easy way to refresh the applet without having to reload the web page (or dragging the GUI offscreen)?

Edited by thetwistedpanda

Share this post


Link to post
Share on other sites



Sooo, does anyone have any ideas? I'm pretty sure that I won't be able to fix this problem (I whipped up several other examples using different applets and none of them seemed to have the problem), but perhaps there's a nifty IE code that'll help.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Try adding this

GUICtrlSetGraphic ($Parent_ActiveX, $GUI_GR_REFRESH)

after your message box

EDIT: NEVER MIND... I'm sure I tried that and it worked, but I just tried again after posting and it doesn't... grrrrrrr

Don't know if it's of any use but "history.go(0)" is supposed to repaint a page in javascript without reloading the page

Edited by ResNullius

Share this post


Link to post
Share on other sites

Thanks for trying. The annoying white spaces don't pop up 100% of the time; it seems to depend on what you were doing at the time...

Share this post


Link to post
Share on other sites

*Bumpie*

Share this post


Link to post
Share on other sites

Yea, I think it's a common problem if you work with a GUI with embeded objects.

To redraw you can use somethink like:

WinSetTrans ("Test Webbrowser", "", 255)

WinSetTrans ("Test Webbrowser", "", 255)

It may be in your while loop and executed if WinList() has changed.

HTH, Reinhard

Share this post


Link to post
Share on other sites

Yea, I think it's a common problem if you work with a GUI with embeded objects.

To redraw you can use somethink like:

WinSetTrans ("Test Webbrowser", "", 255)

WinSetTrans ("Test Webbrowser", "", 255)

It may be in your while loop and executed if WinList() has changed.

HTH, Reinhard

That method doesn't seem to work with the java applet. Instead of repainting it, it paints the entire applet white >.>.

I managed to get around the problem by simply preventing anything and everything from getting in the way of the applet, since I don't know of a way to implement the history.go(0) into autoit haha.

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