LowRider2112

Hello all.

I want to be able to do the exact same functionality that the Windows Explorer shell does for the Downloaded Program Files folder, when you right-click an object and select Remove.

Is there an interface I can use for this via C++ Any code sample reference would be great as well.

Thanks so much, it would really help our QA dept. if I could provide this functionality, then they could write a "clean up" script for our web application that installs a bunch of controls.



Re: Internet Explorer Web Development How can I remove components like the Downloaded Program Files shell does?

all3nmfa

I've been trying to do this as well with no luck. anyone out there figure this out

thanks,
allen




Re: Internet Explorer Web Development How can I remove components like the Downloaded Program Files shell does?

all3nmfa

the API you need is called RemoveControlByName and it is documented on MSDN




Re: Internet Explorer Web Development How can I remove components like the Downloaded Program Files shell does?

LowRider2112

Well that explains why I couldn't find it, as I was looking in IE interfaces and Win32 libraries for anything that looked like it might have to do with removing controls.

Looks like RemoveControlByName() is part of the OCCACHE.DLL. Here's the MSDN link I found on it: http://msdn2.microsoft.com/en-us/library/Aa768173.aspx

Thank you!





Re: Internet Explorer Web Development How can I remove components like the Downloaded Program Files shell does?

all3nmfa

hey lowrider,

are you going to make your app in c++ or .net i can't figure this out for the life of me. still learning programming. if you can, can you post a sample when you figure this out or send via email

thanks!

allen




Re: Internet Explorer Web Development How can I remove components like the Downloaded Program Files shell does?

all3nmfa

i gave this a try and need some help. it deletes the INF file within the downloaded program but doesn't clean up the dll's or the registry entries. am i passing the correct parameters or something wrong with my declarations TIA
Code Block


[DllImport("occache", EntryPoint = "RemoveControlByName")]
static extern int RemoveControlByName(string lpszFile, string lpszCLSID, string lpszTypelibid, bool bForceRemove, int dwISDistUnit);



retval = RemoveControlByName(@"C:\WINDOWS\Downloaded Program Files\MFA.dll", "{53A8AEF8-5503-4B78-A091-634BB68DEECE}", "ActiveX Control", true, 0);