🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #1711

Clipboard operation w/ Icons

#1711
From: Jeff
Date: Thu, 21 Jun 2007 16:23
18 lines
1723 bytes
I've got a TImage component (imgMonitor below) that is displaying an icon 
via ExtractIcon().  The problem is that the Windows clipboard doesn't 
support icons.  I've tried creating a TBitmap and coping it and assigning it 
to the clipboard (see code below), but programs throw errors when attempting 
to paste.  Any ideas on how to get this to work?

    Graphics::TBitmap *tBitmap = new Graphics::TBitmap;

    tBitmap->Width = imgMonitor->Picture->Bitmap->Width;
    tBitmap->Height = imgMonitor->Picture->Bitmap->Height;
    tBitmap->PixelFormat = imgMonitor->Picture->Bitmap->PixelFormat;
    tBitmap->Canvas->Draw(0,0,imgMonitor->Picture->Icon);
    imgMonitor->Picture->Graphic = tBitmap;
    Clipboard()->Assign(imgMonitor->Picture);
    delete tBitmap;

Thanks,
Jeff 
Technical Details
Message-ID: <467aa666$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,94c464a24f7a5b5e,start
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Jeff" <Jeff@nospam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Clipboard operation w/ Icons
Date: Thu, 21 Jun 2007 10:23:56 -0600
Lines: 20
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
NNTP-Posting-Host: 206.104.31.90
Message-ID: <467aa666$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1182443110 206.104.31.90 (21 Jun 2007 09:25:10 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail