I think you understand what I was getting at now! <g>  I knew I
could get the format when reading from the clipboard but I hadn't found a
way to select the correct format for putting data back again when running a
new windows session until rob Kennedy sent me that code.  This would all be
really easy if I knew the system was never shut down!  If I can just get the
regularly registered formats working first then I'll worry about the
specially registered ones.  But even that is turning out to be more of a
problem then I originally thought it would be...see the messages between Rob
and myself regarding the inability to handle standard formats like bmp files
or rtf.  I'm still obviously missing something.
        By the way, the pointer problem I was having was in regards to the
unit I included in one of the original messages to this thread.
"Enhancedclipboard.pas"  I was not able to get the parameters set correctly
for some reason.  

>From "Robert Meek" 
Personal e-mail:  [EMAIL PROTECTED]
dba / "Tangentals Design"
Visit us at:  www.TangentalsDesign.com
Home of "The Keep"!

Member of:  "Association of Shareware Professionals"
Moderator for:  "The Delphi", "Delphi-DB", and "Delphi-Talk" programming
lists at elists.org,
and proud to be a donator to the Jedi VCL 3.0. 


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Jim Burns
Sent: Thursday, April 14, 2005 4:46 PM
To: 'Borland's Delphi Discussion List'
Subject: RE: Oh boy...need pointer help...addendum!

> In any case the problem is
> that I was not able to find a way to get the actual format in 
> it's string
> form.  I was only able to read the list of formats and get 
> their integer aliases.  

If you open up the windows help file (D7), MSDN is fine as well but I prefer
to start with the help file, and look up "clipboard" you'll find 14 general
entries for "Clipboard XXXX."  

Usually I'm just looking for an API function reference so choose, "Clipboard
Functions."

You'll get a list of ALL the clipboard functions in the API.  One of them is
named GetClipboardFormatName().  Robert, is that not so straight-forward,
it's almost scary?



> So in order to set the format correctly for reading from and
> writing to the clipboard I needed a way to convert from the 
> integer value to the string constant!

Actually, to Read from or Write to the clipboard all you need is the format
ID, a number.  Since I've been following along, maybe you mean in order for
your program to "reload" the clipboard, then yes, maybe you'll need more
than just the format ID.  I guess it depends on whether this is days and
reboots later and whether or not that format has been registered.  Keep in
mind, depending on what exactly you're trying to do, you may be able to
count on the fact that every format you pull off the clipboard is still a
registered format when you want to put it back and your job would be
simplier as you'd not need to worry about whether a format's registered or
not.  But only you can make that call.

But what do you mean by "string constant?"  Do you mean the format's name?
I mentioned using GetClipboardFormatName() in my first message so maybe I
can assume this is NOT what you're looking for.  Then, I just don't know how
to interpret what you've said.  There is no common connection between a
format ID and a common string constant.  The program registering the format
provides a string name for the format.  But that doesn't seem to be what you
want. 

What can one say -- Read the help.



> So I thought I could load a list with a set of
> name=value pairs I could use to programmatically lookup these 
> conversions.  

Again, I wouldn't call them conversions but yes, there's a name and a format
id for each registered format.  Saving both of these pieces of data might be
helpful but it depends more precisely on what you're doing.  Either way, if
you attempt to "reload" the clipboard you are going to have to insure the
format is registered, to insure it's registered you're going to make at
least one additional call.  You can call GetClipboardFormatName() and pass
it a string buffer and your saved ID and see if you get a string that
matches your saved format name OR wouldn't it just be easier to call
RegisterClipboardFormat() with your saved format name.  Then, if you did
save the ID and need to know if the format was already registered, you could
simply compare the returned ID to what you hold. 


Where's the pointer problem in all this?  :)


Regards,


------------------------------------------------------------------------
 Jim Burns, <mailto:[EMAIL PROTECTED]>
   Technology Dynamics
   Pearland, Texas  USA 
   281 485-0410 / 281 813-6939


_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi


_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to