Findwindow Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using the following syntax

h=findwindow("HHTaskBar",""

I would like to hide the task bar on a CE 4.1 device and I am using VB .Net. I keep getting an error missing exception method. I have tried h an a integer, intptr and a long. I have also declared the findwindow function. Am I doing something wrong or could sample code be provided. I have only tried this the emulator, could this be my problem

Thanks
Brian
 
<DllImport("coredll")> _
Public Shared Function FindWindow(ByVal lpClass as String, ByVal lpTitle as
String) as IntPtr

Dim hWnd as IntPtr = FindWindow("HHTaskbar", Notihng)

--
Alex Feinman
---
Visit http://www.opennetcf.org
Brian said:
I am using the following syntax.

h=findwindow("HHTaskBar","")

I would like to hide the task bar on a CE 4.1 device and I am using VB
..Net. I keep getting an error missing exception method. I have tried h an
a integer, intptr and a long. I have also declared the findwindow function.
Am I doing something wrong or could sample code be provided. I have only
tried this the emulator, could this be my problem?
 
I have the code:
dim h as intptr = findwindow("HHTaskBar", nothing)

in the main form in the load event

I also have the code declared in side the form:

<DllImport("coredll")> _
Public Shared Function FindWindow(ByVal lpClass as String, ByVal lpTitle as
String) as IntPtr

I am still getting a missing method exception error when the findwindow call is made. Any ideas?
 
Brian said:
I have the code:
dim h as intptr = findwindow("HHTaskBar", nothing)

in the main form in the load event

I also have the code declared in side the form:

<DllImport("coredll")> _
Public Shared Function FindWindow(ByVal lpClass as String, ByVal lpTitle as
String) as IntPtr

I am still getting a missing method exception error when the findwindow call is made. Any ideas?


The following works for me. Not sure what might be the problem on your end
Alex Feinman
---
Visit http://www.opennetcf.org

----------------------------------------------------------------------------
----
Imports System.Runtime.InteropServices
Public Class Form1
Inherits System.Windows.Forms.Form
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
MyBase.Dispose(disposing)
End Sub

Private Sub InitializeComponent()
Me.MainMenu1 = New System.Windows.Forms.MainMenu

'
'Form1
'
Me.Menu = Me.MainMenu1
Me.Text = "Form1"
End Sub
#End Region

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles
MyBase.Load
Dim hWnd As IntPtr = FindWindow("HHTaskbar", Nothing)
hWnd = IntPtr.Zero
End Sub

<DllImport("coredll")> _
Public Shared Function FindWindow(ByVal lpClass As String, ByVal lpTitle As
String) As IntPtr
End Function

End Class
 
Back
Top