Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Doing an OnClick after releasing?!??

Status
Not open for further replies.

cyprus106

Programmer
Apr 30, 2001
654
I've got a TPanel that is moveable thanks to this source code in the OnMouseDown function:

/* release current mouse capture */
ReleaseCapture();

/* fake a caption hit */
SNDMSG(ColorPanel->Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0);

This WOULD be great except for the ReleaseCapture() call at the top. I've got source code in the OnMouseUp function that absolutely has to be in the OnMouseUp and it absolutely has to fire off. ReleaseCapture(), of course, releases the mouse click. So OnMouseUp doesn't fire off.

I could put it right at the end of OnMouseDown except for the fact that then it would fire off after every single OnMouseDown, not juat after the mouse click was released. I can't figure it out and I'm getting desperate here. Can anybody help??

Appreciated,

Cyprus
 
Well.....how about making a thread which checks a flag/condition and if that flag is active the thread fires the event/does whats needed and zerorises the flag?

Totte
 
Instead of release capture you could use a
conditional to check the status or event and
then do something or not depending on the
results of the conditional. that way you have
all events going off but not necessarily resulting
in any action and you will still have the on mouse
up every time.

tomcruz.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top