Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all 1501 articles
Browse latest View live

Floating Desktop Date

$
0
0
Sits on desktop and features week of year and day of year as well as the date and day. Plus 4 form styles. Fairly simple and straight forward.
Attached Images
 
Attached Files

Send Picture

$
0
0
Attached is a Remote Picture Viewer. It is designed to allow you to post pictures to a remote computer. The Receiver is essentially the Picture Viewer here:
https://www.vbforums.com/showthread....3-Image-Viewer
with TCP capabilities. It uses SimpleSock as a module and class module in order to limit the files needed to be installed.

The Sender on the other hand uses my SimplSock Control, simply to demonstrate that the two are essentially the same. To use the module and class module in the Sender program rather than the control, add the two to the program and remove the control. Then uncomment the following 2 lines:
Code:

'Dim WithEvents mSocket As SimpleSock
'Set mSocket = New SimpleSock

Then remove SimpleSockCTL from the Components list and compile or run.

In order for the Sender to connect to a Receiver, the Receiver should have a static IP address or use a registered domain name. For test purposes, "localhost" & "127.0.0.1" have been added to the combo box. They are the same thing, as I believe that "localhost" is included in all default "hosts" files. If you need to use IPv6, the IPvFlg must be set to 6. This goes for both programs. The default is 4.

When the dropdown arrow on the combo box is clicked, it closes any current connection. When an item in the dropdown list is clicked, a connection is attempted to that address. Success or failure is reflected in the bottom status bar after a one second delay. Once connected, the timer interval is changed to 30 seconds. The purpose of this interval is to allow a reconnection if the connection is broken or changed to a different destination.

Once an image is received, clicking on the image causes the window to disappear. It does not appear on the task bar, and if you look for it with the Task Manager, you will find it in with the Background Processes. Because there is no active window in this state, the only way to terminate the program is to use the Task Manager, or send another image to allow the program to be exited normally. If you want the program to start as a background process, change the form "Visible" property to False.

J.A. Coutts
Attached Files

TaskbarButton Progress

$
0
0
Lightweight, no typelib used just DispCallFunc() hacking.

Requires Windows 7 or later, but the manifest is optional. Works in the IDE but uses subclassing so be cautious.

Demo client Form included:

Code:

Option Explicit

Private Const PROG_TOTAL As Long = 500

Private ProgCompleted As Long
Private WithEvents TaskbarList3 As TaskbarList3

Private Sub Command1_Click()
    TaskbarList3.SetProgressState TBPF_NORMAL
    Command1.Enabled = False
    Timer1.Enabled = True
End Sub

Private Sub Form_Initialize()
    'Could also do this in a Form_Load event handler instead:
    Set TaskbarList3 = New TaskbarList3
    TaskbarList3.ConnectFormToShell32 Me
End Sub

Private Sub Form_Unload(Cancel As Integer)
    'Redundant since we are unloading anyway.  But normally you'd do this once
    'the action's indicated progress has completed, so we'll show it here:
    With TaskbarList3
        If .Connected Then .SetProgressState TBPF_NOPROGRESS
    End With
End Sub

Private Sub TaskbarList3_Connected()
    Command1.Enabled = True
End Sub

Private Sub Timer1_Timer()
    With TaskbarList3
        If .Connected Then 'Redundant test here, because to get here the Connected
                          'event has been raised so that Command1 got enabled so that
                          'the user could have pressed it so that Timer1 got enabled.
            ProgCompleted = ProgCompleted + 1
            If ProgCompleted > PROG_TOTAL Then ProgCompleted = 0
            .SetProgressValue ProgCompleted, PROG_TOTAL
        End If
    End With
End Sub

Run the demo. Click on Start and watch the Taskbar button. Even works minimized.

You can pause it or mark it "error" and so on as well.
Attached Files

ucListPlus (ListBox, ComboBox, Menu, Autocomplete TextBox)

$
0
0
Hi guys, here is my latest hobby, it is a multipurpose usercontrol, it fulfills the function of a list and tries to fulfill the function of almost everything that is a simple list, ListBox, ComboBox, Menu, Dropdown List, Autocomplete Textbox, The The novelty is that it adds several extras and aesthetic changes, such as rounded edges, shadows, custom items, support for Png and standard images, rounded corners and color changes can be applied to the images in the case of vector images (PNG), item groups, separator bars, filter and subtext. Perhaps it is necessary to correct or add things, whoever is interested can leave their comment or suggestion
Attached Images
   
Attached Files

Simple Progress Bar

$
0
0
Here is a simple progress bar using a Label control.

Form contains 1 Command button (Command1), 1 Timer (Timer1),
and 1 label (PBar):
Alignment = 2 - Center
Appearance = 0 - Flat
BackColor = (your choice)
BackStyle = 1 - Opaque
BorderStyle = 1 Fixed single
Caption = {blank)
Height = 255
Left = 0
Width = 15
Code:

Option Explicit

Dim PBarInc As Long

Private Sub Command1_Click()
    PBar.Top = Me.ScaleHeight - PBar.Height 'Position at bottom of form
    PBarInc = Me.ScaleWidth / 100 'Determine increment using form width
    PBar.Caption = "Loading"
    Timer1.Enabled = True 'Start
End Sub

Private Sub Timer1_Timer()
    PBar.Width = PBar.Width + PBarInc
    If PBar.Width >= Me.ScaleWidth Then
        Timer1.Enabled = False
        PBar.Width = 0
    End If
End Sub

A Label control will not overlay nongraphical controls such as CommandButton, Checkbox, or ListBox, but can overlay another Label control or graphic object. The download shows the PBar being used over a Status bar Label.

J.A. Coutts
Attached Files

HSlider - Small slider control

$
0
0
Inspired by things like the volume slider in the YouTube web page video player UI. Plenty of ways it could be customized.

Good for things like putting a volume slider into toolbars, statusbars, etc.

Min/Max and Value can be negative, but Min must always be less than Max. Max less than Min could be handled too, but I didn't bother to add that.
Attached Files

Create Controls Name

Slider by Ken

$
0
0
A simple slider control. Nothing fancy , but maybe it can be useful. See what you think of it. Enjoy.
Attached Images
 
Attached Files

Find In Files

$
0
0
Like many programmers, I have a large collection of source code. I wrote this to ease
searching for text in vb files.

The file display uses Scintilla, so if you don't have SciLexer.dll here is the Url to get it.
https://www.vbforums.com/showthread....64#post5527764

Put the scilexer.dll where LoadLibrary can find it, depending on your OS.

To get started, click the button opposite 'Path to Search' to set the search path
then enter desired wild cards, I use *.frm;*.bas;*.cls;*.ctl
then enter a search term and press return

The ini class will remember all the combo box items for next use
Happy coding!
Attached Files

Mirage Source 5

$
0
0
Name:  3uA6SEY.png
Views: 128
Size:  34.4 KB

An open source VB6 gaming engine which uses DirectX 8 and flat file storage. This engine was incredibly popular back in the early 2000's and spawned a whole community of game developers, including PlayerWorlds which had it's own game section on OnRPG.

Mirage Source 5 has updated the entire code and improved the networking system. This particular version includes seamless scrolling maps.

Source: https://sourceforge.net/projects/mirage-source-5/

MS Discord: https://discord.gg/MXtY3gV5H7
Attached Images
 

Simple Usercontrol Assistant

$
0
0
This is not ,by far, a complete and error free app. It will help in developing the properties for a control . Knowledge on usercontrols is still needed though. Feel free to use and improve on it. Enjoy
Updated: Added an extra button to just create the font and forecolor properties. Also selected text stays highlighted now.
Attached Images
 
Attached Files

ClsComDlg.cls【VB6 api for comdlg32.dll without COMDLG32.OCX】

$
0
0
Code:

'in form1
Private Sub Command1_Click()
Dim A As ClsComDlg
Set A = New ClsComDlg
A.ShowColorFlags = cdlCCFullOpen Or cdlCCRGBInit
A.Color = vbYellow
A.ShowColor (Me.hWnd)
Me.BackColor = A.Color

End Sub

ClsComDlg.cls :

Code:

Option Explicit
Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
Private Declare Function GetSaveFileName Lib "comdlg32.dll" Alias "GetSaveFileNameA" (pOpenfilename As OPENFILENAME) As Long
Private Declare Function ChooseColor Lib "comdlg32.dll" Alias "ChooseColorA" (pChoosecolor As CHOOSECOLORS) As Long
Private Declare Function CommDlgExtendedError Lib "comdlg32.dll" () As Long
Private Declare Function GetShortPathName Lib "KERNEL32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
Private Declare Function ChooseFont Lib "comdlg32.dll" Alias "ChooseFontA" (pChoosefont As CHOOSEFONTS) As Long
Private Declare Function PrintDlg Lib "comdlg32.dll" Alias "PrintDlgA" (pPrintdlg As PRINTDLGS) As Long
Private Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Long, ByVal hDC As Long) As Long
Private Const LF_FACESIZE = 32
Private Type OPENFILENAME
    nStructSize As Long
    hwndOwner As Long
    hInstance As Long
    sFilter As String
    sCustomFilter As String
    nCustFilterSize As Long
    nFilterIndex As Long
    sFile As String
    nFileSize As Long
    sFileTitle As String
    nTitleSize As Long
    sInitDir As String
    sDlgTitle As String
    Flags As Long
    nFileOffset As Integer
    nFileExt As Integer
    sDefFileExt As String
    nCustDataSize As Long
    fnHook As Long
    sTemplateName As String
End Type
Private Type CHOOSECOLORS
    lStructSize As Long
    hwndOwner As Long
    hInstance As Long
    rgbResult As Long
    lpCustColors As String
    Flags As Long
    lCustData As Long
    lpfnHook As Long
    lpTemplateName As String
End Type
Private Type LOGFONT
    lfHeight As Long
    lfWidth As Long
    lfEscapement As Long
    lfOrientation As Long
    lfWeight As Long
    lfItalic As Byte
    lfUnderline As Byte
    lfStrikeOut As Byte
    lfCharSet As Byte
    lfOutPrecision As Byte
    lfClipPrecision As Byte
    lfQuality As Byte
    lfPitchAndFamily As Byte
    lfFaceName(LF_FACESIZE) As Byte
End Type
Private Type CHOOSEFONTS
    lStructSize As Long
    hwndOwner As Long ' caller's window handle
    hDC As Long ' printer DC/IC or NULL
    lpLogFont As Long ' ptr. to a LOGFONT struct
    iPointSize As Long ' 10 * size in points of selected font
    Flags As Long ' enum. private Type flags
    rgbColors As Long ' returned text color
    lCustData As Long ' data passed to hook fn.
    lpfnHook As Long ' ptr. to hook function
    lpTemplateName As String ' custom template name
    hInstance As Long ' instance handle of.EXE that
    lpszStyle As String ' return the style field here
    nFontType As Integer ' same value reported to the EnumFonts
    MISSING_ALIGNMENT As Integer
    nSizeMin As Long ' minimum pt size allowed &
    nSizeMax As Long ' max pt size allowed if
End Type
Private Const CF_INITTOLOGFONTSTRUCT = &H40&
Private Type PRINTDLGS
    lStructSize As Long
    hwndOwner As Long
    hDevMode As Long
    hDevNames As Long
    hDC As Long
    Flags As Long
    nFromPage As Integer
    nToPage As Integer
    nMinPage As Integer
    nMaxPage As Integer
    nCopies As Integer
    hInstance As Long
    lCustData As Long
    lpfnPrintHook As Long
    lpfnSetupHook As Long
    lpPrintTemplateName As String
    lpSetupTemplateName As String
    hPrintTemplate As Long
    hSetupTemplate As Long
End Type
Public Enum FileFlags
    cdlOFNAllowMultiselect = &H200
    cdlOFNCreatePrompt = &H2000
    cdlOFNExplorer = &H80000
    cdlOFNExtensionDifferent = &H400
    cdlOFNFileMustExist = &H1000
    cdlOFNHelpButton = &H10
    cdlOFNHideReadOnly = &H4
    cdlOFNLongNames = &H200000
    cdlOFNNoChangeDir = &H8
    cdlOFNNoDereferenceLinks = &H100000
    cdlOFNNoLongNames = &H40000
    cdlOFNNoReadOnlyReturn = &H8000
    cdlOFNNoValidate = &H100
    cdlOFNOverwritePrompt = &H2
    cdlOFNPathMustExist = &H800
    cdlOFNReadOnly = &H1
    cdlOFNShareAware = &H4000
End Enum
Public Enum PrintFlags
    cdlPDAllPages = &H0
    cdlPDCollate = &H10
    cdlPDDisablePrintToFile = &H80000
    cdlPDHelpButton = &H800
    cdlPDHidePrintToFile = &H100000
    cdlPDNoPageNums = &H8
    cdlPDNoSelection = &H4
    cdlPDNoWarning = &H80
    cdlPDPageNums = &H2
    cdlPDPrintSetup = &H40
    cdlPDPrintToFile = &H20
    cdlPDReturnDC = &H100
    cdlPDReturnDefault = &H400
    cdlPDReturnIC = &H200
    cdlPDSelection = &H1
    cdlPDUseDevModeCopies = &H40000
End Enum
Public Enum ColorFlags
    cdlCCFullOpen = &H2
    cdlCCShowHelpButton = &H8
    cdlCCPreventFullOpen = &H4
    cdlCCRGBInit = &H1
End Enum
Public Enum FontFlags
    cdlCFANSIOnly = &H400
    cdlCFApply = &H200
    cdlCFBoth = &H3
    cdlCFEffects = &H100
    cdlCFFixedPitchOnly = &H4000
    cdlCFForceFontExist = &H10000
    cdlCFHelpButton = &H4
    cdlCFLimitSize = &H2000
    cdlCFNoFaceSel = &H80000
    cdlCFNoSimulations = &H1000
    cdlCFNoSizeSel = &H200000
    cdlCFNoStyleSel = &H100000
    cdlCFNoVectorFonts = &H800
    cdlCFPrinterFonts = &H2
    cdlCFScalableOnly = &H20000
    cdlCFScreenFonts = &H1
    cdlCFTTOnly = &H40000
    cdlCFWYSIWYG = &H8000
End Enum
Private FileDialog As OPENFILENAME
Private ColorDialog As CHOOSECOLORS
Private FontDialog As CHOOSEFONTS
Private PrintDialog As PRINTDLGS
Private bCanceled As Boolean
Private tFontName As String
Private tFontBold As Boolean
Private tFontItalic As Boolean
Private tFontUnderline As Boolean
Private tFontStrike As Boolean
Private tFontSize As Long
Private tFontCharSet As Byte
Private tFontColor As Long
Public Sub ShowOpen(ByVal hWnd As Long)
    Dim ret As Long
   
    If FileDialog.sDlgTitle = "" Then FileDialog.sDlgTitle = "打开"
    FileDialog.nStructSize = Len(FileDialog)
    FileDialog.hwndOwner = hWnd
    FileDialog.sFileTitle = Space$(2048)
    FileDialog.nTitleSize = Len(FileDialog.sFileTitle)
    FileDialog.sFile = FileDialog.sFile & Space$(2047) & Chr$(0)
    FileDialog.nFileSize = Len(FileDialog.sFile)
   
    ret = GetOpenFileName(FileDialog)
    If ret Then
        bCanceled = False
    Else
        bCanceled = True
    End If
End Sub
Public Sub ShowSave(ByVal hWnd As Long)
    Dim ret As Long
   
    If FileDialog.sDlgTitle = "" Then FileDialog.sDlgTitle = "另存为"
    FileDialog.nStructSize = Len(FileDialog)
    FileDialog.hwndOwner = hWnd
    FileDialog.sFileTitle = Space$(2048)
    FileDialog.nTitleSize = Len(FileDialog.sFileTitle)
    FileDialog.sFile = Space$(2047) & Chr$(0)
    FileDialog.nFileSize = Len(FileDialog.sFile)
   
'    If FileDialog.Flags = 0 Then
'        FileDialog.Flags = OFS_FILE_SAVE_FLAGS
'    End If
    ret = GetSaveFileName(FileDialog)
    If ret Then
        bCanceled = False
    Else
        bCanceled = True
    End If
End Sub
Public Sub ShowColor(ByVal hWnd As Long)
    Dim customcolors() As Byte ' dynamic (resizable) array
    Dim i As Integer
    Dim ret As Long
       
    If ColorDialog.lpCustColors = "" Then
        ReDim customcolors(0 To 16 * 4 - 1) As Byte 'resize the array
   
        For i = LBound(customcolors) To UBound(customcolors)
            customcolors(i) = 254 ' sets all custom colors to white
        Next i
       
        ColorDialog.lpCustColors = StrConv(customcolors, vbUnicode) ' convert array
    End If
    ColorDialog.hwndOwner = hWnd
    ColorDialog.lStructSize = Len(ColorDialog)
'    ColorDialog.Flags = COLOR_FLAGS
   
    ret = ChooseColor(ColorDialog)
    If ret Then
        bCanceled = False
    Else
        bCanceled = True
    End If
End Sub
Public Sub ShowFont(ByVal hWnd As Long) ', ByVal startingFontName As String)
    Dim ret As Long
    Dim lfLogFont As LOGFONT
    Dim i As Integer
   
    FontDialog.nSizeMax = 0
    FontDialog.nSizeMin = 0
    FontDialog.nFontType = Screen.FontCount
    FontDialog.hwndOwner = hWnd
    FontDialog.hDC = 0
    FontDialog.lpfnHook = 0
    FontDialog.lCustData = 0
    FontDialog.lpLogFont = VarPtr(lfLogFont)
    If FontDialog.iPointSize = 0 Then
        FontDialog.iPointSize = 10 * 10
    End If
    FontDialog.lpTemplateName = Space$(2048)
    FontDialog.rgbColors = RGB(0, 255, 255)
    FontDialog.lStructSize = Len(FontDialog)
   
    If FontDialog.Flags = 0 Then
        FontDialog.Flags = FontFlags.cdlCFScreenFonts Or FontFlags.cdlCFEffects Or CF_INITTOLOGFONTSTRUCT
    End If
    For i = 0 To Len(tFontName) - 1
        lfLogFont.lfFaceName(i) = Asc(Mid(tFontName, i + 1, 1))
    Next
   
    ret = ChooseFont(FontDialog)
   
    If ret Then
        bCanceled = False
        tFontBold = IIf(lfLogFont.lfWeight > 400, True, False)
        tFontItalic = lfLogFont.lfItalic
        tFontStrike = lfLogFont.lfStrikeOut
        tFontUnderline = lfLogFont.lfUnderline
        tFontColor = FontDialog.rgbColors
        tFontCharSet = lfLogFont.lfCharSet
        tFontSize = FontDialog.iPointSize / 10
        tFontName = ""
'        For i = 0 To UBound(lfLogFont.lfFaceName)
'            tFontName = tFontName + Chr(lfLogFont.lfFaceName(i))
'        Next
        tFontName = StrConv(lfLogFont.lfFaceName, vbUnicode)
       
        tFontName = Mid(tFontName, 1, InStr(1, tFontName, Chr(0)) - 1)
    Else
        bCanceled = True
    End If
End Sub
Public Sub ShowPrinter(ByVal hWnd As Long)
    PrintDialog.hwndOwner = hWnd
    PrintDialog.lStructSize = Len(PrintDialog)
    Call PrintDlg(PrintDialog)
End Sub
Public Property Get FileName() As String
    Dim s As String
    Dim charAsc As Long
    Dim i As Long
   
    On Error GoTo ErrEnd
    s = Trim(Left(FileDialog.sFile, Len(FileDialog.sFile) - 1))
    If Len(s) = 0 Then Exit Property
   
    i = 1
    Do Until charAsc <> 0
        charAsc = Asc(Mid(s, Len(s) - i, 1))
        i = i + 1
    Loop
    s = Left(s, Len(s) - i + 1)
    FileName = s
ErrEnd:
End Property
Public Property Get InitDir() As String
    InitDir = FileDialog.sInitDir
End Property
Public Property Let InitDir(ByVal vNewValue As String)
    FileDialog.sInitDir = vNewValue
End Property
Public Property Get Filter() As String
    Filter = FileDialog.sFilter
End Property
Public Property Let Filter(ByVal vNewValue As String)
    FileDialog.sFilter = Replace(vNewValue, "|", Chr(0))
End Property
Public Property Get ShowOpenFlags() As FileFlags
    ShowOpenFlags = FileDialog.Flags
End Property
Public Property Let ShowOpenFlags(ByVal vNewValue As FileFlags)
    FileDialog.Flags = vNewValue
End Property
Public Property Get ShowSaveFlags() As FileFlags
    ShowSaveFlags = FileDialog.Flags
End Property
Public Property Let ShowSaveFlags(ByVal vNewValue As FileFlags)
    FileDialog.Flags = vNewValue
End Property
Public Property Get ShowColorFlags() As ColorFlags
    ShowColorFlags = ColorDialog.Flags
End Property
Public Property Let ShowColorFlags(ByVal vNewValue As ColorFlags)
    ColorDialog.Flags = vNewValue
End Property
Public Property Get ShowPrintFlags() As PrintFlags
    ShowPrintFlags = PrintDialog.Flags
End Property
Public Property Let ShowPrintFlags(ByVal vNewValue As PrintFlags)
    PrintDialog.Flags = vNewValue
End Property
Public Property Get ShowFontFlags() As FontFlags
    ShowFontFlags = FontDialog.Flags
End Property
Public Property Let ShowFontFlags(ByVal vNewValue As FontFlags)
    FontDialog.Flags = vNewValue
End Property
Public Property Get DialogTitle() As String
    DialogTitle = FileDialog.sDlgTitle
End Property
Public Property Let DialogTitle(ByVal vNewValue As String)
    FileDialog.sDlgTitle = vNewValue
End Property
Public Property Get Cancel() As Boolean
    Cancel = bCanceled
End Property


Public Property Get FontName() As String
    FontName = tFontName
End Property
Public Property Let FontName(ByVal vNewValue As String)
    tFontName = vNewValue
End Property
Public Property Get FontBold() As Boolean
    FontBold = tFontBold
End Property
Public Property Get FontItalic() As Boolean
    FontItalic = tFontItalic
End Property
Public Property Get FontCharSet() As Byte
    FontCharSet = tFontCharSet
End Property
Public Property Get FontUnderline() As Boolean
    FontUnderline = tFontUnderline
End Property
Public Property Get FontStrike() As Boolean
    FontStrike = tFontStrike
End Property
Public Property Get FontSize() As Long
    FontSize = tFontSize
End Property
Public Property Get FontColor() As Long
    FontColor = tFontColor
End Property

 Public Property Get Color() As Long
    Color = ColorDialog.rgbResult
End Property
Public Property Let Color(ByVal vNewValue As Long) '
    ColorDialog.rgbResult = vNewValue
End Property

User Control Assistant 2

$
0
0
This is a remake of my previous submission. You can now generate all properties at the same time, except for Font property, which uses a separate button . Lists can be edited to your needs. Hope this app is helpful to someone.
Attached Images
 
Attached Files

[RESOLVED] Cannot get the full name of the ocx eg CODB85~1.OCX

$
0
0
Some time back I installed a set of ActiveX controls and when I checked in the project file, they were listed in full which was great as I could easily alter those settings on other project files without going through the whole process of deleting and re-adding etc etc.

However, I have now installed these again and for whatever reason all I see now is CODB85~1.OCX as an example.

Is there a way, a setting, anything.. that will register the ocx file with the full name ?

Windows 7 x64

Thanks

Voice Action Program Problems with recognition.

$
0
0
well i was posting in the wrong area now finally in the correct area i can get an answer here we go:


I'm using Voice Action a 1999 program made in very old vb6 that does voice recognition and records association of wav files with text and voice and pattern in .SAY files I'm trying to create my custom patterns and words but in my visual studio it runs, but when I record audio nothing happens or even open the voice synthesizer screen, analyzing the code I realized that everything is fine and I have no idea how to use VoiceAction I'm trying to use it to record my audios didn't even do that then neither get it see

Name:  photo.jpg
Views: 142
Size:  30.9 KB

everything is working well here but it does not display the synthesizer editor as it is said in the program's documentation how do I record an audio because it seems this is the only program that will be able to help me in speech recognition by comparing files.

Does anyone know why mine has a problem, I've done everything you can imagine read the document I searched on google modified code but all in vain.

The following synthesizer was supposed to appear:
https://www.vbforums.com/showthread....t=#post5529368

another problem is that the other program that manages the audio files didn't come included, which in this case is .say, so there's no way for me to compare, I'll have to implement everything in this same.

If there is no solution, another recognizer that makes audio file comparisons is welcome.

See the VoiceAction code (download):

https://www.freevbcode.com/ShowCode.asp?ID=2685
Attached Images
 

Simplified Picture Server

$
0
0
Attached is a simplified Web Server utilizing SimpleServer. I started with CVMichael's simple HTTP Web Server (2), simplified it further, and substituted SimpleServer for the MS Winsock Control.

The intent was to create a remote picture viewer utilizing a Web Browser. This enables you to share pictures and other files via the Internet.

When activated, the program will load some default values, so you will need to run "SETUP". The first item to setup is the Shared Directory. This directory must end with a \.

The next item is the Port to listen on. This can be any number from 0 to 65535, but I would recommend a number between 1000 and 10000. Low numbers are used by public servers, and high numbers are used by the operating system.

Next is the Maximum Connections. This is the number of simultaneous connections allowed. I have defaulted to 10, but that number is quite high for this application. 5 should be quite adequate.

Next is the IP version. If you are using IPv6, this should be 6 instead of 4.

Restart the program for the changes to take effect.

To test the program, direct your browser to the port you have assigned (eg. localhost:8080).

To allow access from the outside world, you will need to configure your router to forward the port you have selected to your computer. To do this, you will also need to use a fixed IP address.

Although this application was developed as a picture viewer, it should support any file that your browser supports.

J.A. Coutts
Attached Files

[VB6] Visual Basic 6 Client Websocket Control

$
0
0
Greetings Friends,

I present to you the first free client Websocket control made in Visual Basic 6 (with source code) that can handle both secure (ssl/ssh) and normal websocket server connections!

Name:  ss.png
Views: 81
Size:  5.6 KB

I have personally had to abandon 3 large personal projects of my own because i needed websocket functionality with SSL and couldn't find anything on the internet to fulfill that need. I started a couple times to try to code one of my own but the extreme complexity of implementing SSL and lack of time always hindered my progress and I usually gave up an moved on to something else. (if you check the SSL code you will know what i mean by complex)

But then alas, one day I stumbled upon wqweto's VBAsyncSocket project and hope once again glimmered in my eyes. Here was a project with full SSL/TLS implementation that worked seamlessly under the hood and supported IPV6 to boot. I then came across joshyfrancis's post regarding a websocket server, which led me to Youran's online example code. All of which helped me in achieving my goal of creating a client websocket control in VB6. I took the version i was working on an stripped it down to a bare-bones version to keep it as simple as possible added an example and have posted it here for your use as you see fit. This project wouldn't have been possible without those people's contributions.

Hopefully, you will find this useful and beneficial to your web related projects.

Note, this websocket doesnt support protocol extensions, application layer protocols, and full HTTP header handling, mainly because it doesn't have the full power of a web browser behind it like most websockets. you will be responsible for any data formatting such as JSON, XML etc.. This control only deals with the actual websocket protocol layer. I will be implementing much more functionality into the control as time allows.

Please post any bugs or questions related to the websocket control below and I will try to fix them as much as possible. If you make any useful additions, please share them so they can be added into the main source code.

Note: Please direct any questions regarding the SSL code to wqweto as I don't know crap about SSL.

best regards,
vbLewis
Attached Images
 
Attached Files

Move the control array together

$
0
0
Code:

Option Explicit
Dim xx As Single, yy As Single

Private Sub Picture1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    DoMouseDown Button, X, Y
End Sub
Private Sub Picture1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    DoMove "Picture1", Button, X, Y
End Sub

 Private Sub Picture2_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    DoMouseDown Button, X, Y
End Sub
Private Sub Picture2_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    DoMove "Picture2", Button, X, Y
End Sub

Sub DoMouseDown(Button As Integer, X As Single, Y As Single)
    If Button = 1 Then
        xx = X
        yy = Y
    End If
End Sub
Sub DoMove(GroupName As String, Button As Integer, X As Single, Y As Single)
If Button = 1 Then
    Dim ControlArr As Object, Pic As Object
    Select Case GroupName
    Case "Picture1"
        Set ControlArr = Picture1
    Case "Picture2"
        Set ControlArr = Picture2
    End Select
    For Each Pic In ControlArr
    Pic.Left = Pic.Left + X - xx
    Pic.Top = Pic.Top + Y - yy
    Next
End If

End Sub

can use for like this:
How to Render multiple images into one AlphaImage control-VBForums
https://www.vbforums.com/showthread....aImage-control
Attached Files

vb6 everything SDK,quick Search file for vb6,vba

$
0
0
Need Run EveryThing.exe First !

it's support x64 everything.exe,but un suppot about:Lite version
Download Portable Zip 64-bit,it's only 2 files,it's funny
(Everything.exe,Everything.lng),it's support ipc, VB6 Everything SDK



'Note: sample copied from https://www.voidtools.com/support/ev.../visual_basic/
https://www.voidtools.com/Everything-SDK.zip

Everything-SDK\dll\Everything32.dll
vb6 sdk
Code:

'it's VB6 Everything SDK

'VB.net and the Everything SDK - voidtools forum
'https://www.voidtools.com/forum/viewtopic.php?f=10&t=5550
Option Explicit

Public Declare Function Everything_SetSearchA Lib "Everything32.dll" (ByVal ins As String) As Long
Public Declare Function Everything_QueryA Lib "Everything32.dll" (ByVal bWait As Long) As Long

Public Declare Function Everything_SetSearchW Lib "Everything32.dll" (ByVal ins As Long) As Long

Public Declare Function Everything_SetRequestFlags Lib "Everything32.dll" (ByVal dwRequestFlags As Long) As Long
Public Declare Function Everything_QueryW Lib "Everything32.dll" (ByVal bWait As Long) As Long
Public Declare Function Everything_GetNumResults Lib "Everything32.dll" () As Long
Public Declare Function Everything_GetResultFileNameW Lib "Everything32.dll" (ByVal index As Long) As Long
Public Declare Function Everything_GetLastError Lib "Everything32.dll" () As Long
Public Declare Function Everything_GetResultFullPathNameW Lib "Everything32.dll" (ByVal index As Long, ByVal ins As Long, ByVal size As Long) As Long
Public Declare Function Everything_GetResultSize Lib "Everything32.dll" (ByVal index As Long, ByRef size As Long) As Long          'size UInt64
Public Declare Function Everything_GetResultDateModified Lib "Everything32.dll" (ByVal index As Long, ByRef ft As Long) As Long    'ft UInt64

Public Const EVERYTHING_REQUEST_FILE_NAME = &H1
Public Const EVERYTHING_REQUEST_PATH = &H2
Public Const EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME = &H4
Public Const EVERYTHING_REQUEST_EXTENSION = &H8
Public Const EVERYTHING_REQUEST_SIZE = &H10
Public Const EVERYTHING_REQUEST_DATE_CREATED = &H20
Public Const EVERYTHING_REQUEST_DATE_MODIFIED = &H40
Public Const EVERYTHING_REQUEST_DATE_ACCESSED = &H80
Public Const EVERYTHING_REQUEST_ATTRIBUTES = &H100
Public Const EVERYTHING_REQUEST_FILE_LIST_FILE_NAME = &H200
Public Const EVERYTHING_REQUEST_RUN_COUNT = &H400
Public Const EVERYTHING_REQUEST_DATE_RUN = &H800
Public Const EVERYTHING_REQUEST_DATE_RECENTLY_CHANGED = &H1000
Public Const EVERYTHING_REQUEST_HIGHLIGHTED_FILE_NAME = &H2000
Public Const EVERYTHING_REQUEST_HIGHLIGHTED_PATH = &H4000
Public Const EVERYTHING_REQUEST_HIGHLIGHTED_FULL_PATH_AND_FILE_NAME = &H8000

Public Type FILETIME
    dwLowDateTime As Long
    dwHighDateTime As Long
End Type

Public Type SYSTEMTIME
    wYear As Long
    wMonth As Long
    wDayOfWeek As Long
    wDay As Long
    wHour As Long
    wMinute As Long
    wSecond As Long
    wMilliseconds As Long
End Type

Private Declare Function FileTimeToSystemTime Lib "kernel32" (ByRef ft As Long, lpSystemTime As SYSTEMTIME) As Long
Private Declare Function SystemTimeToTzSpecificLocalTime Lib "kernel32" (ByVal tzi As Long, lpst As SYSTEMTIME, lplt As SYSTEMTIME) As Long
Private Declare Function SystemTimeToVariantTime Lib "OLEAUT32.DLL" (lpSystemTime As SYSTEMTIME, vtime As Date) As Long
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Function CheckEverythingRunning() As Boolean
    Dim FindOK As Boolean
    Dim Hwnd As Long
    Hwnd = FindWindow("EVERYTHING", "Everything")
    CheckEverythingRunning = Hwnd <> 0
End Function
Sub SimpleTest()
If Not CheckEverythingRunning Then
 Debug.Print "Please check Everything Is Running"
Exit Sub
End If
    Dim EyText As String
    Dim test As Boolean
    EyText = "Everything"
  Call Everything_SetSearchW(StrPtr(EyText))
    'Call Everything_SetSearchA(EyText)
   
    Everything_SetRequestFlags (EVERYTHING_REQUEST_FILE_NAME Or EVERYTHING_REQUEST_PATH Or EVERYTHING_REQUEST_SIZE Or EVERYTHING_REQUEST_DATE_MODIFIED)
    test = Everything_QueryW(True)
    'test = Everything_QueryA(True)
    If Not test Then
        Debug.Print "Search Err:Please check Everything Is Running"
        Exit Sub
    End If

    Dim NumResults As Long
    Dim i As Long
    Dim filename2 As String
    Dim filesize As Long
    Dim size As Long
    Dim ftdm As Long
    Dim stdm As SYSTEMTIME
    Dim ltdm As SYSTEMTIME
    Dim DateModified As Date
    Dim ID As Long
 

    NumResults = Everything_GetNumResults()
    Debug.Print "Find FILES:" & NumResults
    filename2 = String(260, 0)
 
    If NumResults > 0 Then
        For i = 0 To NumResults - 1
            test = Everything_GetResultFullPathNameW(i, StrPtr(filename2), 260)
            ID = InStr(filename2, Chr(0))
            If ID > 0 Then
            FileName = Left(filename2, ID - 1)
            Else
            FileName = filename2
            End If
           
            test = Everything_GetResultSize(i, size)

           
            test = Everything_GetResultDateModified(i, ftdm)
            test = FileTimeToSystemTime(ftdm, stdm)
            test = SystemTimeToTzSpecificLocalTime(0, stdm, ltdm)
            test = SystemTimeToVariantTime(ltdm, DateModified)
            Debug.Print DateModified & "//" & size & "//" & FileName
        Next
    End If
End Sub


x64 vba sdk:
Code:

'Replaced for VBA usage
' - UINT32 with LONG
' - UINT64 with LONGLONG
' - INTPtr with LONGPtr
' - System.Text.StringBuilder with String
' - System.DateTime with String
' - filename.Capacity with filesize

Public Declare PtrSafe Function Everything_SetSearchW Lib "C:\SDK\Everything64.dll" (ByVal ins As LongPtr) As Long
Public Declare PtrSafe Function Everything_SetRequestFlags Lib "C:\SDK\Everything64.dll" (ByVal dwRequestFlags As Long) As Long
Public Declare PtrSafe Function Everything_QueryW Lib "C:\SDK\Everything64.dll" (ByVal bWait As Integer) As Integer
Public Declare PtrSafe Function Everything_GetNumResults Lib "C:\SDK\Everything64.dll" () As Long
Public Declare PtrSafe Function Everything_GetResultFileNameW Lib "C:\SDK\Everything64.dll" (ByVal index As Long) As LongPtr
Public Declare PtrSafe Function Everything_GetLastError Lib "C:\SDK\Everything64.dll" () As Long
Public Declare PtrSafe Function Everything_GetResultFullPathNameW Lib "C:\SDK\Everything64.dll" (ByVal index As Long, ByVal ins As LongPtr, ByVal size As Long) As Long
Public Declare PtrSafe Function Everything_GetResultSize Lib "C:\SDK\Everything64.dll" (ByVal index As Long, ByRef size As LongLong) As Integer        'size UInt64
Public Declare PtrSafe Function Everything_GetResultDateModified Lib "C:\SDK\Everything64.dll" (ByVal index As Long, ByRef ft As LongLong) As Integer  'ft UInt64

Public Const EVERYTHING_REQUEST_FILE_NAME = &H1
Public Const EVERYTHING_REQUEST_PATH = &H2
Public Const EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME = &H4
Public Const EVERYTHING_REQUEST_EXTENSION = &H8
Public Const EVERYTHING_REQUEST_SIZE = &H10
Public Const EVERYTHING_REQUEST_DATE_CREATED = &H20
Public Const EVERYTHING_REQUEST_DATE_MODIFIED = &H40
Public Const EVERYTHING_REQUEST_DATE_ACCESSED = &H80
Public Const EVERYTHING_REQUEST_ATTRIBUTES = &H100
Public Const EVERYTHING_REQUEST_FILE_LIST_FILE_NAME = &H200
Public Const EVERYTHING_REQUEST_RUN_COUNT = &H400
Public Const EVERYTHING_REQUEST_DATE_RUN = &H800
Public Const EVERYTHING_REQUEST_DATE_RECENTLY_CHANGED = &H1000
Public Const EVERYTHING_REQUEST_HIGHLIGHTED_FILE_NAME = &H2000
Public Const EVERYTHING_REQUEST_HIGHLIGHTED_PATH = &H4000
Public Const EVERYTHING_REQUEST_HIGHLIGHTED_FULL_PATH_AND_FILE_NAME = &H8000

Public Type FILETIME
    dwLowDateTime As Long
    dwHighDateTime As Long
End Type

Public Type SYSTEMTIME
    wYear As Integer
    wMonth As Integer
    wDayOfWeek As Integer
    wDay As Integer
    wHour As Integer
    wMinute As Integer
    wSecond As Integer
    wMilliseconds As Integer
End Type

Private Declare PtrSafe Function FileTimeToSystemTime Lib "kernel32" (ByRef ft As LongLong, lpSystemTime As SYSTEMTIME) As Long
Private Declare PtrSafe Function SystemTimeToTzSpecificLocalTime Lib "kernel32" (ByVal tzi As LongPtr, lpst As SYSTEMTIME, lplt As SYSTEMTIME) As Long
Private Declare PtrSafe Function SystemTimeToVariantTime Lib "OLEAUT32.DLL" (lpSystemTime As SYSTEMTIME, vtime As Date) As Long

Sub SimpleTest()
    Dim EyText As String
    Dim test As Boolean
    EyText = "Everything"
    Everything_SetSearchW (StrPtr(EyText))
    Everything_SetRequestFlags (EVERYTHING_REQUEST_FILE_NAME Or EVERYTHING_REQUEST_PATH Or EVERYTHING_REQUEST_SIZE Or EVERYTHING_REQUEST_DATE_MODIFIED)
    test = Everything_QueryW(True)
    Debug.Print test

    Dim NumResults As Long
    Dim i As Long
    Dim filename As String
    Dim filesize As Long
    Dim size As LongLong
    Dim ftdm As LongLong
    Dim stdm As SYSTEMTIME
    Dim ltdm As SYSTEMTIME
    Dim DateModified As Date

    filename = String(260, 0)

    NumResults = Everything_GetNumResults()
    Debug.Print NumResults

    If NumResults > 0 Then
        For i = 0 To NumResults - 1
            test = Everything_GetResultFullPathNameW(i, StrPtr(filename), 260)
            Debug.Print filename
           
            test = Everything_GetResultSize(i, size)
            Debug.Print size
           
            test = Everything_GetResultDateModified(i, ftdm)
            test = FileTimeToSystemTime(ftdm, stdm)
            test = SystemTimeToTzSpecificLocalTime(0, stdm, ltdm)
            test = SystemTimeToVariantTime(ltdm, DateModified)
            Debug.Print DateModified
        Next
    End If
End Sub

[RESOLVED] Voice Action Program Problems with recognition.

$
0
0
well i was posting in the wrong area now finally in the correct area i can get an answer here we go:


I'm using Voice Action a 1999 program made in very old vb6 that does voice recognition and records association of wav files with text and voice and pattern in .SAY files I'm trying to create my custom patterns and words but in my visual studio it runs, but when I record audio nothing happens or even open the voice synthesizer screen, analyzing the code I realized that everything is fine and I have no idea how to use VoiceAction I'm trying to use it to record my audios didn't even do that then neither get it see

Name:  photo.jpg
Views: 205
Size:  30.9 KB

everything is working well here but it does not display the synthesizer editor as it is said in the program's documentation how do I record an audio because it seems this is the only program that will be able to help me in speech recognition by comparing files.

Does anyone know why mine has a problem, I've done everything you can imagine read the document I searched on google modified code but all in vain.

The following synthesizer was supposed to appear:
https://www.vbforums.com/showthread....t=#post5529368

another problem is that the other program that manages the audio files didn't come included, which in this case is .say, so there's no way for me to compare, I'll have to implement everything in this same.

If there is no solution, another recognizer that makes audio file comparisons is welcome.

See the VoiceAction code (download):

https://www.freevbcode.com/ShowCode.asp?ID=2685
Attached Images
 
Viewing all 1501 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>