#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Posts
    3
    Rep Power
    0

    Post GetWindowInfo problem...


    i want use GetWindowInfo function in an app but i have a problem...here is some of my code :
    WINDOWINFO info;
    GetWindowInfo(hdlg,&info);
    and i get :
    'WINDOWINFO' : undeclared identifier
    'GetWindowInfo' : undeclared identifier
    i included windos.h,i try to include winuser.h but doesn't work.
    i look in winuser.h and the code was there...i don't understand...please help...
    i use visual c++ 6 on windows xp sp1
  2. #2
  3. I'm Baaaaaaack!
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Jul 2003
    Location
    Maryland
    Posts
    5,538
    Rep Power
    244
    I have found the ordering of include files are often problematic. Try putting <windows.h> as the very first and see if that helps.

    My blog, The Fount of Useless Information http://sol-biotech.com/wordpress/
    Free code: http://sol-biotech.com/code/.
    Secure Programming: http://sol-biotech.com/code/SecProgFAQ.html.
    Performance Programming: http://sol-biotech.com/code/PerformanceProgramming.html.
    LinkedIn Profile: http://www.linkedin.com/in/keithoxenrider

    It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it.
    --Me, I just made it up

    The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
    --George Bernard Shaw
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Posts
    3
    Rep Power
    0

    doesn't work


    i try it but it is the same...'WINDOWINFO' : undeclared identifier
  6. #4
  7. I'm Baaaaaaack!
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Jul 2003
    Location
    Maryland
    Posts
    5,538
    Rep Power
    244
    I have been trying to remember how I resolved a similiar issue I had a few weeks ago. If I get inspiration I will post.

    My blog, The Fount of Useless Information http://sol-biotech.com/wordpress/
    Free code: http://sol-biotech.com/code/.
    Secure Programming: http://sol-biotech.com/code/SecProgFAQ.html.
    Performance Programming: http://sol-biotech.com/code/PerformanceProgramming.html.
    LinkedIn Profile: http://www.linkedin.com/in/keithoxenrider

    It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it.
    --Me, I just made it up

    The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
    --George Bernard Shaw
  8. #5
  9. Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jan 2004
    Location
    near St. Louis Illinois
    Posts
    3,288
    Rep Power
    24
    it is defined in the Windows SDK, which must be downloaded (free) from msdn.

    http://www.microsoft.com/msdownload/...sdk/sdkupdate/
    Last edited by Ancient Dragon; May 4th, 2004 at 10:22 AM.
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Posts
    3
    Rep Power
    0
    i don't think that the problem is there,because i looked in winuser.h and the function and structure is there
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Location
    Cyberspace
    Posts
    10
    Rep Power
    0
    #undef WINVER
    #define WINVER 0x0500
  14. #8
  15. jasondoucette.com
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Canada
    Posts
    378
    Rep Power
    12
    At the bottom of this page: WINDOWINFO Structure it states its requirements. Basically, it asks to include windows.h (you don't have to include winuser.h), and it requires Windows 98. On this page: Using the Windows Headers, it tells you what you have to define WINVER as. You'll notice it says 0x0410, which will not work. But, take heed to the warning following the table:

    "Note that some features introduced in the latest version of Windows may be added to a service pack for a previous version of Windows. Therefore, to target a service pack, you may need to define _WIN32_WINNT with the value for the next major operating system release. For example, the GetDllDirectory function was introduced in Windows Server 2003 and is conditionally defined if _WIN32_WINNT is 0x0502 or greater. This function was also added to Windows XP SP1. Therefore, if you were to define _WIN32_WINNT 0x0501 to target Windows XP, you would miss features that are defined in Windows XP SP1."

    Setting WINVER to 0x0500 will work fine. When in doubt, try different values, and remove includes you think you do not need, and it helps you understand what is going on.

IMN logo majestic logo threadwatch logo seochat tools logo