osk.exeが64bit版Windowsでうまく起動できないみたいですね。
noraさんのスクリプトにドロナワ式で追加してみました。
//mesboxにフォーカスがあるときにスクリーンキーボードが現れる
//inputにフォーカスが移ると消える
#include "user32.as"
#define WM_SYSCOMMAND $00000112
#define SC_MINIMIZE $0000F020
#define SC_RESTORE $0000F120
#include "kernel32.as"
#const PROCESS_TERMINATE 0x0001
onexit *owari
; 64bit OS かどうか調べる --------------
newcom oWshShell, "WScript.Shell"
ProgramFiles_86 = oWshShell("ExpandEnvironmentStrings","%ProgramFiles\(x86\)%")
delcom oWshShell
if ProgramFiles_86 != "" {
if instr(ProgramFiles_86,0,"%") == -1 {
flg_64=1
}
}
; --------------------------------------
sdim s,1000
mesbox s,300,200
hedit=objinfo(stat,2)
input a
repeat
GetFocus
if stat==hedit{
gosub *dispkey
SetForegroundwindow hwnd
}else{
gosub *hidekey
}
wait 1
loop
*dispkey
FindWindow "OSKMainClass", 0
if stat==0{
title "キーボード起動中 ちょっと待ってね"
;exec "osk.exe",16
; ↑を以下に変更 -----------------------
if flg_64 {
exec dir_win+"\\Sysnative\\cmd.exe /C start osk.exe",2
}else{
exec "osk.exe"
}
; --------------------------------------
repeat
FindWindow "OSKMainClass", 0
IsWindowVisible stat
if stat : break
wait 1
loop
title ""
}else{
FindWindow "OSKMainClass", 0
hkey=stat
IsIconic hkey
if stat{
SendMessage hkey, WM_SYSCOMMAND, SC_RESTORE, 0
}
}
return
*hidekey
FindWindow "OSKMainClass", 0
hkey=stat
IsIconic hkey
if stat==0{
FindWindow "OSKMainClass", 0
SendMessage hkey, WM_SYSCOMMAND, SC_MINIMIZE, 0
}
return
*owari
; スクリーンキーボードを終了する -----------
FindWindow "OSKMainClass", 0
if stat {
hkey=stat
pid=0 : GetWindowThreadProcessId hkey,varptr(pid)
OpenProcess PROCESS_TERMINATE, 1, pid
hProcess=stat
if hProcess {
TerminateProcess hProcess, 0
stt=stat
CloseHandle hProcess
}
}
; ------------------------------------------
end