BergenBman Posted January 6, 2003 Posted January 6, 2003 In vb.net what namespace has all the win32 API's(ex FindWindow). I was in the system.microsoft.win32 namespace but couldn't find it. Quote
*Gurus* divil Posted January 6, 2003 *Gurus* Posted January 6, 2003 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, there's no wrapped for FindWindow as yet. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
BergenBman Posted January 7, 2003 Author Posted January 7, 2003 can you still use the old api functions with .net? Would declaring the functions like we did in vb6 still work? Quote
*Gurus* divil Posted January 7, 2003 *Gurus* Posted January 7, 2003 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 doesn't usually get a lot more complicated than changing Long for Integer or IntPtr. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
LeeSalter Posted February 13, 2003 Posted February 13, 2003 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?? Quote
*Gurus* Derek Stone Posted February 14, 2003 *Gurus* Posted February 14, 2003 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. Quote Posting Guidelines
LeeSalter Posted February 14, 2003 Posted February 14, 2003 Derek, I've 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. Quote
Recommended Posts