以下代码适用于普通桌面设置:
#include "stdafx.h"
#include <windows.h>
#define SPI_SETWHEELSCROLLLINES 0x0069
#define SPI_GETWHEELSCROLLLINES 0x0068
/*
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724947(v=vs.85).aspx
BOOL WINAPI SystemParametersInfo(
_In_ UINT uiAction,
_In_ UINT uiParam,
_Inout_ PVOID pvParam,
_In_ UINT fWinIni
);
*/
int _tmain(int argc, _TCHAR* argv[])
{
if (argc>1){
int numLines = _ttoi(argv[1]);
SystemParametersInfo(SPI_SETWHEELSCROLLLINES, numLines, 0, SPIF_UPDATEINIFILE);
return 0;
}
}
但显然 SystemParametersInfo 是系统范围的。有没有办法只在当前用户会话中做到这一点?