![]() |
#1
|
|||
|
|||
![]()
this is my ENTIRE application:
program Executor; uses Forms, ShellApi; {$R *.res} begin Application.Initialize; Application.Run; ShellExecute(Application.Handle, nil, PChar('www.delphipages.com'), nil, nil, 0); end. Its nearly 400KB. It doesn't even have a form! I'm guessing it is becuase of the linking needed for the TApplication class, in the forms unit. The question is, how can I do this (run shellexecute) without needing an instance of TApplication? How else can I create a window handle to pass in? Cheers, Dave. |
#2
|
|||
|
|||
![]()
Try using the GetDesktopWindow() function which will return you the handle of the desktop :
program Project1; uses Windows, ShellAPI; {$R *.RES} begin ShellExecute(GetDesktopWindow(), nil, PChar('www.delphipages.com'), nil, nil, 0); end. It might be lighter. LörAn. MAIL: loran@superheros.as ICQ : 112714184 |
#3
|
|||
|
|||
![]()
Hi,
Eventhough ur not using any forms, still u have referenced Forms unit in the uses Clause, which u dont require. The Application variable also u dotn require. U require only the ShellApi unit. Try the following. program Project1; uses ShellApi; {$R *.RES} begin ShellExecute(0, nil, PChar('www.delphipages.com'), nil, nil, 0); end. Hope this will help. Thanx Tomy. |
#4
|
|||
|
|||
![]()
The reason being is that you've implemented Forms unit. Remove it from the uses clause. Your uses clause should look something like:
uses SysUtils, ShellApi; By the way, why don't you conver it into DOS-console application? It might even get smaller. Almost forgot, you are including a resource file, which every Windows program has {$R *.res}. Try removing it from the program, and compile it. So your DOS console application would look something like this:
The size should be now about 50K. |
#5
|
|||
|
|||
![]()
Hello,
To make you exe smaller make sure "runtime packages"(packages tab) are checked and "use dynamic rtl(linker tab)", but you will have to distribute all library files with exe. If you do decide to build without runtime packages. Only check the packages your application needs, like if you have a component package that you dont use any of those components in you application, uncheck it in the packages screen. All these setting are configured in the Project Options Settings. |
#6
|
|||
|
|||
![]()
Hi,
Ur prob is still unsolved ? Thanx Tomy. |
![]() |
Thread Tools | |
Display Modes | |
|
|