Results 1 to 7 of 7

Thread: Which API call...

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 1999
    Location
    Phoenix
    Posts
    87
    You know when something happens in an application thats not on the foreground, it flashes blue on the windows taskbar? Is there an API call to make that happen?

    Also which property of the main form tells you if it is currently the top level application (screen-wise)

    Thanks

  2. #2
    Fanatic Member
    Join Date
    Sep 1999
    Location
    Bethel, North Carolina, USA
    Posts
    987
    There isn't really a property that tells you if the form is the top-level window you need to use the GetActiveWindow API call for this and the FlashWindow API call is what you need to use to have your window flash in the TaskBar....

    You need a timer to test the following code
    Code:
    Option Explicit
    
    Private Declare Function FlashWindow Lib "user32" (ByVal hwnd As Long, ByVal bInvert As Long) As Long
    Private Declare Function GetActiveWindow Lib "user32" () As Long
    
    Private Sub Form_Load()
    
       Timer1.Interval = 500
    
    End Sub
    
    Private Sub Timer1_Timer()
        
        ' if the current window is not the active window then flash the title bar
        If Not Me.hwnd = GetActiveWindow Then
            
            FlashWindow Me.hwnd, CLng(True)
        
        End If
        
    End Sub
    {Insert random techno-babble here}

    {Insert quote from some long gone mofo here}

  3. #3
    Lively Member
    Join Date
    Jun 2000
    Posts
    124

    Question Quick Question...

    What does Option Explicit mean?
    On Error Resume Screaming...

  4. #4
    Guest
    Option Explicit - Forces explicit declaration of all variables in a script.


    Means you have to Dim everything or you will get an error.


    -------
    'No error
    Option Explicit

    Dim MyString As String
    MyString = "Hello World"
    --------

    -------
    'Error
    Option Explicit

    MyString = "Hello World"
    --------

    -------
    'No error

    Dim MyString As String
    MyString = "Hello World"
    --------

    -------
    'No error

    MyString = "Hello World"
    --------

  5. #5
    Addicted Member KrishnaSantosh's Avatar
    Join Date
    Feb 2001
    Location
    Coimbatore
    Posts
    210
    A Language Can Be Strongly Typed. Or Weakly Typed.

    One Of The Features Of Strongly Typed Languages if That All Variables Needs To Be Declared As A Specific Data Type Before The Instance Of The Variable In That Program.

    On The Other Hand In Weakly Typed Languages You Need Not Declare Variables Prior To The Use. The Type Of the Variables Will Be Determined With The Value You Provide For This.

    Strong Typing Has A Lot Of Advantages Over Weak Typing.

    VB Provides Strongly Typed As Well As Weakly Typed Language Features. If Option Explicit Is Not Included, The Variables Are Weakly Typed, Or Else It Is Strongly Typed.

  6. #6
    Lively Member
    Join Date
    Jun 2000
    Posts
    124
    woah, lay off on the capital letters, there.
    On Error Resume Screaming...

  7. #7
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    You can type faster if you only use capital letters some of the time. Therefore, more posts.

    So try to lay off the capital letters and u will improve your WPM and your post #.

    Of course, that's only a thought.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width