Solved

Text to Clipboard from a Prompt

Posted on 1997-04-13
1
185 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Table Size and Indexes in SQL Server 6 27
Excel Use VBA to get user's Mac Address for their computer 5 244
Problem to adjust sheet 1 92
String manipulation in Visual Basic 7 73
This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

861 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