-
April 22nd, 2010, 02:34 PM
#1
[RESOLVED] "Unable to find an entry point named 'GetForegroundwindow' in DLL 'User32.dll'."
Hello,
I don't know why I got the error.
Code:
EntryPointNotFoundException was unhandled by user code
Thanks for help.
Code:
Private Declare Function SetForegroundwindow Lib "User32" (ByVal hwnd As IntPtr) As IntPtr
Private Declare Function GetForegroundwindow Lib "User32.dll" () As IntPtr
Private Declare Function SetActiveWindow Lib "user32" Alias "SetActiveWindow" (ByVal hwnd As Long) As Long
Private Declare Function GetActiveWindow Lib "user32" Alias "GetActiveWindow" () As Long
Public Overrides Function Execute(ByVal xmlInput As System.Xml.XmlElement, ByVal oInputValues As System.Collections.IDictionary) As System.Xml.XmlElement
' ....
Dim handler As IntPtr
handler = GetForegroundWindow() ' Error here
SetActiveWindow(handler)
-
April 23rd, 2010, 05:49 AM
#2
Re: "Unable to find an entry point named 'GetForegroundwindow' in DLL 'User32.dll'."
Don't know where you got your declarations, but all of them should be Int32, and not IntPtr :
Code:
Private Declare Function GetForegroundWindow Lib "user32.dll" () As Int32
Private Declare Function SetForegroundWindow Lib "user32.dll" (ByVal hwnd As Int32) As Int32
Private Declare Function SetActiveWindow Lib "user32.dll" (ByVal hwnd As Int32) As Int32
Private Declare Function GetActiveWindow Lib "user32.dll" () As Int32
I'd suggest you get a copy of API Viewer 2004
Also, APIs are case sensitive, as they originate from C / C++ - so that may also cause a problem
-
April 23rd, 2010, 07:50 AM
#3
Re: "Unable to find an entry point named 'GetForegroundwindow' in DLL 'User32.dll'."
-
April 23rd, 2010, 08:04 AM
#4
Re: "Unable to find an entry point named 'GetForegroundwindow' in DLL 'User32.dll'."
Like Hannes said, entry point names are case sensitive. That is your only issue.
Code:
Private Declare Function GetForegroundWindow Lib "User32.dll" () As IntPtr
Good Luck,
Craig - CRG IT Solutions - Microsoft Gold Partner
-My posts after 08/2015 = .NET 4.x and Visual Studio 2015
-My posts after 11/2011 = .NET 4.x and Visual Studio 2012
-My posts after 02/2010 = .NET 4.0 and Visual Studio 2010
-My posts after 12/2007 = .NET 3.5 and Visual Studio 2008
-My posts after 04/2007 = .NET 3.0 and Visual Studio 2005
-My posts before 04/2007 = .NET 1.1/2.0
*I do not follow all threads, so if you have a secondary question, message me.
-
April 23rd, 2010, 08:34 AM
#5
Re: [RESOLVED] "Unable to find an entry point named 'GetForegroundwindow' in DLL 'Use
Yep, it seems I was smoking something that affected my braincells today. IntPtr is correct, Ddh! Hannes!
Sorry zhshqzyc - I'm just human afterall LOL!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|