用SystemParametersInfo函数或者IActiveDesktop只能设置桌面墙纸,而不能获取背景颜色,不知道有没有那个API可以设置和获取当前的背景颜色。如果要查询注册表的话,该查询哪一项?这个设置应该是与用户相关的,查询HKEY_CURRENT_USER下的项是,如何获取用户的那串数字标识?

解决方案 »

  1.   

    GetSysColor
    This function retrieves the current color of the specified display element. Display elements are the parts of a window and the Windows display that appear on the system display screen. DWORD GetSysColor(int nIndex);COLOR_BACKGROUND, COLOR_DESKTOP Desktop. 
    Return Values
    The red, green, blue (RGB) color value that determines the color of the specified element indicates success. Zero indicates failure. To get extended error information, call GetLastError.
    SetSysColors
    This function sets the colors for one or more display elements. BOOL WINAPI SetSysColors( 
    int cElements, 
    CONST INT *lpaElements, 
    CONST COLORREF *lpaRgbValues); 
    Parameters
    cElements 
    Specifies the number of display elements in the array pointed to by the lpaElements parameter. 
    lpaElements 
    Long pointer to an array of integers that specify the display elements to be changed. For a list of display elements, see GetSysColor. 
    lpaRgbValues 
    Long pointer to an array of unsigned long integers that contains the new red, green, blue (RGB) color value for each display element in the array pointed to by the lpaElements parameter. 
    Return Values
    Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.
      

  2.   

    COLORREF cr=GetSysColor(COLOR_BACKGROUND);OK,TKS