🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.os2.programmer
2 messages
2 total messages Started by Jan Langhans Wed, 15 Apr 1992 13:37
Hook for PrtSc (PM 1.x)
#711
Author: Jan Langhans
Date: Wed, 15 Apr 1992 13:37
6 lines
834 bytes
I want to write a simple application printing a graphic hardcopy of the PM
screen. That should be comfortably triggered by pressing PrtSc, even when my
application window does not have the focus. Even equipped with all programmers
refs I was too stupid to get this done. Can anybody help me with some sample
code or so ? Any help is appreciated.
Jan Langhans.
Hook for PrtSc (PM 1.x)
#713
Author: Peter Forsberg
Date: Wed, 15 Apr 1992 16:56
24 lines
1744 bytes
In <jlang.703345056@Physik.TU-Muenchen.DE> Jan Langhans writes:
>I want to write a simple application printing a graphic hardcopy of the PM
>screen. That should be comfortably triggered by pressing PrtSc, even when my
>application window does not have the focus. Even equipped with all programmers
>refs I was too stupid to get this done. Can anybody help me with some sample
>code or so ? Any help is appreciated.
>Jan Langhans.
>

The standard way of doing something like this is to register a PM System
Input Hook (check your PM references). Basically, you write a DLL which
contains a function with predefined parameters. You then call WinSetHook
to register your hook function in PM. A good idea is to have the hook
function clear a semaphore which another thread in your program is waiting
on when the event that you're interested in occurrs (e.g. PrtSc pressed).
That way the hook will do as little work as possible (it gets called for
_every_ PM message in the system). Contact me offline if you'd like some
sample code.

Peter
--
Peter Forsberg           E-mail:  peterf@vnet.ibm.com          (primary)
                                  d88-pfo@nada.kth.se        (alternate)
Disclaimer: This posting represents the poster's views, not those of IBM
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads