LoginSignup
0
0

More than 5 years have passed since last update.

smallbasicでクリップボードアクセス

Posted at

データ取得

WC = Text.GetCharacter(34)
CRLF = Text.GetCharacter(13) + Text.GetCharacter(10)
GraphicsWindow.BackgroundColor = "yellow"
button = Controls.AddButton("caption", 300, 200)
Controls.SetButtonCaption(button, "run")
Controls.ButtonClicked = onclick
code = ""
code = code + "Function setup(a)" + CRLF
code = code + "  Set o = CreateObject(" + WC + "htmlfile" + WC + ")" + CRLF
code = code + "  setup = Trim(o.ParentWindow.ClipboardData.GetData(" + WC + "text" + WC + "))" + CRLF
code = code + "End Function" + CRLF

Sub onclick
  a = Class1.VBSrun(code)
  GraphicsWindow.ShowMessage(a, "clipboard")
EndSub

データセット

WC = Text.GetCharacter(34)
CRLF = Text.GetCharacter(13) + Text.GetCharacter(10)
GraphicsWindow.BackgroundColor = "yellow"
button = Controls.AddButton("caption", 300, 200)
Controls.SetButtonCaption(button, "run")
Controls.ButtonClicked = onclick
code = ""
code = code + "Function setup(a)" + CRLF
code = code + "  Set o = CreateObject(" + WC + "htmlfile" + WC + ")" + CRLF
code = code + "  o.parentWindow.clipboardData.setData " + WC + "text" + WC + "," + WC + "クリップボードに入れてみるよ" + WC + CRLF
code = code + "setup = " + WC + "ok" + WC + CRLF
code = code + "End Function" + CRLF

Sub onclick
  a = Class1.VBSrun(code)
  GraphicsWindow.ShowMessage(a, "clipboard")
EndSub

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