Automatic PrintScreen

Subject:  Re: [OT] PrintScreen key

Jerry,
even if fiddling with the registry would do the job (which it doesn't
AFAIK) I wouldn't consider it to be a good idea. What happens if you modify
the registry or whatever system setting "temporarily, of course", and
someboy simply switches the computer off or the app goes down for some
other reason without any chance to restore the original setting? This
reasoning goes for *any* modification of semi-permanent system settings.

The propery solution might go along the following lines:
Leave the print screen function untouched, i.e. have ALT+PrtSc fill the
clipboard.
Install a notification for clipboard changes using
SetClipboardViewer(MyForm.Handle); for further details, see "Clipboard
Functions" in Win32.hlp
Then, if the clipboard content changes, your app will get a
WM_DRAWCLIPBOARD msg. Write a message handler which only acts upon those
changes if a) your app is active, and b) your app recognized a ALT+PrtSc
keypress right before getting the WM_DRAWCLIPBOARD message:

var ALTPrtScPressed: Boolean;
 

procedure TMyForm.WMDrawClipboard(var Msg: TMessage);
begin
  if not Application.Active then Exit;  // somebody else is pasting to the
clipboard
  if not ALTPrtScPressed then Exit;
  // get Clipboard contents, and print them
end

procedure TMyForm.WMKeyDown(...);
begin
  AltPrtScPressed := (Alt in Shift) and (Key = VK_PRTSC);
end;

------------------------------------
Hope [this] helps
Arne Schäpers
At 07:56 06.10.98 -0500, you wrote:
>This is off topic (but may not be if there are no easy answers!)
>
>I have a client who wants to print to the default local printer when the
>Print screen key is pressed rather than to the clipboard.
>
>Anyone know of an easy way to do this (in the registry maybe) or in the
>config settings?