Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FindWindow error: EntryPointNotFoundException

Status
Not open for further replies.

zhshqzyc

Programmer
Jan 21, 2006
13
US
Hello, I use vb.net 2005 to create a Form. Suppose the class name is Form1.vb.
And I try to find the handle of the Form in the code Form1.vb.
Code:
Private Declare Function FindWindow Lib "User32" Alias "FindWindow" (ByVal pClassName as String, ByVal pWindowName as String) as Long
' ------- many code
Dim retval As Long
retval = FindWindow("WindowsForms10.Window.8.app.0.3ce0bb8",vbNullString)
The string for the class name "WindowsForms10.Window.8.app.0.3ce0bb8" was gotten from the tool WinSpy++. Because I don't know what is the proper name for pWindowName, so I used vbNullString.
But an exception was thrown.
Code:
{"Unable to find an entry point named 'FindWindow' in DLL 'User32'.":""}

Can somebody guide me a right direction?

Many thanks.
 
Not that I'm an expert on .NET, but does not the form1.vb have a "Handle". I know in 6.0 it is me.hwnd and in 2k8 it is me.handle. Is it not the same for 2k5 (I don't have a machine it is installed on at the moment).



Good Luck

 
There are FindWindowA and FindWindowW (for Unicode) true entry points for FindWindow generic API name.
May be it helps...
 
From VB6.0 API Viewer...
[tt]
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
[/tt]



Good Luck

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top