HOW GET THE TITLE TASK WHEN ALT+TAB ARE PRESSED?

hi forum members, excuse me if I bother you, but I need your help with some ideas about advanced visual c programming, this time I have a program , that with your given support , the program can get the text from the buttons which have the focus, but now I’m trying to get the window’s title that is displayed when the user press ALT + TAB for switching the task, I’m trying to get this with CBT HOOKS, but the only data that I got was information about some keys were pressed, thanks for your advice

Answer this question

HOW GET THE TITLE TASK WHEN ALT+TAB ARE PRESSED?

  • wfsCA

    You don't need any hooks. Enumerate all top level Windows. Just look for the visible ones. Use GetWindowText and you will receive the caption.

  • lisa52

    You don't need t hook to get a windows handle. I just wrote it in my first post: Enumerate the windows!
    The function is called EnumWindows:
    http://msdn.microsoft.com/library/default.asp url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/enumwindows.asp

    The task manager does nothing else. It just enumerates the top level windows and call GetWindowText. Thats all!

  • pxgator

    But , to use the GetWindowText I need to get a window handle, If it is not necesary to use  any hook to get a window handle, from where can I get  the window handles of the all top level windows
     Beside that , how can I enumerate all top level windows
     
    And if I can enumerate all top level windows, is the same thing like to get the name of the (next) window task , that I am going to switch with ALT + TAB keys

    Thanks for your attention

  • HOW GET THE TITLE TASK WHEN ALT+TAB ARE PRESSED?