天道酬勤,学无止境

setparent

分配给Setparent(..)后Showmodal中的问题(Problems in Showmodal after assigning to Setparent(..))

问题 我创建了两个应用程序MainApps和SubApps,SubApps具有模式类型对话框,如登录/注销表单等,并且工作正常。 将其附加到MainApps后,“模态对话框”显示为类似于普通框形式。 它的行为类似于“ DIALOG.SHOW”而不是“ DIALOG.SHOWMODAL”; 我正在使用delphi编译器 SubApps buttonclick; begin with TfrmDialog.Create(Self, dtLogout) do try iMsgResult := ShowModal; finally Free; end; if iMsgResult = mrOk then begin dmVoca.FHomeworkXMLDoc.Active := False; //Disabled Double Login dmVoca.tmrDoubleLogin.Enabled := False; ................ end; end; MainApps ButtonClick begin setparent(findwindow(nil,'SubApps'),TabSheet1.Handle); ......... end; 回答1 不要惊讶,您尝试的内容充其量是不寻常的。 ShowModal通过禁用调用线程的所有窗口(但不使用模式形式

2021-06-01 14:58:40    分类:技术分享    delphi   forms   modal-dialog   dialog   setparent

Problems in Showmodal after assigning to Setparent(..)

I created two application MainApps and SubApps, the SubApps has a modal type dialogbox such as login/logout form etc. and its working fine. After I attach it to the MainApps, the Modal Dialog box shows like normal box form. It behaves like "DIALOG.SHOW" instead of "DIALOG.SHOWMODAL"; I am using delphi compiler SubApps buttonclick; begin with TfrmDialog.Create(Self, dtLogout) do try iMsgResult := ShowModal; finally Free; end; if iMsgResult = mrOk then begin dmVoca.FHomeworkXMLDoc.Active := False; //Disabled Double Login dmVoca.tmrDoubleLogin.Enabled := False; ................ end; end; MainApps

2021-04-30 09:47:30    分类:问答    delphi   forms   modal-dialog   dialog   setparent

How to shell to another app and have it appear in a delphi form

In Delphi I've used ShellExecute for years to launch (and optionally wait for) other applications. Now though, I need to have one of these applications appear in one of my Delphi app forms. I've tried the code below as a simple test to open notepad (which it does) and to display the result within PAnel1 on my form (which it doesnt). Can some kind person put me on the right track? Thanks var Rec : TShellExecuteInfo; wnd : HWnd; const AVerb = 'open'; AParams = ''; AFileName = 'Notepad.exe'; ADir = ''; begin FillChar(Rec, SizeOf(Rec), #0); Rec.cbSize := SizeOf(Rec); Rec.fMask := SEE_MASK

2021-03-31 01:14:14    分类:问答    delphi   shellexecute   setparent