🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #2370

Re: Windows Subclassing

#2370
From: CADSI
Date: Tue, 30 Apr 1991 15:14
27 lines
1714 bytes
From article <1991Apr29.190909.12436@hyper.hyper.com>, by bonneau@hyper.hyper.com (Paul Bonneau):
> In article <2368@novavax.UUCP> raab@novavax.UUCP (Moshe Raab) writes:
>>
>>          case NUMERIC:
>>// use numeric control
>>          lpfnOldEdit = (FARPROC)GetWindowLong(hDlg,GWL_WNDPROC);
>>          SetWindowLong(hDlg, GWL_WNDPROC,(LONG) lpfnNumericProc);
>>          break;
>>          default:
>>          break;
>>        }
> The problem is that you are subclassing the dialog itself!  Replace
> the above GetWindowLong() and SetWindowLong() window handles with
> GetDlgItem(hDlg, id).  Also, no need to subclass and unsubclass on
> focus changes.  Do it once when the dialog gets WM_INITDIALOG, and
> remove subclass (and don't forget to FreeProcInstance()!) on
> WM_DESTROY.
> 

You both realize, of course, Reference 1 of the Windows SDK says, explicitly,
that you should NOT subclass Window's edit control windows.

|----------------------------------------------------------------------------|
|Tom Hite					|  The views expressed by me |
|Manager, Product development			|  are mine, not necessarily |
|CADSI (Computer Aided Design Software Inc.	|  the views of CADSI.       |
|----------------------------------------------------------------------------|
Technical Details
Message-ID: <1991Apr30.151433.12036@ccad.uiowa.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!ns-mx!ccad.uiowa.edu!cadsi
References: <1991Apr29.190909.12436@hyper.hyper.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!ns-mx!ccad.uiowa.edu!cadsi
From: cadsi@ccad.uiowa.edu (CADSI)
Newsgroups: comp.windows.ms.programmer
Subject: Re: Windows Subclassing
Message-ID: <1991Apr30.151433.12036@ccad.uiowa.edu>
Date: 30 Apr 91 15:14:33 GMT
References: <1991Apr29.190909.12436@hyper.hyper.com>
Organization: CAD-Research, U. of Iowa, Iowa City, Iowa
Lines: 27