Harald van D?k
8/14/2011 9:37:00 AM
On Aug 14, 11:13 am, jacob navia <ja...@spamsink.net> wrote:
> Le 14/08/11 10:24, Harald van D?k a écrit :
> > On Aug 14, 10:03 am, jacob navia<ja...@spamsink.net> wrote:
> >> [...]
> >> GetConsoleTitle( title, 500 );
> >> hwnd = FindWindow( NULL, title );
> >> [...]
> >> This supposes that the title of the console is less than 500 chars
>
> > And this supposes that the console title uniquely identifies the
> > window. Haven't you ever started two instances of the same application?
>
> If you need more sphistication use EnumWindows directly. Then you
> will find ALL windows with the given name.
In which case you don't know which one's yours, so it is unsuitable
for resizing the window. Take BartC's post, follow the link to MSDN,
and you will see that there is a more direct way of getting the window
handle. Which still doesn't really do anything useful for you, but
that's for other reasons :)