comp.lang.ada
 help / color / mirror / Atom feed
From: "Steve" <nospam_steved94@comcast.net>
Subject: Re: HWND of the console
Date: Fri, 24 Jun 2005 18:46:07 -0700
Date: 2005-06-24T18:46:07-07:00	[thread overview]
Message-ID: <3sSdnU0MwKaWKiHfRVn-vw@comcast.com> (raw)
In-Reply-To: e465bcf0.0506240556.7a08f26a@posting.google.com

"Sylvain" <sisi.ard@laposte.net> wrote in message 
news:e465bcf0.0506240556.7a08f26a@posting.google.com...
> Hi,
> Can you give me a piece of code which give me the HWND of the current
> console window given by default by Adagide in the Gnat environment
> with the only add-on called "Win32ADA", please.
>
>
> Thank you ! Bye !

WinBase.GetStdHandle( WinBase.STD_OUTPUT_HANDLE )

Sample code:

PROCEDURE CursorPosnTIF( row, col : Natural ) IS

  result : Win32.BOOL;
  toRow : Natural := Natural'MAX( row, 1 );
  toCol : Natural := Natural'MAX( col, 1 );

BEGIN
  result := WinCon.SetConsoleCursorPosition(
                  WinBase.GetStdHandle( WinBase.STD_OUTPUT_HANDLE ),
                  WinCon.COORD'( X => Win32.Short( toCol - 1 ),
                                 y => Win32.Short( toRow - 1 ) ) );
END CursorPosnTIF;

Note: This only works for the console window.

Steve
(The Duck) 





  parent reply	other threads:[~2005-06-25  1:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-24 13:56 HWND of the console Sylvain
2005-06-24 14:25 ` Adrien Plisson
2005-06-25  1:46 ` Steve [this message]
2005-06-25  7:32   ` Adrien Plisson
2005-06-26  1:07     ` Steve
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox