private ITypeLib loadShellTypeLib() {
// Microsoft Shell Controls And Automation
CLSID.ByReference clsid = new CLSID.ByReference();
// get CLSID from string
HRESULT hr = Ole32.INSTANCE.CLSIDFromString(new WString(
"{50A7E9B0-70EF-11D1-B75A-00A0C90564FE}"), clsid);
COMUtils.checkRC(hr);
assertEquals(0, hr.intValue());
// get user default lcid
LCID lcid = Kernel32.INSTANCE.GetUserDefaultLCID();
// create a IUnknown pointer
PointerByReference pShellTypeLib = new PointerByReference();
// load typelib
hr = OleAuto.INSTANCE.LoadRegTypeLib(clsid, 1, 0, lcid, pShellTypeLib);
COMUtils.checkRC(hr);
assertEquals(0, hr.intValue());
return new TypeLib(pShellTypeLib.getValue());
}