Application.Caption Issue

Hi,

I've just started looking to test what can be displayed in the title bar and I am finding that I am getting additional numbers with brackets after at the end of the information I want displayed. I'm running dual screens and the Left monitor by default has a (1) in the title bar and the right a (2). Now I'm getting (1) (2) (1) on the left and (1) (2) (1) (2) on the right but I cant figure out why these are appearing. I would prefer that none were visible at all if possible. The code I have been using is :

Public Sub hooks_OnDesignFileOpened(ByVal fileName As String)
Dim UsersName As String
Dim FullPath As String
Const str_USTN_USERNAME As String = "$(_USTN_USERNAME)"
Const str_DGNFILE As String = "$(_DGNFILE)"
UsersName = ActiveWorkspace.ExpandConfigurationVariable(str_USTN_USERNAME)
FullPath = ActiveWorkspace.ExpandConfigurationVariable(str_DGNFILE)
Application.Caption = FullPath & " : " & UsersName & " : "
Debug.Print "Application.Caption"
End Sub


 In addition to this:

  1. is it possible to display the date in the title bar? 
  2. Where can I find what else I can put in the title bar, I know about Microstation variables but is there other objects/things?

Thanks

Parents
  • If you don't familiar with MDL, forget it although you can learn it after you install MicroStation SDK (can download this SDK from SELECTServices). The following way maybe a good choice for you--hooking MicroStation's new EnterIdle event to set the dual screen application title. And after using this, you don't need to hook ModelActivateEvent anymore.

    1. Your code module is as below:

    Declare Function mdlNativeWindow_getMainHandle Lib "stdmdlbltin.dll" (ByVal iScreen As Long) As Long
    Declare Function SetWindowTextA Lib "user32.dll" (ByVal hwnd As Long, ByVal lpString As String) As Boolean
    Sub SetDualScreenAppTitle(iScreen As Long, title As String)
       Dim winHandle As Long
       winHandle = mdlNativeWindow_getMainHandle(iScreen)
       SetWindowTextA winHandle, title
    End Sub
    Sub OnProjectLoad()
        AddEnterIdleEventHandler New clsEnterIdle
    End Sub

    2. Your class module is as below: (NOTE, the class name must be 'clsEnterIdle')

    Implements IEnterIdleEvent
    Private Sub IEnterIdleEvent_EnterIdle(ByVal Reserved As Long)
       SetDualScreenAppTitle 0, "Screen 0"
       SetDualScreenAppTitle 1, "Screen 1"
    End Sub
    HTH, Yongan.Fu



  • IEnterIdle

    Unknown said:
    The following way maybe a good choice for you--hooking MicroStation's new EnterIdle event.

    Thanks for pointing that out. The EnterIdle event crept stealthily into the V8i API. It's helpful to have someone point out new features!

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

Reply Children