PDA

Click to See Complete Forum and Search --> : Skin a window??!?!!


meteor
Feb 1st, 2001, 08:06 AM
Hi!!

I'm trying to skin my app!

Is there any way to set an bmp immage to the titlebar and menu and the close button (X) and
minimize button (_) of an form...

using StretchBlt or BitBlt ?!?!?!?!

Or how should it be done?

/meteor

amitabh
Feb 1st, 2001, 03:03 PM
Look at http://forums.vb-world.net/showthread.php?s=&threadid=1886

KrishnaSantosh
Feb 8th, 2001, 12:12 AM
I dont know how to use bitmaps for these But you can create you form in various shapes apart from the standard rectangular shape. In fact a form can be shaped any way you want using WinAPI . For Details EMail Me.

Bios
Feb 10th, 2001, 08:58 AM
First off, there is a topic about odd shaped forms on VB-World so just search for it. Also, to customize your title bar you need to make a form with no title bar, and draw it on. Then make it all work through code.

KrishnaSantosh
Feb 11th, 2001, 01:59 AM
This Piece Of Code Creates A Circular Code. (Call Function MakeRound(Formname)).

|||ly You Can Create Forms With Any Shapes.

Private Declare Function CreateEllipticRgn Lib "gdi32" _
(ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal _
Y2 As Long) As Long

Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd _
As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long


Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_TRANSPARENT = &H20
Private Const SWP_FRAMECHANGED = &H20
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1

Private Const SWP_SHOWME = SWP_FRAMECHANGED Or _
SWP_NOMOVE Or SWP_NOSIZE

Private Const HWND_NOTOPMOST = -2

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 SetWindowPos Lib "user32" _
(ByVal hwnd As Long, ByVal hWndInsertAfter _
As Long, ByVal x As Long, ByVal y As Long, _
ByVal cx As Long, ByVal cy As Long, _
ByVal wFlags As Long) As Long


Public Sub MakeRound(frm As Form)
Dim lngNewWind As Long
Dim lngNewRegn As Long
Dim lngWidth As Long
Dim lngHeight As Long
' Calculate the current width
lngWidth = frm.Width / Screen.TwipsPerPixelX
' Calculate the current height
lngHeight = frm.Height / Screen.TwipsPerPixelY
' Create the new region
lngNewWnd = CreateEllipticRgn(0, 0, lngWidth, lngHeight)
' Apply the new region
lngNewRgn = SetWindowRgn(frm.hwnd, lngNewWnd, True)
End Sub

meteor
Feb 13th, 2001, 07:56 AM
ok!

Thankz!

But all I want to do is to change the color of the title bar and the maximize, minimize and quit buttons and also change the color of the menu in the form...

KrishnaSantosh
Feb 13th, 2001, 10:51 AM
You Can Use your Own Custom TitleBar. And Also Your Own (Any Number Of ) Caption Buttons. For Details EMail Me.

Arcom
Feb 13th, 2001, 05:03 PM
Try this (http://www.vbaccelerator.com/codelib/gfx/skin.htm).

Ph34R
Feb 14th, 2001, 06:27 PM
This is very basic, but it works. (The Restore button dosent work cuz i simply dont know what to do with it lol)

The close and minimize buttons work, and you can drag it around the screen. Also, each thing is very skinnable :P