Shoutbox

[API question?] Forcing a repaint - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [API question?] Forcing a repaint (/showthread.php?tid=70740)

[API question?] Forcing a repaint by Chestah on 01-16-2007 at 01:45 AM

I'm just wondering if theres some API i can use to force a repaint of a Plus! Window.

Basicially what i'm doing requires alot of processing in the one thread, at each step through the process i update the GUI but because it directly starts processing more data the GUI never "visibly" gets updated to the user.

Hopefully theres some way that i can do this, its not necessary - it would just be alot more user friendly :).

Thanks!


RE: [API question?] Forcing a repaint by matty on 01-16-2007 at 01:52 AM

code:
Interop.Call('user32', 'SendMessageW', pPlusWnd.Handle, 0x000F/* WM_PAINT */, 0, 0);

RE: [API question?] Forcing a repaint by deAd on 01-16-2007 at 01:53 AM

Send a WM_PAINT message?

Or, try:

code:
Interop.Call("User32.dll","UpdateWindow",Handle);

RE: [API question?] Forcing a repaint by Chestah on 01-16-2007 at 01:58 AM

Thankyou both :).

Is anyone better than the other?


RE: [API question?] Forcing a repaint by matty on 01-16-2007 at 02:11 AM

Processing time is likely going to be different between the two but I doubt you will notice it. If I am not mistaken its recommended to use window messages over other apis or is it vice versa I forget.


RE: [API question?] Forcing a repaint by Chestah on 01-16-2007 at 04:15 AM

quote:
Originally posted by Matty
Processing time is likely going to be different between the two but I doubt you will notice it. If I am not mistaken its recommended to use window messages over other apis or is it vice versa I forget.

Oh well thankyou for your help anyways :). I've only tried your method so far and it doesn't seem to work in my circumstances. If only Plus! had some multithreading support :).
RE: [API question?] Forcing a repaint by Ash_ on 01-16-2007 at 07:51 AM

if you cant get either to work i know i've used InvalidateRect api with success to Redraw a Window.


RE: [API question?] Forcing a repaint by Chestah on 01-16-2007 at 08:10 AM

quote:
Originally posted by deAd
Send a WM_PAINT message?

Or, try:
code:
Interop.Call("User32.dll","UpdateWindow",Handle);


The above method, i find, works the best in my situation :).

RE: [API question?] Forcing a repaint by felipEx on 01-17-2007 at 05:36 AM

what about RedrawWindow API?
http://felipex.net/2006/12/29/animatewindow-api/


RE: RE: [API question?] Forcing a repaint by CookieRevised on 01-17-2007 at 06:33 AM

quote:
Originally posted by Matty
If I am not mistaken its recommended to use window messages over other apis or is it vice versa I forget.
Depends on what you wanna do.

----------------------------------


If the window’s update region is not empty, UpdateWindow sends a WM_PAINT message directly to the window procedure of the specified window, bypassing the application queue. If the update region is empty, no message is sent. This is the preferred method since it does internal checks on its own etc, all other methods are derived from this one in one way or the other...


The RedrawWindow function updates the specified rectangle or region in a window's client area. If the intention is to redraw the entire window, you better use UpdateWindow...


The WM_PAINT message is sent when the system or another application makes a request to paint a portion of an application's window. The message is sent when the UpdateWindow or RedrawWindow function is called...


InvalidateRect adds a rectangle to the specified window’s update region. The update region represents the portion of the window’s client area that must be redrawn. The invalidated areas accumulate in the update region until the region is processed when the next WM_PAINT message occurs or until the region is validated by using the ValidateRect function. InvalidateRect on its own does not repaint anything...
RE: [API question?] Forcing a repaint by felipEx on 01-17-2007 at 03:31 PM

UpdateWindow API doesn't works for me (and AnimateWindow API)  hehe ^^