Link to home
Start Free TrialLog in
Avatar of LucHoltkamp
LucHoltkamp

asked on

TStatic needs MouseEvents

Hi guys,

I have a little problem using OWL 5.0
I use a recource with an static-frame. In this static-frame I draw a picture. In the code I use a TDialog for the dialog and a TStatic for the static-frame. This works OK.

I want the static to have MouseInput, But it just can't get the TStatic to respond to MouseEvents. I guess the problem is that the static doesn't get input-focus.

In fact I want to create a child-window in a dialog from recource-data (with etched border), so that I can use TClientDC etc for the drawing. The user must be able to  click on the drawing (for selection). TStatic does the
job, except for the MouseInput

So my question is: How to get TStatic to accept MouseEvents?

.Luc.
ASKER CERTIFIED SOLUTION
Avatar of md041797
md041797

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LucHoltkamp
LucHoltkamp

ASKER

The 'parent-notify' was the missing link. I do not understand the logic of it though. It's a frame-flag and according to the help it means that the frame sends it parent (The TStatic?) messages (STN_CLICKED, etc..) when it is clicked. It says nothing about enabling mouseevents.
Could you tell me more about it??
It forces the static control to send STN_ENABLE to the dialog box.
What is the connection between STN_ENABLE messages and mouse-events? STN_ENABLE isn't even used by OWL (as far as I know) so I assume it's Windows Internal. Also: the STN_ENABLE is send to the dialog. How can the dialog affect the TStatic to accept mouse-events. Whats the mechanism behind all this? Can you enlighten me? Thanks,
.Luc.
I got it backwards.
The dialog box sends STN_ENABLE to the static control on initialization. If the static control has the SS_NOTIFY sytle set, it will start accepting mouse and keyboard input after recieving this message.  This is similar to the regular WM_ENABLE message, but its new to Win95 and specific to a static control.


Thanks, its more clear to me now.
.Luc.