Click here to Skip to main content
15,915,093 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Bit shifting in VB Pin
cnurse6-Dec-03 22:54
cnurse6-Dec-03 22:54 
GeneralRe: Bit shifting in VB Pin
Dave Kreskowiak7-Dec-03 5:39
mveDave Kreskowiak7-Dec-03 5:39 
GeneralRe: Bit shifting in VB Pin
cnurse7-Dec-03 13:45
cnurse7-Dec-03 13:45 
GeneralRe: Bit shifting in VB Pin
Dave Kreskowiak7-Dec-03 14:40
mveDave Kreskowiak7-Dec-03 14:40 
GeneralRe: Bit shifting in VB Pin
Ian Darling7-Dec-03 2:43
Ian Darling7-Dec-03 2:43 
GeneralRe: Bit shifting in VB Pin
cnurse7-Dec-03 4:22
cnurse7-Dec-03 4:22 
GeneralVB.Net WS_EX_LAYERED Forms Pin
andrew|5-Dec-03 4:32
andrew|5-Dec-03 4:32 
GeneralRe: VB.Net WS_EX_LAYERED Forms Pin
cnurse5-Dec-03 18:56
cnurse5-Dec-03 18:56 
Andrew,

I sincerely hope this example, which I found for you, helps out...

Using Layered Windows

To have a dialog box come up as a translucent window, first create the dialog as usual. Then, on WM_INITDIALOG, set the layered bit of the window's extended style and call SetLayeredWindowAttributes with the desired alpha value. The code might look like this:

// Set WS_EX_LAYERED on this window
SetWindowLong(hwnd,
GWL_EXSTYLE,
GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);

// Make this window 70% alpha
SetLayeredWindowAttributes(hwnd, 0, (255 * 70) / 100, LWA_ALPHA);
Note that the third parameter of SetLayeredWindowAttributes is a value that ranges from 0 to 255, with 0 making the window completely transparent and 255 making it completely opaque. This parameter mimics the more versatile BLENDFUNCTION of the AlphaBlend function.

To make this window completely opaque again, remove the WS_EX_LAYERED bit by calling SetWindowLong and then ask the window to repaint. Removing the bit is desired to let the system know that it can free up some memory associated with layering and redirection. The code might look like this:

// Remove WS_EX_LAYERED from this window styles
SetWindowLong(hwnd,
GWL_EXSTYLE,
GetWindowLong(hwnd, GWL_EXSTYLE) & ~WS_EX_LAYERED);

// Ask the window and its children to repaint
RedrawWindow(hwnd,
NULL,
NULL,
RDW_ERASE | RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN);


Nursey
GeneralRe: VB.Net WS_EX_LAYERED Forms Pin
andrew|5-Dec-03 21:24
andrew|5-Dec-03 21:24 
GeneralRe: VB.Net WS_EX_LAYERED Forms Pin
Dave Kreskowiak6-Dec-03 4:57
mveDave Kreskowiak6-Dec-03 4:57 
GeneralRe: VB.Net WS_EX_LAYERED Forms Pin
andrew|6-Dec-03 5:44
andrew|6-Dec-03 5:44 
GeneralRe: VB.Net WS_EX_LAYERED Forms Pin
cnurse6-Dec-03 22:52
cnurse6-Dec-03 22:52 
GeneralMSScriptControl and VB.Net Control Events Pin
andrew|5-Dec-03 4:29
andrew|5-Dec-03 4:29 
QuestionHow can I integrated a combobox ? Pin
jlizardo5-Dec-03 3:29
jlizardo5-Dec-03 3:29 
QuestionHow to Stop a Big Loop Pin
rrocha25-Dec-03 0:06
rrocha25-Dec-03 0:06 
AnswerRe: How to Stop a Big Loop Pin
Ian Darling5-Dec-03 0:19
Ian Darling5-Dec-03 0:19 
GeneralMy Computer Shell Extension Pin
MusclePup4-Dec-03 22:58
MusclePup4-Dec-03 22:58 
GeneralVisual Studio Freezing. Pin
cnurse4-Dec-03 21:40
cnurse4-Dec-03 21:40 
GeneralHelp me to draw Icon in CheckedListBox Pin
VitaminY4-Dec-03 16:38
sussVitaminY4-Dec-03 16:38 
GeneralCasting variables in VB.NET Pin
Jim Taylor4-Dec-03 12:16
Jim Taylor4-Dec-03 12:16 
GeneralRe: Casting variables in VB.NET Pin
Nick Seng4-Dec-03 14:48
Nick Seng4-Dec-03 14:48 
GeneralRe: Casting variables in VB.NET Pin
Dave Kreskowiak4-Dec-03 18:58
mveDave Kreskowiak4-Dec-03 18:58 
GeneralRe: Casting variables in VB.NET Pin
Jim Taylor4-Dec-03 22:48
Jim Taylor4-Dec-03 22:48 
Generalsending information from one application to another Pin
Leonard Munteanu4-Dec-03 10:39
Leonard Munteanu4-Dec-03 10:39 
GeneralRe: sending information from one application to another Pin
Dave Kreskowiak4-Dec-03 18:48
mveDave Kreskowiak4-Dec-03 18:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.