Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Help with vista like transparency...if possible
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
wargamer17




PostPosted: Tue Feb 06, 2007 2:25 pm   Post subject: Help with vista like transparency...if possible

I was wondering if it was possible to make the title bar transparent just like in windows vista. I've already found source code for making the whole window transparent, but is it possible to make just the title bar transparent? If so, could someone help me with the code for that? thanks.
Sponsor
Sponsor
Sponsor
sponsor
nightcrawler




PostPosted: Thu Apr 05, 2007 7:41 am   Post subject: RE:Help with vista like transparency...if possible

Can you please post the code to make the entire window transparent please? I have been having trouble with that aspect...
Cervantes




PostPosted: Thu Apr 05, 2007 9:15 am   Post subject: RE:Help with vista like transparency...if possible

There's no way I know of making the title bar transparent. You'd have to get down to the Windows API, which is something Turing doesn't really do.

I too am interested, though, to see how you made the whole window transparent. It seems like that would also require getting down to the windows API, so maybe there is hope yet!
Dan




PostPosted: Thu Apr 05, 2007 12:40 pm   Post subject: RE:Help with vista like transparency...if possible

The new verson of VS and visual basic all suport the vista trasnparncy setings and it is as easy as seting a proptery for the form.

However this could be harder in older versons of visual basicks and VS.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
haskell




PostPosted: Thu Apr 05, 2007 12:51 pm   Post subject: RE:Help with vista like transparency...if possible

In VB.NET, C#, and etc... Transparency is a control property.

Quite easy to do.
cool dude




PostPosted: Thu Apr 05, 2007 12:58 pm   Post subject: Re: Help with vista like transparency...if possible

well i'm not exactly sure if this is what your looking for but click on the form and under properties scroll down until you see borderstyle property. than set that to none.

let me know if this is what you wanted?
Clayton




PostPosted: Thu Apr 05, 2007 2:48 pm   Post subject: RE:Help with vista like transparency...if possible

Cervantes wrote:

You'd have to get down to the Windows API, which is something Turing doesn't really do.


Shouldn't be an issue, as it appears that he's using Visual Basic Razz
wargamer17




PostPosted: Wed Apr 11, 2007 3:25 pm   Post subject: Re: Help with vista like transparency...if possible

Yes, that's right. I am using Visual Basic. This is the code i got:

CODE:
Const GWL_EXSTYLE = -20
Const WS_EX_LAYERED = &H80000
Const GWL_STYLE = (-16)
Const WS_VISIBLE = &H10000000
Const LWA_ALPHA = &H2

Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Option Explicit

Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long


'@ http://digitalpbk.blogspot.com/2007/01/making-any-window-transparent-on-xp.html


Private Type POINTAPI
x As Long
y As Long
End Type

Public xhwnd As Long

Private Sub Command1_Click()
SetWindowLong xhwnd, GWL_EXSTYLE, WS_EX_LAYERED
SetLayeredWindowAttributes xhwnd, 0, Slider1.Value, LWA_ALPHA
End Sub

Private Sub Command2_Click()
SetWindowLong xhwnd, GWL_EXSTYLE, 0
End Sub


Private Sub Label2_Click()
ShellExecute Me.hwnd, "", "http://digitalpbk.blogspot.com/2007/01/making-any-window-transparent-on-xp.html?ref=EXE", "", "", 1
End Sub

Private Sub Slider1_Change()
SetLayeredWindowAttributes xhwnd, 0, Slider1.Value, LWA_ALPHA
End Sub

Private Sub Timer1_Timer()
Dim xy As POINTAPI
Dim retStr As String * 80

If GetAsyncKeyState(vbKeyControl) Then
Call GetCursorPos&(xy)
xhwnd = WindowFromPoint(xy.x, xy.y)
Call GetWindowText(xhwnd, retStr, 100)
If xhwnd = Me.hwnd Then
Label1.Caption = "Making me transparent is not good!"
xhwnd = 0
Else
Label1.Caption = retStr & " " & xy.x & " " & xy.y & " " & xhwnd
End If
End If
End Sub

CODE END
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Wed Apr 11, 2007 4:17 pm   Post subject: Re: RE:Help with vista like transparency...if possible

Clayton @ Thu Apr 05, 2007 2:48 pm wrote:
Cervantes wrote:

You'd have to get down to the Windows API, which is something Turing doesn't really do.


Shouldn't be an issue, as it appears that he's using Visual Basic Razz


Someone tell me the truth: was this originally posted in Turing Help, or am I just going insane?
wargamer17




PostPosted: Wed Apr 11, 2007 4:28 pm   Post subject: Re: Help with vista like transparency...if possible

No, this was originally where I posted it. Right here in the Visual Basic Help section because I am using Visual Basic 6.0, so obviously this is where it would be placed.
Clayton




PostPosted: Wed Apr 11, 2007 4:31 pm   Post subject: Re: RE:Help with vista like transparency...if possible

Cervantes @ Wed Apr 11, 2007 4:17 pm wrote:
Clayton @ Thu Apr 05, 2007 2:48 pm wrote:
Cervantes wrote:

You'd have to get down to the Windows API, which is something Turing doesn't really do.


Shouldn't be an issue, as it appears that he's using Visual Basic Razz


Someone tell me the truth: was this originally posted in Turing Help, or am I just going insane?


No, you're just going insane. It's all right, you're having troubles coping with exams right now Razz
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 11 Posts ]
Jump to:   


Style:  
Search: