Article View: comp.windows.ms.programmer
Article #2363Re: Windows Subclassing
From: Paul Bonneau
Date: Mon, 29 Apr 1991 19:09
Date: Mon, 29 Apr 1991 19:09
18 lines
1117 bytes
1117 bytes
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. cheers - Paul Bonneau.
Technical Details
Message-ID:
<1991Apr29.190909.12436@hyper.hyper.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!hyper.hyper.com!bonneauReferences:
<2368@novavax.UUCP>Show Full Headers
Complete Article Headers
Newsgroups: comp.windows.ms.programmer Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!hyper.hyper.com!bonneau From: bonneau@hyper.hyper.com (Paul Bonneau) Subject: Re: Windows Subclassing Message-ID: <1991Apr29.190909.12436@hyper.hyper.com> Keywords: Subclassing edit Reply-To: bonneau@hyper.UUCP (Paul Bonneau,,) Organization: HyperCube Inc. References: <2368@novavax.UUCP> Date: Mon, 29 Apr 1991 19:09:09 GMT