Tom Wilson or every friend help me

Hi every friend:

 I have a trouble that when I draw  SDL surface onto MFC Control ,I cant get message from the control such as 

WM_LBUTTONDOWN and WM_MOUSEMOVE , how can let the control receive it’s message after SDL surface mask on it.

 The way draw surface is take from Tom Wilson's SDLChildWindow demo .

 thank  Tom Wilson and thank every friends!
 

           Jack xuji

???@xuji_at_hz.cn
???2005-07-17

?? wrote:

Hi every friend:

 I have a trouble that when I draw  SDL surface onto MFC Control ,I cant get message from the control such as 

WM_LBUTTONDOWN and WM_MOUSEMOVE , how can let the control receive it’s message after SDL surface mask on it.

 The way draw surface is take from Tom Wilson's SDLChildWindow demo .

 thank  Tom Wilson and thank every friends!

You need to make your own WndProc that forwards these messages to the
button. As the SDL child window is On-top of the button and receives
the messages.

You need to somehow get the handle of the button. Lets call this hwndButton.

so, for example:

LRESLUT WINAPI ForwardingProc(HWND window, UINT msg, WPARAM wParam,
LRESULT lResult){

return ::SendMessage(hwndButton, msg, wParam, lParam);

}

And then the child window can be told about this function with the function:

SDL_ChildWindow::set_user_proc(LRESULT (*usr_proc)(HWND hwnd_from, UINT
message, WPARAM wParam, LPARAM lParam));

However, your forwarding proc cannot be a class member. This is a bad
limitation. I soon realised this method is extremely rubbish. So I have
some code that uses the current window and will not stop the messages
getting through to the window. It’s much simplified.

I will post this code on my web site later today and re-do the
description text on the SDL web site. I will probably remove the old
SDL_ChildWindow code.

(I have been meaning to do this for about 2 years! :slight_smile: )

I’ll let you know when it’s all packaged up.

  • Tom>
           Jack xuji

???xuji at hz.cn
???2005-07-17


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I hav posted the new code for this and an MFC demo

http://www.polplex.co.uk/~tigger/sdl/

I also added the item to the SDL web site. You used to be able to edit
your own entries, but I can’t do that any more so is there any way to
remove the old entry?

  • Tom