Hi Przemek,
as Sergy reported, a GTWVT app seem to stop the Windows shutdown process.
I somehow strong believe that '0' represents 'FALSE' ;-)
and below is stated, that WM_QUERYENDSESSION should return TRUE,
else no WM_ENDSESSION will appear ( for which we then call DefWindowProc() ).
http://msdn.microsoft.com/en-us/library/windows/desktop/aa376890%28v=vs.85%29.aspx
I tried a changed GTWVT, and that changes reported shutdown behavior.
Maybe it is very wilfull done, or i not the first time overlook something ?
Maybe it's worth an idea, to react different depending on pWVT->CloseMode ?
Rolf
As I can understand complicated discussions about Harbour engine - the main idea is to enable the Windows rebooting.
yes - but as we get no master answer there likely is something we overlook.
This behavior seem exist since very long.
Maybe some Windows behave different -- can comfirm this 'shutdown stop' for my XP 32 & 64bit.
So perhaps some other make additional tests:
choose any GTWVT app, start it, reboot Windows - and please confirm or neglect.
1) why program quits with no one message (HB_K_CLOSE doesn't catch)
I explicitely told you, that is my personal modification !.
I build Harbour from source and work with a bit to my *personal* needs adapted GTs.
This way is also open to you, i named the line in file ...
best regards
Rolf
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
In GTWVG, close is converted to K_ESC, then need test ESC only.
2014-03-19 21:27 UTC-0800 Pritpal Bedi
...
* contrib\gtwvg\gtwgud.c
* contrib\gtwvg\gtwvgd.c
% Changed: WM_CLOSE firing K_ESC => HB_K_CLOSE in accordance rest of GTs.
----
How does your GTWVG behave -- any influence on the Windows shutdown process, if application is opened ?
regards
Rolf
So perhaps some other make additional tests:
choose any GTWVT app, start it, reboot Windows - and please confirm or neglect.
--
i can *not* replicate your other reported behaviors for my both XPs, as e.g.
the app keeps not running ..
*Only* that the app is regularly ending with first shutdown attempt, but this
also stops the shutdown process. So i have to 'double' initiate shutdown.
This behavior is very explainable to me.
I am not only able to 'correct' that in Harbour source, but use it for my logic.
---
Lets look 'under the hood:
# origin:
. case WM_QUERYENDSESSION: /* Windows send this event for shutdown */
. hb_vmRequestQuit(); /* this 'kills' all Harbour threads */
. return 0; /* this value (FALSE) Windows gets as answer */
where FALSE means don't progress ..
# elch personal version:
. case WM_QUERYENDSESSION: /* Closing down computer */
. if( pWVT->CloseMode == 0 || pWVT->CloseMode == 2 )
. {
. hb_vmRequestQuit();
. return 1; /* agree to shutdown request */
. }
. else
. {
. hb_gt_wvt_AddCharToInputQueue( pWVT, HB_K_CLOSE );
. return 0; /* shutdown request rejected */
. }
-----
GTWVG acts in the same manner, you can try for fun:
remove / outcomment that line (as not forcible needed)
* REQUEST HB_GT_WVT_DEFAULT
then compile your example:
hbmk2 bet.prg -gtwvg gtwvg.hbc
? same 'mystic' shutdown behavior, right ?
[ GTWVG still does not know this newer HB_GTI_CLOSEMODE, only the old
HB_GTI_CLOSABLE -- ! NOT the topic of this thread, leave the example as is ! ]
BTW, in opposite to XP 32bit [NT 5], XP64 is morely based on Win 2003 Server [ NT 5.2] -- my test environment ..
best regards
Rolf
GTWVG acts in the same manner, you can try for fun:
additional remark:
it was not an advice to use GTWVG.
Because this GT is in multiple options different to GTWVT and all others -- and lacks of some unsolved problems ..
|------
| hej, pssssst: you easy can compile Harbour from source, described in README.md ..
Ok, to compile an executable is a 'mystic' process for a common user: how the hell this machine is working ..
It should be a butterbrot at breakfest for a 'developer' !
-- and i never again like to miss this advantage: source source source source ! down to the physical ground
What a transister is and do, another topic -- have a look for Zuse, who did it 'machanical':
http://en.wikipedia.org/wiki/File:Zuse_Z1-2.jpg
( from: http://en.wikipedia.org/wiki/Konrad_Zuse )
best regards
Rolf
excuse!, two typos after my tripled proofread ( better before commit to outer world .. )
'transistor' and 'mechanical'
GTWVG acts in the same manner, you can try for fun:
additional remark:
it was not an advice to use GTWVG.
Because this GT is in multiple options different to GTWVT and all others -- and lacks of some unsolved problems ..
was extreme sloppy explained.
minimize window after maximize ( we longer ago talked about, you won't fix )
*restore* the window size as before, after maximize.
It is possible, i hacked it me myself into -- and if i get it work, it should be a bagatelle for you.
HB_GTI_CLOSEMODE missing
( BTW, there is an overlapping area of GTWVG HB_GTI_* settings against hb_gtinfo.ch )
if mean hbgtwvg.ch versus hbgtinfo.ch and #defines >= 71
hb_gfx* functions
long ago -- if i right remember we need to set: Wvt_SetGui( .T. )
but they only appear if using another window as cleaning rag.
Maybe an idea to set this automatic with first hb_gfx* call.
HB_GTI_SETPOS_XY
i see there a hack in my soure: ? " "
to let the window appear before setting. Don't know if this still applies.
This is hb_out.log with crash info:
Application Internal Error - D:\HB_TEST\gtwvt_close_test.exeTerminated at: 2014-09-19 17:03:15Unrecoverable error 6005: Exception error:
Exception Code:C0000005Exception Address:00000000
the 3 lines indicate, that Harbour was living,
before it very ugly stumbled headfirst into the 'holy hole of nothing':
Error 6005 -- exception sigsegv, adress 0
That is NOT an empty array where you try to get a non existing element.
What can cause such an error is very known, but IMHO not the topic.
Because the scary part is, HOW we get there.
During shutdown, the running application get informed about that:
my bespoken WM_ENDQUERYSESSION signal, which causes Harbour to stop execute.
If the taskmanager kills Harbour, it won't execute anything further -- you will NOT get these 3 lines.
Since nor me either others can replicate the behavior,
that the app keeps running during shutdown process,
it must be something special at your 'environment' in farest sense.
I would suggest to switch back to GTWVT
-- and pass to other for ideas, as i have at moment none ......
best regards
Rolf
result:
: regularly errorless lightning fast closing app --- shutdown stopped !
GTWVG:
work with most tries like gtwvt ONLY on XP32, but sometimes? also here:
CRASHES with shutdown (every) attempt on W2K & XP64
( this M$ E.T. want to send report home :-) )
* shutdown stopped *
---
in ANY case the second initiated shutdown will work,
as nothing more running ...
---
no virus found in executables
elch
I recommend you to use GTWVT for now (I use it and have no problems at all) and to report this problem to Pritpal because he is the main maintainer of GTWVG.The main difference of WVT and WVG is that the second uses a lot of Windows API (or Windows driven functions) and I believe the crash you are getting is because of that...