VOGONS


WindowMessages

Topic actions

First post, by NeilC

User metadata
Rank Newbie
Rank
Newbie

This is kinda a sdl question, but i figured i'd ask in here too since i'm using dosbox.

Is there a way i can send standard windows messages to sdl and have them caught and return the msg number, wparam, and lparam?

i've hooked up an event filter which is catching messages posted with SendMessage from c#, but i cannot seem to be able to get the details of the message back.

So far it's like this:

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

Reply 2 of 2, by NeilC

User metadata
Rank Newbie
Rank
Newbie

Golden.

If anyone else is after this kind of thing, here's a bit of a snippet of what i ended up doing:

	int FilterEvents(const SDL_Event *event) {
// we'll handle only SDL_SYSWMEVENT events
if (event->type == SDL_SYSWMEVENT)
{
SDL_SysWMmsg *wmmsg;
wmmsg = event->syswm.msg;
//printf("%d\n",(char*)wmmsg->msg);

switch (wmmsg->msg)
{
case WM_MOVE:
...
}
}
}