专注于互联网--专注于架构

最新标签
网站地图
文章索引
Rss订阅

首页 »VB教程 » vb编程教程:仿照SDK编程写的窗口-vb教程 »正文

vb编程教程:仿照SDK编程写的窗口-vb教程

来源: 发布时间:星期四, 2008年9月25日 浏览:127次 评论:0
ion Explicit

Public Declare Function CreateWindowEx Lib \"user32\" Alias \"CreateWindowExA\" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long
Public Declare Function LoadIcon Lib \"user32\" Alias \"LoadIconA\" (ByVal hInstance As Long, ByVal lpIconName As String) As Long
Public Declare Function LoadCursor Lib \"user32\" Alias \"LoadCursorA\" (ByVal hInstance As Long, ByVal lpCursorName As String) As Long
Public Declare Function GetStockObject Lib \"gdi32\" (ByVal nIndex As Long) As Long
Public Declare Function RegisterClassEx Lib \"user32\" Alias \"RegisterClassExA\" (pcWndClassEx As WNDCLASSEX) As Integer
Public Declare Function ShowWindow Lib \"user32\" (ByVal handle_of_window As Long, ByVal nCmdShow As Long) As Long
Public Declare Function UpdateWindow Lib \"user32\" (ByVal handle_of_window As Long) As Long
Public Declare Function SetFocus Lib \"user32\" (ByVal handle_of_window As Long) As Long
Public Declare Function PostMessage Lib \"user32\" Alias \"PostMessageA\" (ByVal handle_of_window As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public Declare Function DefWindowProc Lib \"user32\" Alias \"DefWindowProcA\" (ByVal handle_of_window As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public Declare Function GetMessage Lib \"user32\" Alias \"GetMessageA\" (lpMsg As MSG, ByVal handle_of_window As Long, ByVal wMsgFilterMin As Long, ByVal wMsgFilterMax As Long) As Long
Public Declare Function TranslateMessage Lib \"user32\" (lpMsg As MSG) As Long
Public Declare Function DispatchMessage Lib \"user32\" Alias \"DispatchMessageA\" (lpMsg As MSG) As Long
Public Declare Sub PostQuitMessage Lib \"user32\" (ByVal nExitCode As Long)
Public Declare Function BeginPaint Lib \"user32\" (ByVal handle_of_window As Long, lpPaint As PAINTSTRUCT) As Long
Public Declare Function EndPaint Lib \"user32\" (ByVal handle_of_window As Long, lpPaint As PAINTSTRUCT) As Long
Public Declare Function GetClientRect Lib \"user32\" (ByVal handle_of_window As Long, lpRect As RECT) As Long
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


Type WNDCLASSEX
cbSize As Long
style As Long
lpfnWndProc As Long
cbClsExtra As Long
cbWndExtra As Long
hInstance As Long
hIcon As Long
hCursor As Long
hbrBackground As Long
lpszMenuName As String
lpszClassName As String
hIconSm As Long
End Type


Type POINTAPI
x As Long
y As Long
End Type

Type MSG
handle_of_window As Long
message As Long
wParam As Long
lParam As Long
time As Long
pt As POINTAPI
End Type

Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Type PAINTSTRUCT
hdc As Long
fErase As Long
rcPaint As RECT
fRestore As Long
fIncUpdate As Long
rgbReserved(32) As Byte ´this was declared incorrectly in VB API viewer
End Type

Public Const WS_VISIBLE As Long = &H10000000
Public Const WS_VSCROLL As Long = &H200000
Public Const WS_TABSTOP As Long = &H10000
Public Const WS_THICKFRAME As Long = &H40000
Public Const WS_MAXIMIZE As Long = &H1000000
Public Const WS_MAXIMIZEBOX As Long = &H10000
Public Const WS_MINIMIZE As Long = &H20000000

相关文章

读者评论

  • 共0条 分0页

发表评论

  • 昵称:
  • 内容: