🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #713

Hook for PrtSc (PM 1.x)

#713
From: 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
Technical Details
Message-ID: <19920415.080729.973@almaden.ibm.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!vnet.ibm.com
References: <jlang.703345056@Physik.TU-Muenchen.DE>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!vnet.ibm.com
From: peterf@vnet.ibm.com (Peter Forsberg)
Message-ID: <19920415.080729.973@almaden.ibm.com>
Date: Wed, 15 Apr 92 16:56:21 SWE
Newsgroups: comp.os.os2.programmer
Subject: Hook for PrtSc (PM 1.x)
Reply-To: peterf@vnet.ibm.com
Organization: IBM Corporation
Disclaimer: This posting represents the poster's views, not those of IBM
News-Software: UReply 3.0
References: <jlang.703345056@Physik.TU-Muenchen.DE>
Lines: 24