Sign in to follow this  
Followers 0
BAM5

Resizing Window Causes Whited Out Controls

4 posts in this topic

So I'm making this gui with an embedded IE object. It all goes well until I add some functionality, one in particular and it's a big one, the window will be in the same place and same size as you left it when you last exited the program. No big deal until I found that when I resize the window programmatically the controls below the IE Object seemingly disappear. Look a little closer and I find that they're not invisible, just white. I messed around and found out that it has something to do with having the style $WS_CLIPCHILDREN on the gui. I take it off and the controls show up no problem, but then the whole IE object freezes so that's definitely not the solution I'm looking for. I've tried searching the forums, the internet, and the help file, but I can't find the answer to this evil problem. One thing I noticed was that if I resized the window just the slightest with the mouse all the controls would reappear, or if I hovered on them they parts of the control would reappear piece by piece. So I tried using some window redraw / repaint functions, I've tried several different winmove functions, and I even went so far as to try to emulate resizing the window through the mouse by using the _SendMessage function to send the individual WM_ENTERSIZEMOVE, WM_SIZING, WM_SIZE, and WM_EXITSIZEMOVE messages to the window, but to no avail. However if I set a certain size of window with the WM_SIZE message that wasn't the window size it would show up in the window with a bunch of whitespace because it wasn't taking up the whole window, but that isn't germane and I digress.

If anyone knows any rerendering messages I could send the the window please post them here! I'm willing to try anything at the moment. I assume there's a message I'm missing in the resizing emulation since it isn't coming out right.

Oh, another thing that would be helpful is if someone knew how to monitor all the messages going to my gui, instead of just specific individual messages defined by the GUIRegisterMsg function.

Below is a far shortened example of my code along with the screen shot of it with a few citations.

#include <IE.au3>
#include <Array.au3>
#include <WinAPI.au3>
#include <Constants.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$name = @UserName
$opts = " |Me ("&$name&")"
$oIE = _IECreateEmbedded()

$Main = GUICreate("Example of Frustration", 795, 610, 192, 124, BitOR($GUI_SS_DEFAULT_GUI,$WS_SIZEBOX,$WS_THICKFRAME,$WS_CLIPCHILDREN))
$ObjectIE = GUICtrlCreateObj($oIE, 8, 8, 777, 561)
GUICtrlSetResizing(-1, $GUI_DOCKTOP+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM+$GUI_DOCKLEFT)
GUICtrlCreateLabel("Follow", 8, 580, 34, 17, $WS_CLIPSIBLINGS)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$ComboFollow = GUICtrlCreateCombo("", 48, 578, 145, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL,$WS_CLIPSIBLINGS))
$default = " "
GUICtrlSetData(-1, $opts, $default)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$SliderOpacity = GUICtrlCreateSlider(280, 576, 150, 25)
GUICtrlSetLimit(-1, 255, 55)
GUICtrlSetData(-1, 255)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$ButtonFullscreen = GUICtrlCreateButton("Faux Fullscreen", 680, 576, 107, 25, $WS_CLIPSIBLINGS)
GUICtrlSetResizing(-1, $GUI_DOCKRIGHT+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)

_IENavigate($oIE, "http://google.com")
GUISetState(@SW_SHOW)

_WinAPI_MoveWindow($Main, 100, 100, 450, 350)


While 1
If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit
WEnd

Posted Image

Thanks for your time!

-Brian


[center]JSON Encoding UDF[/center]

Share this post


Link to post
Share on other sites



Although there might be a style that auto does that.

Yup that is $WS_EX_COMPOSITED

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

That did it! (Sort of, see below)

Thank you so much PhoenixXL I searched all over but to no avail not having a clue what to search for.

You've made my day.

Jon: Yeah, I tried that but it didn't work, maybe it would have if I passed it the right combination of flags.

Thank you both for your help.


Although I would like furthur input.

When I add that style, I didn't notice at first, but the IE object starts to flicker really bad when I move the cursor over it, possibly due to heavy rendering process of the frame not being able to draw fast enough?

Is there a way for me to tell it to draw over the old image instead of setting all the pixels to background color and then drawing over that?

Edited by BAM5

[center]JSON Encoding UDF[/center]

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

  • Similar Content

    • Psyllex
      By Psyllex
      I have a super simple login screen I'm trying to access that is written in java.  My java testing tools can't access the login screen because it's a modal window.  So I figured I'd see if AutoIt can manipulate 'something' on it.  I can enter text within the text boxes for user name and password.  But I can't see to click on the login button.  I've tried just tabbing to it and hitting the enter key (as I really wouldn't have to be completely interacting with the frame).  But that didn't work.  I was hoping to throw it some coordinates and just double click in that relative area, but when I get the whole " ==> Subscript used on non-accessible variable.:" when I attempt to use ControlGetPos() I'm assuming because it can't truly interact with the Java frame.  So I'm kind of stuck here...can't use AutoIt, can't use a Java automation testing tool to do this due to the modal issues.  Does anyone have any ideas?  My code is below though I think it's less to do with code and more what AutoIt can and can't do.
      #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Local $hWnd = WinActivate("[CLASS:sunawtframe]", "Login") Local $aPos = ControlGetPos($hWnd, "[CLASS:SUNAWTFRAME]", "Login") Local $myXPos = $aPos[0] + 420 Local $myYPos = $aPos[1] + 270 Send("guest") Send("{TAB}") Send("guest") Send("{TAB}") ;Tried Control Click it failed ControlClick($hWnd, "", "Login") ;Tried Mouse Click and that failed MouseClick("Left", $myXPos, $myYPos, 2)  
      Thanks for any help!
    • WoodGrain
      By WoodGrain
      Hi guys,
      I'm trying to move and resize a program call CPUID HWMonitor (http://www.cpuid.com/softwares/hwmonitor.html) but WinMove() doesn't work. Can someone tell me how to get this to work for this program? I've successfully moved other programs using WinMove(), and I've used WinGetTitle ("[ACTIVE]") to confirm the title is correct. WinActivate("CPUID HWMonitor") does work.
      If I run the following code nothing happens, doesn't move or resize, but AutoIt doesn't complain about the code either:
      WinMove("CPUID HWMonitor", 0, 0, 475, 715) The class changes every time the program opens (and I've nevery had a lot of success with classes tbh, bit hit and miss for me).
      Thanks all!
    • Trolleule
      By Trolleule
      Hi all,
      i was currently working with html when i got myself the question if there is a windows control that acts like a html container e.g. a div with the hidden attribute. The benfeit is obvious. You can put code in this container and at the moment it is hidden it doesnt take room but when i got visible it uses the room it needs. Is there something i can use with windows forms?
      Normally one have to recalculate the position of all controls and adjust them manually.
    • Leo1906
      By Leo1906
      Hey guys, I could need your help aggain ..
      Is there a way to clip GUIs together (child GUIs - in one script). So if I use WinMove with speed set to one of those GUIs, the others follow at the same speed like they where one block?
      I can't think of an option to do this in pure Autoit. Creating an adlib for each GUI won't help I'm afraid, because adlibs are paused on GUI-move?
      And using this type of function didn't help either: 

      I can't imagine any other way of achieving multiple GUI moves at once using Autoit, because Autoit waits for the WinMove command to finish ..
      Any thoughts? Maybe a build in windows function for clipping GUIs together?
       
      Thanks for your help
    • FMS
      By FMS
      Hello,
      Below is a code whish i made for this problem i've. (code 1)
      The problem is that iff i try Winmove to to show the hidden button it's not working as i tought.
      What i try to do is just simple expand the GUI to make the hidden button visible. (code 2)
      I've already looked into GUICoordMode but don't think that's the problem.(or I don't understand it properly)
      Also tried to look into the forum but din't find anything around this subject but could't find anything around this subject.
      Does somebody knows what I'm doing wrong?
       
      Code 1 (winmove prblem) :
      #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 134, 103, 192, 124) $Button1 = GUICtrlCreateButton("1", 8, 8, 75, 25) $Button2 = GUICtrlCreateButton("2", 8, 40, 75, 25) $Button3 = GUICtrlCreateButton("3", 8, 72, 75, 25) $expand_button = GUICtrlCreateButton("EXP", 96, 40, 27, 25) $hidden_button = GUICtrlCreateButton("Hidden", 160, 40, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $expand_button WinMove($Form1, "From1", 192, 124, 300, 103) EndSwitch WEnd  
      Code 2 What I'm trying to expand to :
      #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 265, 114, 192, 124) $Button1 = GUICtrlCreateButton("1", 8, 8, 75, 25) $Button2 = GUICtrlCreateButton("2", 8, 40, 75, 25) $Button3 = GUICtrlCreateButton("3", 8, 72, 75, 25) $expand_button = GUICtrlCreateButton("EXP", 96, 40, 27, 25) $hidden_button = GUICtrlCreateButton("Hidden", 160, 40, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd