[Migrated content. Thread originally posted on 28 January 2003]
If someone wan't to have a print screen or other great thing you could go to http://www.acucorp.it- Home
- Sitemap
- Product Forums
- Rocket COBOL
- RocketĀ® ACUCOBOL
- [archive] Graphical print screen
[archive] Graphical print screen
- January 30, 2003
- 21 replies
- 0 views
21 replies
- Author
- Rocketeer
- January 30, 2003
[Migrated content. Thread originally posted on 28 January 2003]
If someone wan't to have a print screen or other great thing you could go to http://www.acucorp.itFor those that are not so stiff in Italian, here is a boiled down version that captures the screen and stores it to a filename provided by linkage section:
PROGRAM-ID. WinPrtScr is initial.
*This program makes a screen shot, and saves it to a bitmap file
*using the passed filename.
*This file may later then be used with W$BITMAP functions in
*ACUCOBOL-GT
*Credits to ACUCORP Italy
WORKING-STORAGE SECTION.
01 OrgDLLConv PIC X(10).
01 Result PIC S9(9) COMP-5.
01 WndHandle PIC S9(9) COMP-5.
01 ResImg.
03 IBuff PIC 9(9) COMP-5.
03 Stx PIC 9(9) COMP-5.
03 Sty PIC 9(9) COMP-5.
03 Endx PIC 9(9) COMP-5.
03 Endy PIC 9(9) COMP-5.
03 BuffWidth PIC 9(9) COMP-5.
03 Palette PIC 9(9) COMP-5.
03 ImgColors PIC 9(9) COMP-5.
03 ImgType PIC 9(9) COMP-5.
03 Bmh PIC 9(9) COMP-5.
03 hBitmap PIC 9(9) COMP-5.
LINKAGE SECTION.
01 SaveToName PIC X(256).
PROCEDURE DIVISION USING SaveToName.
MAIN-LOGIC SECTION.
MAIN-LOGIC-001.
INITIALIZE RESULT.
ACCEPT OrgDLLConv FROM ENVIRONMENT
"DLL_CONVENTION".
SET ENVIRONMENT "DLL_CONVENTION" TO "1".
CALL "VIC32.DLL" ON EXCEPTION
GO TO MAIN-LOGIC-800.
INQUIRE WINDOW SYSTEM HANDLE IN WndHandle.
CALL "windowtoimage" USING
BY VALUE WndHandle
BY REFERENCE ResImg.
INSPECT SaveToName REPLACING TRAILING SPACES BY
LOW-VALUES.
CALL "savebmp" USING
BY REFERENCE SaveToName
BY REFERENCE ResImg
BY VALUE 0
GIVING RESULT.
INSPECT SaveToName REPLACING ALL LOW-VALUES BY SPACES.
CALL "freeimage" USING
BY REFERENCE ResImg.
SET ENVIRONMENT "DLL_CONVENTION" TO
OrgDLLConv.
GO TO MAIN-LOGIC-900.
MAIN-LOGIC-800.
MOVE 1 TO RESULT.
MAIN-LOGIC-900.
CANCEL "VIC32.DLL".
GOBACK RETURNING RESULT.
- Author
- Rocketeer
- February 15, 2003
[Migrated content. Thread originally posted on 28 January 2003]
If someone wan't to have a print screen or other great thing you could go to http://www.acucorp.it- Author
- Rocketeer
- February 15, 2003
[Migrated content. Thread originally posted on 28 January 2003]
If someone wan't to have a print screen or other great thing you could go to http://www.acucorp.it- Author
- Rocketeer
- February 17, 2003
[Migrated content. Thread originally posted on 28 January 2003]
If someone wan't to have a print screen or other great thing you could go to http://www.acucorp.itHence, it is a possibility that we may no longer distribute vic32.dll, and we are not planning on including the twain dll you refer to.
- Author
- Rocketeer
- February 17, 2003
[Migrated content. Thread originally posted on 28 January 2003]
If someone wan't to have a print screen or other great thing you could go to http://www.acucorp.itHence, it is a possibility that we may no longer distribute vic32.dll, and we are not planning on including the twain dll you refer to.
- Author
- Rocketeer
- April 8, 2003
[Migrated content. Thread originally posted on 28 January 2003]
If someone wan't to have a print screen or other great thing you could go to http://www.acucorp.it- Author
- Rocketeer
- April 9, 2003
[Migrated content. Thread originally posted on 28 January 2003]
If someone wan't to have a print screen or other great thing you could go to http://www.acucorp.itDeclare it like this:
77 H-ACU-WND PIC 9(9) COMP-5 EXTERNAL.
Once the window is shown, this variable will have the handle to it.
However, to make a screen shot of an application window into the clipboard, you don't have to know this. You can just programmatically simulate the printscreen command through the keyboard. Here we go:
IDENTIFICATION DIVISION.
PROGRAM-ID. WINPRTSCR.
AUTHOR. (c) 1999, ACUCORP, Cheesle.
REMARKS.
*This program must be compiled with -Dw32 -Dl4
*For use with 32 bit Windows only
*This program demonstrates how to perform a printscreen from an
*Acucobol application.
*This program is free of use for Acucorp customers, provided as is.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 VK-SNAPSHOT SIGNED-SHORT.
01 COPY-MODE SIGNED-SHORT.
01 WS-NULL1 SIGNED-INT.
01 WS-NULL2 SIGNED-INT.
SCREEN SECTION.
PROCEDURE DIVISION.
MAIN SECTION.
MAIN-001.
*Set COPY-MODE to 0 to perform a printscreen of the entire screen,
*Set COPY-MODE to 1 to perform a printscreen of your applications
* window.
SET ENVIRONMENT "DLL_CONVENTION" TO "1".
MOVE 0 TO COPY-MODE.
MOVE 44 TO VK-SNAPSHOT.
MOVE 1 TO WS-NULL1
WS-NULL2.
DISPLAY "Prepare for snapshot...".
CALL "USER32.DLL" ON EXCEPTION GO TO MAIN-900.
CALL "keybd_event" USING
BY VALUE VK-SNAPSHOT
BY VALUE COPY-MODE
BY VALUE WS-NULL1
BY VALUE WS-NULL2
ON EXCEPTION GO TO MAIN-900.
*Your printscreen is now stored as a bitmap in the clipboard
DISPLAY "Done...".
ACCEPT OMITTED.
CANCEL "USER32.DLL".
MAIN-900.
MAIN-EXIT.
GOBACK.
- Author
- Rocketeer
- April 9, 2003
[Migrated content. Thread originally posted on 28 January 2003]
If someone wan't to have a print screen or other great thing you could go to http://www.acucorp.itDeclare it like this:
77 H-ACU-WND PIC 9(9) COMP-5 EXTERNAL.
Once the window is shown, this variable will have the handle to it.
However, to make a screen shot of an application window into the clipboard, you don't have to know this. You can just programmatically simulate the printscreen command through the keyboard. Here we go:
IDENTIFICATION DIVISION.
PROGRAM-ID. WINPRTSCR.
AUTHOR. (c) 1999, ACUCORP, Cheesle.
REMARKS.
*This program must be compiled with -Dw32 -Dl4
*For use with 32 bit Windows only
*This program demonstrates how to perform a printscreen from an
*Acucobol application.
*This program is free of use for Acucorp customers, provided as is.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 VK-SNAPSHOT SIGNED-SHORT.
01 COPY-MODE SIGNED-SHORT.
01 WS-NULL1 SIGNED-INT.
01 WS-NULL2 SIGNED-INT.
SCREEN SECTION.
PROCEDURE DIVISION.
MAIN SECTION.
MAIN-001.
*Set COPY-MODE to 0 to perform a printscreen of the entire screen,
*Set COPY-MODE to 1 to perform a printscreen of your applications
* window.
SET ENVIRONMENT "DLL_CONVENTION" TO "1".
MOVE 0 TO COPY-MODE.
MOVE 44 TO VK-SNAPSHOT.
MOVE 1 TO WS-NULL1
WS-NULL2.
DISPLAY "Prepare for snapshot...".
CALL "USER32.DLL" ON EXCEPTION GO TO MAIN-900.
CALL "keybd_event" USING
BY VALUE VK-SNAPSHOT
BY VALUE COPY-MODE
BY VALUE WS-NULL1
BY VALUE WS-NULL2
ON EXCEPTION GO TO MAIN-900.
*Your printscreen is now stored as a bitmap in the clipboard
DISPLAY "Done...".
ACCEPT OMITTED.
CANCEL "USER32.DLL".
MAIN-900.
MAIN-EXIT.
GOBACK.
- Author
- Rocketeer
- April 9, 2003
[Migrated content. Thread originally posted on 28 January 2003]
If someone wan't to have a print screen or other great thing you could go to http://www.acucorp.it- Author
- Rocketeer
- April 9, 2003
[Migrated content. Thread originally posted on 28 January 2003]
If someone wan't to have a print screen or other great thing you could go to http://www.acucorp.it- Author
- Rocketeer
- April 9, 2003
[Migrated content. Thread originally posted on 28 January 2003]
If someone wan't to have a print screen or other great thing you could go to http://www.acucorp.it- Author
- Rocketeer
- August 3, 2006
[Migrated content. Thread originally posted on 28 January 2003]
If someone wan't to have a print screen or other great thing you could go to http://www.acucorp.itI have tried using the w$bitmap desktop-capture with different color-depths, but this doesn't seem to do anything in either version 6.2 or 7.0, I end up with a 5 Meg file, which is not suitable for sending via email everytime. I don't care if it is even 1 bit per pixel.
Regards
- Author
- Rocketeer
- August 3, 2006
[Migrated content. Thread originally posted on 28 January 2003]
If someone wan't to have a print screen or other great thing you could go to http://www.acucorp.itI have tried using the w$bitmap desktop-capture with different color-depths, but this doesn't seem to do anything in either version 6.2 or 7.0, I end up with a 5 Meg file, which is not suitable for sending via email everytime. I don't care if it is even 1 bit per pixel.
Regards
- Author
- Rocketeer
- August 3, 2006
[Migrated content. Thread originally posted on 28 January 2003]
If someone wan't to have a print screen or other great thing you could go to http://www.acucorp.itI have tried using the w$bitmap desktop-capture with different color-depths, but this doesn't seem to do anything in either version 6.2 or 7.0, I end up with a 5 Meg file, which is not suitable for sending via email everytime. I don't care if it is even 1 bit per pixel.
Regards
- Author
- Rocketeer
- August 3, 2006
[Migrated content. Thread originally posted on 28 January 2003]
If someone wan't to have a print screen or other great thing you could go to http://www.acucorp.itI have tried using the w$bitmap desktop-capture with different color-depths, but this doesn't seem to do anything in either version 6.2 or 7.0, I end up with a 5 Meg file, which is not suitable for sending via email everytime. I don't care if it is even 1 bit per pixel.
Regards
- Author
- Rocketeer
- August 3, 2006
[Migrated content. Thread originally posted on 28 January 2003]
If someone wan't to have a print screen or other great thing you could go to http://www.acucorp.it- Author
- Rocketeer
- August 4, 2006
[Migrated content. Thread originally posted on 28 January 2003]
If someone wan't to have a print screen or other great thing you could go to http://www.acucorp.itRegards
- Author
- Rocketeer
- August 4, 2006
[Migrated content. Thread originally posted on 28 January 2003]
If someone wan't to have a print screen or other great thing you could go to http://www.acucorp.itRegards
- Author
- Rocketeer
- August 4, 2006
[Migrated content. Thread originally posted on 28 January 2003]
If someone wan't to have a print screen or other great thing you could go to http://www.acucorp.ithttp://www.catenarysystems.com/docs/viclibref-a-c.html
- Author
- Rocketeer
- August 4, 2006
[Migrated content. Thread originally posted on 28 January 2003]
If someone wan't to have a print screen or other great thing you could go to http://www.acucorp.ithttp://www.catenarysystems.com/docs/viclibref-a-c.html
- Author
- Rocketeer
- August 22, 2006
[Migrated content. Thread originally posted on 28 January 2003]
If someone wan't to have a print screen or other great thing you could go to http://www.acucorp.ithttp://www.gdpicture.com/
Regards
Recent badge winners
Neil Morrishas earned the badge Consistent Trajectory
Kevin Hondhas earned the badge Orbit Established
Kevin Hondhas earned the badge Consistent Trajectory
OsmanShariffhas earned the badge Network Contributor
OsmanShariffhas earned the badge Orbit Established
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.
Scanning file for viruses.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
OKThis file cannot be downloaded
Sorry, our virus scanner detected that this file isn't safe to download.
OK