hide taskbar

G

Guest

I am developing an application with VB .Net on a Win CE 4.1 Symbol device. I
am continuing to have a problem with some code. Here is what I am using:

Private Declare Function FindWindow Lib "coredll" Alias "FindWindowA"
(ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
Private Declare Function ShowWindow Lib "coredll" (ByVal hWnd As IntPtr,
ByVal nCmdShow As Long) As Long

In the form load event...:

dim OurParent as IntPtr

OurParent = FindWindow("HHTaskbar", String.Empty)
ShowWindow(OurParent, 5)

I am getting an error of MISSING METHOD EXCEPTION when findwindow is called.
What am I doing wrong and what do I need to change?

Thanks,
Brian
 
G

Guest

I will adjust my code and give it a try. I will let you know what happens.
If I have another error, I will redisplay my code.

Thanks,
Brian
 
G

Guest

This is my code now:

Private Declare Function FindWindow Lib "coredll" Alias "FindWindowA"
(ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
Private Declare Function ShowWindow Lib "coredll" (ByVal hWnd As
IntPtr, ByVal nCmdShow As Long) As Long

In the form load, I have:

OurParent = FindWindow("HHTaskbar", String.Empty)
ShowWindow(OurParent, 0)

The findwindow is working buy now I get the error notsupportedexception,
again I do not know what is incorrect, any help would be great.

Thanks,
Brian H
 
G

Guest

Here is my code now:

Private Declare Function FindWindow Lib "coredll" Alias "FindWindowW"
(ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
Private Declare Function ShowWindow Lib "coredll" (ByVal hWnd As IntPtr,
ByVal nCmdShow As Long) As Long

In the form load event I have:

OurParent = FindWindow("HHTaskbar", String.Empty)
ShowWindow(OurParent, 0)

But now I get an error of NotSupportedException. Any idea what I am doing
wrong?
 
C

Chris Tacke, eMVP

It's becasue your ShowIndow is using 64-bit Longs. Use 32-bit Integers or
System.Int32 for clarity

-Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top