Has anyone found a straight forward solution for this issue?
The only approach that seems likely to work is to write a system service to
notify PB applications.
pbm_thisusuallydoesnothelp:-))
Philip Salgannik
"Tyler Cruse" <tcr...@trlx.com> wrote in message
news:4180f4bf$1@forums-1-dub...
>I would like to get the Wm_POWERBROADCAST messages and respond to them,
I have not tried PeekMessage yet, but I would suspect that the message is
being processed up by PBVM already.
"Philip Salgannik" <philema...@comcast.net> wrote in message
news:4180f7c9@forums-1-dub...
From here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/power/base/wm_powerbroadcast.asp
The WM_POWERBROADCAST message is broadcast to an application
to notify it of power-management events.
A window receives this message through its
W-i-n-d-o-w-P-r-o-c function.
--So unless Sybase is specifically doing something with this
message, then you WILL see it in the OTHER event of the
window.
> 2) I would not know how to identify the message since the
> WPARM vaulues are very generic 0-15.
You will identify it by number, like so:
In the OTHER event of the window:
IF message.number = WM_POWERBROADCAST THEN
IF wparam = PBT_APMQUERYSUSPEND THEN
//don't think so
message.processed = TRUE
RETURN BROADCAST_QUERY_DENY
END IF
END IF
Now, how would go about recognizing these messages; The "other" (event id =
pbm_other) has two parameters wparm and lparm. These match the parameters
passed in the Windows standard structure. Now, what the other event does
not do is identify the message type. In this case the wparm values range
from 0 to 16. So, even if you got the event, how would you recognize the
event as being one that you are interested in.
In the case of the say WM_USER messages, PB maps each WM_USER message to a
separate event, so that you know that WM_USER+1 message with wparm = 1 is
not mistaken for WM_USER+2 message with wparm = 1.
So, what am I missing?
<Philip Salgannik> wrote in message
news:41814d4c.61e...@sybase.com...
--
This is a FAQ, read Help, then search
www.groups.google.com/advanced_group_search
pbm_thisusuallydoesnothelp:-))
Philip Salgannik
"Tyler Cruse" <tcr...@trlx.com> wrote in message
news:4181a229$1@forums-1-dub...
> GetMessage and PeekMessage retrieve only messages that match the range
> selected. So, it is not given that the Sybase runtime would see the
> message. But for the sake of discussion lets assume that PBVM processes
> all messages below 0x400. These messages would be processed in the windows
> message loop for the application and any not handled passed to the other
> event.
>
> Now, how would go about recognizing these messages; The "other" (event id
> = pbm_other) has two parameters wparm and lparm. These match the
> parameters passed in the Windows standard structure. Now, what the other
> event does not do is identify the message type. In this case the wparm
> values range from 0 to 16. So, even if you got the event, how would you
> recognize the event as being one that you are interested in.
>
> In the case of the say WM_USER messages, PB maps each WM_USER message to a
> separate event, so that you know that WM_USER+1 message with wparm = 1 is
> not mistaken for WM_USER+2 message with wparm = 1.
>
> So, what am I missing?
message.number ?
"Philip Salgannik" <philema...@comcast.net> wrote in message
news:4181c183$1@forums-1-dub...