mAPIs.bas
资源名称:IE_VB.rar [点击查看]
上传用户:davilee3
上传日期:2015-04-22
资源大小:986k
文件大小:26k
源码类别:
浏览器
开发平台:
Visual Basic
- Attribute VB_Name = "mAPIs"
- Option Explicit
- '## API ########################################
- '== 控件与消息函数 =============================
- 'CallWindowProc 把消息信息传递给指定的窗体过程
- 'SetWindowLong 在窗体结构中为指定的窗体设置信息。返回值:Long,指定数据的前一个值。
- Public Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal MSG As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
- Public Const GWL_WNDPROC = -4
- '=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=
- '== Windows消息 ================================
- Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
- Public Declare Function SendMessageLng Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
- Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
- Public Const WM_SYSCOMMAND = &H112
- Public Const SC_MOVE = &HF010&
- Public Const SC_SIZE = &HF000&
- Public Declare Function ReleaseCapture Lib "user32" () As Long
- Public Const HTCAPTION As Long = 2
- Public Const WM_PAINT As Long = &HF
- Public Const WM_NCPAINT = &H85
- Public Const WM_ACTIVATE = &H6
- Public Const WM_ACTIVATEAPP = &H1C
- Public Const WM_MOUSEACTIVATE = &H21
- Public Const WM_NCACTIVATE = &H86
- Public Const WM_SYNCPAINT As Long = &H88
- Public Const WM_CREATE As Long = &H1
- Public Const WM_MDIACTIVATE As Long = &H222
- Public Const WM_MDIMAXIMIZE As Long = &H225
- Public Const WM_MDICREATE As Long = &H220
- Public Const WM_MDINEXT As Long = &H224
- Public Const WM_SETREDRAW As Long = &HB
- Public Const WM_DRAWITEM = &H2B '绘制Item
- Public Const WM_MEASUREITEM = &H2C '确定自画项目大小
- Public Const WM_LBUTTONDBLCLK As Long = &H203
- Public Const WM_LBUTTONDOWN As Long = &H201
- Public Const WM_LBUTTONUP As Long = &H202
- Public Const WM_MBUTTONDBLCLK As Long = &H209
- Public Const WM_MBUTTONDOWN As Long = &H207
- Public Const WM_MBUTTONUP As Long = &H208
- Public Const WM_RBUTTONDBLCLK As Long = &H206
- Public Const WM_RBUTTONDOWN As Long = &H204
- Public Const WM_RBUTTONUP As Long = &H205
- Public Const WM_MOUSEMOVE As Long = &H200
- Public Const WM_MOUSEWHEEL As Long = &H20A
- Public Const WM_USER = &H400
- Public Const WM_COMMAND = &H111
- Public Const WM_INITMENUPOPUP = &H117&
- Public Const WM_MENUCOMMAND As Long = &H126
- Public Const WM_MENURBUTTONUP As Long = &H122
- Public Const WM_MENUSELECT As Long = &H11F
- Public Const WM_EXITMENULOOP As Long = &H212
- Public Const WM_CANCELMODE As Long = &H1F
- Public Const WM_CONTEXTMENU As Long = &H7B
- Public Const WM_MOVE As Long = &H3
- Public Const WM_SIZE As Long = &H5
- Public Const SIZE_MAXIMIZED As Long = 2
- Public Const WM_SYSCOLORCHANGE As Long = &H15
- Public Const WM_KEYDOWN = &H100
- Public Const WM_KEYUP As Long = &H101
- Public Const MK_CONTROL = &H8
- Public Const MK_LBUTTON As Long = &H1
- Public Const MK_RBUTTON As Long = &H2
- Public Const MK_SHIFT As Long = &H4
- '== 硬件与系统函数 =============================
- 'CopyMemory 从一个地点拷贝一块记忆到另外一个
- 'GetSysColor 判断指定windows显示对象的颜色
- Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long)
- Public Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long
- '-- GetSysColor --------------------------------
- '标准的:0~20
- Public Const COLOR_ACTIVEBORDER = 10 '活动窗口的边框
- Public Const COLOR_ACTIVECAPTION = 2 '活动窗口的标题
- Public Const COLOR_APPWORKSPACE = 12 'MDI桌面的背景
- Public Const COLOR_BACKGROUND = 1 'windows桌面
- Public Const COLOR_BTNFACE = 15 '按钮
- Public Const COLOR_BTNHIGHLIGHT = 20 '按钮的3D加亮区
- Public Const COLOR_BTNSHADOW = 16 '按钮的3D阴影
- Public Const COLOR_BTNTEXT = 18 '按钮文字
- Public Const COLOR_CAPTIONTEXT = 9 '窗口标题中的文字
- Public Const COLOR_GRAYTEXT = 17 '灰色文字;如使用了抖动技术则为零
- Public Const COLOR_HIGHLIGHT = 13 '选定的项目背景
- Public Const COLOR_HIGHLIGHTTEXT = 14 '选定的项目文字
- Public Const COLOR_INACTIVEBORDER = 11 '不活动窗口的边框
- Public Const COLOR_INACTIVECAPTION = 3 '不活动窗口的标题
- Public Const COLOR_INACTIVECAPTIONTEXT = 19 '不活动窗口的文字
- Public Const COLOR_MENU = 4 '菜单
- Public Const COLOR_MENUTEXT = 7 '菜单文字
- Public Const COLOR_SCROLLBAR = 0 '滚动条
- Public Const COLOR_WINDOW = 5 '窗口背景
- Public Const COLOR_WINDOWFRAME = 6 '窗框
- Public Const COLOR_WINDOWTEXT = 8 '窗口文字
- '== 设备场景函数 ===============================
- 'GetDC 获取指定窗口的设备场景。返回值:Long,指定窗口的设备场景句柄,出错则为0。
- 'ReleaseDC 释放由调用GetDC或GetWindowDC函数获取的指定设备场景。返回值:Long,执行成功为1,否则为0。
- Public Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long
- Public Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Long, ByVal hdc As Long) As Long
- Public Declare Function GetWindowDC Lib "user32" (ByVal hWnd As Long) As Long
- '== 文本和字体 =================================
- '-= 字体范围 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- 'GetTextExtentPoint32 判断一个字串的大小(范围)。返回值:Long,非零表示成功,零表示失败。
- Public Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32A" (ByVal hdc As Long, ByVal lpsz As Long, ByVal cbString As Long, lpSize As Size) As Long
- '-= 文本输出 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- 'DrawText 将文本描绘到指定的矩形中。返回值:Long,描绘文字的高度。
- 'GetTextColor 判断当前字体颜色。通常也称为“前景色”。返回值:Long,文字的当前RGB颜色设置。如果出错,会返回CLR_INVALID。
- 'SetTextColor 设置当前文本颜色。这种颜色也称为“前景色”。返回值:Long,文本色的前一个RGB颜色设定。
- Public Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hdc As Long, ByVal lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As Long
- Public Declare Function GetTextColor Lib "gdi32" (ByVal hdc As Long) As Long
- Public Declare Function SetTextColor Lib "gdi32" (ByVal hdc As Long, ByVal crColor As Long) As Long
- '-- DrawText -----------------------------------
- Public Const DT_LEFT = &H0
- Public Const DT_CENTER = &H1
- Public Const DT_RIGHT = &H2
- Public Const DT_SINGLELINE = &H20
- Public Const DT_TOP = &H0
- Public Const DT_VCENTER = &H4
- Public Const DT_BOTTOM = &H8
- Public Const DT_CALCRECT = &H400 'AutoSize
- Public Const DT_WORDBREAK = &H10 'AutoCrLf
- Public Const DT_NOCLIP = &H100 '不剪切区域
- Public Const DT_NOPREFIX = &H800 '不处理&
- Public Const DT_EXPANDTABS = &H40 '用制表符作为定位点
- Public Const DT_TABSTOP = &H80 '用8~15位来指定制表符
- Public Const DT_EXTERNALLEADING = &H200 '计算文本行高度时,使用当前字体的外部铅距属性。
- '== 绘图函数 ===================================
- 'CreateSolidBrush 用纯色创建一个刷子
- 'DeleteObject 用这个函数删除GDI对象,比如画笔、刷子、字体、位图、区域以及调色板等等。对象使用的所有系统资源都会被释放
- 'DrawEdge 用指定的样式描绘一个矩形的边框。返回值:Long,非零表示成功,零表示失败。
- 'FillRect 用指定的刷子填充一个矩形
- 'SelectObject 每个设备场景都可能有选入其中的图形对象。其中包括位图、刷子、字体、画笔以及区域等等。一次选入设备场景的只能有一个对象。选定的对象会在设备场景的绘图操作中使用。返回值:Long,与以前选入设备场景的相同hObject类型的一个对象的句柄,零表示出错。
- 'SetBkColor 为指定的设备场景设置背景颜色。
- 'SetBkMode 设置背景透明
- 'SetPixelV 在指定的设备场景中设置一个像素的RGB值
- Public Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
- Public Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
- Public Declare Function DrawEdge Lib "user32" (ByVal hdc As Long, qrc As RECT, ByVal edge As Long, ByVal grfFlags As Long) As Long
- Public Declare Function FillRect Lib "user32" (ByVal hdc As Long, lpRect As RECT, ByVal hBrush As Long) As Long
- Public Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
- Public Declare Function SetBkColor Lib "gdi32" (ByVal hdc As Long, ByVal crColor As Long) As Long
- Public Declare Function SetBkMode Lib "gdi32" (ByVal hdc As Long, ByVal nBkMode As Long) As Long
- Public Declare Function SetPixelV Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long
- 'Public Declare Function SelectObject Lib "gdi32" (ByVal hDC As Long, ByVal hObject As Long) As Long
- Public Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
- Public Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
- Public Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
- Public Declare Function DeleteDC Lib "gdi32.dll" (ByVal hdc As Long) As Long
- Public Const SRCCOPY = &HCC0020
- Public Const SRCINVERT = &H660046
- Public Const DSTINVERT = &H550009
- Public Const PATINVERT = &H5A0049
- '-- SetBkMode ----------------------------------
- Public Const TRANSPARENT = 1 '透明处理,即不作上述填充
- Public Const OPAQUE = 2 '用当前的背景色填充虚线画笔、阴影刷子以及字符的空隙
- Public Const NEWTRANSPARENT = 3 '在有颜色的菜单上画透明文字
- '-- DrawEdge -----------------------------------
- ' - edge - - - - - - - - - - - - - - - - - - - -
- Public Const BDR_RAISEDOUTER = &H1 '外层凸
- Public Const BDR_SUNKENOUTER = &H2 '外层凹
- Public Const BDR_RAISEDINNER = &H4 '内层凸
- Public Const BDR_SUNKENINNER = &H8 '内层凹
- Public Const BDR_OUTER = &H3
- Public Const BDR_RAISED = &H5
- Public Const BDR_SUNKEN = &HA
- Public Const BDR_INNER = &HC
- Public Const EDGE_RAISED = (BDR_RAISEDOUTER Or BDR_RAISEDINNER)
- Public Const EDGE_ETCHED = (BDR_SUNKENOUTER Or BDR_RAISEDINNER)
- Public Const EDGE_BUMP = (BDR_RAISEDOUTER Or BDR_SUNKENINNER)
- Public Const EDGE_SUNKEN = (BDR_SUNKENOUTER Or BDR_SUNKENINNER)
- ' - grfFlags - - - - - - - - - - - - - - - - - -
- Public Const BF_LEFT = &H1
- Public Const BF_TOP = &H2
- Public Const BF_RIGHT = &H4
- Public Const BF_BOTTOM = &H8
- Public Const BF_DIAGONAL = &H10
- Public Const BF_MIDDLE = &H800
- Public Const BF_SOFT = &H1000
- Public Const BF_ADJUST = &H2000
- Public Const BF_FLAT = &H4000
- Public Const BF_MONO = &H8000
- Public Const BF_RECT = (BF_LEFT Or BF_TOP Or BF_RIGHT Or BF_BOTTOM)
- Public Const BF_TOPLEFT = (BF_TOP Or BF_LEFT)
- Public Const BF_TOPRIGHT = (BF_TOP Or BF_RIGHT)
- Public Const BF_BOTTOMLEFT = (BF_BOTTOM Or BF_LEFT)
- Public Const BF_BOTTOMRIGHT = (BF_BOTTOM Or BF_RIGHT)
- Public Const BF_DIAGONAL_ENDTOPLEFT = (BF_DIAGONAL Or BF_TOP Or BF_LEFT)
- Public Const BF_DIAGONAL_ENDTOPRIGHT = (BF_DIAGONAL Or BF_TOP Or BF_RIGHT)
- Public Const BF_DIAGONAL_ENDBOTTOMLEFT = (BF_DIAGONAL Or BF_BOTTOM Or BF_LEFT)
- Public Const BF_DIAGONAL_ENDBOTTOMRIGHT = (BF_DIAGONAL Or BF_BOTTOM Or BF_RIGHT)
- '## 类型 #######################################
- Public Type POINTAPI
- x As Long
- y As Long
- End Type
- Public Type MSG
- hWnd As Long
- message As Long
- wParam As Long
- lParam As Long
- time As Long
- pt As POINTAPI
- End Type
- Public Type RECT
- Left As Long
- Top As Long
- Right As Long
- Bottom As Long
- End Type
- Public Type Size
- cx As Long
- cy As Long
- End Type
- Public Type DRAWITEMSTRUCT
- CtlType As Long '绘制的类型
- CtlID As Long '对菜单没用
- itemID As Long '菜单的索引ID
- itemAction As Long '定义要求的绘画的行动
- itemState As Long '绘画的行动发生以后,指定条款的视觉的状态 =选择
- hwndItem As Long '指定菜单的柄( HMENU )为菜单包含条款
- hdc As Long '绘图的设备场景
- rcItem As RECT '一个矩形定义控制的边界被拉的 由hDC 成员指定。
- itemData As Long 'CMenu::ModifyMenu
- End Type
- Public Type MEASUREITEMSTRUCT
- CtlType As Long '指定控制类型。=ODT_MENU
- CtlID As Long '对菜单没用
- itemID As Long
- itemWidth As Long '指定绘画菜单的宽度
- itemHeight As Long '指定绘画菜单的高度
- itemData As Long '指定与菜单条款
- End Type
- '=======================================================
- '===================Proxy API===========================
- '=======================================================
- Public Type INTERNET_PROXY_INFO
- dwAccessType As Long
- lpszProxy As String
- lpszProxyBypass As String
- End Type
- Public Const ERROR_INSUFFICIENT_BUFFER = 122
- Public Const INTERNET_OPTION_PROXY = 38
- Public Const INTERNET_OPTION_REFRESH As Long = 37
- Public Const INTERNET_OPTION_SETTINGS_CHANGED As Long = 39
- Public Const INTERNET_OPEN_TYPE_PRECONFIG = 0 '// use registry configuration
- Public Const INTERNET_OPEN_TYPE_DIRECT = 1 '// direct to net
- Public Const INTERNET_OPEN_TYPE_PROXY = 3 '// via named proxy
- Public Const INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY = 4 '// prevent using java/script/INS
- Public Declare Function InternetSetOption Lib "wininet.dll" Alias "InternetSetOptionA" (ByVal hInternet As Long, ByVal dwOption As Long, ByRef lpBuffer As Any, ByVal dwBufferLength As Long) As Long
- '## Window Function #####################################
- Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
- Public Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
- Public Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long
- Public Declare Function GetClientRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long
- Public Declare Function MoveWindow Lib "user32" (ByVal hWnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
- Public Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hWnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
- Public Declare Function PtInRect Lib "user32" (lpRect As RECT, ByVal x As Long, ByVal y As Long) As Long
- Public Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
- Public Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
- Public Const SWP_SHOWWINDOW = &H40
- Public Const SWP_NOACTIVATE = &H10
- Public Const HWND_TOP = 0
- Public Const SWP_NOMOVE = &H2
- Public Const SWP_NOSIZE As Long = &H1
- Public Const SWP_NOREDRAW As Long = &H8
- Public Const SWP_DEFERERASE As Long = &H2000
- Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
- Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
- Public Const GWL_STYLE = (-16&)
- Public Const WS_BORDER = &H800000
- Public Const WS_CAPTION = &HC00000
- Public Const WS_THICKFRAME = &H40000
- Public Const WS_SIZEBOX = WS_THICKFRAME
- Public Const WS_SYSMENU = &H80000
- Public Const WS_CHILD As Long = &H40000000
- Public Const GWL_EXSTYLE As Long = -20
- Public Const WS_EX_LAYERED As Long = &H80000
- '透明窗口
- Public Declare Function SetLayeredWindowAttributes Lib "user32.dll" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
- Public Const LWA_COLORKEY As Long = &H1
- Public Const LWA_ALPHA As Long = &H2
- '## Other #################################################
- Public Declare Function CreateStatusWindow Lib "comctl32.dll" (ByVal Style As Long, ByVal lpszText As String, ByVal hwndParent As Long, ByVal wID As Long) As Long
- Public Const SB_SETPARTS As Long = (WM_USER + 4)
- Public Const SB_SETTIPTEXTA As Long = (WM_USER + 16)
- Public Const SB_SETTEXTA As Long = (WM_USER + 1)
- '### vk #########################
- Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
- Public Const VK_RETURN As Long = &HD
- Public Const VK_LBUTTON As Long = &H1
- Public Const VK_RBUTTON As Long = &H2
- Public Const VK_MBUTTON As Long = &H4
- Public Const VK_F3 = &H72
- Public Const VK_F4 = &H73
- Public Const VK_F6 = &H75
- Public Const VK_F8 = &H77
- Public Const VK_F12 As Long = &H7B
- Public Const VK_SHIFT As Long = &H10
- Public Const VK_MENU = &H12
- Public Const VK_CONTROL = &H11
- Public Const VK_LEFT As Long = &H25
- Public Const VK_RIGHT As Long = &H27
- Public Const VK_UP As Long = &H26
- Public Const VK_DOWN As Long = &H28
- Public Const VK_ESCAPE As Long = &H1B
- Public Declare Function RegisterHotKey Lib "user32" (ByVal hWnd As Long, ByVal id As Long, ByVal fsModifiers As Long, ByVal vk As Long) As Long
- Public Declare Function UnregisterHotKey Lib "user32" (ByVal hWnd As Long, ByVal id As Long) As Long
- Public Const MOD_ALT As Long = &H1
- Public Const MOD_CONTROL As Long = &H2
- Public Const MOD_SHIFT As Long = &H4
- Public Const MOD_WIN As Long = &H8
- Public Const WM_HOTKEY As Long = &H312
- '-------------------------------------------------------
- ' Api Declares....
- '-------------------------------------------------------
- Public Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long
- '-------------------------------------------------------
- ' Api Constants...
- '-------------------------------------------------------
- Public Const GWL_USERDATA = (-21&)
- 'Public Const GWL_WNDPROC = (-4&)
- 'Public Const WM_USER = &H400&
- Public Const TRAY_CALLBACK = (WM_USER + 101&)
- Public Const NIM_ADD = &H0&
- Public Const NIM_MODIFY = &H1&
- Public Const NIM_DELETE = &H2&
- Public Const NIF_MESSAGE = &H1&
- Public Const NIF_ICON = &H2&
- Public Const NIF_TIP = &H4&
- '-------------------------------------------------------
- ' Api Types....
- '-------------------------------------------------------
- Public Type NOTIFYICONDATA
- cbSize As Long
- hWnd As Long
- uID As Long
- uFlags As Long
- uCallbackMessage As Long
- hIcon As Long
- szTip As String * 64
- End Type
- Public Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
- Public Declare Function SetCapture Lib "user32" (ByVal hWnd As Long) As Long
- Public Declare Function GetCursor Lib "user32" () As Long
- Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
- '------------------------------------------
- 'titile bar info ...
- '------------------------------------------
- Public Const CCHILDREN_TITLEBAR As Long = 5
- Public Declare Function GetTitleBarInfo Lib "user32.dll" ( _
- ByVal hWnd As Long, _
- ByRef pti As PTITLEBARINFO) As Long
- Public Type PTITLEBARINFO
- cbSize As Long
- rcTitleBar As RECT
- rgstate(0 To CCHILDREN_TITLEBAR) As Long
- End Type
- '----------------------------------------------------
- '------------------------------------
- 'system info
- '------------------------------------
- Public Declare Function GetSystemMetrics Lib "user32" ( _
- ByVal nIndex As Long) As Long
- Public Const SM_CXSIZE As Long = 30
- Public Const SM_CYSIZE As Long = 31
- Public Const SM_CYSCREEN As Long = 1
- Public Const SM_CXSCREEN As Long = 0
- '------------------------------------------
- Public Declare Function ScreenToClient Lib "user32" (ByVal hWnd As Long, lpPoint As POINTAPI) As Long
- Public Declare Function ClientToScreen Lib "user32" (ByVal hWnd As Long, lpPoint As POINTAPI) As Long
- Public Declare Function GetLastError Lib "kernel32" () As Long
- Public Declare Function BringWindowToTop Lib "user32" ( _
- ByVal hWnd As Long) As Long
- '##### keyboard and mouse hook ##################
- Public Type MOUSEHOOKSTRUCT
- pt As POINTAPI
- hWnd As Long
- wHitTestCode As Long
- dwExtraInfo As Long
- End Type
- Public Declare Function CallNextHookEx Lib "user32" _
- (ByVal hHook As Long, _
- ByVal ncode As Long, _
- ByVal wParam As Long, _
- ByVal lParam As Long) As Long
- Public Declare Function SetWindowsHookEx Lib "user32" _
- Alias "SetWindowsHookExA" _
- (ByVal idHook As Long, _
- ByVal lpfn As Long, _
- ByVal hmod As Long, _
- ByVal dwThreadId As Long) As Long
- Public Declare Function UnhookWindowsHookEx Lib "user32" _
- (ByVal hHook As Long) As Long
- Public Const WH_KEYBOARD As Long = 2
- Public Const WH_MOUSE As Long = 7
- Public Const HC_SYSMODALOFF = 5
- Public Const HC_SYSMODALON = 4
- Public Const HC_SKIP = 2
- Public Const HC_GETNEXT = 1
- Public Const HC_ACTION = 0
- Public Const HC_NOREMOVE As Long = 3
- '##########################################
- Public Const DC_ACTIVE = &H1
- Public Const DC_NOTACTIVE = &H2
- Public Const DC_ICON = &H4
- Public Const DC_TEXT = &H8
- Public Const DFC_BUTTON = 4
- Public Const DFC_POPUPMENU = 5 'Only Win98/2000 !!
- Public Const DFCS_BUTTON3STATE = &H10
- Public Const DFCS_PUSHED As Long = &H200
- Public Const DFCS_BUTTONPUSH As Long = &H10
- Public Const DC_GRADIENT = &H20 'Only Win98/2000 !!
- Public Declare Function DrawCaption Lib "user32" (ByVal hWnd As Long, ByVal hdc As Long, pcRect As RECT, ByVal un As Long) As Long
- Public Declare Function DrawFocusRect Lib "user32" (ByVal hdc As Long, lpRect As RECT) As Long
- Public Declare Function DrawFrameControl Lib "user32" (ByVal hdc As Long, lpRect As RECT, ByVal un1 As Long, ByVal un2 As Long) As Long
- Public Declare Function SetRect Lib "user32" (lpRect As RECT, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
- Public Declare Function OffsetRect Lib "user32" (lpRect As RECT, ByVal x As Long, ByVal y As Long) As Long
- Public Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
- Public Const SW_RESTORE As Long = 9
- Public Const SW_AUTOPROF_LOAD_MASK As Long = &H1
- Public Const SW_AUTOPROF_SAVE_MASK As Long = &H2
- Public Const SW_ERASE As Long = &H4
- Public Const SW_FORCEMINIMIZE As Long = 11
- Public Const SW_HIDE As Long = 0
- Public Const SW_INVALIDATE As Long = &H2
- Public Const SW_MAX As Long = 10
- Public Const SW_MAXIMIZE As Long = 3
- Public Const SW_MINIMIZE As Long = 6
- Public Const SW_NORMAL As Long = 1
- Public Const SW_OTHERUNZOOM As Long = 4
- Public Const SW_OTHERZOOM As Long = 2
- Public Const SW_PARENTCLOSING As Long = 1
- Public Const SW_PARENTOPENING As Long = 3
- Public Const SW_SCROLLCHILDREN As Long = &H1
- Public Const SW_SHOW As Long = 5
- Public Const SW_SHOWDEFAULT As Long = 10
- Public Const SW_SHOWMAXIMIZED As Long = 3
- Public Const SW_SHOWMINIMIZED As Long = 2
- Public Const SW_SHOWMINNOACTIVE As Long = 7
- Public Const SW_SHOWNA As Long = 8
- Public Const SW_SHOWNOACTIVATE As Long = 4
- Public Const SW_SHOWNORMAL As Long = 1
- Public Const SW_SMOOTHSCROLL As Long = &H10
- '######## Window Version #################
- Public Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
- Public Type OSVERSIONINFO
- dwOSVersionInfoSize As Long
- dwMajorVersion As Long
- dwMinorVersion As Long
- dwBuildNumber As Long
- dwPlatformID As Long
- szCSDVersion As String * 128
- End Type
- Public Const VER_PLATFORM_WIN32_NT As Long = 2
- Public Const VER_PLATFORM_WIN32_WINDOWS As Long = 1
- Public Const VER_PLATFORM_WIN32s As Long = 0
- '############################################
- '########## Redraw Window ################
- Public Declare Function RedrawWindow Lib "user32" (ByVal hWnd As Long, lprcUpdate As Any, ByVal hrgnUpdate As Long, ByVal fuRedraw As Long) As Long
- Public Const RDW_ALLCHILDREN As Long = &H80
- Public Const RDW_ERASE As Long = &H4
- Public Const RDW_ERASENOW As Long = &H200
- Public Const RDW_FRAME As Long = &H400
- Public Const RDW_INTERNALPAINT As Long = &H2
- Public Const RDW_INVALIDATE As Long = &H1
- Public Const RDW_NOCHILDREN As Long = &H40
- Public Const RDW_NOERASE As Long = &H20
- Public Const RDW_NOFRAME As Long = &H800
- Public Const RDW_NOINTERNALPAINT As Long = &H10
- Public Const RDW_UPDATENOW As Long = &H100
- Public Const RDW_VALIDATE As Long = &H8
- '############################################
- Public Declare Function GetWindow Lib "user32" (ByVal hWnd As Long, ByVal wcmd As Long) As Long
- Public Const GW_HWNDNEXT As Long = 2
- Public Const GW_HWNDFIRST As Long = 0
- Public Const GW_HWNDPREV As Long = 3
- Public Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String) As Long
- Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As Long, ByVal cch As Long) As Long
- Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
- '###### ToolBar #################################
- 'Public Type TBBUTTON
- ' iBitmap As Long
- ' idCommand As Long
- ' fsState As Byte
- ' fsStyle As Byte
- ' dwData As Long
- ' iString As Long
- 'End Type
- '
- 'Public Type TBBUTTONINFOA
- ' cbSize As Long
- ' dwMask As Long
- ' idCommand As Long
- ' iImage As Long
- ' fsState As Byte
- ' fsStyle As Byte
- ' cx As Integer
- ' lParam As Long
- ' pszText As String
- ' cchText As Long
- 'End Type
- '
- 'Public Const TB_GETBUTTONINFOA As Long = (WM_USER + 65)
- 'Public Const TB_GETBUTTONINFOW As Long = (WM_USER + 63)
- 'Public Const TB_SETBUTTONINFOA As Long = (WM_USER + 66)
- 'Public Const TB_SETBUTTONINFOW As Long = (WM_USER + 64)
- 'Public Const TB_GETBUTTON As Long = (WM_USER + 23)
- 'Public Const TBIF_STYLE As Long = &H8
- 'Public Const BTNS_WHOLEDROPDOWN As Long = &H80
- '#####################################################