This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <oleauto.h> | |
#include <conio.h> | |
#include <stdio.h> | |
#pragma comment(lib,"OleAut32.lib") | |
/* | |
This is an example of testing OleAut32.DispCallFunc from C with a VB6 ActiveX object. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'bulk compile all vb6 project files in and below target directory | |
'requires a reference to vbdevkit library: http://sandsprite.com/tools.php?id=3 | |
Sub Main() | |
On Error Resume Next | |
Dim exe As String, f() As String, ff, b | |
Dim fso As New CFileSystem2, c As New CCmdOutput | |
exe = "C:\Program Files (x86)\Microsoft Visual Studio\VB98\vb6.exe" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'output: | |
' main | |
' VBAutomation | |
' | |
' imm | |
' OleDropTargetInterface | |
' OleEndPointID | |
' VBAutomation | |
Declare Function lstrlenA Lib "kernel32" (lpString As Any) As Long |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long | |
Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWndParent As Long, ByVal hWndChildAfter As Long, ByVal lpszClass As String, ByVal lpszWindow As String) As Long | |
Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long) | |
Public Const KEYEVENTF_KEYUP = &H2 | |
Public Const VK_CANCEL = &H3 | |
Public Const VK_CONTROL = &H11 | |
Public Const WM_ACTIVATE As Long = &H6 | |
Public Sub ClearImmediateWindow() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Sub Form_Load() | |
Dim t As t1 'defined as public UDT in an activex dll | |
t.aaaaa = 21 | |
t.bbbbb = "test" | |
t.ccccc = "blahblah" | |
Debug.Print UDTMemberGetValue(t, "bbbbb") | |
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Private Sub Form_Load() | |
Dim test As String | |
test = String(20, "A") & " 111 222" & vbCrLf & _ | |
String(40, "B") & " 333 444" & vbCrLf & _ | |
String(5, "C") & " 555 666" & vbCrLf | |
Debug.Print txtTable(test, " ", 3, , Me) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'save this file as enumSerialPorts.vbs | |
'open a command shell, | |
'change directory to the same folder the vbs script is in (cd command) | |
'type in: cscript enumSerialPorts.vbs | |
'if WMI is working it should print out any connected COM port devices like arduinos. | |
strComputer = "." | |
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") | |
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_SerialPort", , 48) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'copies all the data from a flexgrid into well formatted rows for text display | |
'use delimiter to skip padding and have in csv type format, | |
'delimiter not checked for in data | |
Public Sub FlexGridCopy(fg As msflexgrid, Optional delimiter = Empty) | |
Dim colWidths() As Long | |
ReDim colWidths(fg.Cols) | |
Dim rows() As String | |
Dim fields() As String | |
Dim d As String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace NAMESPACE | |
{ | |
public enum WindowsMessage | |
{ | |
WM_NULL = 0x0000, | |
WM_CREATE = 0x0001, | |
WM_DESTROY = 0x0002, | |
WM_MOVE = 0x0003, | |
WM_SIZE = 0x0005, | |
WM_ACTIVATE = 0x0006, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vb6 parser: | |
------------------------------------------ | |
tmp = Split(Text1, vbCrLf) | |
Dim x, r() | |
For Each x In tmp | |
'.Upack:100082E0 dword_100082E0 dd 77DDEFB8h ; DATA XREF: ToExtractEmail+15r | |
a = InStr(x, "dword_") |