有以下C文件.
#include <windows.h>DWORD dwHandleCount = GetGuiResources(NULL,GR_USEROBJECTS);编译时报错:
d:\project\taskmgr\new.c(3) : warning C4013: 'GetGuiResources' undefined; assuming extern returning int
d:\project\taskmgr\new.c(3) : error C2065: 'GR_USEROBJECTS' : undeclared identifier我查看了声明GetGuiResources函数的头文件winuser.h确实包含在windows.h中,请问是怎么回事?

解决方案 »

  1.   

    Windows Server 2003 family _WIN32_WINNT>=0x0502 
    Windows XP _WIN32_WINNT>=0x0501 
    Windows 2000 _WIN32_WINNT>=0x0500 
    Windows NT 4.0 _WIN32_WINNT>=0x0400 
    Windows Me _WIN32_WINDOWS=0x0490 
    Windows 98 _WIN32_WINDOWS>=0x0410 
    Internet Explorer 6.0 _WIN32_IE>=0x0600 
    Internet Explorer 5.01, 5.5 _WIN32_IE>=0x0501 
    Internet Explorer 5.0, 5.0a, 5.0b _WIN32_IE>=0x0500 
    Internet Explorer 4.01 _WIN32_IE>=0x0401 
    Internet Explorer 4.0 _WIN32_IE>=0x0400 
    Internet Explorer 3.0, 3.01, 3.02 _WIN32_IE>=0x0300 
    自己看一下自己的系统设置~~~
      

  2.   

    你在头文件上面添加
    _WIN32_WINNT>=0x0500 
    是版本问题~~~
    GetGuiResources:
    Client: Included in Windows XP and Windows 2000 Professional.
    Server: Included in Windows Server 2003 and Windows 2000 Server.
    所以你加上_WIN32_WINNT定义为大于0x0500
      

  3.   

    winuser.h中,关于此函数的描述为下:#if(WINVER >= 0x0500)
    #define GR_GDIOBJECTS     0       /* Count of GDI objects */
    #define GR_USEROBJECTS    1       /* Count of USER objects */DWORD GetGuiResources(HANDLE hProcess, DWORD uiFlags);
    #endif /* WINVER >= 0x0500 */请问在头文件中怎么添加你说的那条语句?
      

  4.   

    且在winuser.h中有语句.#ifndef WINVER
    #define WINVER  0x0500      /* version 5.0 */
    #endif /* !WINVER */
      

  5.   

    就是你用到的GetGuiResources函数所对应的CPP文件阿~~
    然后你在上面添加进去~~~
    或者你直接加到#include "StdAfx.h"~~~
      

  6.   

    添加_WIN32_WINNT>=0x0500?
    这不是合法的语句啊?