home *** CD-ROM | disk | FTP | other *** search
- program WinDemo;
-
- uses CRT, WinAware;
-
- var
- MajorRev, MinorRev : byte;
- ch : char;
- Result : word;
- Dresult : Longint;
- ClipDat : pointer;
- TestAr : array [1..255] of char;
- i : integer;
-
- const TestAr2 : array [1..32] of char = ('T', 'e', 's', 't',
- '1', '2', '3', '4',
- '1', '2', '3', '4',
- '1', '2', '3', '4',
- '1', '2', '3', '4',
- '1', '2', '3', '4',
- '1', '2', '3', '4',
- '1', '2', '3', #0 );
-
- BEGIN
- Result := 0;
- Dresult := 0;
- if RunningWin386( MajorRev, MinorRev) then
- begin
- Writeln(' Running Win ', MajorRev:1, '.', MinorRev:1, ' in 386 mode.');
- Writeln;
- Result := OpenWinClip;
- if Result <> 0 then
- begin
- Dresult := GetWinClipSize(1);
- if Dresult < 255 then { don't want to overflow the test array }
- begin
- Writeln( ' The text data in the clipboard is: ' );
- Writeln;
- GetMem(ClipDat, Dresult);
- Result := GetWinClipData( ClipDat, 1 );
- Move( ClipDat^, TestAr, Dresult );
- Result := PutWinClipData( @TestAr2, 1, 32);
- end
- else
- Writeln( 'More than 255 characters are in clipboard.');
- end;
- Result := CloseWinClip;
- i := 1;
- repeat
- Write( TestAr[i] );
- Inc(i);
- until (TestAr[i] = #0) or (i = 255);
- Writeln;
- Writeln;
- Writeln('Attempted to write some text to the clipboard. Check it.');
- ch := readkey;
- Writeln;
- Result := OpenWinClip;
- Result := ClearWinClip;
- Result := CloseWinClip;
- end
- else
- begin
- writeln(' Not in Win 386 mode.');
- if MajorRev <> 0 then
- writeln(' Windows version ', MajorRev:1, '.', MinorRev:1, ' in real or std mode.');
- end;
- END.