Hello, Friends!
I'm sorry if this is a stupid question, but is there any way to clear my ICS Interaction window, something like the ics 'cls' command trough winboard?
Thanks!
Moderator: Andres Valverde
#include <windows.h>
#include <Richedit.h>
int WINAPI WinMain(HINSTANCE hInst,HINSTANCE hPrev,LPSTR lpCmd,int nShow)
{
HWND hwnd,hwndChild;
char title[64];
if((hwnd = FindWindow("WBConsole",NULL)) != INVALID_HANDLE_VALUE)
{ //security check
GetWindowText(hwnd, title, 64);
if(strstr(title, "I C S Interaction:"))
{ //the ICS interaction is the 1st child, so no worries:
hwndChild = FindWindowEx(hwnd, NULL, "RICHEDIT", 0);
//SetWindowText it's not going to work, it lacks the invoke of DefWindowProc()!
SendMessage(hwndChild,WM_SETTEXT,0,(LPARAM)"");
//Without invalidation, DefWindowProc() of the child will not update the buffer,so:
InvalidateRect(hwndChild,0,TRUE);
}
}
return 0;
}
xcomponent wrote:Ok, here's the 'workaround' i made
It's a bit stupid, but works perfectly.
- Code: Select all
#include <windows.h>
#include <Richedit.h>
int WINAPI WinMain(HINSTANCE hInst,HINSTANCE hPrev,LPSTR lpCmd,int nShow)
{
HWND hwnd,hwndChild;
char title[64];
if((hwnd = FindWindow("WBConsole",NULL)) != INVALID_HANDLE_VALUE)
{ //security check
GetWindowText(hwnd, title, 64);
if(strstr(title, "I C S Interaction:"))
{ //the ICS interaction is the 1st child, so no worries:
hwndChild = FindWindowEx(hwnd, NULL, "RICHEDIT", 0);
//SetWindowText it's not going to work, it lacks the invoke of DefWindowProc()!
SendMessage(hwndChild,WM_SETTEXT,0,(LPARAM)"");
//Without invalidation, DefWindowProc() of the child will not update the buffer,so:
InvalidateRect(hwndChild,0,TRUE);
}
}
return 0;
}
here's a link:
[url]
http://pawny.netii.net/cls.zip
[/url]
xcomponent wrote:No, just click it and the Interaction window gets cleared. That's it.
H.G.Muller wrote:I think it should be trivial to declare the text-edit of the consoleuser-writable, rather than read-only, in the winboard.rc file. In that case you could clear it by Ctrl+A plus <Del>. And you could do much, much more, like drawing an ASCII picture of yourself.
The question could of course be: why would you want to?
Return to Winboard and related Topics
Users browsing this forum: No registered users and 13 guests