Solved

Text to Clipboard from a Prompt

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

730 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