面对华丽Windows桌面工作心情或许好很多但是久了总会失去兴趣总想定期地更新桌面图片软件Software开发人员又面对这样需求了需要如何样去做呢?努力去找API吧到目前为止还有很多变桌面图片软件Software并且还能很挣钱其实设置桌面图片需求在目前数码相片处理软件Software也有现实需求比如当你去旅游回来后想把照片当作桌面图片就可以在处理图片时就设置为桌面图片这样就需要使用ParametersInfo来完成这项工作了当然这个还有很多其它功能比如获取桌面工作区大小
ParametersInfo声明如下:
WINUSERAPI
BOOL
WINAPI
ParametersInfoA(
__in UINT uiAction,
__in UINT uiParam,
__inout_opt PVOID pvParam,
__in UINT fWinIni);
WINUSERAPI
BOOL
WINAPI
ParametersInfoW(
__in UINT uiAction,
__in UINT uiParam,
__inout_opt PVOID pvParam,
__in UINT fWinIni);
#def UNICODE
# ParametersInfo ParametersInfoW
#
# ParametersInfo ParametersInfoA
#end // !UNICODE
uiAction是作区别操作参数
uiParam是设置参数
pvParam是设置或返回参数
fWinIni是设置参数
例子如下:
#001 //
#002 //获取系统配置信息
#003 //蔡军生 2007/11/16 QQ:9073204 深圳
#004 void GetParam(void)
#005 {
#006 //获取桌面墙纸路径
#007 //SPI_GETDESKWALLPAPER
#008 TCHAR chPath[MAX_PATH];
#009 (ParametersInfo(SPI_GETDESKWALLPAPER,MAX_PATH,chPath,0))
#010 {
#011 //
#012 OutputDebugString(chPath);
#013 OutputDebugString(_T("\r\n"));
#014 }
#015
#016 //获取工作区大小
#017 //SPI_GETWORKAREA
#018 RECT rcWorkArea;
#019 (ParametersInfo(SPI_GETWORKAREA,0,&rcWorkArea,0))
#020 {
#021 //
#022 const nBufSize = 256;
#023 TCHAR chBuf[nBufSize];
#024
#025 wsprf(chBuf,_T("%u,%u,%u,%u"),rcWorkArea.left,rcWorkArea.top,
#026 rcWorkArea.right,rcWorkArea.bottom);
#027
#028 OutputDebugString(chBuf);
#029 OutputDebugString(_T("\r\n"));
#030 }
#031
#032 }
最新评论