Results 1 to 9 of 9

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

Threaded View

  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 01:50 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width