Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
XML RSS Feed
 
 
 
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitleGive a window a toolbar style title bar
Keywordsform, toolbar, titlebar, SetWindowLong
CategoriesControls, API
 
Use the SetWindowLong API function to set the form's WS_EX_TOOLWINDOW style, making it use a small title bar. Then use SetWindowPos to make the form redraw itself with the new frame style.
 
Private Sub Form_Load()
Dim styles As Long

    ' Set the WS_EX_TOOLWINDOW style
    styles = GetWindowLong(hwnd, GWL_EXSTYLE)
    styles = SetWindowLong(hwnd, GWL_EXSTYLE, _
        styles Or WS_EX_TOOLWINDOW)

    ' Make the form redraw itself to update its frame.
    SetWindowPos hwnd, 0, 0, 0, 0, 0, _
        SWP_FRAMECHANGED Or SWP_NOMOVE Or _
        SWP_NOZORDER Or SWP_NOSIZE
End Sub
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated