我記得有一個API是 Get****Resources, 具體是什麼忘記了,在VC中搜索也找不到
不知哪位大俠能告知!

解决方案 »

  1.   

    HGLOBAL LoadResource( 
    HMODULE hModule, 
    HRSRC hResInfo );
      

  2.   

    不是 LoadResource, 其实就像是 WIN ME下有一个资源监视的工具, 可以列出三种资源的使用情况!
      

  3.   

    GetGuiResourcesThe GetGuiResources function retrieves the count of handles to graphical user interface (GUI) objects in use by the specified process.
    DWORD GetGuiResources(
      HANDLE hProcess,
      DWORD uiFlags
    );Parameters
    hProcess 
    [in] Handle to the process. The handle must have the PROCESS_QUERY_INFORMATION access right. For more information, see Process Security and Access Rights. 
    uiFlags 
    [in] GUI object type. This parameter can be one of the following values. Value Meaning 
    GR_GDIOBJECTS Return the count of GDI objects. 
    GR_USEROBJECTS Return the count of USER objects. Return Values
    If the function succeeds, the return value is the count of handles to GUI objects in use by the process. If no GUI objects are in use, the return value is zero.If the function fails, the return value is zero. To get extended error information, call GetLastError.Res
    A process without a graphical user interface does not use GUI resources, therefore, GetGuiResources will return zero.Requirements
    Client: Included in Windows XP and Windows 2000 Professional.
    Server: Included in Windows Server 2003 and Windows 2000 Server.
    Header: Declared in Winuser.h; include Windows.h.
    Library: Use User32.lib.
      

  4.   

    楼上的可否将 Performance Counters 说得详细些, Thanks, thanks!这个问题问了好多天了
      

  5.   

    参考MSDN中Performance Monitoring的内容,具体有什么计数器可以看看"性能"
      

  6.   

    error C2065: 'GetGuiResources' : undeclared identifier我可以查到这个函数(在 vc98\include)中也在 link中加入了 user32.lib怎么还是不行
      

  7.   

    /// 如果您必须使用下列所指定的平台之前的平台,则修改下面的定义。
    // 有关不同平台的相应值的最新信息,请参考 MSDN。
    #ifndef WINVER
    #define WINVER 0x0500 //为 Windows 2000 及更新版本改变为适当的值。
    #endif#ifndef _WIN32_WINNT // 允许使用 Windows 2000或更高版本的特定功能。
    #define _WIN32_WINNT 0x0500 //为Windows 2000 及更新版本改变为适当的值。
    #endif #ifndef _WIN32_WINDOWS // 允许使用 Windows 2000或更高版本的特定功能。
    #define _WIN32_WINDOWS 0x0500 //为 Windows Me 及更新版本改变为适当的值。
    #endif
      

  8.   

    typedef DWORD (__stdcall GetGui)(HANDLE, DWORD);HINSTANCE hInst = ::LoadLibrary("User32.dll");
    VERIFY(hInst != NULL);
    GetGui *p = (GetGui*)::GetProcAddress(hInst, "GetGuiResources");HANDLE hHandle = ::OpenProcess(PROCESS_QUERY_INFORMATION, FALSE,
    ::GetCurrentProcessId());DWORD dwReturn = p(hHandle, 0);
    TCHAR buf[20];
    AfxMessageBox(ltoa(dwReturn, buf, 10));::CloseHandle(hHandle);
    ::FreeLibrary(hInst);通过函数指针
    这样是实现了, 取得的值为 18左右
    这应该是当前进程占用的资源百比分吧, 如果我想得到系统剩余的资源又该怎么办
    谢谢!