WINAMP.COM | Forums : Powered by vBulletin version 2.3.9 WINAMP.COM | Forums > Developer Center > NSIS Discussion > Plugin for controlling Internet Explorer
  Last Thread   Next Thread
Author
Thread Post New Thread    Post A Reply
dRaakje
Junior Member

Registered: Oct 2003
From: Netherlands

Plugin for controlling Internet Explorer

Hi,

I've created a plugin for controlling Internet Explorer. I haven't found anything like it yet. Or anyway, that has the ability to make toolbars visible in Internet Explorer.

I know, it's a bit big (51K) but I couldn't get it to compile/link smaller

Anyway, it does the following, not much, but it can easily be expanded upon:

- Open an internet explorer instance
- Surf to an URL
- Make a toolbar visible (you need to know its CLSID)
- Close the browser.

source files included.

Remco Lam

Attachment: iefunctions.zip
This has been downloaded 402 time(s).

Quick Link | Report this post to a moderator | IP: Logged

dRaakje is offline Old Post 10-30-2003 10:39 AM
Click Here to See the Profile for dRaakje Click here to Send dRaakje a Private Message Find more posts by dRaakje Add dRaakje to your buddy list Edit/Delete Message Reply w/Quote
DrO
Moderator

Registered: Sep 2003
From: UK

can't look at your code at the moment but have a look at the source code for the plugin here which may be of use in showing how you can cut the dll size down

the code has a similar feature to you're plugin i guess and when i put the code in it only added 1k to 1.5k to the plugin's size (was thinking of coding a similar plugin myself but don't need to now i guess )

hope this is of some help

-daz

__________________
My Plugin Site | Current Plugin Releases | Winamp-en-gb Lang Pack [14/03/2009 (Rev #2)]

Quick Link | Report this post to a moderator | IP: Logged

DrO is offline Old Post 10-30-2003 01:26 PM
Click Here to See the Profile for DrO Click here to Send DrO a Private Message Find more posts by DrO Add DrO to your buddy list Edit/Delete Message Reply w/Quote
dRaakje
Junior Member

Registered: Oct 2003
From: Netherlands

I've downloaded and compiled that plugin and compared all the settings.

I could copy almost all settings and it still worked. All except the entrypoint, if I set that I get the following error:

libcmt.lib(crt0.obj) : error LNK2001: unresolved external symbol _main

Besides, I think most of the filesize probably comes from the my inclusion of COM pointers... (comdef.h) But if anyone manages in creating a smaller dll, I'd be very interested

Quick Link | Report this post to a moderator | IP: Logged

dRaakje is offline Old Post 10-30-2003 02:30 PM
Click Here to See the Profile for dRaakje Click here to Send dRaakje a Private Message Find more posts by dRaakje Add dRaakje to your buddy list Edit/Delete Message Reply w/Quote
DrO
Moderator

Registered: Sep 2003
From: UK

the reason for the size is because of 'libcmt.lib' which is the c run time (crt) library. had a look and you're using things like sprintf, memset and using the default 'new' and 'delete' operators.

in my code i redefine the 'new' and 'delete' operators to not use the crt and if you put in you're own memset function and to use wsprintf(..) then that should cut things down

if you don't beat me to it i'll post a modified version for you

-daz

__________________
My Plugin Site | Current Plugin Releases | Winamp-en-gb Lang Pack [14/03/2009 (Rev #2)]

Quick Link | Report this post to a moderator | IP: Logged

DrO is offline Old Post 10-30-2003 05:18 PM
Click Here to See the Profile for DrO Click here to Send DrO a Private Message Find more posts by DrO Add DrO to your buddy list Edit/Delete Message Reply w/Quote
deguix
Major Dude

Registered: Dec 2002
From: Everett - MA, USA

quote:
Make a toolbar visible


It can't be done using the registry?

And the other features:

- Open the Internet Explorer: Using the function "Wait file execution registry based" and just renaming the part that says (like) ExecWait "$..." to Exec "$...".
- Close the Internet Explorer: Have some functions in Archive for it.
- Opening an URL: Executing (i.e.) http://www.test.com using "Wait file execution registry based" (see Open the Internet Explorer).

(to get the function "Wait file execution registry based", see it in my signature)

__________________
My Wiki Pages

Working now on:
New projects. (language: any)

Quick Link | Report this post to a moderator | IP: Logged

deguix is offline Old Post 10-30-2003 08:56 PM
Click Here to See the Profile for deguix Click here to Send deguix a Private Message Click Here to Email deguix Find more posts by deguix Add deguix to your buddy list Edit/Delete Message Reply w/Quote
dRaakje
Junior Member

Registered: Oct 2003
From: Netherlands

quote:
Originally posted by deguix
[B]It can't be done using the registry?



It probably can, but I've looked into that, and it looks like IE stores its active toolbars in a binary registry setting. Good luck deciphering that!

And of course, you could use other functions to open IE and surf to an URL. But my point was this one can easily be extended for all sorts of functions. You can even receive IE events (although I don't know why you'd need that in an installer)

Dr0:
Much obliged if you'd post that updated version. I'm pretty goed at high level programming, but don't ask me about low level code optimizations... Although I'll certainly take a look at your code and play around with it. Always good to learn something new. Why, just this week I learned how to make an installer using NSIS

Remco

Quick Link | Report this post to a moderator | IP: Logged

dRaakje is offline Old Post 10-31-2003 06:42 AM
Click Here to See the Profile for dRaakje Click here to Send dRaakje a Private Message Find more posts by dRaakje Add dRaakje to your buddy list Edit/Delete Message Reply w/Quote
DrO
Moderator

Registered: Sep 2003
From: UK

here's what i've done (only 4.5k now ) i have stripped some bits from the project (exdll dependancies which weren't needed) and a few other bits.

the link error was to do with the crt being included i've altered the Navigate and Toolbar functions (the Navigate definitely works but you'll need to check the toolbar one out)

for interest it is related to the _bstr_t (taken from an msdn example)

quote:
Favorites Reader uses some of the new C++ smart pointers and new types available in Visual C++ 5.0 such as _bstr_t. These features clean up the code significantly but unfortunately they do require the C Run-time. This does increase the size of the DLL a bit.
40k is a bit (bigger than a basic nsis installer )

-daz

Attachment: iefuncs.zip
This has been downloaded 335 time(s).

__________________
My Plugin Site | Current Plugin Releases | Winamp-en-gb Lang Pack [14/03/2009 (Rev #2)]

Quick Link | Report this post to a moderator | IP: Logged

DrO is offline Old Post 10-31-2003 01:09 PM
Click Here to See the Profile for DrO Click here to Send DrO a Private Message Find more posts by DrO Add DrO to your buddy list Edit/Delete Message Reply w/Quote
dRaakje
Junior Member

Registered: Oct 2003
From: Netherlands

quote:
Originally posted by DrO
here's what i've done (only 4.5k now ) i have stripped some bits from the project (exdll dependancies which weren't needed) and a few other bits.



Wow! I'm impressed. As I said before, I've never really looked at how to optimize my code for size.

Unforunately, showbar doesn't work anymore...

Which is really weird, since I've stepped through the execution and the BSTR variant looks exactly the same whether I fill it using your functions or whether I use _bstr_t as a cast. (I put it back in just to test)



Remco

Quick Link | Report this post to a moderator | IP: Logged

dRaakje is offline Old Post 10-31-2003 02:17 PM
Click Here to See the Profile for dRaakje Click here to Send dRaakje a Private Message Find more posts by dRaakje Add dRaakje to your buddy list Edit/Delete Message Reply w/Quote
dRaakje
Junior Member

Registered: Oct 2003
From: Netherlands

Just relalized something. I think the problem is with bstr ownership.
When I do this:
vtBandGUID1.bstrVal = _bstr_t(szBarCLSID);

the _bstr_t class knows its being assigned to another BSTR and so relinguishes control over the BSTR (Or allocates a new BSTR)

When I do:
vtBandGUID2.bstrVal = bBarCLSID;

Nothing special is done and the call of ShowBandObject doesn't have access to the bstr that is being passed on.
VariantClear() afterwards isn't even necessary...

Or am I completely off track here... I have to admit, I've been bluffing my way through COM without really understanding it :P

Remco

Quick Link | Report this post to a moderator | IP: Logged

dRaakje is offline Old Post 10-31-2003 02:23 PM
Click Here to See the Profile for dRaakje Click here to Send dRaakje a Private Message Find more posts by dRaakje Add dRaakje to your buddy list Edit/Delete Message Reply w/Quote
dRaakje
Junior Member

Registered: Oct 2003
From: Netherlands

Well, I was right, I've solved it.

I just needed to add SysAllocString

So the call now is:
vURL.bstrVal = SysAllocString(bstrUrl);

Thanx for the downsizing help daz!

Give me sec and I'll upload a new working version

Quick Link | Report this post to a moderator | IP: Logged

dRaakje is offline Old Post 10-31-2003 02:31 PM
Click Here to See the Profile for dRaakje Click here to Send dRaakje a Private Message Find more posts by dRaakje Add dRaakje to your buddy list Edit/Delete Message Reply w/Quote
dRaakje
Junior Member

Registered: Oct 2003
From: Netherlands

Well, here it is. The dll is now 4.5K

Actually the bug is pretty obvious, once you see it

Again, thanks daz

Remco

Attachment: iefunctions.zip
This has been downloaded 336 time(s).

Quick Link | Report this post to a moderator | IP: Logged

dRaakje is offline Old Post 10-31-2003 02:45 PM
Click Here to See the Profile for dRaakje Click here to Send dRaakje a Private Message Find more posts by dRaakje Add dRaakje to your buddy list Edit/Delete Message Reply w/Quote
DrO
Moderator

Registered: Sep 2003
From: UK

just seen this has changed.

it was no problem plus a 4.5k is a lot nicer

-daz

[edit]
just checked out the new version and i see you haven't updated the text file -> still refers to a 56k file size. pointing it out in case you haven't noticed it already
[/edit]

__________________
My Plugin Site | Current Plugin Releases | Winamp-en-gb Lang Pack [14/03/2009 (Rev #2)]

Last edited by DrO on 10-31-2003 at 04:52 PM

Quick Link | Report this post to a moderator | IP: Logged

DrO is offline Old Post 10-31-2003 02:52 PM
Click Here to See the Profile for DrO Click here to Send DrO a Private Message Find more posts by DrO Add DrO to your buddy list Edit/Delete Message Reply w/Quote
dRaakje
Junior Member

Registered: Oct 2003
From: Netherlands

quote:
Originally posted by DrO

just checked out the new version and i see you haven't updated the text file -> still refers to a 56k file size. pointing it out in case you haven't noticed it already



Does this justify uploading it again? I think I'll just leave it this way. I'll change it locally in case I ever need to distrtibute it again. Thanks for the tip

<edit>
Well, I'll upload it again, I've made some changes anyway
>/edit>

Remco

Last edited by dRaakje on 11-03-2003 at 10:42 AM

Quick Link | Report this post to a moderator | IP: Logged

dRaakje is offline Old Post 11-03-2003 10:05 AM
Click Here to See the Profile for dRaakje Click here to Send dRaakje a Private Message Find more posts by dRaakje Add dRaakje to your buddy list Edit/Delete Message Reply w/Quote
dRaakje
Junior Member

Registered: Oct 2003
From: Netherlands

Here's a new version. The attached zip contains the 2 dll's, one real small one (3.5K) that works just fine. And a slightly bigger one (5.1K) that displays some messageboxes when an error occurs.

Of course I've also updated the included text file.

Greets

Remco

Attachment: iefunctions.zip
This has been downloaded 1487 time(s).

Quick Link | Report this post to a moderator | IP: Logged

dRaakje is offline Old Post 11-03-2003 10:44 AM
Click Here to See the Profile for dRaakje Click here to Send dRaakje a Private Message Find more posts by dRaakje Add dRaakje to your buddy list Edit/Delete Message Reply w/Quote
kichik
M.I.A.
[NSIS Dev, Mod]

Registered: Oct 2001
From: Jerusalem, Israel

No Archive page?

__________________
NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius

Quick Link | Report this post to a moderator | IP: Logged

kichik is offline Old Post 11-05-2003 08:15 PM
Click Here to See the Profile for kichik Click here to Send kichik a Private Message Visit kichik's homepage! Find more posts by kichik Add kichik to your buddy list Edit/Delete Message Reply w/Quote
dRaakje
Junior Member

Registered: Oct 2003
From: Netherlands

quote:
Originally posted by kichik
No Archive page?


Is that something I should do? I'm still new to all this

Remco

Quick Link | Report this post to a moderator | IP: Logged

dRaakje is offline Old Post 11-06-2003 06:31 AM
Click Here to See the Profile for dRaakje Click here to Send dRaakje a Private Message Find more posts by dRaakje Add dRaakje to your buddy list Edit/Delete Message Reply w/Quote
DrO
Moderator

Registered: Sep 2003
From: UK

archive is here

you will need to register as a user for the archive (is up at the top of the page to do that). once your registered then go down to 'contribute' (or similar worded) and follow the instructions.

as a note you should probably link to the most current version you have in this thread on the page you create.

-daz

__________________
My Plugin Site | Current Plugin Releases | Winamp-en-gb Lang Pack [14/03/2009 (Rev #2)]

Quick Link | Report this post to a moderator | IP: Logged

DrO is offline Old Post 11-06-2003 11:12 AM
Click Here to See the Profile for DrO Click here to Send DrO a Private Message Find more posts by DrO Add DrO to your buddy list Edit/Delete Message Reply w/Quote
dRaakje
Junior Member

Registered: Oct 2003
From: Netherlands

quote:
Originally posted by DrO
as a note you should probably link to the most current version you have in this thread on the page you create.



Ah, that last one, I didn't think of that... I'd already checked the contrib part of the archive, but since I wasn't allowed to upload I didn't see the point in submitting anything

I'll make a page right away...

<EDIT>
It is URL submitted by user.!
</EDIT>
Remco

Quick Link | Report this post to a moderator | IP: Logged

dRaakje is offline Old Post 11-06-2003 11:22 AM
Click Here to See the Profile for dRaakje Click here to Send dRaakje a Private Message Find more posts by dRaakje Add dRaakje to your buddy list Edit/Delete Message Reply w/Quote
wacki
Junior Member

Registered: Jun 2008
From:

I downloaded the plugin and put it in:

C:\Program Files\NSIS\Plugins

And then I tried compiling this:


outFile "installer.exe"
section
IEFunctions::OpenBrowser /NOUNLOAD
sectionEnd


only to get this error:

Invalid command: IEFunctions::OpenBrowser
Error in script "C:\Documents and Settings\jnowacki\Desktop\NSIS\link.nsi" on line 7 -- aborting creation process


Suggestions?

Quick Link | Report this post to a moderator | IP: Logged

wacki is offline Old Post 06-27-2008 01:48 AM
Click Here to See the Profile for wacki Click here to Send wacki a Private Message Click Here to Email wacki Find more posts by wacki Add wacki to your buddy list Edit/Delete Message Reply w/Quote
Afrow UK
Moderator

Registered: Nov 2002
From: Shropshire, England

Make sure you put IEFunctions.dll not IEFunctionsDbg.dll in there. Also what are you doing exactly? If you want to just open a web page, just use ExecShell open `http://...`

Stu

__________________
afrowuk.co.uk

Quick Link | Report this post to a moderator | IP: Logged

Afrow UK is offline Old Post 06-27-2008 03:01 PM
Click Here to See the Profile for Afrow UK Click here to Send Afrow UK a Private Message Click Here to Email Afrow UK Visit Afrow UK's homepage! Find more posts by Afrow UK Add Afrow UK to your buddy list Edit/Delete Message Reply w/Quote
All times are GMT. The time now is 09:56 AM. Post New Thread    Post A Reply
  Last Thread   Next Thread
WINAMP.COM | Forums : Powered by vBulletin version 2.3.9 WINAMP.COM | Forums > Developer Center > NSIS Discussion > Plugin for controlling Internet Explorer
Show Printable Version
 | 
Email this Page
 | 
Subscribe to this Thread

Forum Jump:
 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is off
vB code is ON
Smilies are ON
[IMG] code is ON