What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » RECT type ?

RECT type ?
Author: Message:
felipEx
Scripting Contest Winner
***


Posts: 378
Reputation: 24
35 / Male / Flag
Joined: Jun 2006
O.P. RECT type ?
hi guys..
how can i use the RECT type (like Visual Basic) in mp!live scripting ?
code:
Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type

thanks ;)
12-27-2006 06:26 AM
Profile E-Mail PM Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
35 / Male / Flag
Joined: Mar 2004
RE: RECT type ?
to write to it (the second param of WriteDWORD is the value)
code:
var RECT = Interop.Allocate(16); //long = 4 so size = 4 * 4
RECT.WriteDWORD(0, 0); //left
RECT.WriteDWORD(4, 0); //Top
RECT.WriteDWORD(8, 0); //Right
RECT.WriteDWORD(12, 0); //Bottom


to read it

code:

var RECT = Interop.Allocate(16); //long = 4 so size = 4 * 4
//pass to some api function where it changes it

var left = RECT.ReadDWORD(0); //left
var top = RECT.ReadDWORD(4); //Top
var right = RECT.ReadDWORD(8); //Right
var bottom = RECT.ReadDWORD(12); //Bottom



This post was edited on 12-27-2006 at 06:39 AM by -dt-.
[Image: dt2.0v2.png]      Happy Birthday, WDZ
12-27-2006 06:32 AM
Profile PM Web Find Quote Report
felipEx
Scripting Contest Winner
***


Posts: 378
Reputation: 24
35 / Male / Flag
Joined: Jun 2006
O.P. RE: RECT type ?
thanks. so, i have some problems to repaint a window (N)
12-27-2006 06:57 AM
Profile E-Mail PM Find Quote Report
felipEx
Scripting Contest Winner
***


Posts: 378
Reputation: 24
35 / Male / Flag
Joined: Jun 2006
O.P. RE: RECT type ?
please, see my code :D
code:
var RECT = Interop.Allocate(16);
RECT.WriteDWORD(0, 0);
RECT.WriteDWORD(4, 0); 
RECT.WriteDWORD(8, 0); 
RECT.WriteDWORD(12, 0);

Interop.Call("user32.dll", "RedrawWindow", ChatWnd.Handle, RECT, 1, 1);


can you help me?, i need redraw a window ;)
12-27-2006 09:26 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: RECT type ?
code:
Interop.Call('user32', 'RedrawWindow', ChatWnd.Handle, 0, 0, 0x001 /* RDW_INVALIDATE */);

This would be better to use. Just send the window the WM_PAINT message to have it paint itself.
code:
Interop.Call('user32', 'SendMessageW', ChatWnd.Handle, 0x000F /* WM_PAINT */, 0, 0);

This post was edited on 12-27-2006 at 09:35 PM by matty.
12-27-2006 09:32 PM
Profile E-Mail PM Find Quote Report
felipEx
Scripting Contest Winner
***


Posts: 378
Reputation: 24
35 / Male / Flag
Joined: Jun 2006
O.P. RE: RECT type ?
this doesn't work for me :P  (doesn't redraw the window)
i was playing with “animatewindow api”, so the redrawwindow api doesn't work (N)
anyway, thank you ;)
12-27-2006 09:41 PM
Profile E-Mail PM Find Quote Report
Ash_
Senior Member
****

Avatar

Posts: 638
Reputation: 31
35 / Male / –
Joined: Aug 2004
RE: RECT type ?
if you havent solved the problem yet look into the InvalidateRect API that's how i made the windows repaint. i don't have any code on here anymore to show you though.

edit:
code:
Interop.Call('user32', 'InvalidateRect', WindowHandle, 0, False);

should be what your looking for.

This post was edited on 12-28-2006 at 11:28 AM by Ash_.
[Image: jeansiger5.jpg]
12-28-2006 11:25 AM
Profile PM Find Quote Report
felipEx
Scripting Contest Winner
***


Posts: 378
Reputation: 24
35 / Male / Flag
Joined: Jun 2006
O.P. RE: RECT type ?
vb code (it work):
code:
Private Declare Function RedrawWindow Lib "user32" (ByVal hwnd As Long, lprcUpdate As RECT, ByVal hrgnUpdate As Long, ByVal fuRedraw As Long) As Long
Private Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
End Type

Private Sub Command1_Click()
Print "test.."
Dim theRECT As RECT
theRECT.Left = 0
theRECT.Top = 0
theRECT.Right = 0
theRECT.Bottom = 0
Call RedrawWindow(Me.hwnd, theRECT, 1, 1)
End Sub


how I can use this code (correctly) in scripting ? :D
12-28-2006 11:35 AM
Profile E-Mail PM Find Quote Report
Ash_
Senior Member
****

Avatar

Posts: 638
Reputation: 31
35 / Male / –
Joined: Aug 2004
RE: RE: RECT type ?
code:
    Var Wnd = MsgPlus.CreateWnd(... ) (im assuming you've created the window and stuff? if you have Var Wnd will hold the Handle (Me.hwnd in VB))
    var theRECT = Interop.Allocate(16); //long = 4 so size = 4 * 4
    theRECT .WriteDWORD(0, 0); //left
    theRECT .WriteDWORD(4, 0); //Top
    theRECT .WriteDWORD(8, 0); //Right
    theRECT .WriteDWORD(12, 0); //Bottom
   Interop.Call('user32', 'RedrawWindow', Wnd, theRECT, 1, 1);

[Image: jeansiger5.jpg]
12-28-2006 11:39 AM
Profile PM Find Quote Report
felipEx
Scripting Contest Winner
***


Posts: 378
Reputation: 24
35 / Male / Flag
Joined: Jun 2006
O.P. RE: RECT type ?
(Y) THANKS ;)
12-28-2006 11:42 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On