Solved

Is title bar enabled.

Posted on 2003-11-13
7
258 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
Comment Utility
Titlebar of what ?
0
 

Author Comment

by:homerWS
Comment Utility
form!
0
 
LVL 14

Expert Comment

by:aelatik
Comment Utility
Private Sub Command1_Click()
    If Me.BorderStyle <> 0 And Me.Visible = True Then
        MsgBox "Visible"
    Else
        MsgBox "Not visible"
    End If
End Sub
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:homerWS
Comment Utility
aelatik,

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

Expert Comment

by:InTheWind
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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 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…

762 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

10 Experts available now in Live!

Get 1:1 Help Now