1、判断原生窗口的滚动条是否显示
BOOL
bRet = ::ShowScrollBar(GetSafeHwnd(), SB_HORZ, FALSE);
//先隐藏掉
SCROLLBARINFO sbInfo;
ZeroMemory((
void
*)&sbInfo,
sizeof
(SCROLLBARINFO));
sbInfo.cbSize =
sizeof
(SCROLLBARINFO);
BOOL
bRet2 = GetScrollBarInfo(GetSafeHwnd(), OBJID_HSCROLL, &sbInfo);
DWORD
dRet = sbInfo.rgstate[0];
if
(dRet & STATE_SYSTEM_INVISIBLE)
AfxMessageBox(
"un-visible~"
);
else
AfxMessageBox(
"visible~"
);
2、获取本地时区,同时考虑时令
TIME_ZONE_INFORMATION stInfoZone;
int nResult = GetTimeZoneInformation(&stInfoZone);
int nTimeZone = stInfoZone.Bias / (-60);
if (TIME_ZONE_ID_DAYLIGHT == nResult)
{
nTimeZone += stInfoZone.DaylightBias / (-60);
}
else if (TIME_ZONE_ID_STANDARD == nResult)
{
nTimeZone += stInfoZone.StandardBias / (60);
}