VBScript/VB6-Dll - Use VB Forms And Controls along with The API in VBscript
Have you ever wanted to use VB Forms and Controls without using HTML stuff in VBscript?
Have you ever wanted to use, call the API in VBscript?
I will share my VB6-Dll and helper dll, it will let you use VB Forms and Controls and call the API.
Here are the Methods and Properties, look @ the .VBS files to get the details.
Register the DLL before running VBS's.
Code:
Set_Window - Setup your Gui(Window) (if X and Y = 0 Gui is centered)
Set_Control - Setup your Controls on Gui
Obj2Ptr - Get a pointer from an object
NoFocus_On - Remove focus lines on controls that have them
Show_Window - Show Gui(Window Obj)
Close_Window - Close Gui(Window Obj)
CallDll - Dynamically call a function in a DLL
PeekByte - Look @ byte data from memory location
PeekLong - Look @ long data from memory location
PeekWord - Look @ word data from memory location
PokeByte - Set byte data @ memory location
PokeLong - Set Long data @ memory location
PokeWord - Set word data @ memory location
Click - Click an object returns the pointer to the object
Index - Get VB's index object (some VB objects use and set an index)
DllActive - Return the number of open VB windows
BorderStyle - Set Gui(Window) border style
0=None,1=Fixed Single,2=Sizable,3=Fixed Dialog,4=Fixed ToolWindow,
5=Sizable ToolWindow (*Must be set before Set_Window()*)
If style is 0(none) the mouse will automatically drag the window.
vbTagColor - Set the background color property of a command button for mouse over effect
(default is RED)
To use this property set 'Tag' to True of the command button object.
If a Picture object is set for command button along with the DownPicture property,
set the 'Tag' property to a picture file name for mouse over picture.
These are the controls you can use, each one returns an object.
Forms
CommandButton
Label
PictureBox (If X,Y,W,H are 0 the picture will tile)
ListBox
TextBox
Timer
DriveListBox
DirListBox
FileListBox
ComboBox
OptionButton
CheckBox
Frame
HScrollBar
VScrollBar
MonthView
Image
Line
Shape
HUpDown
VUpDown
SSTab
ToggleButton (Is a formated CheckBox)
DTPicker
StatusBar
ProgressBar
MsFlexGrid
Slider
ListView
TreeView
ImageList
ToolBar
App
Screen
The VB6-Dll will write once (if not there) a helper Dll called "CallDll.dll" in "c:\WINDOWS\Temp".
This Dll must be there for the VB6-Dll to work.
If you need a pointer or structure(type data) for any API, just use "GlobalAlloc" and calulate the
byte data needed. Api5.vbs uses "GlobalAlloc" to setup the RECT structure, 4(long)*4(size in bytes)=16.
Code:
EXAMPLE: pRC=[obj].CallDll("Kernel32","GlobalAlloc",&h40,16) &h40=GPTR 16=RECT structure size
[obj].CallDll "User32","GetClientRect",hWnd,pRC
RECT Structure
LONG left =pRC
LONG top =pRC+4
LONG right =pRC+8
LONG bottom=pRC+12
Api5.vbs is a little jurkie, flying in space, tried to setup a back buffer (commented lines) but did
not work, so you can see with the API you just have to play with it to see what will work.
Run the .VBS files to see how it all works, and remember... have fun.
Re: VBScript/VB6-Dll - Use VB Forms And Controls along with The API in VBscript
This is all about VBscripts not VB6dll, all source for vbs is there.
If you do not want to use my VBscripts with my dll no source then
don't download it, but let people decide for themself.
If anyone wants the DLL please email me and I will send you the link.
Re: VBScript/VB6-Dll - Use VB Forms And Controls along with The API in VBscript
So why is this in the VB 6 & earlier CodeBank?
This sounds like something that is illegally packaging every VB6 control's runtime license into a DLL. There are terms in the VB6 license agreement requiring that applications "add significant functionality" which this is not doing.
If you want to write VBScript with GUIs there are better options than hanging one off the side of a WSH script. You can write HTAs or use a 3rd party script host designed for the purpose such as NSBasic/Desktop.
Re: VBScript/VB6-Dll - Use VB Forms And Controls along with The API in VBscript
Originally Posted by dilettante
So why is this in the VB 6 & earlier CodeBank?
Exactly my thought? Although, may the "& earlier" covers VBScript as well.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu. https://get.cryptobrowser.site/30/4111672
Re: VBScript/VB6-Dll - Use VB Forms And Controls along with The API in VBscript
I wouldn't think so, but there really isn't a good place for VBScript here. The closest fit would be classic ASP and client-side scripting I guess. Most desktop scripting tends to be administrative, making that an odd fit for this site though we seem to see more and more box jockeys wandering in here.
My biggest concerns would be (a.) that this offers nothing to VB developers and (b.) creating fairly simple license wrappers for VB6 components violates the license terms. I'm sure the license issue wasn't foremost in the development of this DLL, but it is an unavoidable side-effect.
It's like the registry hack people use to get an MSComm dev license to use in Excel: strictly verboten.
Re: VBScript/VB6-Dll - Use VB Forms And Controls along with The API in VBscript
I put my post in the CodeBank Other..... Hack moved it here so ask him.
My VB6 Dll exposes Com to Vbscripts, not llegal. If you know CreateObject and how it works, then making VBscripts look like VB6 very simple task.
My VB6 Dll compliments VBscripts by using VB6 Classes, again not llegal.
If you don't know VBscripts then my Dll will not help or work for you.
Re: VBScript/VB6-Dll - Use VB Forms And Controls along with The API in VBscript
VB6 controls require an embedded runtime license in applications. The only way to do that is to have a developer license, i.e. a license for VB6.
What you have done is create a "null" DLL that simply wraps the controls and containers and a set of runtime licenses for them. This violates your licensing terms for VB6.