Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2006 Oct : TActionList, TFrom and Windows.DialogBoxParam

www.cryer.info
Managed Newsgroup Archive

TActionList, TFrom and Windows.DialogBoxParam

Subject:TActionList, TFrom and Windows.DialogBoxParam
Posted by:"tao lin" (lams_..@hotmail.com)
Date:Thu, 26 Oct 2006 11:37:23 +1300

Hi,

I decide start an new thread in here instead of language.delphi.win32
because I believe here is the better place.

Here is my problem.

I try to dock a TForm into true Windows dialog which created by
DialogBoxParam. Remy Lebeau and Peter Below kindly help me solve this
problem. But now I face another problem. My TForm is quite complicate, it
include TActionList, CoolBar, ToolBar, Data Controls.

The problem is that after my TForm 'dock' into the true windows Dialog, I
found the TActionList.Onupdate not working any more. It seems like the
windows Dialog block the Delphi's message such as CM_ACTIONUPDATE.

Any idea?

Cheers,

Tao


Here is my DialogFunc for DialogBoxParam:
================================================================================
function DialogFunc(hDlg: HWND; msg: UINT;  wParam: WPARAM; lParam: LPARAM):
BOOL; stdcall;
var
  currentForm: TForm;
begin
  case msg of
    WM_INITDIALOG:
      begin
        currentForm := TForm(lParam);
        currentForm.ParentWindow := hDlg;
        currentForm.Show;
        currentForm.Tag := hDlg;
        SetWindowText(hDlg, PChar(currentForm.Caption));
        MoveWindow(hDlg, currentForm.Left, currentForm.Top,
currentForm.Width,currentForm.Height, true);
        currentForm.Align := alClient;
        Result := True;
      end;
    WM_COMMAND:
      case LoWord(wParam) of
      IDOK:
        begin
          EndDialog(hDlg, wParam);
          Result := True
        end;
      IDCANCEL:
        begin
          EndDialog(hDlg, wParam);
          Result := True
        end
      else
        Result := False
      end {case wParam of}
    else
        Result := False;
  end;
end;
================================================================================

Replies:

www.cryer.info
Managed Newsgroup Archive