
Originally Posted by
RPM_VR4
Um, unless you already had it in the source code for "skinbedder4", your gonna have to teach me how to detect a resume

. I have no clue. Also, I previously added a shutdown script but it never worked. I put it in the OnFormClose handler but I guess it won't let me ShellEx while I am already shutting down. Do you know how to fix that? Also, is it possible to run a script just before entering hibernate (might be usful someday)?
Well, I was able to pause recognition before hibernation in NaviVoice, so MAYBE we'll be able to run a script on coming into hibernation. But we should be able to run it when coming out for sure.
Code:
//--- WMPowerBroadcast -------------------------------------------------------\\
procedure TfrmCommandAndControl.WMPowerBroadcast(var message: TMessage);
var
I : Integer;
begin
case message.WParam of
$0004 : begin
log('PBT_APMSUSPEND'); //PBT_APMSUSPEND
spsharedrecocontext.State := SRSInactive;
end;
$0005 : log('PBT_APMSTANDBY'); //PBT_APMSTANDBY
$0006 : log('PBT_APMRESUMECRITICAL'); //PBT_APMRESUMECRITICAL
$0007 : begin
log('PBT_APMRESUMESUSPEND'); //PBT_APMRESUMESUSPEND
spsharedrecocontext.State := SRSActive;
if Title <> 'MapMonkey' then
if EXE_Running(
LoadString('programs', 'program_name400', 'NaviVoice.ini'),
True) then begin
log('navigation was running');
bringformtofront(FindWindow(PChar('#32770'), nil));
SendKeysToTitle(Title,SK_ENTER);
BringFormToFront(GetHandleFromWindowTitle(Title));
SendKeysToTitle(Title,SK_Alt_DN + 'T' + SK_ALT_UP);
SendKeysToTitle(Title,'G');
SendKeysToTitle(Title,SK_RIGHT);
SendKeysToTitle(Title,SK_DOWN);
SendKeysToTitle(Title,SK_RIGHT);
for i := 1 to (LoadInteger('settings','commport',
'NaviVoice.ini') - 1) do
SendKeysToTitle(Title,SK_DOWN);
SendKeysToTitle(Title,SK_ENTER);
end
end;
$0008 : log('PBT_APMRESUMESTANDBY'); //PBT_APMRESUMESTANDBY
end;
end;
//--- WMPowerBroadcast -------------------------------------------------------//
Add procedure WMPowerBroadcast(var message: TMessage); to private.
That code is from NaviVoice.
Bookmarks