I cannot find the old app where I played with both a console and GUI windows
in an app.
However there is a window associated with the console. You cannot subclass
it but you can do some things with it. For example, here's a 'quicky' that
moves it around.
. Ed
-----------------------
// can be built from the command line with
// bcc32 -WCR filename
#include <windows.h>
class Console
{
public:
Console();
~Console() {}
operator HWND () const { return console_hwnd; }
private:
Console(const Console &);
Console operator = (const Console &);
HWND console_hwnd;
static char new_title[];
}; // end class Console
char Console::new_title[] = " ZAB}{NEW TITLE][ABC";
Console::Console()
{
char orig_title[1024];
// make sure the new title is unique
*new_title = ' ';
for (char c = '!';
FindWindow(NULL, new_title) && (c <= '`');
++c)
{
*new_title = c;
}
GetConsoleTitle(orig_title, sizeof(orig_title));
if (SetConsoleTitle(new_title))
{
Sleep(10); // Give Win9x/WinME time to update the title
console_hwnd = FindWindow(NULL, new_title);
SetConsoleTitle(orig_title);
}
else
{
console_hwnd = NULL;
}
} // end Console::Console
void ShowWindowMovement(HWND hwnd)
{
RECT rect;
GetWindowRect(hwnd, &rect);
int top = rect.top;
int high = rect.bottom - top;
int wide = rect.right - rect.left;
for (int i = 0, x = rect.left - 20;
i < 4;
++i, x += 5)
{
MoveWindow(hwnd, x, top, wide, high, TRUE);
Sleep(1000);
}
} // end ShowWindowMovement
int main()
{
Console cons_info;
ShowWindowMovement(cons_info);
return 0;
}
-----------------------