Solved

Is title bar enabled.

Posted on 2003-11-13
7
259 Views
Last Modified: 2010-05-01
Halo,

     Does anyone knows how to check title bar status(if enabled or disabled) using API. What I meant by enable and disable is wheather if it is visible or not.
0
Comment
Question by:homerWS
  • 3
  • 2
  • 2
7 Comments
 
LVL 14

Expert Comment

by:aelatik
ID: 9740214
Titlebar of what ?
0
 

Author Comment

by:homerWS
ID: 9740236
form!
0
 
LVL 14

Expert Comment

by:aelatik
ID: 9740536
Private Sub Command1_Click()
    If Me.BorderStyle <> 0 And Me.Visible = True Then
        MsgBox "Visible"
    Else
        MsgBox "Not visible"
    End If
End Sub
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:homerWS
ID: 9740664
aelatik,

      I do know how to handle via BorderStyle....  but I am more interested in using API.
0
 
LVL 1

Expert Comment

by:InTheWind
ID: 9740862
I think what you're trying to do is find out when someone switches focus away from your application to something else, or vice versa... no?

If that's the case, then you need a "onlostfocus" event on the main form... no?
0
 

Author Comment

by:homerWS
ID: 9742078
InTheWind,

      No not that, I am creating a IDE (much like VB IDE), where I have a check box that can select and deselected title bar for a MDI child form.
0
 
LVL 1

Accepted Solution

by:
InTheWind earned 20 total points
ID: 9742272
so then you want to toggle visible, based on the current value...

toolbar.visible = not (toolbar.visible)

This will just switch the value with the opposite of the current value. In the case of the title bar, this is a property in VB which is determined by whether or not there is a title caption and control box. What kind of a window it is...tool window, etc...

So, if you wanted to use an API to test the title bar you would probably need to create your own function to do this, based on some other API functions.

This function allows you to move a titlebarless window...

      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 Sub ReleaseCapture Lib "User32" ()

      Const WM_NCLBUTTONDOWN = &HA1
      Const HTCAPTION = 2

      Private Sub Form_Load()
         Command1.Caption = "Exit"
      End Sub

      Private Sub Form_MouseMove(Button As Integer, Shift As Integer, _
                                 X As Single, Y As Single)
         Dim lngReturnValue As Long

         If Button = 1 Then
            Call ReleaseCapture
            lngReturnValue = SendMessage(Form1.hWnd, WM_NCLBUTTONDOWN, _
                                         HTCAPTION, 0&)
         End If
      End Sub

      Private Sub Command1_Click()
         End
      End Sub

This article is something I have used before...  http://support.microsoft.com/default.aspx?scid=kb;en-us;147815&Product=vb6 to flash the title bar.

Perhaps some help you can find in these.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now