Tray windows

This is a discussion on Tray windows within the Windows Programming forums, part of the Platform Specific Boards category; Im trying to output only the windows opened in the Taskbar. I tried to use FindWindow() but apparrently its not ...

  1. #1
    Registered User
    Join Date
    Dec 2007
    Location
    France
    Posts
    749

    Tray windows

    Im trying to output only the windows opened in the Taskbar.
    I tried to use FindWindow() but apparrently its not the one to use.

    Code:
    #include <windows.h>
    #include <iostream>
    #pragma hdrstop
    #pragma argsused
    
    using namespace std;
    
    BOOL EnumWindowsProc(HWND hTaskbar, long lParam)
    {
          char Buff[255], NameOfClass[255];
          
          hTaskbar = FindWindow(TEXT("Shell_TrayWnd"), NULL); 
    
          GetWindowText(hTaskbar, Buff, 254);
          GetClassName(hTaskbar, NameOfClass, 254);
          cout << "Window Text: " << Buff << "\t"
               << "Class Name: "  << NameOfClass << endl;
    
          return TRUE;
    }
    
    
    int main(int argc, char* argv[])
    {
          EnumWindows((WNDENUMPROC)EnumWindowsProc, 0);
          cin.ignore();
          return 0;
    }
    Compiler MSVC++ 2010 with Code::Blocks.

  2. #2
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    611

  3. #3
    Registered User
    Join Date
    Dec 2007
    Location
    France
    Posts
    749
    Thanks a lot Adeyblue!
    Compiler MSVC++ 2010 with Code::Blocks.

  4. #4
    Registered User
    Join Date
    Apr 2007
    Posts
    137
    Quote Originally Posted by adeyblue View Post
    It's not the right (official) method.

  5. #5
    Registered User
    Join Date
    Dec 2007
    Location
    France
    Posts
    749
    Would you mind giving a link or an example of the right method?

    Thanks!
    Compiler MSVC++ 2010 with Code::Blocks.

  6. #6
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    This looks pretty good The Old New Thing : Which windows appear in the Alt+Tab list?

    The purpose of this algorithm is to assign the most meaningful representative winow from each cluster of windows related by ownership.
    ACtually that is what adeyblue's link is about.

    ╔╗╔╦══╦╗╔╦══╦╗
    ║╚╝║╔╗║╚╝║╔╗║║
    ║╔╗║╠╣║╔╗║╠╣╠╣
    ╚╝╚╩╝╚╩╝╚╩╝╚╩╝

    codez http://code.google.com/p/zxcvbn/

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Windows 98/2000 programming in Windows XP
    By Bill83 in forum Windows Programming
    Replies: 3
    Last Post: 07-22-2005, 02:16 PM
  2. Dialog Box Problems
    By Morgul in forum Windows Programming
    Replies: 21
    Last Post: 05-31-2005, 05:48 PM
  3. dual boot Win XP, win 2000
    By Micko in forum Tech Board
    Replies: 6
    Last Post: 05-30-2005, 02:55 PM
  4. SDL and Windows
    By nickname_changed in forum Windows Programming
    Replies: 14
    Last Post: 10-24-2003, 12:19 AM
  5. IE 6 status bar
    By DavidP in forum Tech Board
    Replies: 15
    Last Post: 10-23-2002, 05:31 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21