Problem:
This sample show how to trap Function Keys events - F3 & F10 in this sample - before Windows does. This is achieved by sub-classing the object (e.g. entry field) where the F10 or F3 should be intercepted.
***This demo can also be used to trap any keys, not only Function keys.
Resolution:
INTRODUCTION
==========
Pressing the F10 function key activates the menu and F3 function key to exit screen in Windows. This sample show how to trap these events before Windows does. This is achieved by sub-classing the object (e.g. entry field) where the F10 or F3 should be intercepted.
***This demo can also be used to trap any keys, not only Function keys.
SOURCE FILES:
==========
Program Files Description
------------------- -----------------------------------------------------------
NewSet.cbl Program generated by the Dialog System
Wizard sc.cbl Sub-class program
Copy Files:
------------------- -----------------------------------------------------------
NewSet.cpy Copybook generated by Dialog System
DS-CNTRL.MF Via $COBCPY
P2CEVENT.CPY Via $COBCPY
KEYS.CPY Via $COBCPY
DS-CALL.CPY Via $COBCPY
OPERATION:
========
1. Load TrapF10F3.app into Net Express
2. Click Project > Update All Dependencies
3. Click Project > Rebuild All
4. Click Animate > Run (or F5 or click on the Running-man button)
5. Place the cursor in the first entry field (Sub-classed EF)
6. Press the F10 function key -> a message box will pop up
7. Place the cursor in the second entry field (Regular EF)
8. Press the F10 function key -> the menu will be activated
9. Place the cursor in the first entry field (Sub-classed EF)
10. Press the F3 function key -> a message box will pop up
11. Place the cursor in the second entry field (Regular EF)
12. Press the F3 function key -> the application will stop
NOTE:
====
This sample was originally written by development back in Net Express v3.0, and it has been refined by Micro Focus SupportLine engineer under v3.1 and v4.0.
==========================================================
Keywords: demonstration, sample, example, demo, Dialog System, trapF10F3.zip
demo.ex
demo.ne