Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

[TESTING, POSSIBLY RESOLVED] maximize function

bderagonbderagon Member Posts: 3
Hi All,

I'm using Visual Studio 2003, and MFC/C++.
I want to simulate just the update/refresh portion of the maximize command, on an ie window. I've already managed to connect to the window and can send minimize and maximize commands to it, as well as move the window around the screen, even hide and show the window if I wish to. I just need to know what message or function I have to pass to that window to get it to do JUST the refresh portion of its maximize command.

Here's some background info and stuff I've already tried:

I have an internet page, that uses java applets served from a server I have no control over. The internet page loads, but none of the background graphics, or button graphics load, so you pretty much have to click on a blank screen and "guess" where the buttons are.

However, if you minimize the window, and maximize (tested over 100 times, by multiple people, under different conditions, with a 100% success ratio), it'll redraw the window properly.

I've tried simulating a very rapid alt+tab and it restored the buttons graphics but not the main graphic (not acceptable to my client). I've also tried the following commands:

::RedrawWindow(hWnd,0,0,RDW_INVALIDATE);
::RedrawWindow(hWnd,0,0,0);
::UpdateWindow(hWnd);
::SetFocus(hWnd);

Any help here would be greatly appreciated.

Thanks,
Brian

Comments

  • zibadianzibadian Member Posts: 6,349
    : Hi All,
    :
    : I'm using Visual Studio 2003, and MFC/C++.
    : I want to simulate just the update/refresh portion of the maximize
    : command, on an ie window. I've already managed to connect to the
    : window and can send minimize and maximize commands to it, as well as
    : move the window around the screen, even hide and show the window if
    : I wish to. I just need to know what message or function I have to
    : pass to that window to get it to do JUST the refresh portion of its
    : maximize command.
    :
    : Here's some background info and stuff I've already tried:
    :
    : I have an internet page, that uses java applets served from a server
    : I have no control over. The internet page loads, but none of the
    : background graphics, or button graphics load, so you pretty much
    : have to click on a blank screen and "guess" where the buttons are.
    :
    : However, if you minimize the window, and maximize (tested over 100
    : times, by multiple people, under different conditions, with a 100%
    : success ratio), it'll redraw the window properly.
    :
    : I've tried simulating a very rapid alt+tab and it restored the
    : buttons graphics but not the main graphic (not acceptable to my
    : client). I've also tried the following commands:
    :
    : ::RedrawWindow(hWnd,0,0,RDW_INVALIDATE);
    : ::RedrawWindow(hWnd,0,0,0);
    : ::UpdateWindow(hWnd);
    : ::SetFocus(hWnd);
    :
    : Any help here would be greatly appreciated.
    :
    : Thanks,
    : Brian
    :
    Have you tried sending a minimize and maximize command to the window?
  • LundinLundin Member Posts: 3,711
    InvalidateRect(hwnd, NULL, TRUE) followed by UpdateWindow() is the usual way to do it.

    I suppose you could try sending a WM_SYSCOMMAND to the window with SC_MINIMIZE or SC_MAXIMIZE, but I have no idea of what behavior you'll get then.
  • bderagonbderagon Member Posts: 3
    : : Hi All,
    : :
    : : I'm using Visual Studio 2003, and MFC/C++.
    : : I want to simulate just the update/refresh portion of the maximize
    : : command, on an ie window. I've already managed to connect to the
    : : window and can send minimize and maximize commands to it, as well as
    : : move the window around the screen, even hide and show the window if
    : : I wish to. I just need to know what message or function I have to
    : : pass to that window to get it to do JUST the refresh portion of its
    : : maximize command.
    : :
    : : Here's some background info and stuff I've already tried:
    : :
    : : I have an internet page, that uses java applets served from a server
    : : I have no control over. The internet page loads, but none of the
    : : background graphics, or button graphics load, so you pretty much
    : : have to click on a blank screen and "guess" where the buttons are.
    : :
    : : However, if you minimize the window, and maximize (tested over 100
    : : times, by multiple people, under different conditions, with a 100%
    : : success ratio), it'll redraw the window properly.
    : :
    : : I've tried simulating a very rapid alt+tab and it restored the
    : : buttons graphics but not the main graphic (not acceptable to my
    : : client). I've also tried the following commands:
    : :
    : : ::RedrawWindow(hWnd,0,0,RDW_INVALIDATE);
    : : ::RedrawWindow(hWnd,0,0,0);
    : : ::UpdateWindow(hWnd);
    : : ::SetFocus(hWnd);
    : :
    : : Any help here would be greatly appreciated.
    : :
    : : Thanks,
    : : Brian
    : :
    : Have you tried sending a minimize and maximize command to the window?

    Yes, it produces an unwanted flicker, they want this to be seamless, as in not even knowing it is there.

    I think InvalidateRect will work, going to try it tonight or tomorrow morning, and will update to let people know. Thank you for the quick responses.
  • bderagonbderagon Member Posts: 3
    : InvalidateRect(hwnd, NULL, TRUE) followed by UpdateWindow() is the
    : usual way to do it.
    :
    : I suppose you could try sending a WM_SYSCOMMAND to the window with
    : SC_MINIMIZE or SC_MAXIMIZE, but I have no idea of what behavior
    : you'll get then.

    I'll try the InvalidateRect tonight, I think that'll work and give me the intended result.

    I'll update with how it works out either tonight or tomorrow after I give it a try at the job site.

    Thanks
    Brian
Sign In or Register to comment.