p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Pro VB 6 (http://p2p.wrox.com/forumdisplay.php?f=73)
-   -   create custom vb form title bar (http://p2p.wrox.com/showthread.php?t=4713)

cindy October 8th, 2003 11:27 AM

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

scancode September 22nd, 2005 02:57 PM

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 [8]



All times are GMT -4. The time now is 07:55 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.