Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

hide taskbar

30 views
Skip to first unread message

H@discussions.microsoft.com Brian H

unread,
Aug 9, 2004, 10:03:03 PM8/9/04
to
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

Peter Foot [MVP]

unread,
Aug 10, 2004, 3:44:37 AM8/10/04
to
Since Windows CE.NET is a fully Unicode OS you should use alias FindWindowW
for the P/Invoke declaration.

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups

"Brian H" <Brian H...@discussions.microsoft.com> wrote in message
news:8B97B9EC-A9C3-49F1...@microsoft.com...

Brian H

unread,
Aug 10, 2004, 8:21:02 AM8/10/04
to
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

Brian H

unread,
Aug 10, 2004, 9:43:02 PM8/10/04
to
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

Brian H

unread,
Aug 10, 2004, 9:47:02 PM8/10/04
to
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?

Chris Tacke, eMVP

unread,
Aug 11, 2004, 8:22:31 AM8/11/04
to
It's becasue your ShowIndow is using 64-bit Longs. Use 32-bit Integers or
System.Int32 for clarity

-Chris


"Brian H" <Bri...@discussions.microsoft.com> wrote in message
news:EE2F82D5-B8F4-4E36...@microsoft.com...

0 new messages