qileilove

blog已经转移至github,大家请访问 http://qaseven.github.io/

判断windows操作系统平台

判断当前Windows系统是win2000,winXP,winVista,win2003,win7...
private static IntPtr GetSysTrayWnd()
{
IntPtr handle = FindWindow("Shell_TrayWnd", null);
handle = FindWindowEx(handle, IntPtr.Zero, "TrayNotifyWnd", null);
if (IsWindowsXP || IsWindows2000 || IsWindows2003 || IsWindowsVista || IsWindows7)
{
if (IsWindows2000)
{
handle = FindWindowEx(handle, IntPtr.Zero, "ToolbarWindow32", null);
return handle;
}
else
{
handle = FindWindowEx(handle, IntPtr.Zero, "SysPager", null);
handle = FindWindowEx(handle, IntPtr.Zero, "ToolbarWindow32", null);
return handle;
}
}
else
{
return handle;
}
}

判断当前Windows系统是win2000,winXP,winVista,win2003,win7...
private static IntPtr GetSysTrayWnd()
{
IntPtr handle = FindWindow("Shell_TrayWnd", null);
handle = FindWindowEx(handle, IntPtr.Zero, "TrayNotifyWnd", null);
if (IsWindowsXP || IsWindows2000 || IsWindows2003 || IsWindowsVista || IsWindows7)
{
if (IsWindows2000)
{
handle = FindWindowEx(handle, IntPtr.Zero, "ToolbarWindow32", null);
return handle;
}
else
{
handle = FindWindowEx(handle, IntPtr.Zero, "SysPager", null);
handle = FindWindowEx(handle, IntPtr.Zero, "ToolbarWindow32", null);
return handle;
}
}
else
{
return handle;
}
}

posted on 2014-07-09 11:12 顺其自然EVO 阅读(237) 评论(0)  编辑  收藏 所属分类: 测试学习专栏


只有注册用户登录后才能发表评论。


网站导航:
 
<2014年7月>
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

导航

统计

常用链接

留言簿(55)

随笔分类

随笔档案

文章分类

文章档案

搜索

最新评论

阅读排行榜

评论排行榜