SetClipboardViewerでぐぐったら、
最初に見つかった↓のC言語のソースを、HSP3でやってみた
http://nienie.com/~masapico/api_SetClipboardViewer.html
#include "user32.as"
#include "kernel32.as"
#const WM_DRAWCLIPBOARD $00000308
#const WM_CHANGECBCHAIN $0000030D
#const CF_TEXT $00000001
title "クリップボード監視中・・・(TEXTデータのみ)"
txt = ""
mesbox txt, 600, 400, 5, 0 : oi_txt = stat
onexit gosub *on_exit
SetClipboardViewer hwnd
hNextWnd = stat
oncmd gosub *on_WM_DRAWCLIPBOARD, WM_DRAWCLIPBOARD
oncmd gosub *on_WM_CHANGECBCHAIN, WM_CHANGECBCHAIN
stop
*on_exit
ChangeClipboardChain hwnd, hNextWnd
end
*on_WM_DRAWCLIPBOARD
OpenClipboard hwnd
GetClipboardData CF_TEXT
hText = stat
if( hText ) {
GlobalLock hText
pText = stat
txt += strf("%s", pText) + "\n"
GlobalUnlock hText
}
CloseClipboard
if( hNextWnd ) {
sendmsg hNextWnd, WM_DRAWCLIPBOARD, wParam, lParam
}
if( hText ) {
objprm oi_txt, txt
}
return
*on_WM_CHANGECBCHAIN
if( wParam == hNextWnd ) {
hNextWnd = lParam
}
else {
if( hNextWnd ) {
sendmsg hNextWnd, WM_CHANGECBCHAIN, wParam, lParam
}
}
return