判断当前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;
}
}
|
最新内容请见作者的GitHub页:http://qaseven.github.io/