What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » Windows registry: how hard can it be...

Windows registry: how hard can it be...
Author: Message:
chris
Veteran Member
*****


Posts: 1137
Reputation: 2
36 / Male / –
Joined: May 2003
RE: Windows registry: how hard can it be...
code:
MPPLUGIN_RETURN_BOOL Initialize(/*[in]*/ DWORD nVersion,
                                /*[in]*/ const char* sUserEmail,
                                /*[in]*/ IDispatch* iMessengerObj)
{
    bool retValue = TRUE;
    long retCode = 0;
    HKEY regKey;
    unsigned long szType = 0, szSize = MAX_PATH;
    unsigned char szValue[MAX_PATH];

    retCode = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE/Patchou/MsgPlus2",
        0, KEY_QUERY_VALUE, ŪKey);
    if (retCode != ERROR_SUCCESS)
    {
        MessageBox(NULL, "Error opening registry", "Error", MB_OK);
        retValue = FALSE;
    }
    else
    {
        retCode = RegQueryValueEx(regKey, "PluginDir", NULL,
            &szType, szValue, &szSize);
        if (retCode != ERROR_SUCCESS){ retValue = FALSE;
            MessageBox(NULL, "Error reading registry", "Error", MB_OK);
        }
        else strcpy(sPluginPath,
            reinterpret_cast<const char*>(szValue));
    }

    retCode = RegCloseKey(regKey);

    if (retCode != ERROR_SUCCESS){ retValue = FALSE;
        MessageBox(NULL, "Error closing registry", "Error", MB_OK);
    }

    return retValue;
}

Try that:) You can thank DJM for it:p

This post was edited on 11-20-2003 at 01:54 PM by chris.
11-20-2003 01:52 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Windows registry: how hard can it be... - by RaceProUK on 11-19-2003 at 11:31 PM
RE: Windows registry: how hard can it be... - by chris on 11-20-2003 at 01:52 PM
RE: Windows registry: how hard can it be... - by RaceProUK on 11-20-2003 at 02:24 PM
RE: Windows registry: how hard can it be... - by Hah on 11-20-2003 at 09:18 PM
RE: Windows registry: how hard can it be... - by optimism_ on 11-21-2003 at 02:03 AM
RE: Windows registry: how hard can it be... - by chris on 11-21-2003 at 04:10 AM
RE: Windows registry: how hard can it be... - by WDZ on 11-21-2003 at 04:52 AM
RE: Windows registry: how hard can it be... - by RaceProUK on 11-21-2003 at 03:22 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On