Solved

Is title bar enabled.

Posted on 2003-11-13
7
261 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
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

828 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