Private Const WM_USER As Integer = 1024
Private Const DTM_ZOOMLEVEL As Integer = WM_USER + 116
Private Const DISPLAYCLASS As String = "DISPLAYCLASS"
Private Const WC_HTML As String = DISPLAYCLASS
Private Const WS_CHILD As Long = &H40000000L
Private Const WS_VISIBLE As Long = &H10000000L
Private Const HS_NOSCROLL As Integer = &H20
Private Declare Function SendZoomMessage Lib "Coredll" Alias "SendMessage" ( _
ByVal HWND As IntPtr, _
ByVal wMsg As Integer, _
ByVal wParam As Integer, _
ByRef lParam As Integer) As Integer
Private Declare Function CreateWindowPocket Lib "Coredll" Alias "CreateWindowEx" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String, _
ByVal dwStyle As Integer, _
ByVal x As Integer, _
ByVal y As Integer, _
ByVal nWidth As Integer, _
ByVal nHeight As Integer, _
ByVal hWndParent As IntPtr, _
ByVal hMenu As IntPtr, _
ByVal hInstance As Int32) As IntPtr
Friend objWindow As New Integer
Friend hwndHTML As IntPtr
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
hwndHTML = CreateWindowPocket(WC_HTML, Nothing, _
WS_CHILD Or WS_VISIBLE Or HS_NOSCROLL, _
0, 0, 100, 100, Me.Handle, _
Nothing, objWindow)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim retInt As Integer = SendZoomMessage(hwndHTML, DTM_ZOOMLEVEL, 0, 4)
Me.Button2.Text = retInt.ToString()
End Sub
|