0

I need to change icon on left corner to atts.ico.

I tried

message=InputBox("ATTS","atts.ico","Enter text to speech.")

But it didn't work...

T2D
  • 13
  • 4
  • Didn't you a [similar question yesterday](https://stackoverflow.com/q/74876927/692942) except it was `Msgbox()` not `InputBox()`? The [same answer](https://stackoverflow.com/questions/74876927/how-to-change-top-left-icon-in-vbscript#comment132139802_74876927) applies - "You can't, `InputBox()` does not support custom icons. See [`InputBox` Function](https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/scripting-articles/3yfdhzk5(v=vs.84)).". – user692942 Dec 22 '22 at 13:04
  • 2
    You can make it look the way you want if you change your script to an HTA. The change is particularly beneficial if you are prompting for more than one input (or want to provide options via dropdown menus, checkboxes, or radio buttons). – LesFerch Dec 22 '22 at 13:43
  • Does this answer your question? [Pass two lines of text into InputBox](https://stackoverflow.com/a/24110507) – user692942 Dec 22 '22 at 15:27

1 Answers1

0

Refer to this link Multiline inputbox via HTA written by omegastripes

Just change the path to your icon in this line on this vbscript below : %windir%\system32\notepad.exe and give a test for it


dim completed,INPUT

INPUT=inputboxml("Enter text:", "Multiline inputbox via HTA", "default" & vbcrlf & vbtab & "multiline" & vbcrlf & "text")
CreateObject("SAPI.spVoice").speak INPUT

function inputboxml(prompt, title, defval)
  set window = createwindow()
  completed = 0
  defval = replace(replace(replace(defval, "&", "&amp;"), "<", "&lt;"), ">", "&gt;")
  with window
    with .document
      .title = title
      .body.style.background = "buttonface"
      .body.style.fontfamily = "consolas, courier new"
      .body.style.fontsize = "8pt"
      .body.innerhtml = "<div><center><nobr>" & prompt & "</nobr><br><br></center><textarea id='hta_textarea' style='font-family: consolas, courier new; width: 100%; height: 580px;'>" & defval & "</textarea><br><button id='hta_cancel' style='font-family: consolas, courier new; width: 85px; margin: 10px; padding: 3px; float: right;'>Cancel</button><button id='hta_ok' style='font-family: consolas, courier new; width: 85px; margin: 10px; padding: 3px; float: right;'>OK</button></div>"
    end with
    .resizeto 700, 700
    .moveto 300, 50
  end with
  window.hta_textarea.focus
  set window.hta_cancel.onclick = getref("hta_cancel")
  set window.hta_ok.onclick = getref("hta_ok")
  set window.document.body.onunload = getref("hta_onunload")
  do until completed > 0
    wscript.sleep 10
  loop
  select case completed
  case 1
    inputboxml = ""
  case 2
    inputboxml = ""
    window.close
  case 3
    inputboxml = window.hta_textarea.value
    window.close
  end select
end function

function createwindow()
    rem source http://forum.script-coding.com/viewtopic.php?pid=75356#p75356
    dim signature, shellwnd, proc
    on error resume next
    signature = left(createobject("Scriptlet.TypeLib").guid, 38)
    do
    set proc = createobject("WScript.Shell").exec("mshta ""about:<head><script>moveTo(-32000,-32000);</script><hta:application id=app border=dialog minimizebutton=no maximizebutton=no scroll=no showintaskbar=yes contextmenu=no selection=yes innerborder=no icon=""%windir%\system32\notepad.exe""/><object id='shellwindow' classid='clsid:8856F961-340A-11D0-A96B-00C04FD705A2'><param name=RegisterAsBrowser value=1></object><script>shellwindow.putproperty('" & signature & "',document.parentWindow);</script></head>""")
    do
      if proc.status > 0 then exit do
      for each shellwnd in createobject("Shell.Application").windows
        set createwindow = shellwnd.getproperty(signature)
        if err.number = 0 then exit function
        err.clear
      next
    loop
  loop
end function

sub hta_onunload
  completed = 1
end sub

sub hta_cancel
  completed = 2
end sub

sub hta_ok
  completed = 3
end sub
user692942
  • 16,398
  • 7
  • 76
  • 175
Hackoo
  • 18,337
  • 3
  • 40
  • 70