Article View: news.software.readers
Article #144097Re: [Dialog] help needed with scripts
From: Doktor
Date: Tue, 24 Feb 2004 12:11
Date: Tue, 24 Feb 2004 12:11
81 lines
3721 bytes
3721 bytes
On 24 Feb (11:46) You wrote:
> I think I'll try also to put a counter in the form, as Jeff Relf suggested,
> without checking for running processes because I don't know how to do it in
> Dialog scripts.
I don't know how to check if the thread is active but I have another idea.
At your main script at the beginning, You must create some Form. Later, You
should put Your code. At the end of script You should destroy this Form.
At the second script you should check if the form exists in memory. If
exists - process is active, if not exists - process is not active.
I know it's not the best solution but it works. ;)
Examples: (You'll see the effect on the Dialog main window caption) :)
First script (main):
// -------------------
Program test;
uses Forms;
var Form : TForm;
// here is only example to show that script works:
function MessageBox (hWnd : LongWord; lpText,
lpCaption : PChar; uType : LongWord ) : Integer;
external 'MessageBoxA@user32.dll stdcall';
Begin
Form := TForm.Create (Application.MainForm);
Form.Parent := Application.MainForm;
Form.Name := 'DummyForm';
// [your code goes here]
// here is only example to show that script works:
MessageBox (0, 'Check Main 40tude Dialog form caption', 'Info', $40);
Form.Free;
End.
// -------------------
Second script (OnTimer2 event):
// -------------------
program OnTimer2;
uses Forms;
procedure OnTimer2;
begin
if Application.MainForm.FindComponent ('DummyForm') <> nil
then Application.MainForm.Caption := 'Process active!'
else Application.MainForm.Caption := 'Process not active!';
end;
begin
end.
// -------------------
This way allows You to "communicate" between every two or more scripts. :)
> If you have other inputs they'll be very welcome! :)
You are welcome. ;)
PS.
Sorry for my English. I know it's not good enough. I still better know
Pascal language than English. ;)
--
Doktor
http://usenetowa.lameriada.com
Technical Details
Message-ID:
<c1fihj.81.1@czy.konie.mnie.slysza>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!intern1.nntp.aus1.giganews.com!internal1.nntp.sjc.giganews.com!border2.nntp.sjc.giganews.com!border1.nntp.sjc.giganews.com!nntp.giganews.com!newsfeed.news2me.com!newsfeed.tpinternet.pl!news.dialog.net.pl!not-for-mailReferences:
<1mops9bm8bjs5.dlg@ID-187316.user.uni-berlin.de> <c1f98k.8a.1@czy.konie.mnie.slysza> <6e80ibdpsm5s.dlg@ID-187316.user.uni-berlin.de>Show Full Headers
Complete Article Headers
Message-ID: <c1fihj.81.1@czy.konie.mnie.slysza>
Subject: Re: [Dialog] help needed with scripts
Date: Tue, 24 Feb 2004 13:11:14 +0100
From: Doktor <doktorLubicz@poczta.onet.pl>
References: <1mops9bm8bjs5.dlg@ID-187316.user.uni-berlin.de> <c1f98k.8a.1@czy.konie.mnie.slysza> <6e80ibdpsm5s.dlg@ID-187316.user.uni-berlin.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!intern1.nntp.aus1.giganews.com!internal1.nntp.sjc.giganews.com!border2.nntp.sjc.giganews.com!border1.nntp.sjc.giganews.com!nntp.giganews.com!newsfeed.news2me.com!newsfeed.tpinternet.pl!news.dialog.net.pl!not-for-mail
Newsgroups: news.software.readers
Organization: news.software.readers readers
Lines: 81
NNTP-Posting-Host: client-energetyka-1.lubin.dialog.net.pl
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: absinth.dialog.net.pl 1077624548 10301 62.87.210.161 (24 Feb 2004
X-Complaints-To: http://www.dialog.pl/dialog/internet/internet.php?id=41
NNTP-Posting-Date: Tue, 24 Feb 2004 12:09:08 +0000 (UTC)
X-Face: #gpB?2x2H3a;
JaK{YLYghqy@q9q!lAbZKu|`91+h>>d=5"]O<GBR'-vYbSchuQ(,I!j+])@
]uE:OF:9:Q/W|QMHMa'e{F0'S-|6J!)ti2EQ7D}2QEomHm|a1Z(`Edfqt]{R&z(ED[:w<+,+2=-';
4 k(B%>-"NjF\mlx4UM'9@]dvD*i/I1FZ*/V:>jxe/R1u6eTPP_k40,eGco-lGRU!2EBk*e0n.R9
X-Newsreader: Tajemniczy czytnik Doktora ;)
X-Web: http://usenetowa.lameriada.com
X-GaduGadu: 875719