Good tutorial on Windows API

  • Thread starter Thread starter Jarod_24
  • Start date Start date
J

Jarod_24

I've been using a lot of <DllImports> as of late and i was wondering if
anyone could tell me a good tutorial/website/articles/books
that explains what System.Marshal** actually does and how to make those
structures that some windows api methods need passed in/out.

So far i've used mostly methods that send in/out strings, bool, integer and
so on, easy to convert into CLR types, but some methods need structures and
some of these have quite some exotic <parameters> set. How do people know
when that is needed to be set is a mystery to me (i would like to learn it).

Example:

<StructLayout(LayoutKind.Sequential)> _
Public Structure StartUpInfo
Public cb As Integer
<MarshalAs(UnmanagedType.LPTStr)> Public lpReserved As String
<MarshalAs(UnmanagedType.LPTStr)> Public lpDesktop As String
....



this article was great:
http://msdn.microsoft.com/library/default.asp?url=/msdnmag/issues/03/07/NET/toc.asp
 
Back
Top