#85093 - 2002-02-07 08:14 PM
Re: Com / VBS call to inputbox
|
Alex.H
Seasoned Scripter
Registered: 2001-04-10
Posts: 406
Loc: France
|
The inputbox is internal to VB. It may be possible to call it from WSH through COM, but didn't try it
_________________________
? getobject(Kixtart.org.Signature)
|
|
Top
|
|
|
|
#85094 - 2002-02-11 04:59 AM
Re: Com / VBS call to inputbox
|
cj
MM club member
   
Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
|
Here is some com code to use the File Open dialog. It is taken from TicTacToe and may need some tweaking. You can see the KiX3.63 code commented.code:
$dlgNet=createobject("MSComDlg.CommonDialog") ; access MS Common Dialog collection ;$dlgNet=olecreateobject("MSComDlg.CommonDialog") if $dlgNet=0 color r+/n "You cannot access the MSComDlg.CommonDialog Object!" color w/n $netfile="" else ; use Dialog box $dlgNet.Filter="HTML TicTacToe Game Files|*.ttt" ;$=oleputproperty($dlgNet, "Filter", "s", "HTML TicTacToe Game Files|*.ttt") $dlgNet.FilterIndex=3 ;$=oleputproperty($dlgNet, "FilterIndex", "s", "3") $dlgNet.Filename=$netpath+"\*.ttt" ; look for all .ttt files in $netpath ;$=oleputproperty($dlgNet, "Filename", "s", $netpath+"\*.ttt") $dlgNet.DialogTitle="Connect to Network Game" ;$=oleputproperty($dlgNet, "DialogTitle", "s", "Connect to Network Game") $dlgNet.MaxFileSize=128 ;$=oleputproperty($dlgNet, "MaxFileSize", "s", "128") $dlgNet.ShowOpen() ; show the FILE OPEN dialog ;$=olecallfunc($dlgNet, "ShowOpen") $netfile=$dlgNet.filename ;$netfile=olegetproperty($dlgNet, "filename") endif
This uses the MS Common Dialogs object which, I believe, has File Open, Printing, Font Selectors and other dialogs. Perhaps one of these is a standard Input box. If you find out, please let us know  cj
|
|
Top
|
|
|
|
#85095 - 2002-02-11 05:32 AM
Re: Com / VBS call to inputbox
|
cj
MM club member
   
Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
|
|
|
Top
|
|
|
|
#85096 - 2002-02-11 02:11 PM
Re: Com / VBS call to inputbox
|
Alex.H
Seasoned Scripter
Registered: 2001-04-10
Posts: 406
Loc: France
|
Cj, The MSComDlg you used is the ocx version, comming from VB. On opposite to the MSComDlg.dll version that can only be called by API, the ocx doesn't need value given as pointer, so it can be used with Kixtart but i'm not sure it can be used on any computer : the ocx version need some special informations to be bind as a new component, and so may refuse to work on a computer that don't have Visual Basic or any part of Visual Studio v5/v6 such as Visual C++. On Visual Basic project, when you add the ocx within, the project also gains all needed information to initialize it on any computer, and so the final program.To get back on Inputbox, it's not a part of the common dialog library. Just an idea as-is : $Result=createobject("wsh.application").inputbox("This is a test","test caption") Does this work ?
_________________________
? getobject(Kixtart.org.Signature)
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|