On Tue, 02 Mar 2010, Szak�ts Viktor wrote:

Hi,

> >> Oh yes, so you are using GTWIN.
> >> No, for this GT "Close -> X" button cannot be manipulated.
> > It can, through API SetConsoleCtrlHandler(). Handles events:
> > CTRL_C_EVENT
> > CTRL_BREAK_EVENT
> > CTRL_CLOSE_EVENT             <<<===
> > CTRL_LOGOFF_EVENT
> > CTRL_SHUTDOWN_EVENT
> Can you show an example for that using current gtwin.c code?
> We're already handling these events, so if doable, it should 
> be implemented here:
[...]

For CTRL_LOGOFF_EVENT, CTRL_SHUTDOWN_EVENT we should enable CANCEL
or QUIT action. Please only remember that CtrlHandler is executed
using separate non HVM thread.

Current implementation ignores CTRL_CLOSE_EVENT (it returns TRUE what
disable default ExitProcess() action). It causes that after 5 seconds
systems shows message box asking about confirmation of process termination.

There is no way to disable [X] close button using SetConsoleCtrlHandler()
and CTRL_SHUTDOWN_EVENT (BTW maybe we should change default action for this
event to QUIT or CANCEL).

On newer systems having GetConsoleWindow() function it's possible to
use exactly the same solution as in GTWVT, i.e:

   HMENU hSysMenu = GetSystemMenu( GetConsoleWindow(), FALSE );
   if( hSysMenu )
      EnableMenuItem( hSysMenu, SC_CLOSE, MF_BYCOMMAND | MF_GRAYED );

best regards,
Przemek
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to