Results 1 to 9 of 9

Thread: Skin a window??!?!!

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2001
    Location
    Sweden, Sthlm
    Posts
    112

    Arrow

    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

  2. #2

  3. #3
    Addicted Member KrishnaSantosh's Avatar
    Join Date
    Feb 2001
    Location
    Coimbatore
    Posts
    210
    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.

  4. #4
    Lively Member Bios's Avatar
    Join Date
    Nov 1999
    Location
    Richton Park, IL, USA
    Posts
    71
    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.
    Bios
    Age: 17
    Languages: (Q)BASIC, Visual Basic, Dark Basic,C/C++, Visual C++, Perl, Java Script, HTML, ASP

    "DO:BEEP:LOOP"

  5. #5
    Addicted Member KrishnaSantosh's Avatar
    Join Date
    Feb 2001
    Location
    Coimbatore
    Posts
    210
    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

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Feb 2001
    Location
    Sweden, Sthlm
    Posts
    112
    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...

  7. #7
    Addicted Member KrishnaSantosh's Avatar
    Join Date
    Feb 2001
    Location
    Coimbatore
    Posts
    210
    You Can Use your Own Custom TitleBar. And Also Your Own (Any Number Of ) Caption Buttons. For Details EMail Me.

  8. #8
    Addicted Member
    Join Date
    Aug 2000
    Location
    Croatia
    Posts
    200

  9. #9
    Addicted Member
    Join Date
    Feb 2001
    Location
    Classified
    Posts
    234

    Post ...

    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
    Attached Files Attached Files
    My ICQ Status: (85634850)

    Seriously Sick Tshirts

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width