There is no specific namespace that wraps those APIs. You can find lots of them wrapped all over the framework, but they are by no means totally covered.
As far as I know, theres no wrapped for FindWindow as yet.
Yes, with some differences, caused by the differences in datatypes in .net. There are samples in the framework sdk and documentation on it in the msdn help.
It doesnt usually get a lot more complicated than changing Long for Integer or IntPtr.
But how about getting the data from the buffer. With NetUserGetInfo under VB6 you used to have to call the MoveMemory API and then convert the Pointers to Unicode strings etc......how do you go about doing that in VB .NET??
How do you go about doing it? With a little bit of help from the Marshal and MarshalAsAttribute classes found under System.Runtime.InteropServices. If you post a Visual Basic 5/6 example we should be able to convert it to .NET for you.
Ive actually been toying with this problem all week ad it was getting very frustrating.
I was trying to use the NetUserGetInfo API to return user info from our NT Domain.
Finally, clarity came yesterday afternoon and , as you say, with a little bit of help from Marshal.PtrToStructure and Marshal.StructureToPtr, success arrived!! Woohoo!!
....so much easier under .NET once you understand the new syntax.
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.