Announcement

Collapse
No announcement yet.

How to logically press PrtSc in PBDOS 3

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Lance Edmonds
    replied
    Windows exposes an interface to the clipboard through a DOS interrupt, but it takes a pointer to the data, not the 'contents of the screen' as your 1st message required.

    The clipboard would not be able to "make sense" of the raw bytes that comprise a SCREEN 12 image - but it could easily be used to transfer a BMP or a DIB image file - therefore you'd still need to convert your data into a BMP or DIB format.

    Search the Source Code forum for "clipboard", and also the www.basicguru.com/abc site for code to access the clipboard programmatically.


    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Eric Pearson
    replied
    Sure, I still hang around here.

    I just ran a quick test with a PB/CC console app (using the Console Tools "ConsoleKey" function) and %VK_SNAPSHOT does work, at least on NT4. I ran my program, started Word and pressed Shift-Insert, and I saw a bitmap of the entire desktop. So the NT4 console does process %VK_SNAPSHOT properly. (I can't test 95/98/2000 yet because my multiboot test machine is still down due to 2000 installation problems.)

    But I'm not sure how this information could be used by a PB/DOS program...? And if Neil needs a bitmap of the DOS window he'd have to find a way to make sure that the console had the focus or %VK_SNAPSHOT might produce a bitmap of the wrong window.

    -- Eric

    ------------------
    Perfect Sync: Perfect Sync Development Tools
    Email: mailto:[email protected][email protected]</A>



    [This message has been edited by Eric Pearson (edited March 15, 2000).]

    Leave a comment:


  • Lance Edmonds
    replied
    arl, I not 100% sure, but I believe that only works for GUI applications because DOS and console windows don't have a message queue in the same sense. A search of http://msdn.microsoft.com could be a worthwhile avenue.

    Also, I believe Eric Pearson _may_ be able to comment more on this as he has considerable experience with non-gui message processing (Eric: do you still lurk in here?)



    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Lance
    that link certainly did the biz for me. I d'loaded SAVEBMP.BAS and now I'm automatically saving BMPs to disk and pasting them into VB with no problems.

    Thanks very much for the advice. I think it's still a shame I couldn't just press PrtSc somehow - maybe a gameport-driven robot?

    ------------------

    Leave a comment:


  • Lance Edmonds
    replied
    Then I would suggest that you look at translating the DOS graphics screen into a BMP file and save it to disk - then your VB app can simply load the BMP directly and manipulate it. There is code for BMP and Screen 12 routines on the http://www.basicguru.com/abc site which may give you the building blocks you need to do this.

    Another technique could be to convert the DOS app to PB/CC or PB/DLL and create a BMP file - it is not "simple" as the graphics code will need to be rewritten but it is another possible solution. Graphic Tools for PB/CC from http://www.perfectsync.com would be the easiest way to do it with PB/CC or PB/DLL. However, this would also 'restrict' your app to running in Win32, so it may not be the best solution for - you are using VB3 which runs on top of Win16 - if this is the case, then PB/DLL 2.0 can be used to write Win16 app's as can VB3.

    Beyond that, maybe someone else can suggest another technique?

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Lance,
    what I'm attempting to do is produce an automated daily report which needs to run a DOS program and then print the VGA screen from the DOS program to a Windows printer. This will be done several (or more) times in a loop. I have written a VB shell which identifies on which files this DOS program operates, and executes the DOS program successfully. I just need to be able to capture the DOS screen to the clipboard as a bitmap during the 3 seconds (or so) that the image is displayed before the DOS program is closed. Pressing "PrtSc" programmatically would seem to me the way to do it, because it works fine when I press it physically. Would I be better off finding a way for my VB program to press "PrtSc" itself while the DOS program has the focus? Thanks for any help.

    ------------------

    Leave a comment:


  • Lance Edmonds
    replied
    The !INT &H05 is probably working ok, but Windows 98 will be interfering with the process because it intercepts Interrupt &H05. However, under Windows 2000, an INT &H05 from a DOS app does nothing (at least as far as I can detect - even the clipboard is untouched!) - my guess is that Windows98 will do the same thing.

    Off hand I'm not sure that you can do this directly without programmatically creating a BMP file and calling the Windows clipboard functions through the DOS-level interface it exposes.

    While I'm not sure what you want to do once you capture the images - if you wanted to print the image(s), then my suggestion would be to utilize some of the SCREEN 12 printing code that has been posted to this BBS in the past - the code will need to be printer-dependent though.

    Anyone else here care to offer a better idea? Maybe is we knew what you wanted to do with the images it might open the field a little wider?

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Guest's Avatar
    Guest started a topic How to logically press PrtSc in PBDOS 3

    How to logically press PrtSc in PBDOS 3

    I am running a PBDOS 3 program in Screen 12 in a maximised DOS box atop Win98. I want to be able to automatically capture the screen to the Windows clipboard. Physically pressing "PrtSc" does exactly what I want. I thought, mistakenly, that CALL INTERRUPT &H05 would do the same thing - but it does nothing. Is there a way of inserting a "PrtSc" press via an interrupt? My MS-DOS function book is at work, so I'm struggling a little here.
Working...
X