Mail Archives: djgpp/1999/11/10/16:47:02
> But I've never been able to
> paste from the clipboard back into the same DOS program (open, get
> size, get data, close), whether it was copied from Notepad or that same
> DOS program. The size regs (dx:ax) always come back 0. Any idea why?
Maybe you are using a wrong subfunction number.
The following works (extract from a TP unit)
function Generic_winclip: boolean; assembler;
Asm
MOV AH, 17H
INT 2FH
OR AX, AX
JZ @end
MOV AL, 1
@end:
End;
function GetClipboardDataSize(Format: Word): LongInt;; assembler;
Asm
MOV DX, Format
MOV AX, 1704H
INT 2FH
End;
function GetClipboardData(Format: Word; var Data): Boolean; assembler;
Asm MOV DX, Format
LES BX, Data
MOV AL, 5
call near ptr Generic_winclip
End;
Note that the data size can be too long. A sort
of bug that will last till the end of Windows
You can see it in action (from/to Win clipboard) in EDIT
http://members.xoom.com/gdemont/edit.htm
HTH
--
Gautier
- Raw text -