如何设置打开工程文件时主窗体不自动打开而只打开*.dpr(100分)

  • 主题发起人 主题发起人 cndsb
  • 开始时间 开始时间
C

cndsb

Unregistered / Unconfirmed
GUEST, unregistred user!
1.如何设置打开工程文件时主窗体不自动打开而只打开*.dpr?
2.主窗口:FrmMain,启动窗口:FrmSplash,用户验证窗口:FrmLoad,FrmDM数据模板窗口
我想实现先打开启动窗口FrmSplash,再打开主窗口FrmMain,然后在主窗口上面打开用户验证窗口:FrmLoad,验证合法后再主窗口菜单能用.以下是源码,但用户验证窗口总在主窗口下,请各位指教.
begin
Application.Initialize;
FrmSplash:=TFrmSplash.Create(Application);
FrmSplash.show;
FrmSplash.Update;
Application.CreateForm(TFrmMain, FrmMain);
Application.CreateForm(TDM, DM);
FrmLoad:=TfrmLoad.create(Application);
FrmSplash.Close;
FrmSplash.free;
FrmLoad.Show;
Application.Run;
end.
 
Application.Initialize;
FrmSplash:=TFrmSplash.Create(Application);
FrmSplash.show;
FrmSplash.Update;
Application.CreateForm(TFrmMain, FrmMain);
Application.CreateForm(TDM, DM);
FrmLoad:=TfrmLoad.create(Application);
FrmSplash.Close;
FrmSplash.free;
FrmLoad.Showmodal;
 
toAdden_lian,这样主窗口就不显示了
 
Application.Initialize;
FrmSplash:=TFrmSplash.Create(Application);
FrmSplash.show;
FrmSplash.Update;
Application.CreateForm(TFrmMain, FrmMain);
Application.CreateForm(TDM, DM);
FrmMain.Show;
FrmMain.Update;//先显示主窗体
FrmLoad:=TfrmLoad.create(Application);
FrmSplash.Close;
FrmSplash.free;
FrmLoad.Showmodal;
 
1、查了查帮助,好像没有这个。
This topic lists and describes all of the options that you can use to start the IDE from the command line.

You must precede all options (unless otherwise noted) with either a dash (-) or a slash (/). The options are not case sensitive.Therefore, the following options are all identical: -d /d -D /D.

You use these options with the IDE startup command: delphi32.exe.

For example:

delphi32.exe -ns -hm

Starts the IDE with no splash screen and tracks memory allocation.

delphi32.exe 杝dc:/test/source 杁 c:/test/myprog.exe -td

Starts the IDE and loads c:/test/myprog.exe into the debugger and used c:/test/source as the location for the source code while debugging. The 杢d and any other argument that appears after the 杁exename debugger option is used as an argument to c:/test/myprog.exe.

General options

Option Description

? Displays help for IDE command-line options.
hm Heap Monitor. Displays information in the IDE title bar regarding the amount of memory allocated using the memory manager. Displays the number of blocks and bytes allocated. Information gets updated when the IDE is idle.
hv Heap Verify. Performs validation of memory allocated using the memory manager. Displays error information in the IDE title bar if errors are found in the heap.
ns No splash screen. Suppresses display of the splash screen during IDE startup.

np No Project. Supresses loading of any desktop files on IDE startup and suppresses creation of a default project.

Debugger options

Option Description

dexename Loads the specified executable (exename) into the debugger. Any parameters specified after the exename are used as parameters to the program being debugged and are ignored by the IDE. A space is allowed between the d and the exename.
attach:%1;%2 Performs a debug attach, using %1 as the process ID to attach to and %2 as the event ID for that process. It can be used manually, but is used mostly for Just in Time debugging.
td TDGoodies. Implements several features found in the TurboDebugger, TD32. It must be used with the d option. It causes the CPU and FPU views to stay open when a process terminates. It causes Run|Program Reset to terminate the current process and reload it in the debugger. If there is no current process, Run|Program Reset reloads the last process that terminated. It also causes breakpoints and watches to be saved in the default desktop if desktop saving is on and no project is loaded.

sddirectories Source Directories. Must be used with the d option. The argument is either a single directory or a semicolon delimited list of directories which are used as the Debug Source Path setting (can also be set using the Project|Options|Directories/Conditionals option page). No space is allowed between sd and the directory list argument.
hhostname Hostname. Must be used with the d option. When specified, a remote debug session is initiated using the specified host name as the remote host to debug on. The remote debug server program must be running on the remote host.

Project options

Option Description

filename (No preceding dash) The specified filename is loaded in the IDE. It can be a project, project group, or a single file.
b AutoBuild. Must be used with the filename option. When specified, the project or project group is built automatically when the IDE starts. Any hints, errors, or warnings are then saved to a file. Then the IDE exits. This facilitates doing builds in batch mode from a batch file. The Error Level is set to 0 for successful builds and 1 for failed builds. By default, the output file has the same name as the filename specified with the file extension changed to .err. This can be overridden using the o option.

m AutoMake. Same as AutoBuild, but a make is performed rather than a full build.
ooutputfile Output file. Must be used the b or m option. When specified, any hints, warnings, or errors are written to the file specified instead of the default file.
 
to kingdeezj
首先感谢你为我解决了第二个问题.
对于第一个问题,我原行做过一个程序,打开工程文件时就不显示主窗体,在此情况下我所贴源码就能实现我所问的第二个问题.
我给你EMAIL份,你看看,行否?
 
好的。kingdeezj@sina.com
 
第2个问题解决啦,我就不多说了。
关于第1个问题是因为你对工程文件进行过修改导致的。Delphi自动会认为
Application.CreateForm() 创建的第一个窗体是主窗体,而如果你对这段Delphi自动维护的代码做了修改,如自已写代码加入了欢迎窗体等等就会出现这样的现象。
 
to helloqiner
我不知道我的第二问题为什么当时会按要求执行的
 
关于第2个问题,
其实这种效果我是经常写的。不过,一般我只在工程文件中创建欢迎窗体,而登陆窗体我从来是放在MainFm中创建的。在主窗体的FormShow或FormActivate事件中创建登陆窗体并进行口令效验,所以从来没有出来过你的这种问题。
 
1、看了你的程序包,有了以下发现:
只要有一个和*.dpr同名的*.dsk(0字节也可),DELPHI就不会自动创建主窗体。
*.DSK ----- DELPHI桌面配置文件.delphi加载此文件内容配置IDE.关于它的配置方法和资料我也没有,你可查阅一下相关文档
 
多人接受答案了。
 
后退
顶部