Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 8th, 2003, 11:27 AM
Registered User
 
Join Date: Jun 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default create custom vb form title bar

Hi,

Anyone has any idea to create a custom form title bar in vb? I'd like some source code or API function names.

Thanks,
cindy
 
Old September 22nd, 2005, 02:57 PM
Registered User
 
Join Date: Sep 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to scancode
Default

Code:
Option Explicit 

' API functions 
Private Declare Function ReleaseCapture Lib "user32" () As Long 
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long 
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long 

' Constants for above API calls 
Private Const HTCAPTION = 2 
Private Const WM_NCLBUTTONDOWN = &HA1 

Private Sub Form_Load() 
  Dim retVal As Long 

  retVal = SetWindowText(Me.hwnd, Label1) 
End Sub 

Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) 
  ReleaseCapture 
  SendMessage hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& 
End Sub
Code by nzjonboy
- Use google






Similar Threads
Thread Thread Starter Forum Replies Last Post
url appears in title bar when refreshing shibp2pkumar Classic ASP Basics 3 May 4th, 2005 07:48 PM
How to trap Mouse events on Title bar/Caption bar chiefouko Pro VB.NET 2002/2003 0 September 21st, 2004 02:42 AM
Dynamically write to title bar. fs22 Javascript How-To 2 June 2nd, 2004 04:16 PM
Removing title bar - is this possible? larry HTML Code Clinic 4 January 26th, 2004 03:07 PM
How to create a custom form shape lotfi BOOK: Professional C#, 2nd and 3rd Editions 0 November 15th, 2003 08:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.