Solved

Text to Clipboard from a Prompt

Posted on 1997-04-13
1
181 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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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 demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now