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 | |
' | |
' http://bbs.wankuma.com/ - Thread No95539 | |
' | |
Public Function LenExp(ByVal text As String) As Long | |
Dim rawLen As Long, length As Long | |
rawLen = Len(text) | |
length = 0& | |
Dim i As Long, uni As Long, pair As Long | |
i = 0& |
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 On | |
Option Strict On | |
Imports SHDocVw '参照設定(COM):Microsoft Internet Controls | |
Imports Shell32 '参照設定(COM):Microsoft Shell Controls And Automation | |
'Imports mshtml '参照設定(COM):Microsoft HTML Object Library | |
Imports System.IO | |
Imports System.Runtime.InteropServices | |
'コントロールを 2 つ貼っておく | |
' Button1 |
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
// >= .NET 5.0 | |
using System; | |
using System.IO; | |
using System.Threading; | |
using System.Threading.Tasks; | |
public static class DirectoryInfoExtensions | |
{ | |
/// <summary> | |
/// ディレクトリのサイズを返します。 | |
/// </summary> |
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 Module TextBoxBaseExtensions | |
<System.Runtime.CompilerServices.Extension> | |
Public Sub SetText(this As TextBoxBase, value As String) | |
Static forceWindowText As System.Reflection.MethodInfo = GetType(System.Windows.Forms.TextBoxBase).GetMethod("ForceWindowText", System.Reflection.BindingFlags.NonPublic Or System.Reflection.BindingFlags.Instance) | |
forceWindowText.Invoke(this, New Object(0) {value}) | |
End Sub | |
End Module |
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 Declare PtrSafe Function CLSIDFromString Lib "ole32" (ByVal pString As LongPtr, ByRef pCLSID As Currency) As Long | |
Private Declare PtrSafe Function RegisterWindowMessageW Lib "user32" (ByVal lpString As LongPtr) As Long | |
Private Declare PtrSafe Function SendMessageTimeoutW Lib "user32" (ByVal hWnd As LongPtr, ByVal msg As Long, ByVal wParam As LongPtr, ByRef lParam As LongPtr, ByVal fuFlags As Long, ByVal uTimeout As Long, ByRef lpdwResult As Long) As LongPtr | |
Private Declare PtrSafe Function ObjectFromLresult Lib "oleacc" (ByVal lResult As Long, ByRef riid As Currency, ByVal wParam As LongPtr, ppvObject As Any) As Long | |
Private Enum SMTO | |
NORMAL = 0 | |
BLOCK = 1 | |
ABORTIFHUNG = 2 |
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
Partial Public Class RecordingForm | |
Inherits System.Windows.Forms.Form | |
Private recordingData As System.IO.MemoryStream '録音データ | |
' NuGet で NAudio パッケージを組み込んでおくこと | |
Private WithEvents waveIn As NAudio.Wave.WaveInEvent | |
Private writer As System.IO.Stream | |
Private Sub waveIn_DataAvailable(sender As Object, e As NAudio.Wave.WaveInEventArgs) Handles waveIn.DataAvailable | |
writer?.Write(e.Buffer, 0, e.BytesRecorded) |
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
'NuGet で「Microsoft.Windows.SDK.Contracts」を参照しておく | |
Option Strict On | |
Imports System.Drawing.Imaging | |
Imports System.IO | |
Imports System.Linq | |
Imports Windows.Data.Pdf | |
Public Class Form1 | |
Private Const WICTiffEncoder As String = "0131be10-2001-4c5f-a9b0-cc88fab64ce8" |
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 Strict On | |
Imports System.ComponentModel | |
Imports System.IO | |
Imports System.Runtime.CompilerServices | |
Imports System.Runtime.InteropServices | |
Module FileInfoExtention | |
''' <summary> | |
''' ドライブのクラスターサイズを返します。 | |
''' </summary> |
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 Declare PtrSafe Function IsClipboardFormatAvailable Lib "user32" (ByVal wFormat As Long) As Long | |
Private Declare PtrSafe Function OpenClipboard Lib "user32" (ByVal hWnd As LongPtr) As Long | |
Private Declare PtrSafe Function GetClipboardData Lib "user32" (ByVal wFormat As Long) As LongPtr | |
Private Declare PtrSafe Function CloseClipboard Lib "user32" () As Long | |
Private Declare PtrSafe Function OleCreatePictureIndirect Lib "oleaut32" (ByRef lpPictDesc As PICTDESC_BITMAP, ByRef RefIID As Any, ByVal fPictureOwnsHandle As Long, ByRef IPic As IPicture) As Long | |
Private Const PtrNull As LongPtr = 0 | |
Private Type PICTDESC_BITMAP | |
cbSizeofStruct As Long |
OlderNewer