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 SETCANCEL() thing, but maybe rather it could be the standard GTWIN behavior (without any extra setting). For sure it's not a HB_GTI_CLOSABLE setting either. Or, we just leave it as is. Brgds, Viktor On 2010 Mar 4, at 20:21, Xavi wrote: > 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 system creates a new thread in > the process to execute the function. > " > > PROCEDURE Main() > > SetCancel(.F.) > ? "Click [X] Not close windows" > Wait > RETURN > > Now it's happening that you are introduced ch = HB_BREAK_FLAG in Inkey Poll, > keyboard buffer. > Wait ends and the main process is finished so the new thread to execute the > function is killed before it can complete their work. > > -- > Xavi > _______________________________________________ > Harbour mailing list (attachment size limit: 40KB) > Harbour@harbour-project.org > http://lists.harbour-project.org/mailman/listinfo/harbour _______________________________________________ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour