?
Solved

Text to Clipboard from a Prompt

Posted on 1997-04-13
1
Medium Priority
?
189 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
sperling earned 300 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

741 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