Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-05 Thread Xavi
Thanks Saulius, At least SetConsoleMenuClose grayed also the option Close in caption menu not only the button in title bar. :) I still don't understand why we have to introduce HB_BREAK_FLAG in Inkey Poll in response to CTRL_CLOSE_EVENT. I think if we do this .- --- Index: gtwin.c =

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-05 Thread Saulius Zrelskis
Hi, > Do you know which windows version accepts SetConsoleMenuClose() > and other functions like SetConsolePalette()? > > If this is commonly supported functionality then we can add some > extension to GTWIN. These goodies appears since Windows 2000. Also console alias, command history, font serv

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-05 Thread Przemysław Czerpak
On Fri, 05 Mar 2010, Saulius Zrelskis wrote: Hi, > > SetConsoleMenuClose() is an undocumented Windows API function, > > so IMO it's not a good idea to use it in Harbour. > We are familiar with undocumented things since Clipper days. > And Harbour is and must be compatible with it 100% :) Do you

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-05 Thread Przemysław Czerpak
On Fri, 05 Mar 2010, Saulius Zrelskis wrote: Hi, > [for those interested] > Sample below really controls console close button on Windows XP and > later systems. Please test it and enjoy:) Yes it is and we have exactly such code in our GTWIN (unfortunately it needs GetConsoleWindow() so it does n

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-05 Thread Viktor Szakáts
Hi, >> SetConsoleMenuClose() is an undocumented Windows API function, >> so IMO it's not a good idea to use it in Harbour. > > We are familiar with undocumented things since Clipper days. That's okay, but it's quite dangerous thing to do, as the API may disappear (easy to handle, see commit),

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-05 Thread Saulius Zrelskis
> SetConsoleMenuClose() is an undocumented Windows API function, > so IMO it's not a good idea to use it in Harbour. We are familiar with undocumented things since Clipper days. And Harbour is and must be compatible with it 100% :) Best regards, Saulius ___

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-05 Thread Viktor Szakáts
Thank you. I did implement similar a few days ago in GTWIN. SetConsoleMenuClose() is an undocumented Windows API function, so IMO it's not a good idea to use it in Harbour. Brgds, Viktor On 2010 Mar 5, at 10:19, Saulius Zrelskis wrote: > [for those interested] > Sample below really controls co

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-05 Thread Saulius Zrelskis
[for those interested] Sample below really controls console close button on Windows XP and later systems. Please test it and enjoy:) --->>> #include 'inkey.ch' proc main() local nKey while (nKey := Inkey(0)) # K_ESC Qout(Str(nKey) +' "' +Chr(nKey) +'"') if nKey == Asc("0") .or. nKey ==

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-05 Thread Viktor Szakáts
Hi Xavi, > Maybe is about CTRL_LOGOFF_EVENT, CTRL_SHUTDOWN_EVENT that is received only > by services. > But if so is a issue of Vista and Win7/2008, not ours, because the official > documentation nothing says about this, AFAIK. The documentation was just not updated for Vista/Win7, I see you s

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-04 Thread Xavi
Viktor, It also doesn't work on Vista/Win7/2008. Maybe is about CTRL_LOGOFF_EVENT, CTRL_SHUTDOWN_EVENT that is received only by services. But if so is a issue of Vista and Win7/2008, not ours, because the official documentation nothing says about this, AFAIK. And no excuse for not correcting

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-04 Thread Viktor Szakáts
It also doesn't work on Vista/Win7/2008. Did _you_ read the comments in your quoted (now for the 6th times) article? I tested it on XP x64, there there is a window asking for 'Cancel' and 'End Now', so even here this method cannot prevent the app to be closed by user. In any case it's not a S

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-04 Thread Xavi
Sorry I meant SetCancel(.F.) http://msdn.microsoft.com/en-us/library/ms683242%28VS.85%29.aspx " An application-defined function used with the SetConsoleCtrlHandler function. A console process uses this function to handle control signals received by the process. When the signal is received, the

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-04 Thread Viktor Szakáts
It doesn't work on Vista and Win7/2008. Brgds, Viktor On 2010 Mar 4, at 20:16, Xavi wrote: > [ I don't know because I've to answer this. Maybe the last time. :( ] > > http://msdn.microsoft.com/en-us/library/ms683242%28VS.85%29.aspx > > " > An application-defined function used with the SetConso

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-04 Thread Xavi
[ I don't know because I've to answer this. Maybe the last time. :( ] http://msdn.microsoft.com/en-us/library/ms683242%28VS.85%29.aspx " An application-defined function used with the SetConsoleCtrlHandler function. A console process uses this function to handle control signals received by the p

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-04 Thread Viktor Szakáts
> http://msdn.microsoft.com/en-us/library/ms683242%28VS.85%29.aspx > > " > Return TRUE. In this case, no other handler functions are called, and the > system displays a pop-up dialog box that asks the user whether to terminate > the process. The system also displays this dialog box if the proces

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-04 Thread Viktor Szakáts
>> Can you describe what is exactly this "expected" result? > > http://msdn.microsoft.com/en-us/library/ms683242%28VS.85%29.aspx > > " > Return TRUE. In this case, no other handler functions are called, and the > system displays a pop-up dialog box that asks the user whether to terminate > the

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-04 Thread Xavi
Can you describe what is exactly this "expected" result? http://msdn.microsoft.com/en-us/library/ms683242%28VS.85%29.aspx " Return TRUE. In this case, no other handler functions are called, and the system displays a pop-up dialog box that asks the user whether to terminate the process. The sys

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-04 Thread Viktor Szakáts
>> I was referring to your patch. Did you >> try it with a test application with both >> SETCANCEL(.T.) and SETCANCEL(.F.) ? >> >>> IMHO this difference can be assumed because the code must be fixed in MT >>> mode. >>> [ >>> #if ! defined( HB_MT_VM )&& 0 >>> if( hb_setGetCancel() ) >>>

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-04 Thread Xavi
Did you test this code? Yes, if you're referring to that SetCancel( .T. ) Clipper's program under NTVDM differs. I was referring to your patch. Did you try it with a test application with both SETCANCEL(.T.) and SETCANCEL(.F.) ? IMHO this difference can be assumed because the code must be f

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-04 Thread Viktor Szakáts
>> Did you test this code? > > Yes, if you're referring to that SetCancel( .T. ) Clipper's program under > NTVDM differs. I was referring to your patch. Did you try it with a test application with both SETCANCEL(.T.) and SETCANCEL(.F.) ? > IMHO this difference can be assumed because the code

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-04 Thread Xavi
Hi, Did you test this code? Yes, if you're referring to that SetCancel( .T. ) Clipper's program under NTVDM differs. IMHO this difference can be assumed because the code must be fixed in MT mode. [ #if ! defined( HB_MT_VM ) && 0 if( hb_setGetCancel() ) s_bBreak = HB_TRUE;

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-03 Thread Viktor Szakáts
Hi Xavi, > Yes, you're right. > I have another patch to fix this, IMHO a issue, but I don't have right to > commit it, there are two differents points of view and few opinions. Please > note that GTWIN behavior is the same as a Clipper program under NTVDM. > > --- .patch > Index: gtwin.c >

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-03 Thread Xavi
Hi, I'm trying to write a simple Hello World app that does something like a WAIT command and maybe calls a function if I click the X button for a GTWIN app. Yes, you're right. I have another patch to fix this, IMHO a issue, but I don't have right to commit it, there are two differents points o

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-03 Thread Viktor Szakáts
>> I have it in mind to try that 'one of these days', meaning probably within >> your lifetime. ;-) > > It would be nice if this could be chewed > into HB_GTI_NOTIFIERBLOCK support for GTWIN, > at least for close events that is. > > Any results of your experiments is useful, > so just take yo

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-03 Thread Viktor Szakáts
Hi Paul, >> With GTWIN I still have to see proof that >> it's technically possible to catch close >> events like that, until then I assume it's >> not possible, and for sure it's not implemented >> in Harbour. > > I have seen some code posted on the Clipper forum that I hope I captured > concern

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-03 Thread Paul Tucker
Victor, With GTWIN I still have to see proof that it's technically possible to catch close events like that, until then I assume it's not possible, and for sure it's not implemented in Harbour. I have seen some code posted on the Clipper forum that I hope I captured concerning fullscreen/Wind

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-03 Thread smu johnson
Wow this test is really cute. I'll be poking around with this. Thanks a ton! On Wed, Mar 3, 2010 at 2:21 PM, Viktor Szakáts wrote: > > I'm trying to write a simple Hello World app that does something like a > WAIT command and maybe calls a function if I click the X button for a GTWIN > app. I

Re: [Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-03 Thread Viktor Szakáts
> I'm trying to write a simple Hello World app that does something like a WAIT > command and maybe calls a function if I click the X button for a GTWIN app. > I have no idea if this is even possible, as I have grepped the entire harbour > src .zip file contents for some hints. In the few resul

[Harbour] Question about hb_gt_win_CtrlHandler usage

2010-03-03 Thread smu johnson
Hi, I'm trying to write a simple Hello World app that does something like a WAIT command and maybe calls a function if I click the X button for a GTWIN app. I have no idea if this is even possible, as I have grepped the entire harbour src .zip file contents for some hints. In the few results for