掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
PrintScreenを無効にしたい (ID:10561)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
Delphi5を使用しています。アプリケーションのハードコピーを取らせたくない ためPrintScreenキーを無効にしたいと思っています。 SetWindowsHookExを使用してdllを作成したのですが、 DeleteやBackSpaceキーの無効化は出来たのですがPrintScreenは無効に できません。 Dll側ソース Function keyWndProc(nCode : integer; wParam : WPARAM; lParam : LPARAM):LRESULT;stdcall; begin if nCode < 0 then begin Result := CallNextHookEx(hHookCallWndProc, nCode, wParam, lParam); end else begin Result := CallNextHookEx(hHookCallWndProc, nCode, wParam, lParam); if nCode = HC_ACTION then begin Case Wparam of //ここから下に渡したくないキーを設定する。 VK_SNAPSHOT : begin Result := -1;//PrintScreenキーを無効 MessageBox(0, PChar('PrintScreenが押された'), PChar('Title'), MB_YESNO); end; VK_DELETE : Result := -1;//DELETEキーを無効 VK_NUMLOCK : Result := -1;//NUMLOCKキーを無効 VK_BACK : Result := -1; end;// Case Wparam of end;// if nCode = HC_ACTION then end; //if nCode < 0 then end; Function InstallCallWndProcHook:Boolean; var Ret:Integer; begin Result := False; Ret := SetWindowsHookEx(WH_KEYBOARD,@KeyWndProc,HInstance,0); if Ret = 0 then Exit else hHookCallWndProc := ret; Result := True; end; 環境は Win98SE + Del5Ent です。 よろしくお願いします。
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.