views:

18

answers:

1

Hi,

I've got two windows in the same process. Window 1 contains some text. Window 2 contains a bitmap of the contents of window 1.

Whenever I click (WM_LBUTTONDOWN ) or move (WM_MOUSEMOVE) the cursor in window 2, i pass the message into window 1 by posting the message to window 1's message queue.

I now want to emulate more complex interaction. I'd like to do a "mouse select", where the WM_LBUTTONDOWN goes down and several WM_MOUSEMOVE occur. This should select some text in window #1. (it works fine if I perform this action directly in window 1)

I haven't been able to get this working by just posting the messages. It seems that mouse capture needs to be held by window 1, but my clicks and moves are happening in window 2.

Any pointers on an implementation using only WIN32 API?

Thanks,

Chris

A: 

Why are you trying to do this using window messages? Can't you just have a common function that updates the selection in window 1, so that both window 1 and window 2 can just call this function to get the work done?

casablanca