Hello,
I have been working a little calling API Windows functions (Gianni know) and now i can contribute with this simple example to shutdown (turn off) the computer from PowerCOBOL.
For this, first you need to add the USER32.LIB to your ppj and the ALPHAL(WORD) directive to the compiler, then in an event (ie the click event of a command button) simply put this code:
That's all! When you click on your command button, your PC shutdown and turn off. Tested with: Win95,98 and Millenium. If work in other versions, please let me know. Thanks!
Saludos!
Jose Holzmann
I have been working a little calling API Windows functions (Gianni know) and now i can contribute with this simple example to shutdown (turn off) the computer from PowerCOBOL.
For this, first you need to add the USER32.LIB to your ppj and the ALPHAL(WORD) directive to the compiler, then in an event (ie the click event of a command button) simply put this code:
Code:
WORKING-STORAGE SECTION.
01 RETCODE PIC S9(9) COMP-5 VALUE 0.
PROCEDURE DIVISION.
CALL "ExitWindowsEx" WITH STDCALL LINKAGE
USING BY VALUE 5
BY VALUE 0
RETURNING RETCODE
Saludos!
Jose Holzmann