Re: Installing IE toolbar for one user only

From: Cristian Amarie (cristianamarie_at_hotmail.com)
Date: 03/24/05


Date: Thu, 24 Mar 2005 19:37:41 +0200

Yes it is, but I'm not very sure how. From what I see in my registry there
is only a single key named CmdMapping, containing several values associated
by installed extension.

Name Type Value
Default REG_SZ ""
(GUID) REG_DWORD 0x00002000
(GUID) REG_DWORD 0x00002001
(GUID) REG_DWORD 0x00002002
NextId REG_DWORD 0x00002003

>From what they look like it seems are command IDs used by the parent rebar
control (possibly also by IOleCommandTarget ?).
But this is only a guess...

Cristian

"Jan" <biteme@nospam.com> wrote in message
news:eqYtmyIMFHA.244@tk2msftngp13.phx.gbl...
> Hi Cristian,
>
> Thanks for your reply. That technique would certainly work.
>
> I take it the registry key HKCU\Software\Microsoft\Internet
> Explorer\Extensions isnt used by IE?
>
> Jan
>
> "Cristian Amarie" <cristianamarie@hotmail.com> wrote in message
> news:#nj2sNIMFHA.580@TK2MSFTNGP15.phx.gbl...
>> The registration should be kept on HKLM, otherwise the extension won't be
>> recognized.
>> You can try to:
>> - set up a custom key/value name to save/load the user name (as well as
>> other informations as needed);
>> - modify the code of DllMain in order to load the user name from registry
>> - get the current user name;
>> - compare the registry value with the current user name;
>> - if they matches, continue with the normal loading, else you can either
>> return FALSE from DllMain so the dll won't be loaded.
>>
>> A similar technique is used when the extension doesn't want to be loaded
> on
>> explorer.exe, but only on IExplore.exe:
>>
>> BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwCallReason, LPVOID
>> pvReserved)
>> {
>> TCHAR szRegUserName[UNLEN + 1];
>> TCHAR szCurUserName[UNLEN + 1];
>>
>> GetUserName(szCurUserName);
>> /* read from registry into szRegUserName */
>> if ( lstrcmp(szRegUserName, szCurUserName) != 0) {
>> return FALSE; /* do not load extension for other user(s) */
>> }
>>
>> /* normal DllMain implementation */
>> return TRUE;
>> }
>>
>> (Note. Error checking and registry read is stripped).
>>
>> Cristian Amarie
>>
>>
>> "Jan" <biteme@nospam.com> wrote in message
>> news:%23%23BPecxLFHA.2384@tk2msftngp13.phx.gbl...
>> > Hi,
>> >
>> > I'm trying to install an Internet Explorer toolbar so that it appears
> for
>> > the installing user only. As I understand it changing the registry keys
>> > from
>> > HKLM to HKCU should achieve this however when I do this the toolbar
> doesnt
>> > appear. Is there something else I have to change?
>> >
>> > Here is the registration code.
>> >
>> > STDAPI DllRegisterServer(void)
>> > {
>> > // registers object, typelib and all interfaces in typelib
>> >
>> > HKEY hKey = NULL;
>> >
>> > RegCreateKeyEx(HKEY_CURRENT_USER,
>> > _T("Software\\Microsoft\\Internet Explorer\\Toolbar"),
>> > 0,
>> > NULL,
>> > REG_OPTION_NON_VOLATILE,
>> > KEY_WRITE,
>> > NULL,
>> > &hKeyLocal,
>> > NULL);
>> >
>> > RegSetValueEx(hKey,
>> > _T("{19BDA04B-AACD-46ED-B2FA-5C71B289B131}"),
>> > 0,
>> > REG_BINARY,
>> > NULL,
>> > 0);
>> >
>> > RegCloseKey(hKey);
>> >
>> > return _Module.RegisterServer(TRUE);
>> > }
>> >
>> > // Here is the .rgs file
>> >
>> > HKCR
>> > {
>> > MVToolbar.MVToolbarObj.1 = s 'MV'
>> > {
>> > CLSID = s '{19BDA04B-AACD-46ED-B2FA-5C71B289B131}'
>> > }
>> > MVToolbar.MVToolbarObj = s 'MV'
>> > {
>> > CLSID = s '{19BDA04B-AACD-46ED-B2FA-5C71B289B131}'
>> > CurVer = s 'MVToolbar.MVToolbarObj.1'
>> > }
>> > NoRemove CLSID
>> > {
>> > ForceRemove {19BDA04B-AACD-46ED-B2FA-5C71B289B131} = s 'MV'
>> > {
>> > ProgID = s 'MVToolbar.MVToolbarObj.1'
>> > VersionIndependentProgID = s 'MVToolbar.MVToolbarObj'
>> > ForceRemove 'Programmable'
>> > InprocServer32 = s '%MODULE%'
>> > {
>> > val ThreadingModel = s 'Apartment'
>> > }
>> > 'TypeLib' = s '{DC9180A4-6B8D-462C-9ADE-65975BD956E4}'
>> > }
>> > }
>> > }
>> > HKCU
>> > {
>> > Software
>> > {
>> > Microsoft
>> > {
>> > 'Internet Explorer'
>> > {
>> > Extensions
>> > {
>> > ForceRemove {D1EDFDDA-9EA5-4985-B8BA-2DCB1A479D3B} = s 'MV'
>> > {
>> > val BandClsid = s '{19BDA04B-AACD-46ED-B2FA-5C71B289B131}'
>> > val Clsid = s '{E0DD6CAB-2D10-11D2-8F1A-0000F87ABD16}'
>> > val 'Default Visible' = s 'Yes'
>> > }
>> > }
>> > }
>> > }
>> > }
>> > }
>> >
>> > Am I missing something?
>> >
>> > Thanks,
>> >
>> > Jan
>> >
>> >
>>
>>
>
>



Relevant Pages

  • Re: [fitsbits] Start of "Foreign File Encapsulation" Public Comment Period
    ... I have been following the discussion on the FOREIGN extension for quite ... There was some confusion about the fact that a thing like the FOREIGN ... extension should go in the convention registry, ...
    (sci.astro.fits)
  • Re: Custom IE toolbar button
    ... registry modifications, so user must be familiar with the registry and ... globally unique identifiers (GUID). ... programming so that programmers can get paid more. ... That's the extension CLSID. ...
    (microsoft.public.scripting.vbscript)
  • Re: FileInfo, Getting File properties, particularly File TYPE
    ... the concept of this description string it would not make alot of sense to ... extension of .tif, based on what application is associated with the ... Remember also that your code will need registry permissions to access the ... FileInfo object does not seem to expose some of ...
    (microsoft.public.dotnet.general)
  • Re: change app associated with right-click menu "Edit" option
    ... Right click on each file with extension you want to change, ... This will false All Opens to use your application, whether you want to Edit ... Or you can add an Edit key to each extension in the registry to use your ...
    (microsoft.public.win2000.registry)
  • Re: untitled bmp crapola!!!
    ... > pc decided it couldn't save a jpeg as a jpeg. ... Information About Editing the Registry ... ".jpg extension may be incorrect in registry" ... changing them to .jpg ...
    (microsoft.public.windowsxp.photos)