From: Erik B. <eb...@us...> - 2007-03-23 01:09:40
|
Update of /cvsroot/gexperts/gexperts/unstable/Src In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv4545 Modified Files: GX_EditorFormServices.pas Log Message: Add HCBT_ACTIVATE comment for later consideration Index: GX_EditorFormServices.pas =================================================================== RCS file: /cvsroot/gexperts/gexperts/unstable/Src/GX_EditorFormServices.pas,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- GX_EditorFormServices.pas 28 Apr 2005 18:34:06 -0000 1.23 +++ GX_EditorFormServices.pas 23 Mar 2007 00:43:09 -0000 1.24 @@ -224,7 +224,7 @@ try case nCode of - HCBT_SETFOCUS: + HCBT_SETFOCUS: // A control with a window handle was focused if wParam > 0 then // wParam is 0 if an Exception happens in HCBT_Setfocus begin ApiResult := GetClassName(wParam, ClassNameBuffer, SizeOf(ClassNameBuffer)); @@ -240,6 +240,24 @@ PrivateGxEditorFormServices.BeforeSetFocusEditorForm(wParam); end; end; + (* This may be useful later to replace the Screen.OnActiveFormChanged hook + HCBT_ACTIVATE: // A top-level window was focused + if wParam > 0 then // wParam is 0 if an Exception happens in HCBT_ACTIVATE? + begin + ApiResult := GetClassName(wParam, ClassNameBuffer, SizeOf(ClassNameBuffer)); + Win32Check(ApiResult <> 0); + Assert(ApiResult < ClassNameBufferSize, 'Found class name larger than fixed buffer size'); + + {$IFOPT D+} SendDebug('Window hook found: ' + StrPas(ClassNameBuffer)); {$ENDIF} + ComparisonResult := StrLIComp(ClassNameBuffer, 'TDefaultEnvironmentDialog', ClassNameBufferSize); + if ComparisonResult = 0 then + begin + {$IFOPT D+} SendDebug('SetFocus hook found a form to resize'); {$ENDIF} + Assert(Assigned(PrivateGxEditorFormServices)); + //PrivateGxEditorFormServices.BeforeSetFocusEditorForm(wParam); + end; + end; + *) else // Nothing. end; |