動画上に描画しようと思ったらウィンドウを分けて重ねないと無理っぽいですね。
http://hsp.tv/play/pforum.php?mode=pastwch&num=59585
http://hsp.tv/play/pforum.php?mode=pastwch&num=16106
ただ、今ですと背景透過子ウィンドウをレイヤーとして重ねても良いと思います。
子ウィンドウの背景透過はWindows8以降が対象です。
また、マニフェストにプログラムがWindows8以降の機能に対応していることを明記しないといけません。
ということで、以下のスクリプトを下記手順で実行してみてください。
1. 一度だけ、F5で実行してください。スクリプトファイルと同じ場所にmanifest.txtが保存されます。
2. Ctrl+F9で実行ファイル自動作成をしてください。
3. 「動画に描画実験.exe」を実行してください。
マニフェストの書き換えは実行ファイルを作成するときにしかできません。
F5(実行)のデバッグ時には上手く動作しないので注意してください。
// Windows8以降で動作
// 1. 一度だけ、F5で実行してください。スクリプトファイルと同じ場所にmanifest.txtが保存されます。
// 2. Ctrl+F9で実行ファイル自動作成をしてください。
// 3. 動画に描画実験.exeを実行してください。
#packopt name "動画に描画実験"
#packopt manifest "manifest.txt"
gosub *saveManifest_debugMode //マニフェストファイルを保存する(デバッグ時のみ)
#include "user32.as"
#define GWL_EXSTYLE -20 ;拡張ウィンドウスタイル
#define WS_EX_LAYERED $80000 ;レイヤードウィンドウにする
#define WS_EX_TRANSPARENT $20 ;マウスイベントの透過(ウィンドウをクリックしたことにならず、その下のウィンドウをクリックしたことになる)
#define LWA_COLORKEY 1 ;設定した色を透明にしてウィンドウを描画
#define LWA_ALPHA 2 ;設定した透明度でウィンドウを半透明に描画
#define SWP_NOSIZE 0x0001
#define SWP_NOMOVE 0x0002
#define SWP_NOZORDER 0x0004
#define SWP_NOACTIVATE 0x0010
#define SWP_FRAMECHANGED 0x0020
#define ctype RGB(%1, %2 ,%3) (%1 | %2 << 8 | %3 << 16 )
screen 0
hw(0)=hwnd
;mciで再生
dialog "mpg;*.avi;*.wmv;*.asf;*.3gp;*.mp4;*.flv",16,"動画など"
//↑環境依存
if stat=0:end //未選択時に終了
x=0:y=0:ax=640:ay=480 //動画の左上座標、動画サイズ
fname=refstr //ファイル名を代入
mci "open \""+fname+"\" alias f"
if stat=-1 : dialog "Open err":end //オープンエラー
mci "window f handle "+hw(0) //ウィンドウハンドルをMCIに送信
mci "put f destination at "+x+" "+y+" "+ax+" "+ay //ウィンドウに貼り付け
mci "play f"
bgscr 1, ginfo_sx,ginfo_sy,0,0,0
hw(1) = hwnd
color 1,1,1 : boxf : font "MS ゴシック",32,1
SetParent hw(1), hw(0) ;screen 0 の子ウィンドウにする
GetWindowLong hw(1), GWL_EXSTYLE
SetWindowLong hw(1), GWL_EXSTYLE, stat | WS_EX_LAYERED | WS_EX_TRANSPARENT ;拡張ウィンドウスタイルに WS_EX_LAYERED | WS_EX_TRANSPARENT を追加
SetLayeredWindowAttributes hw(1), RGB(1,1,1), 0, LWA_COLORKEY ;背景透過
comment_px = 600 ;コメント位置
repeat
redraw 0
color 1,1,1 :boxf :color 200,200,200
comment_px -= 2
pos comment_px,200
mes "コメント"
redraw 1
wait 1
loop
stop
//デバッグモード時にmanifest.txtを保存する
*saveManifest_debugMode
#ifdef _debug
//デバッグモード
manifest = {"<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="X86"
name="OnionSoftware.hsp3.exe"
type="win32"
/>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
</application>
</compatibility>
<description>XPStyle</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
"}
notesel manifest
notesave "manifest.txt"
#endif
return
【参考】
Windows 8 で可能になった半透明子ウィンドウ (フェンリル | デベロッパーズブログ)
https://blog.fenrir-inc.com/jp/2012/10/window8_layered_window_.html