0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

オペミス防止に特化したクリップボードビューアを作った話 (開発・公開)

0
Last updated at Posted at 2026-07-05

以下の記事で記載したクリップボードビューアの ver0.01 を公開しました。

■オペミス防止に特化したクリップボードビューアを作った話 (構想編)
https://qiita.com/ponta2026/items/da2eaab1ee82e5a090fd

■事故防止安全クリップボードビューア (Safety Clipboard Viewer)
https://github.com/ponta2026/safety-clipboard-viewer

ver0.01ですが、テキストの表示とテキスト(Unicode)以外のデータへの警告文のみです。

image.png

■ダウンロード
https://github.com/ponta2026/safety-clipboard-viewer/tree/main/build

■ソースコード

;===========================================================
; Safety Clip Board Viewer (ver0.01)
;===========================================================

#include "hspext.as"

SCREEN_X = 800
SCREEN_Y = 100

screen 0, SCREEN_X, SCREEN_Y
title "事故防止 - Safety Clibboard Viewer (v0.01)"

#uselib "user32.dll"
#func SetWindowPos "SetWindowPos" int,int,int,int,int,int,int
#func IsClipboardFormatAvailable "IsClipboardFormatAvailable" int

#const HWND_TOPMOST   -1
#const SWP_NOSIZE     $0001
#const SWP_NOMOVE     $0002
#const SWP_SHOWWINDOW $0040
#const CF_UNICODETEXT 13

hw = hwnd
SetWindowPos hw, HWND_TOPMOST, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW

viewText = ""
oldViewText = ""

gosub *draw

*main

    ;--------------------------------
    ; TEXT 判定
    ;--------------------------------
    if IsClipboardFormatAvailable(CF_UNICODETEXT) {
        clipText = ""        ; ← 文字列型として宣言
        clipget clipText     ; 
        viewText = clipText
    } else {
        viewText = "警告:テキスト(UNICODE)以外のデータです"
    }

    ;--------------------------------
    ; TEXT 以外
    ;--------------------------------
    if viewText != oldViewText {
        oldViewText = viewText
        gosub *draw
    }

    await 100
goto *main

*draw
    redraw 0
    color 46, 46, 46 : boxf 0,0,SCREEN_X, SCREEN_Y
    color 224, 224, 224 : pos 10,10 : mes viewText

    redraw 1
return

以上です。現時点では機能は限定されていますが、これからちょっとづつ機能追加していきたいと思います。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?