[DUG] Component creation

John Bird johnkbird at paradise.net.nz
Wed Sep 6 13:43:38 NZST 2006


This raises a related question.....

Where does one get such information on Windows Messages?  So far seems
mainly ask someone who knows, or Google.
Fortunately I 've only done a little message handling so far, I would feel
in the dark if I had to...

Any good reference material?

John

-----Original Message-----
From: delphi-bounces at ns3.123.co.nz [mailto:delphi-bounces at ns3.123.co.nz] On
Behalf Of Robert martin
Sent: Wednesday, 6 September 2006 1:24 p.m.
To: karlreynolds at xtra.co.nz; NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Component creation


Hi

I didn't know about WM_CAPTURECHANGED but it read as similar.  I used 
CancelMode simply because that was what was in my example controls.

I just did a quick test and it doesn't seem to trigger on the same 
events (It seemed to only trigger when clicking on my control).  Not 
really thoroughly tested though.  I will stick wilt CancelMode as I have 
it working well :)


Rob Martin
Software Engineer

phone +64 03 377 0495
fax   +64 03 377 0496
web www.chreos.com

Wild Software Ltd



Karl @ Work wrote:
> You learn something every day.  Guess my hooking code was OTT.
>
> I notice that although some effort has obviously been made to 
> implement CM_CANCELMODE, its effects look very similar to those of 
> WM_CAPTURECHANGED (Rob, mightn't that work for you as well?).  Can 
> anyone enlighten me as to the difference?
>
> Cheers,
> Carl
>
>   
>> -----Original Message-----
>> From: delphi-bounces at ns3.123.co.nz 
>> [mailto:delphi-bounces at ns3.123.co.nz]On Behalf Of Robert martin
>> Sent: Tuesday, September 05, 2006 7:42 PM
>> To: NZ Borland Developers Group - Delphi List
>> Subject: Re: [DUG] Component creation
>>
>>
>> Hi all
>>
>> I have this beaten now  !!!!
>>
>> The required message is CM_CANCELMODE ....
>>
>> procedure   CMCancelMode(var Message: TCMCancelMode); message
>> CM_CANCELMODE;
>>
>>
>> I found this using my expert skills (or looking at some third party 
>> components we use and putting breakpoints in)  ;-)
>>
>> I had tried this earlier but my component actually creates a child 
>> component when expanded and I needed to better provide communication 
>> between them.  I am not an expert component creator (far from it) but 
>> what I have is both components checking for this event and using the 
>> ScreenToClient code provided by Todd to ensure the mouse isn't within 
>> either component. If not it closes the 'component'.
>>
>> CM_CANCELMODE and its friend WM_CANCELMODE are really strangely 
>> described my MS and others as 'providing special functionality in 
>> certain circumstances' or some such.  But essentially it seems to be 
>> when a non focusable control or window is selected.
>>
>> Will test further but it seems this has hit the nail on the head.  A 
>> big thanks to all who have contributed.
>>
>>
>>
>> Rob Martin
>> Software Engineer
>>
>> phone +64 03 377 0495
>> fax   +64 03 377 0496
>> web www.chreos.com
>>
>> Wild Software Ltd
>>     
>
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz http://ns3.123.co.nz/mailman/listinfo/delphi
>
>   
_______________________________________________
Delphi mailing list
Delphi at ns3.123.co.nz http://ns3.123.co.nz/mailman/listinfo/delphi


__________ NOD32 1.1461 (20060329) Information __________

This message was checked by NOD32 antivirus system. http://www.eset.com




More information about the Delphi mailing list