Win Squeak needs to know about waking up! (Re: Laptop suspending and network drives)
Ned Konz
ned at bike-nomad.com
Wed Sep 11 15:51:02 UTC 2002
On Wednesday 11 September 2002 07:50 am, Andreas Raab wrote:
> Ned,
>
> > Sounds like we're missing some notification from WinNT/WinCE...
>
> To me, it sounds as if MS should get its act together. If it
> doesn't send a notification to the window that's been woken up
> after a sleep to redraw itself, what do you expect Squeak to do?!
> If it isn't capable of getting the network connections back up what
> do you expect Squeak to do?! Test on each every access if the
> connection is still there and if not try to restart Windows?! (hey,
> now that's an idea ;-)))
>
> Cheers,
> - Andreas
What about the WM_POWERBROADCAST message (at least for non-WinCE
apps)?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/power/base/wm_powerbroadcast.asp
From its docs:
LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // WM_POWERBROADCAST
WPARAM wParam, // power-management event
LPARAM lParam // function-specific data
);
Parameters
hwnd
Handle to window.
uMsg
WM_POWERBROADCAST message identifier.
wParam
Power-management event. This parameter can be one of the following
events.
Event
Meaning
PBT_APMBATTERYLOW
Battery power is low.
PBT_APMOEMEVENT
OEM-defined event occurred.
PBT_APMPOWERSTATUSCHANGE
Power status has changed.
PBT_APMQUERYSUSPEND
Request for permission to suspend.
PBT_APMQUERYSUSPENDFAILED
Suspension request denied.
PBT_APMRESUMEAUTOMATIC
Operation resuming automatically after event.
PBT_APMRESUMECRITICAL
Operation resuming after critical suspension.
PBT_APMRESUMESUSPEND
Operation resuming after suspension.
PBT_APMSUSPEND
System is suspending operation.
lParam
Function-specific data. For most events, this parameter is reserved
and not used.
However, if wParam is one of the resume events (PBT_APMRESUME*), the
lParam parameter can specify the PBTF_APMRESUMEFROMFAILURE flag. This
flag indicates that a suspend operation failed after the
PBT_APMSUSPEND event was broadcast.
Return Values
Return TRUE to grant a request.
Return BROADCAST_QUERY_DENY to deny a request.
Requirements
Windows NT/2000/XP: Included in Windows NT 4.0 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Winuser.h; include Windows.h.
--
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE
More information about the Squeak-dev
mailing list
|