お知らせ

電子会議

ライブラリ

パレット

Delphi FAQ検索

Delphi FAQ一覧

サンプル蔵





FDelphi FAQ
16番会議室「玉石混淆みんなで作るSample蔵」に寄せられたサンプル

"RE:読み仮名取得コンポーネント"

この発言は
#01246 かつぼー さんの読み仮名取得コンポーネント
に対するコメントです

この発言に対し以下のコメントが寄せられています
#01248 かつぼー さん RE^2:読み仮名取得コンポーネント

アップした後、Delphiを終わらせるときにエラーがでて 不具合に気が付きました。下のように訂正します。 ほかに危ないところがあったら教えてください。 procedure TYomi.Notification(AComponent: TComponent; Operation: TOperation); begin inherited Notification(AComponent, Operation); if not (csDesigning in ComponentState) and //追加 (Operation = opRemove) and (AComponent <> nil) and (AComponent = FControl) then begin // SetWindowLong(FControl.Handle, GWL_WNDPROC, Longint(FOldWinProc)); FreeObjectInstance(FOldWinProc); FreeObjectInstance(FProcInstance); FOldWinProc := nil; FProcInstance := nil; FControl := nil; end; end; procedure TYomi.SetControl(AControl: TWinControl); begin if not (csDesigning in ComponentState) then //追加&ちょっと変更 begin if (FControl <> nil) and (FOldWinProc <> nil) then SetWindowLong(FControl.Handle, GWL_WNDPROC, Longint(FOldWinProc)); if AControl <> nil Then begin FProcInstance := MakeObjectInstance(WndProc); FOldWinProc := Pointer(GetWindowLong(AControl.Handle, GWL_WNDPROC)); SetWindowLong(AControl.Handle, GWL_WNDPROC, Longint(FProcInstance)); end else begin FreeObjectInstance(FProcInstance); FOldWinProc := nil; FProcInstance := nil; end; end; FControl := AControl; end;    かつぼー  Original document by かつぼー 氏 ID:(CQU00157)



ここにあるドキュメントは NIFTY SERVEの Delphi Users' Forum の16番会議室「玉石混淆みんなで作るSample蔵」に投稿されたサンプルです。これらのサンプルはボーランド株式会社がサポートする公式のものではありません。また、必ずしも動作が検証されているものではありません。これらのサンプルを使用したことに起因するいかなる損害も投稿者、およびフォーラムスタッフはその責めを負いません。使用者のリスクの範疇でご使用下さい。

Copyright 1996-2002 Delphi Users' Forum