Skip to content

Instantly share code, notes, and snippets.

@xxdoc
xxdoc / cPrintersCombo.cls
Created October 15, 2019 03:58 — forked from wqweto/cPrintersCombo.cls
Based on [Retrieving icons of current user printers](https://stackoverflow.com/a/1183185/40691)
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cPrintersCombo"
Attribute VB_GlobalNameSpace = False
@xxdoc
xxdoc / Collection2.cls
Created September 26, 2019 04:29 — forked from philo-ng/Collection2.cls
Enhanced VB6 Collection
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "Collection2"
Attribute VB_GlobalNameSpace = False
'----------------------------------------- SUBJECT -----------------------------------------
'Changes screen resolution using MS Visual Basic 6.0
evry1falls
http://www.evry1.net/VB6/
'----------------------------------------- Code -----------------------------------------
Option Explicit
Const CCHDEVICENAME = 32
Const CCHFORMNAME = 32
@xxdoc
xxdoc / base64.bas
Created September 26, 2019 04:23 — forked from cainhill/base64.bas
' http://web.archive.org/web/20060527094535/http://www.nonhostile.com/howto-encode-decode-base64-vb6.asp
' http://cwestblog.com/2013/09/23/vbscript-convert-image-to-base-64/
Public Function ConvertFileToBase64(strFilePath As String) As String
Const UseBinaryStreamType = 1
Dim streamInput: Set streamInput = CreateObject("ADODB.Stream")
Dim xmlDoc: Set xmlDoc = CreateObject("Microsoft.XMLDOM")
Dim xmlElem: Set xmlElem = xmlDoc.createElement("tmp")
' #
' # 依值設定ComboBox.ListIndex
' # VB6的Combox的操作實在不人性,只好讓它人性一些些。
' # ref → http://stackoverflow.com/questions/18422210/vb6-select-combobox-text-value-based-on-database-data
' # 假設combox的list放資料的格式為:<value>.<dispaly_name>
' # eg. "0001.我是一號", "0002.我是二號二號", "0003.我是三號三號三號"
' # code → CombobBox_SetListIndexWithValue myCombox, "0002"
' #
Public Sub CombobBox_SetListIndexWithValue(cboData As ComboBox, value As String, Optional intCboLen As Integer = 4)
@xxdoc
xxdoc / ComWithoutRegister2.cls
Created September 26, 2019 04:18 — forked from relyky/ComWithoutRegister2.cls
ComWithoutRegister第二版,可真的動態載入DLL函式庫,不需註冊COM也能調用。
Option Explicit
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpSectionName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpbuffurnedString As String, ByVal nBuffSize As Long, ByVal lpFileName As String) As Long
Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpSectionName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Private Declare Function GetModuleHandle Lib "kernel32.dll" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long
Private Declare Function DispCallFunc Lib "oleaut32.dll" (ByVal pvInstance A
@xxdoc
xxdoc / gist:b0a28b84d2378139f85bd658160a91cd
Created September 26, 2019 04:16 — forked from alvin2ye/gist:239332
vb6 ModShellEx
'*************************************************************************
'**模 块 名:ModShellEx
'**说 明:增强SHELL函数
'**创 建 人:马大哈
'**描 述:紫水晶工作室 http://www.m5home.com/
'**日 期:2007年4月24日
'**版 本:V1.0
'*************************************************************************
Option Explicit
@xxdoc
xxdoc / Form1.frm
Created March 25, 2019 14:35 — forked from wqweto/Form1.frm
PNG filter on save
Option Explicit
Private Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long
Private Declare Function GdiplusStartup Lib "gdiplus" (hToken As Long, pInputBuf As Any, Optional ByVal pOutputBuf As Long = 0) As Long
Private Declare Function GdipLoadImageFromFile Lib "gdiplus" (ByVal lFilenamePtr As Long, hImage As Long) As Long
Private Declare Function GdipDisposeImage Lib "gdiplus" (ByVal hImage As Long) As Long
Private Sub Form_Load()
Dim aInput(0 To 3) As Long
@xxdoc
xxdoc / LabelVert.ctl
Created March 8, 2019 03:28 — forked from wqweto/LabelVert.ctl
Windowless Vertical Label control
VERSION 5.00
Begin VB.UserControl LabelVert
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
CanGetFocus = 0 'False
ClientHeight = 3372
ClientLeft = 0
ClientTop = 0
ClientWidth = 4980
@xxdoc
xxdoc / gist:cddc2e105896e4a9f9012689bb1da81f
Created October 3, 2018 07:13 — forked from facebookegypt/gist:5666803
Color Picker Source Code Download Visual Basic 6.0
'Source : http://evry1.net/VB6/
'Subject : Visual Basic 6.0 How to create and understand
'Color Picker Appliaction
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Option Explicit
Private Type pointapi
Px As Long
Py As Long
End Type