【HSP3】VOICEROID+ 結月ゆかりを使用してHSPからしゃべらせるサンプル。V2

VOICEROID+ 結月ゆかり を使用してHSPからしゃべらせるサンプル。(作り途中) VOICEROID+ 結月ゆかり が別途必要。 http://www.amazon.co.jp/gp/product/B006GGRTZ6?ie=UTF8&tag=inovia2004-22&linkCode=shr&camp=1207&creative=8411&creativeASIN=B006GGRTZ6&redirect=true&ref_=s9_simh_gw_p65_d0_g65_i2 テキストの消去を切り取りで代用。

VOICEROID+ 結月ゆかり を使用してHSPからしゃべらせるサンプル。(作り途中) VOICEROID+ 結月ゆかり が別途必要。 http://www.amazon.co.jp/gp/product/B006GGRTZ6?ie=UTF8&tag=inovia2004-22&linkCode=shr&camp=1207&creative=8411&creativeASIN=B006GGRTZ6&redirect=true&ref_=s9_simh_gw_p65_d0_g65_i2 テキストの消去を切り取りで代用。

#include "user32.as"
#include "kernel32.as"
// ↓使
// http://lldev.jp/hsp/module/clipboard_text.html
#include "modClipboardText.hsp"
#module __AttachThread__
//
#defcfunc GetFocus2
GetForegroundWindow
GetWindowThreadProcessId stat, 0
ttid = stat
GetCurrentThreadId
ctid = stat
AttachThreadInput ctid, ttid, 1
GetFocus
h = stat
AttachThreadInput ctid, ttid, 0
return h
//
#deffunc SetFocus2 int _h
GetWindowThreadProcessId _h, 0
ttid = stat
GetCurrentThreadId
ctid = stat
AttachThreadInput ctid, ttid, 1
SetFocus _h
AttachThreadInput ctid, ttid, 0
return
/*
#deffunc ShowWindow2 int h, int f
ShowWindow h, f
return
#deffunc IsWindow2 int _h
IsWindow h
return stat
*/
#global
#module __VOICEROID__
// 調
#defcfunc GetRunningNumV
h = 0 : c = 0
repeat
FindWindowExA 0, h, "TkTopLevel", "VOICEROID "
h = stat
if h == 0 : c = cnt : break // 0
loop
return c
//
#defcfunc GetTopWindowV
FindWindowA "TkTopLevel", "VOICEROID "
return stat
//
#deffunc GetTextBoxV
FindWindowExA GetTopWindowV(), 0, "TkChild", 0
hChild = stat
FindWindowExA hChild, 0, "TkChild", 0 //
FindWindowExA hChild, stat, "TkChild", 0 // 2
FindWindowExA hChild, stat, "TkChild", 0 // 3
hGrandchild = stat
return
//
#deffunc TextAllSelectV
sendmsg GetTopWindowV(), 0x0111/*WM_COMMAND*/, 60, 0
return
//
#deffunc TextPasteV
sendmsg GetTopWindowV(), 0x0111/*WM_COMMAND*/, 56, 0
return
//
#deffunc TextDeleteV
keybd_event 46, 0, 0, 0 // DEL // 8
keybd_event 46, 0, 2, 0 // DEL
return
// ()
#deffunc TextDelete2V
sendmsg GetTopWindowV(), 0x0111/*WM_COMMAND*/, 52, 0
return
// ()
#deffunc SetText2V str _s
s = _s
//
nowHwnd = GetFocus2()
//
SetFocus2 GetTopWindowV()
//
TextAllSelectV
TextDelete2V
wait 1 //
//
setcbtext s
//
TextPasteV
//
SetFocus2 nowHwnd
return
//
#deffunc PlayTextV
FindWindowExA GetTopWindowV(), 0, "TkChild", 0
hChild = stat
FindWindowExA hChild, 0, "TkChild", 0 //
FindWindowExA hChild, stat, "TkChild", 0 // 2
hGrandchild = stat
FindWindowExA hGrandchild, 0, "Button", 0 // 2()
FindWindowExA hGrandchild, stat, "Button", 0 // 22
FindWindowExA hGrandchild, stat, "Button", 0 // 23
FindWindowExA hGrandchild, stat, "Button", 0 // 24
FindWindowExA hGrandchild, stat, "Button", 0 // 25
hTarget = stat
/*
mes strf("0x%08X", hTarget)
SetFocus2 hTarget
SetForegroundWindow hTarget
mes stat
*/
;PostMessageA hTarget, 0x0006/*WM_ACTIVATE*/, 1, 0
//SendMessageA hTarget, 0x00F5/*BM_CLICK */, 0, 0
;PostMessageA hTarget, 0x0201/*WM_LBUTTONDOWN */, 0x0001, 0x0017003D
;PostMessageA hTarget, 0x0200/*WM_MOUSEMOVE*/, 0x0001, 0x0017003D
;PostMessageA hTarget, 0x0203/*WM_LBUTTONUP */, 0x0000, 0x0017003D
PostMessageA hTarget, 0x0000/*WM_NULL*/, 0x0000, 0x00000000 //
return
#deffunc StopTextV
FindWindowExA GetTopWindowV(), 0, "TkChild", 0
hChild = stat
FindWindowExA hChild, 0, "TkChild", 0 //
FindWindowExA hChild, stat, "TkChild", 0 // 2
hGrandchild = stat
FindWindowExA hGrandchild, 0, "Button", 0 // 2()
FindWindowExA hGrandchild, stat, "Button", 0 // 22
FindWindowExA hGrandchild, stat, "Button", 0 // 23
FindWindowExA hGrandchild, stat, "Button", 0 // 24
hTarget = stat
PostMessageA hTarget, 0x0000/*WM_NULL*/, 0x0000, 0x00000000 //
return
#global
//
// 1
if GetRunningNumV() > 0 {
SetText2V ""
PlayTextV
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX