Solved

Text to Clipboard from a Prompt

Posted on 1997-04-13
1
184 Views
Last Modified: 2013-12-03
I need to get text to the clipboard form a prompt outside of windows.  I would prefer to use C++ to write the code.  Does anyone out there know how to do this, or have any ideas for starting points?
Another question.  Is there a way to activate a button on the Win-95 tool bar outside of windows, or without actually pushing it with a mouse click, and how would one go about doind that.

Thanks.
0
Comment
Question by:relwof
1 Comment
 
LVL 3

Accepted Solution

by:
sperling earned 100 total points
ID: 1334574
When you say "Outside of Windows", I assume you mean from a DOS program.

If so:

INT 2F, AX=1701
  Open clipboard
Return value in AX:
  0            - Clipboard already open
  Other values - success

INT 2F, AX=1702
  Empty clipboard
Return value in AX
  0            - failure
  Other values - success

INT 2F, AX=1703
  Set clipboard data
  DX = Format:
    01 - Text
    02 - Bitmap
    03 - Metafile
    04 - SYLK
    05 - DIF
    06 - TIFF
    07 - OEM Text
    08 - DIB Bitmap
  ES:BX -> Data
  SI:CX = Size of data
Return value in AX
  0            - failure
  Other values - success

INT 2F, AX=1704
  DX - Format
Return value
  DX:AX = Size of data. Can be rounded up to multiple of 32 bytes
  0:0 if no data in clipboard

INT 2F, AX=1705
  DX - Format
  ES:BX -> Buffer
Return value in AX
  0            - failure
  Other values - success

INT 2F, AX=1708
  Close clipboard
Return value in AX
  0            - failure
  Other values - success


A simple technique for communicating in between DOS and Windows, is to write a Windows program which installs itself as a Clipboard viewer. The DOS program will then send text commands to clipboard, and the windows program will decode and perform the actions. Look up SetClipboardViewer for an explanation of clipboard viewers.


Regards,

Erik.
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question