Author Topic: Registry key REGISTRAR  (Read 2074 times)

ToutEnMasm

  • Member
  • *****
  • Posts: 1189
    • EditMasm
Registry key REGISTRAR
« on: November 12, 2012, 06:35:03 PM »
This ATL feature need only a couple of IID and some defines to work.
Here is what you need to use it.
see msdn REGISTRAR for more information
Quote
.const
   sCLSID_Registrar TEXTEQU <{44EC053AH,400Fh,11D0h,{9Dh,0CDh,00h,0A0h,0C9h,03h,91h,0D3h}}>
      sIID_IRegistrar TEXTEQU   <{044EC053Bh,0400Fh,011D0h,{09Dh,0CDh,000h,0A0h,0C9h,003h,091h,0D3h}}>
.data
   CLSID_Registrar GUID sCLSID_Registrar
   IID_IRegistrar GUID sIID_IRegistrar   
   wregistry dw "R","E","G","I","S","T","R","Y",0
   wmodulefilename dw MAX_PATH dup(0)
ppvIRegistrar dd 0
.code
                ;coinitialise
   invoke CoCreateInstance,addr CLSID_Registrar,NULL,CLSCTX_ALL,\
            addr IID_IRegistrar,addr ppvIRegistrar
   .if ppvIRegistrar != 0
      invoke GetModuleFileNameW,hInstance,addr wmodulefilename,2*MAX_PATH
      IRegistrar ResourceRegister,addr wmodulefilename,300,addr wregistry
      IRegistrar ResourceUnregister,addr wmodulefilename,300,addr wregistry
      ;addreplacement to change a named module %MODULE%
      IRegistrar Release
   .endif
.rc
300          REGISTRY MOVEABLE PURE  "essai.rgs"
.rgs
HKEY_CURRENT_USER
{
  ForceRemove 'ToutEnmasm_registry' = s 'HowGoesIt?'
}


Fa is a musical note to play with CL