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

Transparent background for RichEditControl
Author: Message:
pariah123
New Member
*


Posts: 3
Joined: May 2007
O.P. Huh?  Transparent background for RichEditControl
I'm trying to make a Text box that displays content (RSS).
I want the background of the text box to be transparent, there is a background image on the window.
I tried RichEdit and StaticControls but have no success...
There arent much options, Alpha, and BaseColor with transparency.
Any suggestions?
05-24-2007 02:55 PM
Profile E-Mail PM Find Quote Report
Ash_
Senior Member
****

Avatar

Posts: 638
Reputation: 31
35 / Male / –
Joined: Aug 2004
RE: Transparent background for RichEditControl
i don't know how to do it with the Styles and stuff used for scripts but i think i remember how to do it with API.

heres the code in the best way i show you (sorry i havent made a script in ages dunno the calls to use the API)
code:
var GWL_EXSTYLE = -16
var WS_EX_TRANSPARENT = 0x20

var temp
temp = GetWindowLong(CtrlWnd, GWL_STYLE)
SetWindowLong(CtrlWnd, GWL_EXSTYLE, temp | WS_EX_TRANSPARENT)

(remember that CtrlWnd contains the handle of the RichTextBox not the entire window, im pretty sure your given the handle of the control when you create it (rtb = MsgPlus.CreateWnd(... or whatever it is))

hopefully that can solve your problem.

This post was edited on 05-28-2007 at 02:34 AM by Ash_.
[Image: jeansiger5.jpg]
05-28-2007 02:32 AM
Profile PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: RE: Transparent background for RichEditControl
Well, GetWindowLong and SetWindowLong are Win32 API functions and are not built-in in JScript. Therefore, you'll need to call the libraries with Interop.Call. Also, the control handle can only be retrieved with PlusWnd.GetControlHandle. With these two things in mind, we end up with the following code:
code:
//PlusWnd is your created window with the RichEditControl
var GWL_EXSTYLE = -16
var WS_EX_TRANSPARENT = 0x20

var hWnd = PlusWnd.GetControlHandle("EdtThingy"); //Parameter is the Id of the RichEditcontrol
var Style = Interop.Call("user32", "GetWindowLong", hWnd, GWL_STYLE);
if(Style > 0) {
   Interop.Call("user32", "SetWindowLong", hWnd, GWL_STYLE, Style | WS_EX_TRANSPARENT);
} else {
   Debug.Trace("GetWindowLong returned an error. Return value: "+(Style.toString()));
}
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
05-28-2007 07:18 AM
Profile E-Mail PM Web 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