WindowMessages

I’m trying to process arbitrary messages posted to a SDL app.

So far I’ve created a function to filter events:

int FilterEvents(const SDL_Event event) {
printf("%d\n",(const char
)event);
return (1);
}

And enabled the event state and set the filter

SDL_EventState(SDL_SYSWMEVENT,SDL_ENABLE);
SDL_SetEventFilter(FilterEvents);

The messages I send with the standard SendMessage function get captured in
the app (and printed to the console from above), however I cannot seem to be
able to retrieve the msg and params. Am I going about this the right way?
What should I be getting from even for these values?

Cheers
Neil Cross

-------------- next part --------------
A non-text attachment was scrubbed…
Name: winmail.dat
Type: application/ms-tnef
Size: 1634 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060314/88c7d888/attachment.bin

Hello Neil,

Tuesday, March 14, 2006, 2:41:46 AM, you wrote:

NC> I’m trying to process arbitrary messages posted to a SDL app.

NC> So far I’ve created a function to filter events:

NC> int FilterEvents(const SDL_Event event) {
NC> printf("%d\n",(const char
)event);
NC> return (1);
NC> }

NC> And enabled the event state and set the filter

NC> SDL_EventState(SDL_SYSWMEVENT,SDL_ENABLE);
NC> SDL_SetEventFilter(FilterEvents);

NC> The messages I send with the standard SendMessage function get captured in
NC> the app (and printed to the console from above), however I cannot seem to be
NC> able to retrieve the msg and params. Am I going about this the right way?
NC> What should I be getting from even for these values?

That SDL_Event * will really be a SDL_SysWMEvent *

This has a SDL_SysWMmsg * field which on Win32 will point to a struct
containing the HWND, the message as UINT, WPARAM and LPARAM. You’ll
need to include SDL_syswm.h to get it.

So you want something like:

int FilterEvents(const SDL_Event *event)
{
if (event.type == SDL_SYSWMEVENT)
{
SDL_SysWMmsg *wmmsg;
wmmsg = event.syswm.msg;

   // Do what you like with the fields of wmmsg here
}

}–
Best regards,
Peter mailto:@Peter_Mulholland

int FilterEvents(const SDL_Event *event)
{
if (event.type == SDL_SYSWMEVENT)
{
SDL_SysWMmsg *wmmsg;
wmmsg = event.syswm.msg;

   // Do what you like with the fields of wmmsg here
}

}

Any chance of a new API like this:

int FilterEvents(void *client_data, const SDL_Event *event)
{

}

void *mydata;
SDL_SetEventFilterEx(FilterEvents, mydata);

??On Tue, 2006-03-14 at 03:38 +0000, Peter Mulholland wrote:


John Skaller
Async PL, Realtime software consultants
Checkout Felix: http://felix.sourceforge.net