What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » WLM Plus! General » Force Plus to load

Pages: (2): « First « 1 [ 2 ] Last »
Force Plus to load
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Force Plus to load
oh I see, yeah... hmm... I drasticly edited my post now... I hope it's correct this time
.-= A 'frrrrrrrituurrr' for Wacky =-.
08-10-2004 10:07 AM
Profile PM Find Quote Report
lopardo
Veteran Member
*****


Posts: 1395
Reputation: 33
38 / Male / Flag
Joined: Nov 2002
Status: Away
O.P. RE: Force Plus to load
Thank you guys, it's very clear now :)

However, I've been doing some tests under a virtual machine with a clean Windows XP and noticed something:

I installed MSN Messenger 6.2 and then Plus. MSN Messenger set itself at startup in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run. Plus set itself at startup in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run.

I closed MSN Messenger but Plus didn't replace the MSN Messenger startup key with the Plus one with "/WinStart" as expected.

I checked the registry, in HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger, AppSettings was = 62 00 00 80 (autorun disabled), but in the Options window it was enabled!
[Image: Image1.PNG]

When I clicked OK there, then it changed to 62 02 00 80 (autorun enabled) and when I closed MSN Messenger, Plus did what I expected it to do in the first place.
[Image: Image2.PNG]


So, my question is how does Plus read the AppSettings value to determine if MSN Messenger should start when Windows starts? Its value depends on many options (it's not always "62 00 00 80" for autorun disabled like in my case, it depends on the other options aswell).
Hope I was clear :)
[Image: userbar452797dd.gif]
08-10-2004 09:17 PM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Force Plus to load
quote:
Originally posted by lopardo
So, my question is how does Plus read the AppSettings value to determine if MSN Messenger should start when Windows starts?
When Plus is started with /WinStart:
====================================
Plus! performs:
1) Unknown1 = RegGet(HKEY_CURRENT_USER\Software\Patchou\MsgPlus2\HandleMessengerStart)
AutoMsg4Start = RegGet(HKEY_CURRENT_USER\Software\Patchou\MsgPlus2\AutoMsg4Start)
AutoMsg5Start = RegGet(HKEY_CURRENT_USER\Software\Patchou\MsgPlus2\AutoMsg5Start)
2) When "AutoMsg5Start" or "AutoMsg4Start" has a value (the normal startup string) then Messenger is strarted up automaticly
3) Plus! process ends (?)...

.........
.........
You exit Messenger:

Nothing happens, because Plus! process was already stopped (?)...


When Plus is started without /WinStart
======================================
Plus! performs:
AppState = RegGet(HKEY_CURRENT_USER\Software\Microsoft\MessengerService\AppSettings)
ForceLoad = RegGet(HKEY_LOCAL_MACHINE\SOFTWARE\Patchou\MsgPlus2\ForceLoad)

.........
.........
You exit Messenger:

Plus! performs (explained in pseudo-code again):

MSNString = RegGet(HKCU\Software\Microsoft\Windows\CurrentVersion\Run\msnmsgr)
RegDelete(HKCU\Software\Microsoft\Windows\CurrentVersion\Run\MessengerPlus2)

Unknown1 = RegGet(HKCU\Software\Patchou\MsgPlus2\HandleMessengerStart)
Unknown2 = RegGet(HKCU\Software\Patchou\MsgPlus2\HandleMessengerStart)
/* meaning? and why twice? */

IF MSNString = NOT Empty THEN
  AppState = RegGet(HKCU\Software\Microsoft\MSNMessenger\AppSettings)
  IF CheckBit(AppState, 17) = 1 THEN
    RegSet(HKCU\Software\Microsoft\Windows\CurrentVersion\Run\MessengerPlus3, "c:\blah\msgplus.exe /Winstart")
    RegSet(HKCU\Software\Patchou\MsgPlus2\AutoMsg5Start, "c:\blah\msnmsgr.exe /background")
    /* (or "AutoMsg4Start", depending on what messenger version is used I assume) */
    RegDelete(HKCU\Software\Microsoft\Windows\CurrentVersion\Run\msnmsgr)
  END IF
ELSE
  IF RegGet(HKCU\Software\Patchou\MsgPlus2\AutoMsg5Start) = NOT Empty THEN
    AppState = RegGet(HKCU\Software\Microsoft\MSNMessenger\AppSettings)
    IF CheckBit(AppState, 17) = 1 THEN
      RegSet(HKCU\Software\Microsoft\Windows\CurrentVersion\Run\MessengerPlus3, "c:\blah\msgplus.exe /Winstart")
      RegDelete(HKCU\Software\Microsoft\Windows\CurrentVersion\Run\msnmsgr)
    ELSE
      RegDelete(HKCU\Software\Patchou\MsgPlus2\AutoMsg5Start)
    END IF
  END IF
END IF





these things can be found out with programs like Registry Monitor...


PS: There is also something about HKCU\Software\Patchou\MsgPlus2\HandleMessengerStart which is read after the "MessengerPlus2"-key is deleted, but I don't know why or what it's function is and I hadn't time yet to figure that out...


EDIT (3hours later:p): OK, I'll stop editing for now... It isn't easy to figure these things out, possible, but very confussing... my head hurts now :p Also, it seems complicated. And I don't know why all these things are performed. But there must be a reason. All this is just to show that Plus! does many things when Messenger is quit... It doesn't realy answer the question in a strait forward way, but I started this to try and answer it, and all this was the result... confussing isn't it :p
quote:
Originally posted by lopardo
So, my question is how does Plus read the AppSettings value to determine if MSN Messenger should start when Windows starts?
So, my second answer would be, it doesn't :p
It does do some checks and makes some changes when Messenger quits, and depending on that (HandleMessengerStart, AutoMsg4Start, AutoMsg5Start ?) it starts up Messenger the next time...
But is seems that when Plus! is started with /WinStart it doesn't perform all those checks....



Patchou, post your code instead, much easier :p ... nah... j/k



FYI: AppSettings consists of a some hexadecimal numbers indicating some general settings for MSN Messenger (eg: 62 0E 00 80):
=> if bit 1 of the second one (0E) is set (= bit 17 from the entire number, see above code), then MSN Messenger is started up when windows starts up and there should be an entry in the run-key. (eg: if it wasn't set in this example then the second number would be "0C")
=> if bit 5 of the first one (62) is set, then the option "open messenger main window when messenger starts" is selected also. (eg: if it wasn't set in this example then the first number would be "42"). Note that this bit is always set when bit 1 of second number is not set.
=> if bit 2 of the second one (0E) is set, then the option "allow automatic sign in when connected to the internet" is selected.
=> etc...

This post was edited on 08-11-2004 at 04:59 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
08-11-2004 01:32 PM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Force Plus to load
quote:
Originally posted by lopardo
I installed MSN Messenger 6.2 and then Plus. MSN Messenger set itself at startup in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run. Plus set itself at startup in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run.

That depends on if you install Plus! in a admin account, on a windows with multiple accounts, etc... I assume
.-= A 'frrrrrrrituurrr' for Wacky =-.
08-11-2004 05:02 PM
Profile PM Find Quote Report
Patchou
Messenger Plus! Creator
*****

Avatar

Posts: 8607
Reputation: 201
43 / Male / Flag
Joined: Apr 2002
RE: Force Plus to load
lol... you're right, here is the code :p. I think you found out pretty much everythign anyway. As for "HandleMessengerStart" it's just here as a user setting (how did you know about it? I don't remember giving this information publicly :). I added it in case someone wouldn't want Plus! to create it's own /Winstart key for some obscure technical reason.

code:
//
///////////////////////////////////////////////////////////////
void CMsgPlusUtilWnd::PreventAutoMessengerStart()
{
    try
    {
        TRACE("CMsgPlusUtilWnd::PreventAutoMessengerStart - called");

        //Removes Messenger from Windows starts and remember the command lines
        CRegKey reg;
        if(reg.Open(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Run")) == ERROR_SUCCESS)
        {
            TCHAR sPath[1024]; sPath[0] = '\0';
            ULONG nSize = 1024;
            reg.QueryStringValue(CPreferences::GetMessengerVersion() < 5 ? _T("MSMSGS") : _T("msnmsgr"), sPath, &nSize);
            reg.DeleteValue(_T("MessengerPlus2")); //Delete the old value

            CRegKey regMP;
            regMP.Create(HKEY_CURRENT_USER, _T("Software\\Patchou\\MsgPlus2"));
           
            DWORD nEnable = 1;
            regMP.QueryDWORDValue(_T("HandleMessengerStart"), nEnable);
            if(nEnable)
            {
                //First, check if we can do something here
                regMP.QueryDWORDValue(_T("HandleMessengerStart"), nEnable);
                if(sPath[0] == '\0')
                {
                    TCHAR sMPPath[1024]; sMPPath[0] = '\0';
                    DWORD nSize = 1024;
                    regMP.QueryStringValue(CPreferences::GetMessengerVersion() < 5 ? _T("AutoMsg4Start") : _T("AutoMsg5Start"), sMPPath, &nSize);
                    if(sMPPath[0] == '\0')
                        return;
                }

                //Check if Messenger is set to start automatically
                bool bMessengerStart = false;

                CRegKey regAdmin;
                DWORD nNotAdminMode = FALSE;
                if(regAdmin.Open(HKEY_CURRENT_USER, _T("Software\\Patchou\\MsgPlus2"), KEY_READ) == ERROR_SUCCESS)
                {
                    regAdmin.QueryDWORDValue(_T("NotAdminMode"), nNotAdminMode);
                    regAdmin.Close();
                }

                if(!nNotAdminMode)
                {
                    if(CPreferences::GetMessengerVersion() < 5)
                    {
                        CRegKey reg;
                        if(reg.Open(HKEY_CURRENT_USER, _T("Software\\Microsoft\\MessengerService")) == ERROR_SUCCESS)
                        {
                            DWORD nAppSettings = 0;
                            reg.QueryDWORDValue(_T("AppSettings"), nAppSettings);
                            if(nAppSettings & 0x200)
                                bMessengerStart = true;
                        }
                    }
                    else
                    {
                        CRegKey reg;
                        if(reg.Open(HKEY_CURRENT_USER, _T("Software\\Microsoft\\MSNMessenger")) == ERROR_SUCCESS)
                        {
                            DWORD nAppSettings = 0;
                            reg.QueryDWORDValue(_T("AppSettings"), nAppSettings);
                            if(nAppSettings & 0x200)
                                bMessengerStart = true;
                        }
                    }
                }

                //Add or remove our MP start value?
                if(bMessengerStart)
                {
                    //Add a special Messenger Plus! command line
                    string sMPCmdLine = _T("\"");
                    sMPCmdLine += CPreferences::GetMessengerPlusBinDir();
                    sMPCmdLine += _T("\\");
                    sMPCmdLine += CPreferences::GetMsgPlusExeName();
                    sMPCmdLine += _T("\" /WinStart");
                    reg.SetStringValue(_T("MessengerPlus3"), sMPCmdLine);

                    //Remember the path
                    if(sPath[0] != '\0')
                        regMP.SetStringValue(CPreferences::GetMessengerVersion() < 5 ? _T("AutoMsg4Start") : _T("AutoMsg5Start"), sPath);
                    reg.DeleteValue(CPreferences::GetMessengerVersion() < 5 ? _T("MSMSGS") : _T("msnmsgr"));
                }
                else
                    regMP.DeleteValue(CPreferences::GetMessengerVersion() < 5 ? _T("AutoMsg4Start") : _T("AutoMsg5Start"));
            }
            else
                reg.DeleteValue(_T("MessengerPlus3"));
        }
        TRACE("CMsgPlusUtilWnd::PreventAutoMessengerStart - exited");
    }
    catch(...)
    {
        TRACE("An exception was thrown in CMsgPlusUtilWnd::PreventAutoMessengerStart");
    }
}
[Image: signature2.gif]
08-11-2004 05:50 PM
Profile PM Web Find Quote Report
Dempsey
Scripting Contest Winner
*****

Avatar
http://AdamDempsey.net

Posts: 2395
Reputation: 53
38 / Male / Flag
Joined: Jul 2003
RE: Force Plus to load
:o Plus! source! :o
SoundPacks   -   Scripts   -   Skins

that's not a bug, thats an unexpected feature
08-11-2004 06:47 PM
Profile E-Mail PM Web Find Quote Report
Choli
Elite Member
*****

Avatar
Choli

Posts: 4714
Reputation: 42
43 / Male / Flag
Joined: Jan 2003
RE: Force Plus to load
quote:
Originally posted by Patchou
As for "HandleMessengerStart" it's just here as a user setting (how did you know about it?
quote:
Originally posted by CookieRevised
these things can be found out with programs like Registry Monitor...
Patchou: a nice tool from sysinternals: http://www.sysinternals.com/ntw2k/source/regmon.shtml

Cookie: i don't have time now to read your pseudo-code nor patchou's code, so, could you send me a brief description of what HandleMessengerStart does? tnx;)
quote:
Originally posted by Dempsey
:o Plus! source! :o
it isn't the first time :P
Messenger Plus! en espaņol:
<< http://www.msgpluslive.es/ >>
<< http://foro.msgpluslive.es/ >>
:plus4:
08-11-2004 09:06 PM
Profile PM Find Quote Report
lopardo
Veteran Member
*****


Posts: 1395
Reputation: 33
38 / Male / Flag
Joined: Nov 2002
Status: Away
O.P. RE: Force Plus to load
Great! Now I understand :)

This is for Delphi:
function IsMessengerAutostartEnabled: Boolean;
var
  reg: TRegistry;
  Buffer: DWORD;
begin
  Result := False;

  reg := TRegistry.Create;
  try
    reg.RootKey := HKEY_CURRENT_USER;

    if (reg.OpenKey('\Software\Microsoft\MSNMessenger',False)) then
    begin
      try
        if (reg.ReadBinaryData('AppSettings',Buffer,SizeOf(Buffer)) = 4) then
        begin
          Result := (Buffer and $0200 <> 0);
        end;
      except
      end;
    end;
  finally
    reg.Free;
  end;
end;

One last thing though, how did you know that option was 0x200?
[Image: userbar452797dd.gif]
08-12-2004 04:44 AM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Force Plus to load
That's the easy part...

Select the option in Messenger, press ok, check the value in the registry...
Unselect the option in Messenger, press ok, check the value in the registry...
Compare the two....

;)
.-= A 'frrrrrrrituurrr' for Wacky =-.
08-12-2004 08:38 AM
Profile PM Find Quote Report
Pages: (2): « First « 1 [ 2 ] Last »
« Next Oldest Return to Top Next Newest »


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