1. __declspec(selectany)
http://msdn.microsoft.com/en-us/library/5tkz6s71%28v=VS.90%29.aspx
2. 设置桌面墙纸IActiveDesktop远比SystemParametersInfo好使。CoInitialize(NULL);IActiveDesktop* pActiveDesktop = NULL;
hr = CoCreateInstance(CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER,
IID_IActiveDesktop, (void**)&pActiveDesktop);
hr = pActiveDesktop->SetWallpaper(image, style);
WALLPAPEROPT wpo;
wpo.dwSize = sizeof(WALLPAPEROPT);
wpo.dwStyle = dwStyle;
hr = pActiveDesktop->SetWallpaperOptions(&wpo, 0);
pActiveDesktop->ApplyChanges(AD_APPLY_ALL);
3. MoveFileEx(,,MOVEFILE_DELAY_UNTIL_REBOOT)
强行删除一个被占用的文件,未必是最好的,特别是在一个好的产品中。
【注意:Pending项写重复了,逻辑往往不会正确的。】
4. Win7 Upgrade VS2008(90天试用版)http://www.lvtaostudio.com/2010/0105/442.html
5. CreateMutex 确保只有一个进程
这个问题是不是太简单了?
不过好像在Win7,低权限运行的时候,会遇到一些问题。