Eloquent? No - SLick considering DarkGDK winMain? I think so - its like Landscape Maker someone on here did. Idea is to make one app control the other - and devise some InterProcess Comm to make it work.
Attaching Exe - but I'll post the source - its harmless and requires notepad.exe fro xp in your path.
[edit]Changed to launch cmd.exe[/edit]
project1.lpr
program project1;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms
{ add your units here }, Unit1;
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
unit1.pas - remember most of this code was written for me in the Lazarus IDE!!!!
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, Process, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons,
StdCtrls, Menus, ExtCtrls, MaskEdit, Grids, ColorBox, ComCtrls, EditBtn,
FileCtrl, Chart, ButtonPanel, SynHighlighterCPP, SynEdit;
type
{ TForm1 }
TForm1 = class(TForm)
BarChart1: TBarChart;
Bevel1: TBevel;
BitBtn1: TBitBtn;
Button1: TButton;
Button2: TButton;
ButtonPanel1: TButtonPanel;
CalcEdit1: TCalcEdit;
CheckBox1: TCheckBox;
ColorBox1: TColorBox;
DateEdit1: TDateEdit;
DirectoryEdit1: TDirectoryEdit;
DrawGrid1: TDrawGrid;
Edit1: TEdit;
FileListBox1: TFileListBox;
FileNameEdit1: TFileNameEdit;
Label1: TLabel;
LabeledEdit1: TLabeledEdit;
MainMenu1: TMainMenu;
MaskEdit1: TMaskEdit;
MenuItem1: TMenuItem;
MenuItem2: TMenuItem;
MenuItem3: TMenuItem;
MenuItem4: TMenuItem;
MenuItem5: TMenuItem;
MenuItem6: TMenuItem;
MenuItem7: TMenuItem;
MenuItem8: TMenuItem;
MenuItem9: TMenuItem;
ProgressBar1: TProgressBar;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioGroup1: TRadioGroup;
ScrollBar1: TScrollBar;
StatusBar1: TStatusBar;
StringGrid1: TStringGrid;
SynEdit1: TSynEdit;
ToolBar1: TToolBar;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
ToolButton3: TToolButton;
ToolButton4: TToolButton;
ToolButton5: TToolButton;
ToolButton6: TToolButton;
TrackBar1: TTrackBar;
TreeView1: TTreeView;
UpDown1: TUpDown;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
AProcess: TProcess;
implementation
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
if(aprocess=nil) then
begin
try
AProcess := TProcess.Create(nil);
AProcess.CommandLine := 'cmd';
AProcess.Options := AProcess.Options;// + [poWaitOnExit];
// Now that AProcess knows what the commandline is
// we will run it.
AProcess.Execute;
except
AProcess.Free;
AProcess:=nil;
end;
end
else
begin
ShowMessage('Its running already I think. Isn''t it?');
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if(aprocess<>nil)then
begin
AProcess.Terminate(0);
AProcess.Free;
AProcess:=nil;
end
else
begin
ShowMessage('Its not running is it?');
end;
end;
initialization
{$I unit1.lrs}
AProcess:=nil;
end.
Note - I tossed in other widgets so you can See WHY I might bother to use FreePascal - (besides I have literally 10's of Thousands of routines I've written for it over the years from sockets to multithreaded webserver, linkeed list, advanced parsers etc etc.
You have all the source and the project1.exe in the attached Zip.
Next Post will have screenie.