<DLLImport("user32")> Function FindWindow(ByVal lpClassName As String, _
ByVal lpWindowName as String) as Integer
and as Ive done above all Integers must be converted to Shorts and Long to Integer when copying from vb6. You can use the Declare statement but this seems to be the recommended way of doing it in .net. Also you only use ByRef for structures as far as I know.
On the few occasions Ive required to do this, I just copy it out of the old API viewer and paste it in to VB.NET, change Longs to Integers, (or sometimes IntPtrs), and it works.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.