S
stephen.garner
Hi,
I am using the
IntPtr FindWindow(string lpClassName, string lpWindowName);
to get the handle for a window (notepad in this case), I am then using
int GetClassName(IntPtr hWnd, out StringBuilder lpClassName, int
nMaxCount);
to get the name of this window. Now it all works fine but as prove of
concept i want to print the name of the class to console. The
GetClassName returns 7 (Specifies the length, in TCHAR, of the buffer
pointed to by the lpClassName parameter) which would make sense as
notepad class name is Notepad. I'm having problems printing this to
console. It returns 3 characters to the console. I declared a local
StringBuilder class_name and passed that as an out parameter in my
method.
thanks,
steve.
I am using the
IntPtr FindWindow(string lpClassName, string lpWindowName);
to get the handle for a window (notepad in this case), I am then using
int GetClassName(IntPtr hWnd, out StringBuilder lpClassName, int
nMaxCount);
to get the name of this window. Now it all works fine but as prove of
concept i want to print the name of the class to console. The
GetClassName returns 7 (Specifies the length, in TCHAR, of the buffer
pointed to by the lpClassName parameter) which would make sense as
notepad class name is Notepad. I'm having problems printing this to
console. It returns 3 characters to the console. I declared a local
StringBuilder class_name and passed that as an out parameter in my
method.
thanks,
steve.