VBScript/VB6-Dll - Use VB Forms And Controls along with The API in VBscript-VBForums
Results 1 to 9 of 9

Thread: VBScript/VB6-Dll - Use VB Forms And Controls along with The API in VBscript

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2011
    Posts
    3

    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.
    Attached Files Attached Files
    Last edited by xroot; Dec 20th, 2011 at 12:50 PM.

  2. #2
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,334

    Re: VBScript/VB6-Dll - Use VB Forms And Controls along with The API in VBscript

    Quote Originally Posted by xroot View Post
    I will share my VB6-Dll and helper dll
    Then do not post the DLLs - no compiled files are allowed.

    If you wish to share your DLLs post the source code in an attachement that is attached to a post on this site (not to a zip file on another site).
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2011
    Posts
    3

    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.

  4. #4
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,334

    Re: VBScript/VB6-Dll - Use VB Forms And Controls along with The API in VBscript

    Then attachment the zip file to a post on this site.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  5. #5
    PowerPoster
    Join Date
    Feb 2006
    Posts
    11,012

    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.

  6. #6
    Web developer Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    12,437

    Re: VBScript/VB6-Dll - Use VB Forms And Controls along with The API in VBscript

    Quote Originally Posted by dilettante View Post
    So why is this in the VB 6 & earlier CodeBank?
    Exactly my thought? Although, may the "& earlier" covers VBScript as well.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    Please consider giving me some rep points if I help you a lot.
    Links to my code examples can now be found on my website: My websites
    Please rate my post if you find it helpful!
    Technology is a dangerous thing in the hands of an idiot! I am that idiot.

  7. #7
    PowerPoster
    Join Date
    Feb 2006
    Posts
    11,012

    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.

  8. #8

    Thread Starter
    New Member
    Join Date
    Dec 2011
    Posts
    3

    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.

  9. #9
    PowerPoster
    Join Date
    Feb 2006
    Posts
    11,012

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.