Active Desktop
-
Hello, I have developed a Channel File that is distributed using an installation file. In order to install the File on the active desktop I use a small C++ application which does the following: ShellExecute(NULL, NULL, activedesktop.cdf, "", "", SW_NORMAL); When I tested on several machines on some XP it works just fine and on other it does not show the Add Item to Active Desktop dialog. If someone has experience with the Active Desktop I would appreciate a suggestion. Thanks, Dan.
-
Hello, I have developed a Channel File that is distributed using an installation file. In order to install the File on the active desktop I use a small C++ application which does the following: ShellExecute(NULL, NULL, activedesktop.cdf, "", "", SW_NORMAL); When I tested on several machines on some XP it works just fine and on other it does not show the Add Item to Active Desktop dialog. If someone has experience with the Active Desktop I would appreciate a suggestion. Thanks, Dan.
Hello, I have managed to find the solution. For anyone interested this is it:
bool InstallActiveDesktop() { COMPONENT component; COMPPOS comppos; CoInitialize(NULL); HRESULT hr; IActiveDesktop *pActiveDesktop; hr = CoCreateInstance(CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER, IID_IActiveDesktop, (void**)&pActiveDesktop); ZeroMemory(&component, sizeof(COMPONENT)); component.dwSize = sizeof(COMPONENT); component.iComponentType = COMP_TYPE_WEBSITE; component.fChecked = TRUE; component.fDirty = TRUE; component.fNoScroll = TRUE; comppos.dwHeight = 400; comppos.dwSize = sizeof(COMPPOS); comppos.dwWidth = 165; comppos.fCanResize = TRUE; comppos.fCanResizeX = TRUE; comppos.fCanResizeY = TRUE; comppos.iLeft = 400; comppos.iTop = 20; comppos.izIndex = 0; component.cpPos = comppos; MultiByteToWideChar(CP_ACP, 0, "FriendlyName", strlen("FriendlyName")+1, component.wszFriendlyName, sizeof(component.wszFriendlyName)); MultiByteToWideChar(CP_ACP, 0, "http://www.complete.link", strlen("http://www.complete.link")+1, component.wszSource, sizeof(component.wszFriendlyName)); component.dwCurItemState = IS_NORMAL; pActiveDesktop->AddDesktopItem(&component, 0); pActiveDesktop->ApplyChanges(AD_APPLY_ALL); pActiveDesktop->Release(); CoUninitialize(); return true; } bool UnInstallActiveDesktop() { COMPONENT component; COMPPOS comppos; CoInitialize(NULL); HRESULT hr; IActiveDesktop *pActiveDesktop; hr = CoCreateInstance(CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER, IID_IActiveDesktop, (void**)&pActiveDesktop); ZeroMemory(&component, sizeof(COMPONENT)); component.dwSize = sizeof(COMPONENT); component.iComponentType = COMP_TYPE_WEBSITE; component.fChecked = TRUE; component.fDirty = TRUE; component.fNoScroll = TRUE; comppos.dwHeight = 400; comppos.dwSize = sizeof(COMPPOS); comppos.dwWidth = 165; comppos.fCanResize = TRUE; comppos.fCanResizeX = TRUE; comppos.fCanResizeY = TRUE; comppos.iLeft = 100; comppos.iTop = 20; comppos.izIndex = 0; component.cpPos = comppos; MultiByteToWideChar(CP_ACP, 0, "FriendlyName", strlen("FriendlyName")+1, component.wszFriendlyName, sizeof(component.wszFriendlyName)); MultiByteToWideChar(CP_ACP, 0, "http://www.complete.link", strlen("http://ww