|
发表于 2019-1-13 12:33:58
|
显示全部楼层
江苏省扬州市
建立一个程序集
.版本 2
.程序集 隐藏任务栏
.子程序 Hide_Taskbar, 逻辑型, , 隐藏任务栏按钮.成功返回真,失败返回假
.参数 Winhandle, 整数型, , 窗口句柄
.局部变量 Var_Hwnd, 整数型
.如果真 (IsWindow (Winhandle) = 0)
返回 (假)
.如果真结束
Var_Hwnd = -1
CloseHandle (CreateThread (0, 0, &CreateHideWin, Var_Hwnd, 0, 0))
.判断循环首 (Var_Hwnd = -1)
处理事件 ()
.判断循环尾 ()
' 本源码来自易语言资源网(www.5A5X.com)
.如果真 (Var_Hwnd = 0)
返回 (假)
.如果真结束
SetWindowLong (Winhandle, #GWLP_HWNDPARENT, Var_Hwnd)
返回 (真)
.子程序 Display_Taskbar, 逻辑型, , 显示任务栏,成功返回真,失败返回假
.参数 Winhandle, 整数型, , 窗口句柄
.局部变量 Var_Hwnd, 整数型
.局部变量 Var_BShow, 逻辑型
.局部变量 Var_BIcon, 逻辑型
.如果真 (IsWindow (Winhandle) = 0)
返回 (假)
.如果真结束
Var_BIcon = IsIconic (Winhandle)
Var_BShow = IsWindowVisible (Winhandle)
Var_Hwnd = GetWindowLong (Winhandle, -8)
SetWindowLong (Winhandle, -8, 0)
PostThreadMessage (GetWindowThreadProcessId (Var_Hwnd, 0), 18, 0, 0)
SendMessage (Var_Hwnd, 16, 0, 0)
SendMessage (Winhandle, 11, 0, 0)
ShowWindow (Winhandle, 7)
.如果真 (Var_BIcon = 假)
ShowWindow (Winhandle, 4)
.如果真结束
SendMessage (Winhandle, 11, 1, 0)
.如果真 (Var_BShow = 假)
ShowWindow (Winhandle, 0)
.如果真结束
返回 (真) ' 本源码来自易语言资源网(www.5A5X.com)
.子程序 CreateHideWin
.参数 hwnd, 整数型, 参考
.局部变量 Var_Msg, 整数型, , "7"
.局部变量 Var_WndClass, WNDCLASS
Var_WndClass.style = 3
Var_WndClass.lpfnwndproc = GetProcAddress (GetModuleHandle (“user32.dll”), “DefWindowProcA”)
Var_WndClass.hInstance = GetModuleHandle (Var_WndClass.lpszClassName)
Var_WndClass.hbrBackground = GetStockObject (0)
Var_WndClass.lpszClassName = “HideTaskbar”
RegisterClass (Var_WndClass)
hwnd = CreateWindowEx (384, Var_WndClass.lpszClassName, “”, 79691776, 0, 0, 0, 0, 0, 0, Var_WndClass.hInstance, 0)
.如果真 (hwnd ≠ 0)
.判断循环首 (GetMessage (Var_Msg, 0, 0, 0) ≠ 0)
TranslateMessage (Var_Msg)
DispatchMessage (Var_Msg)
.判断循环尾 ()
.如果真结束
.子程序 Sub_EnumTopWin, 整数型, , 枚举顶级窗口,返回枚举出来的窗口句柄数组成员数
.参数 WinArray, 整数型, 参考 数组, 该数组变量用来接收所有枚举出来相关的窗口句柄
.参数 ParentWin, 整数型, , 0=屏幕则枚举出来所有顶层的窗口,若指定一个父窗口,将枚举出其子控件窗口句柄
.参数 Windclass, 文本型, 可空, 只返回与该类名相同的窗口句柄
.参数 WindText, 文本型, 可空, 只返回包含有该标题文本的窗口句柄
.局部变量 Local_hWnd, 整数型
.局部变量 Local_ClassName, 文本型
.局部变量 Local_WindowText, 文本型
.局部变量 Local_NullString, 文本型
清除数组 (WinArray)
Local_NullString = 字符 (0)
Local_hWnd = FindWindowEx (ParentWin, 0, Local_NullString, Local_NullString)
.判断循环首 (Local_hWnd ≠ 0)
连续赋值 (取空白文本 (255), Local_ClassName, Local_WindowText)
GetClassName (Local_hWnd, Local_ClassName, 255)
GetWindowText (Local_hWnd, Local_WindowText, 255)
.如果真 (Windclass = “” 或 Local_ClassName = Windclass)
.如果真 (WindText = “” 或 寻找文本 (Local_WindowText, WindText, , 真) ≠ -1)
加入成员 (WinArray, Local_hWnd)
.如果真结束
' 本源码来自易语言资源网(www.5A5X.com)
.如果真结束
Local_hWnd = FindWindowEx (0, Local_hWnd, Local_NullString, Local_NullString)
.判断循环尾 ()
返回 (取数组成员数 (WinArray))
.子程序 Sub_TakeSysVersion, 文本型, , 取系统版本
.局部变量 Local_OSsinfo, OSVERSIONINFO
.局部变量 Local_dwod, 整数型
.局部变量 Local_RetVer, 文本型
Local_OSsinfo.dwOSVersionInfoSize = 148
Local_OSsinfo.szCSDVersion = 取空白文本 (128)
Local_dwod = GetVersionEx (Local_OSsinfo)
.如果真 (Local_OSsinfo.dwMajorVersion = 6 且 Local_OSsinfo.dwMinorVersion = 0)
.如果 (Local_OSsinfo.wProductType = #VER_NT_WORKSTATION)
Local_RetVer = “Microsoft Windows Vista”
.否则
Local_RetVer = “Microsoft Windows Server 2008”
.如果结束
.如果真结束
.如果真 (Local_OSsinfo.dwMajorVersion = 6 且 Local_OSsinfo.dwMinorVersion = 1)
Local_RetVer = “Microsoft Windows 7”
.如果真结束
.如果真 (Local_OSsinfo.dwMajorVersion = 5 且 Local_OSsinfo.dwMinorVersion = 1)
.如果 (Local_OSsinfo.wSuiteMask = #VER_SUITE_PERSONAL)
Local_RetVer = “Microsoft Windows XP Home Edition”
.否则
Local_RetVer = “Microsoft Windows XP Professional”
.如果结束
.如果真结束
.如果真 (Local_OSsinfo.dwMajorVersion = 5 且 Local_OSsinfo.dwMinorVersion = 2)
Local_RetVer = “Microsoft Windows Server 2003”
.如果真结束
.如果真 (Local_OSsinfo.dwMajorVersion = 5 且 Local_OSsinfo.dwMinorVersion = 0)
Local_RetVer = “Microsoft Windows 2000”
.如果真结束
返回 (Local_RetVer)
.子程序 Sub_Barheight, 整数型, , 取任务栏高度
.局部变量 Local_RECT, RECT
.局部变量 Local_Height, 整数型
SystemParametersinfo (#SPI_GETWORKAREA, 0, Local_RECT, 0)
Local_Height = 取屏幕高度 () - Local_RECT.Bottom
返回 (Local_Height)
程序调用
.版本 2
‘隐藏
Set_Winhandle = _启动窗口.取窗口句柄 ()
Var_TkbStat = Hide_Taskbar (Set_Winhandle)
‘显示
Set_Winhandle = _启动窗口.取窗口句柄 ()
Var_TkbStat = Display_Taskbar (Set_Winhandle)
|
|