Article View: comp.windows.ms.programmer
Article #922Re: Return key in combo boxes.
From: Ken SYKES
Date: Wed, 19 Dec 1990 00:01
Date: Wed, 19 Dec 1990 00:01
31 lines
1886 bytes
1886 bytes
In article <28660006@hpopd.HP.COM> richardh@hpopd.HP.COM (Richard Hancock) writes:
>/ hpopd:comp.windows.ms.programmer / eric@eecg.toronto.edu (Eric Smith) / 7:43 pm Dec 6, 1990 /
>
>> Moreover, the Guide to Programming explicitly warns
>> against subclassing predefined window classes (i.e. combo boxes),
>> so messages can't be intercepted there either.
>
>I've been subclassing edit controls for years (with no ill effects).
>
>Richard.
There's a difference between subclassing a window CLASS and a window CONTROL.
It is okay to subclass a window CONTROL because it is only one instance and
the control usually belongs to you. Subclassing a predefined window CLASS
changes the behavior of ALL controls created after the class has been
subclassed. This has several implications such as:
- What about the controls that already existed? Do I go and set all
of their window procedures or leave them alone?
- Am I going to stick around until all of the controls have been
destroyed or will I run through again and point to the old Window
procedures?
- And probably most important, do I have the right to change the
behavior of ALL the apps running in the system? Most of the time
the answer is no.
It is for this reason and possibly others that predefined CLASSES shouldn't
be subclassed.
Ken Sykes
Disclaimer: The above opinions are solely my own.
Technical Details
Message-ID:
<59926@microsoft.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!microsoft!kensyReferences:
<1990Dec6.144321.12168@jarvis.csri.toronto.edu> <28660006@hpopd.HP.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!microsoft!kensy From: kensy@microsoft.UUCP (Ken SYKES) Newsgroups: comp.windows.ms.programmer Subject: Re: Return key in combo boxes. Message-ID: <59926@microsoft.UUCP> Date: 19 Dec 90 00:01:32 GMT References: <1990Dec6.144321.12168@jarvis.csri.toronto.edu> <28660006@hpopd.HP.COM> Reply-To: kensy@microsoft.UUCP (Ken SYKES) Organization: Microsoft Corp., Redmond WA Lines: 31