Detecting the Active Window in VB6

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David C. Barber

    #1

    Detecting the Active Window in VB6

    I'm having a problem knowing what is the current active window using VB6.
    Yes I can use the ActiveWindow property to determine what is my VB active
    window, HOWEVER, if the active window is some other program than my VB6 one,
    it doesn't tell me that.

    So how can I best determine the overall active window at the moment in VB6?

    Thanks!

    *David*


  • M. Posseth

    #2
    Re: Detecting the Active Window in VB6

    well this can be done with some API`s

    1. Use "GetForegroundW indow" to get the handle of the active window.

    2. Use "GetClassNa me" to get the class name. Use the long value got by
    previous function in the field 'hndl' of this function.

    3. Use "GetWindowT ext" to get the caption. Use the long value got by
    previous function in the field 'hndl' of this function.

    M. Posseth MCP


    "David C. Barber" <david@NOSPAMdb arber.com> wrote in message
    news:iuydnXJG6v aGJ5_c4p2dnA@co mcast.com...[color=blue]
    > I'm having a problem knowing what is the current active window using VB6.
    > Yes I can use the ActiveWindow property to determine what is my VB active
    > window, HOWEVER, if the active window is some other program than my VB6[/color]
    one,[color=blue]
    > it doesn't tell me that.
    >
    > So how can I best determine the overall active window at the moment in[/color]
    VB6?[color=blue]
    >
    > Thanks!
    >
    > *David*
    >
    >[/color]


    Comment

    Working...