CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Posts
    6

    Title of the active window

    Hello,
    What is the best way to get the title (or any other info) about the current active window (It may not belong to my application). In other words I mean the window user working with.
    As I understandd CWnd::GetActiveWindow works only with current Application

    Best regards, Constantin Kuznetsov Jr.


  2. #2
    Join Date
    Apr 1999
    Posts
    24

    Re: Title of the active window

    This is the standard action to retrieve a caption of any Windows control.
    char szTitle[80];
    HWND hActiveWnd = GetActiveWindow();
    hActiveWnd = GetWindowText(hActiveWnd, szTitle);
    This is using Windows API but it is easy to find analogs in Visual C



  3. #3
    Join Date
    May 1999
    Posts
    216

    Re: Title of the active window

    If the application may not be urs, u can use GetForegroundWindow(). This will help i think


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

Featured