Hi,
I am trying to make a plugin for Messenger Plus, but before I start developing it, I want to make sure I can successfully install it first, so I can test it.
I am using VB6.
This is my "Installer". I am using the DLL that comes in the Messenger Plus! Plugins Documentation, Visual Basic 6 Samples section (MPPluginVB.dll)
Form 1:
code:
Private Sub Form_Load()
FileSystem.FileCopy App.Path & "\MPPluginVB.dll", GetPluginDirectory & "\MPPluginVB.dll"
MsgBox InstallPlugin("MPPluginVB.dll", "MPPluginVB.Sample")
ReloadPlus
End Sub
Module:
code:
Public Declare Function RegisterWindowMessage Lib "user32" Alias "RegisterWindowMessageA" (ByVal lpString As String) As Long
Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public Const HWND_BROADCAST = &HFFFF&
Public Function GetPluginDirectory()
Dim Temp As String
Temp = GetKeyValue(HKEY_LOCAL_MACHINE, "SOFTWARE\Patchou\MsgPlus2", "PluginDir")
If Temp = "" Then Temp = GetKeyValue(HKEY_CURRENT_USER, "SOFTWARE\Patchou\MsgPlus2", "PluginDir")
If Temp = "" Then Temp = "**ERROR** - Plugin Directory Not Found"
GetPluginDirectory = Temp
End Function
Public Function InstallPlugin(FileName As String, VBWord As String) As Boolean
UpdateKey HKEY_CURRENT_USER, "SOFTWARE\Patchou\MsgPlus2\RegisteredPlugins", FileName, VBWord
InstallPlugin = UpdateKey(HKEY_LOCAL_MACHINE, "SOFTWARE\Patchou\MsgPlus2\RegisteredPlugins", FileName, VBWord)
End Function
Public Function ReloadPlus()
Dim nMsg As Long
nMsg = RegisterWindowMessage("MessengerPlus_PluginChange")
PostMessage HWND_BROADCAST, nMsg, 0, 0
End Function
I have used the "RegAccess.bas" file that comes with VB6 to access the registry.
It doesn't work!!! What have I done wrong?!