🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #160933

[dialog] problem with script and clipboard

#160933
From: Big Ben
Date: Mon, 17 Jan 2005 15:30
60 lines
2588 bytes
Hi,

Here a little script to get the name of a group :

Program TEST;

uses
   Forms,
   StdCtrls;
const
   MB_OK = 0;
var
   myForm: TForm;
   myMemo: TMemo;      
    
FUNCTION EmptyClipboard:boolean; external 'EmptyClipboard@user32.dll
stdcall';
FUNCTION OpenClipboard(hWndNewOwner: INTEGER):boolean; external
'OpenClipboard@user32.dll stdcall';
FUNCTION CloseClipboard:boolean; external 'CloseClipboard@user32.dll
stdcall';
FUNCTION MessageBox(hWnd: Cardinal; lpText, lpCaption: PChar; uType:
longword): Integer; external 'MessageBoxA@user32.dll stdcall';

Begin                            

   myForm := tForm.Create(nil);
   myForm.width:=800;
   myForm.Height:=600;
   myMemo := tMemo.Create(myForm);
   myMemo.Parent := myForm;
   myMemo.Width := myForm.width;
   myMemo.Height := myForm.Height;

   // clear clipboard              
   OpenClipboard(Application.Handle);
   EmptyClipboard;
   CloseClipboard;
   MyMemo.Clear;
   
   // select one line on newsgroup panel	
   ADo('NewGroupPane');        
   ADo('Copy');                      

   // and the result
   MyMemo.PasteFromClipboard;                         
   messageBox(0, Mymemo.lines.Strings[0],'result',MB_OK);      

End.

It's ok on WindowsXP but on Windows2000 I get some extra characters like
'@6' instead of 'news.software.readers' for example. I think clipboard
format is not good but how can I retrieve the text of clipboard ?

(sorry for my bad english)

-- 
Cordialement,
Ben.
Technical Details
Message-ID: <1mm1q70nd3st8$.dlg@Beny.be.fr>
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!number1.nntp.ams.giganews.com!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border1.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!news.cs.univ-paris8.fr!proxad.net!usenet-fr.net!enst.fr!grolier!rain.fr!INTRANET.USINOR.com

Show Full Headers
Complete Article Headers
Message-ID: <1mm1q70nd3st8$.dlg@Beny.be.fr>
Subject: [dialog] problem with script and clipboard
Date: Mon, 17 Jan 2005 16:30:21 +0100
From: Big Ben <beny.news*a_supprimer*@lorraine.com>
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!number1.nntp.ams.giganews.com!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border1.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!news.cs.univ-paris8.fr!proxad.net!usenet-fr.net!enst.fr!grolier!rain.fr!INTRANET.USINOR.com
NNTP-Posting-Host: 150.39.52.51
Newsgroups: news.software.readers
User-Agent: 40tude_Dialog/2.0.14.1fr (84b4af78.40.503)
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Face: EPCs4Yj4MlV)n4v; =.|'msKUawj/*(rH<S;
 -0H1Lzq3nzZD=)p=OS)*3Wh\LStcL9e3xt\E +Y:z<ieoFk;
 IXAyZ4GpCrj_Z4pK7kOBO_$du4oe>z`*Jcj8D:NEq~"eA!ap
Lines: 60