Create Pointer to Buffer?

  • Thread starter Thread starter scottf35
  • Start date Start date
S

scottf35

Hi,

I am trying to copy a window to a file and I have found some windows
messages that I can use with the SendMessage API that I presume will
help me do this.

One message is GetText which will copy the text in a window to a
buffer. However one parameter is the lParam and the definition says it
is the pointer to the buffer that is to receive the text.

Below is the SendMessage API with the GetText message
======================================================================
( lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_GETTEXT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);

Parameters

wParam
Specifies the maximum number of TCHARs to be copied, including
the terminating null character.

Windows NT/2000/XP:ANSI applications may have the string in the
buffer reduced in size (to a minimum of half that of the wParam value)
due to conversion from ANSI to Unicode.
lParam
Pointer to the buffer that is to receive the text.
=======================================================================

My question is, how do I create a pointer to the buffer that is to
recieve the text?

Any help would be appreciated.
 
My question is, how do I create a pointer to the buffer that is to
recieve the text?

You use StrungBuilder as the parameter type and pass in a
StringBuilder instance with big enough capacity.


Mattias
 
Back
Top