PDA

View Full Version : Long time till iMon awake after sleep (hibernate) mode.


ShIvADeSt
07-21-2009, 10:41 AM
When i send my computer in sleep mode (hibernation mode) and awake it from it i have next trouble. iMon wait for a while till begins to receive remote commands (icon look like iMon inactive). Usually it 1 or 3 minutes (mb more or less). But if I after awakin computer move mouse iMon starts to work immediatly (icon immediatly looks like normal iMon). Can u decrease time of reaction iMon after hibernate mode?

slash.kim
07-29-2009, 12:43 AM
Dear ShIvADeSt,

Windows sends resume_from_suspend message to all applications running right after it is awaken from S3 or S4. And iMON is ready to receive this message and if there's this message is arrived, it open the iMON device driver and change the indicator color from yellow to blue.

However, long time before some users reported iMON Manager did not be activated after S3/S4. There maybe some environment where the resume_from_suspend message is not arrived to iMON Manager. And so we added some code for safety using Windows timer. And this timer works if there's no resume_from_suspend message arrived.

It's system or environment specific problem.
Could you let me know the system specification(CPU, motherboard, RAM, VGA, PSU, OS) of yours?
And could you check the problem after exiting all other applications including apps in system tray. The resume_from_suspend message can be eaten by application.

Thanks and best regards,
slash.kim

RomanticBoy83
07-29-2009, 08:55 PM
I had have the same problem with my AVM WLAN-Stick.

My Problem solved this artikel of Microsoft (http://support.microsoft.com/?scid=kb%3Ben-us%3B928631&x=10&y=13)

I only changed a option in the registry.

slash.kim
07-30-2009, 02:37 AM
I had have the same problem with my AVM WLAN-Stick.

My Problem solved this artikel of Microsoft (http://support.microsoft.com/?scid=kb%3Ben-us%3B928631&x=10&y=13)

I only changed a option in the registry.
Dear RomanticBoy83,
Thank you for helpful information.

Dear ShIvADeSt,
If you could solve the problem with the article linked, please let us know it. If it can solve the problem with your system, we need to add this to FAQ.


Thanks and best regards,
slash.kim

ShIvADeSt
07-30-2009, 07:31 AM
Dear ShIvADeSt,

Windows sends resume_from_suspend message to all applications running right after it is awaken from S3 or S4. And iMON is ready to receive this message and if there's this message is arrived, it open the iMON device driver and change the indicator color from yellow to blue.
Thanks and best regards,
slash.kim
I have Windows XP SP3 and fix for Vista cannot help me. But i wrote small application in delphi with only code

procedure TForm1.WndProc(var Msg: TMessage);
begin
CASE Msg.Msg OF
WM_POWERBROADCAST: if Msg.WParam = PBT_APMRESUMEAUTOMATIC then ShowMessage('OK');
end;
inherited;
end;

just to test that resume message not hooked and can arrive to all application. After resume my application immediatly show message with text "OK" but iMon continued stay inactive till i move mouse or till ellapse some minutes. Can U give me code (which messages u hook) that i can test its behavior on my system? It apllied only to resume not other code. If u hook not PBT_APMRESUMEAUTOMATIC but PBT_APMRESUMESUSPEND - U failed coz this message was arrived only after user input triggered.

ShIvADeSt
07-30-2009, 11:20 AM
I make a little utilite that help iMON awake from hibernate immediatly. Here code

program SGResume;
{$I messages.inc}
{$I windows.inc}

const
HWND_BROADCAST = $FFFF;
PBT_APMRESUMEAUTOMATIC = $12;
PBT_APMRESUMESUSPEND = $7;
WM_POWERBROADCAST = 536;


function MainWndProc(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
begin
case Msg of
WM_POWERBROADCAST:
begin
if (WParam = PBT_APMRESUMEAUTOMATIC) then begin
Sleep(1000);
SendMessage(HWND_BROADCAST,WM_POWERBROADCAST,PBT_A PMRESUMESUSPEND,lParam);
end;
end;
end;
Result := DefWindowProc(hwnd,msg,wParam,lParam);
end;

var
wc:TWndClass;
msg:TMsg;
begin
wc.hIcon := LoadIcon(hInstance,PChar(17));
wc.hCursor := LoadCursor(0,IDC_ARROW);
wc.style := 0;
wc.cbClsExtra:=0;
wc.cbWndExtra:=0;
wc.lpfnWndProc := @MainWndProc;
wc.hInstance := hInstance;
wc.hbrBackground := HBRUSH(COLOR_WINDOW+1);
wc.lpszMenuName:=nil;
wc.lpszClassName := 'iMON Resumer';
RegisterClass(wc);
CreateWindowEx(0,wc.lpszClassName,'iMON Resumer',
0,
0,0,0,0, 0, 0,
hInstance, nil);
while GetMessage(msg,0,0,0) do
begin
TranslateMessage(msg);
DispatchMessage(msg);
end;
ExitProcess(msg.WParam);
end.

as U see when i catch message that time to awake - i translate new message with new wParam - awake by user input. This message catched by iMON and driver start up.
Also i included attachment with compiled utilite. It wrote by full API and have small size on disk and in memory. It stay resident and after resume helps iMon awake.

majstang
07-30-2009, 02:10 PM
Nice fix Shivadest!
But really...this sounds like an another standby/hibernation bug (more in the line of the first remotepress fails after resuming from standby/hibernation bug). Soundgraph, are you sure this can't be reproduced on your testbench? If it could it sure must be better to put this issue up as a bug, rather than pushing this quickfix from Shivadest? No offense against you Shivadest, your fix is truly impressing :)

ShIvADeSt
08-03-2009, 11:08 AM
Hmmm, some days left, but no words about fix from developers. Maybe they didn't see it? Pls give me an answer - will it be fixed in next version or not?

slash.kim
08-06-2009, 05:26 PM
Dear ShIvADeSt,

A shame, but we have overlooked the simple and basic things. After seeing you posted, we checked our source code again. And we could only find that iMON waited for PBT_APMRESUMESUSPEND instead of PBT_APMRESUMEAUTOMATIC.

Thank you very much, ShIvADeSt. We'll this fix to our To Do List.

Thanks a lot,
slash.kim