Hey Leute,
Als erstes würde ich erstmal gerne allen hier hallo sagen. Ich hoffe einfach mal darauf dass ich hier richtig bin und ihr meine kleine Rechtschreibschwäche akzeptiert (xD)
Also nun zu meinem Problem:
Ich bin schon seit einiger Zeit mit BAT am fahren. jedoch gibts dort keine GUI...
Jetzt wollte ich mich mal dran wagen für ein etwas größeres Projekt zu arbeiten. Jedoch ist für sowas ne reine textausgabe nartürlich mist...
Nach langem suchen habe ich nur einen lösungsansatz gefunden....
Wie die Experten hier sehen können (also alle auser ich xD) wird hier halt ne Dropdpwn GUI erstellt. Das ganze läuft auch ohne HTA ab (Zum Glück...)
Das endergebnis wird halt in ner txt-datei gespeichert (Zwichenverarbeitung durch BAT)
Su nun denn...
jedoch hätte ich halt lieber ein GUI mit Buttons...
Ich will jetzt aber nartürlich nicht nen Quellcode in dem alles fertig ist... villeicht ein paar Hilfestellungen (TUTs oder sowas [hab da nach ewiger Forensuche und googeln nix gefunden...]) und/oder Codeschnipsel die mir Helfen könnten...
da ich blutiger anfänger in VBS bin seit bitte ned Böse wenn ich nicht alles Verstehe
MFG
note
Als erstes würde ich erstmal gerne allen hier hallo sagen. Ich hoffe einfach mal darauf dass ich hier richtig bin und ihr meine kleine Rechtschreibschwäche akzeptiert (xD)
Also nun zu meinem Problem:
Ich bin schon seit einiger Zeit mit BAT am fahren. jedoch gibts dort keine GUI...
Jetzt wollte ich mich mal dran wagen für ein etwas größeres Projekt zu arbeiten. Jedoch ist für sowas ne reine textausgabe nartürlich mist...
Nach langem suchen habe ich nur einen lösungsansatz gefunden....
Visual Basic-Quellcode
- Option Explicit
- Dim aOpt(4)
- aOpt(0) = "1"
- aOpt(1) = "2"
- aOpt(2) = "3"
- aOpt(3) = "4"
- aOpt(4) = "5"
- Dim objFSO, objFile, MeineVariable
- Const ForWriting = 2
- Const Create = trueSet objFSO = Wscript.CreateObject("Scripting.FileSystemObject")
- Set objFile = objFSO.OpenTextFile("tmp.txt", ForWriting, Create)
- MeineVariable = SelectBox("test", aOpt)
- objFile.WriteLine MeineVariable
- objFile.closeSet objFile = nothing
- Set objFSO = nothing
- Function SelectBox(sTitle, aOptions)
- Dim oIE, s, item
- set oIE = CreateObject("InternetExplorer.Application")
- With oIE
- .ToolBar = False : .RegisterAsDropTarget = False
- .StatusBar = False : .Navigate("about:blank")
- While .Busy : WScript.Sleep 100 : Wend
- With .document
- With .parentWindow
- if Instr(.navigator.appVersion, "MSIE 6") > 0 Then
- oIE.FullScreen = True
- End if
- oIE.width = 400 : oIE.height = 150
- oIE.left = .screen.width \ 2 - 200
- oIE.top = .screen.height\ 2 - 75
- End With ' ParentWindow
- s = "<html><head><title>" & sTitle & " " & String(80, ".") _
- & "</title></head><script language=vbs>bWait=true</script>" _
- & "<body bgColor=Silver><center><b>" & sTitle & "<b><p>" _
- & "<select id=entries size=1 style='width:250px'>" _
- & " <option selected>" & sTitle & "</option>"
- For each item in aOptions
- s = s & " <option>" & item & "</option>"
- Next
- s = s & " </select><p>" _
- & "<button id=but0 onclick='bWait=false'>OK</button>" _
- & "</center></body></html>"
- .WriteLn(s)
- With .body
- .scroll="no"
- .style.borderStyle = "outset"
- .style.borderWidth = "3px"
- End With ' Body
- .all.entries.focus
- oIE.Visible = True
- On Error Resume Next
- While .ParentWindow.bWait
- WScript.Sleep 100
- if oIE.Visible Then SelectBox = "Aborted"
- if Err Then Exit Function
- Wend ' Wait
- On Error Goto 0
- With .ParentWindow.entries
- SelectBox = .options(.selectedIndex).text
- End With
- End With ' document
- .Visible = False
- End With ' IE
- End Function
Wie die Experten hier sehen können (also alle auser ich xD) wird hier halt ne Dropdpwn GUI erstellt. Das ganze läuft auch ohne HTA ab (Zum Glück...)
Das endergebnis wird halt in ner txt-datei gespeichert (Zwichenverarbeitung durch BAT)
Su nun denn...
jedoch hätte ich halt lieber ein GUI mit Buttons...
Ich will jetzt aber nartürlich nicht nen Quellcode in dem alles fertig ist... villeicht ein paar Hilfestellungen (TUTs oder sowas [hab da nach ewiger Forensuche und googeln nix gefunden...]) und/oder Codeschnipsel die mir Helfen könnten...
da ich blutiger anfänger in VBS bin seit bitte ned Böse wenn ich nicht alles Verstehe
MFG
note