Imports System.Runtime.InteropServices Imports System.Text Public Partial Class Form1 Private Const CPL_DYNAMIC_RES As UInteger = 0UI Private Const CPL_INIT As UInteger = 1UI Private Const CPL_GETCOUNT As UInteger = 2UI Private Const CPL_INQUIRE As UInteger = 3UI Private Const CPL_NEWINQUIRE As UInteger = 8UI Private Const CPL_EXIT As UInteger = 7UI <StructLayout(LayoutKind.Sequential, Pack:=4)> Private Class CPLINFO Public idIcon As Integer Public idName As Integer Public idInfo As Integer Public lData As IntPtr End Class <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi, Pack:=4)> Private Class NEWCPLINFOA Public dwSize As Integer Public dwFlags As Integer Public dwHelpContext As Integer Public lData As IntPtr Public hIcon As IntPtr <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=32)> Public szName As String <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=64)> Public szInfo As String <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=128)> Public szHelpFile As String End Class <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode, Pack:=4)> Private Class NEWCPLINFOW Public dwSize As Integer Public dwFlags As Integer Public dwHelpContext As Integer Public lData As IntPtr Public hIcon As IntPtr <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=32)> Public szName As String <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=64)> Public szInfo As String <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=128)> Public szHelpFile As String End Class Private Delegate Function CPlAppletDelegate(hwndCPl As IntPtr, uMsg As UInteger, lParam1 As IntPtr, lParam2 As IntPtr) As Integer Private Declare Unicode Function LoadLibrary Lib "kernel32" Alias "LoadLibraryW" (lpFileName As String) As IntPtr Private Declare Ansi Function GetProcAddress Lib "kernel32" (hModule As IntPtr, lpProcName As String) As IntPtr Private Declare Unicode Function FreeLibrary Lib "kernel32" (hModule As IntPtr) As Boolean Private Declare Unicode Function LoadString Lib "user32" Alias "LoadStringW" (hInstance As IntPtr, uID As Integer, lpBuffer As StringBuilder, nBufferMax As Integer) As Integer End Class