Question : Problem: Checking code for Pocket PC

Hey experts,

 I changed the VC++ code from the following link (http://msdn2.microsoft.com/en-us/library/bb415520.aspx) to VB.NET as follows (check snippet), but the problem is that when I test it on Pocket PC 2003 emulator, there are two issues: 1- the window doesn't appear and when I press the button, 2- SendZoomMessage would return 0 (indicating failure); any help on how to solve these issues?
   
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
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
Open in New Window Select All

Answer : Problem: Checking code for Pocket PC

>>Mikal613

The main thing that I needed to do is to change the text size of the WebBrowser .NET control, but it turns out that it doesn't support this change, so I tried to use SendMessage on it with param. DTM_ZOOMLEVEL, but it didn't work (also returning always 0), so I tried to do it this way; since it was done in the code in the link that I provided this way.
Random Solutions  
 
programming4us programming4us