This is roughly what I'm trying to do:-
struct // This structure holds every line to be displayed.
{
char Contents[MAX_TEXT];
} DisplayBuffStruct[RTVNUMLINES];
// ------------------------------------------------
case WM_PAINT :
hdc = BeginPaint (hwnd, &ps); // Prepare the window for painting.
// ****************************** Find painting limits ******************************.
for (n = FirstLine; n <= LastLine; n++)
{
TextOut(hdc, 10, y), DisplayBuffStruct[n].Contents, StrLength); // Write a line of text from DisplayBuffStruct[].Contents to the client area.
}
EndPaint (hwnd, &ps); // Indicate that painting is finished.
return 0;
// ------------------------------------------------
void WatchStr(char *TheString, char *TheText) // This counts as a declaration of WatchStr()
{
if(strlen(TheString) > MAX_TEXT-1)
{
MessageBox(NULL, TEXT("Too Big !"), TEXT("WatchStr"), MB_OK);
exit(0);
}
sprintf(DisplayBuffStruct[DispLine++].Contents, "%s = %s", TheText, TheString);
InvalidateRect(hwnd, NULL, TRUE);
}
// ------------------------------------------------
I want to copy a selected portion of the text from the screen to the clipboard.