-
Win32 API bug
Code:
[DllImport("user32")]
public static extern int GetClassName(
int hWnd,
string lpClassName,
int nMaxCount
);
I am just messing around trying to refresh my memory on some stuff I haven't done lately. Right ow I am making a simple Window Info Spy to get some practice using the Win32 API. The problem is that I can't this to pass out a value. If I add ref or out to string lpClassName I get a fatal crash. With out the out/ref mark I get nothing.
Anyone know what might be doing this xor how to fix it?
-
Re: Win32 API bug
Code:
[DllImport("user32")]
public static extern int GetClassName(
int hWnd,
[MarshalAs(UnmanagedType.LPTStr)]
string lpClassName,
int nMaxCount
);
Now I have a string that is in an unreadable format.....