General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
Pages: 12Next
Current Page: 1 of 2
Plugins updates (technical)
Posted by: asmpgmr
Date: April 28, 2003 08:41PM

MonkeeSage,

The other thread was getting too long (and wide) so I started a new one.

About the bookmarks problem could you try the following - in ns_bookmarks\ns_bookmarks_edit.cpp, routine EditProc, in case IDCANCEL remove if (feof(bmFile)) { and the corresponding closing } but leave the code within intact, the feof isn't needed and may be the cause of the problem.

---

Implement favorites nicknames by reading the quicksearch registry branch
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl


Add findnick to ie_favorites\ie_plugin.cpp:

else if (stricmp(subject, "AddLink") == 0) {
addLink((char *)data1, (char *)data2);
}
else if (stricmp(subject, "FindNick") == 0) {
findNick((char *)data1, (char *)data2);
}
else return 0;


Add findnick to ie_favorites\ie_utils.cpp:

#include <wininet.h>

#define REG_SEARCHURL "Software\\Microsoft\\Internet Explorer\\SearchUrl"
void findNick(char *nick, char *url)
{
HKEY hKey;
DWORD dwSize;
*url = 0;
if (RegOpenKey(HKEY_CURRENT_USER, REG_SEARCHURL, &hKey) == ERROR_SUCCESS) {
dwSize = INTERNET_MAX_URL_LENGTH;
RegQueryValueEx(hKey, (LPCTSTR)nick, NULL, NULL, (LPBYTE)url, &dwSize);
RegCloseKey(hKey);
}
}

Finally activate the commented out code in BrowserView.cpp in function OnNewUrlEnteredInUrlBar to lookup favorites nicknames.

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: asmpgmr
Date: April 28, 2003 10:11PM

The feof probably isn't the problem. It looks like between ns_bookmarks_edit.cpp 1.17 and 1.18 (see CVS) the IDCANCEL code in EditProc was changed signifcantly. Restoring the 1.17 IDCANCEL code should fix it for now:

case IDCANCEL:
UnhookWindowsHookEx(hHook);
if (hWndFront)
PostMessage(hWndFront, WM_COMMAND, wm_deferbringtotop, (LPARAM) NULL);
ghWndEdit = NULL;
EndDialog(hDlg, 0);
break;

Apparently the newer code is trying to delete any in-memory changes and re-read the bookmarks file but something isn't quite right and the bookmarks menu processing code no longer sees any bookmarks after the re-read.

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: asmpgmr
Date: April 29, 2003 03:09AM

This should fix the problem, in ns_bookmarks_edit.cpp routine EditProc change:

if (feof(bmFile)) {
delete gBookmarkRoot.child;
delete gBookmarkRoot.next;
gBookmarkRoot.child = NULL;
gBookmarkRoot.next = NULL;

strtok(bmFileBuffer, "\n");
ParseBookmarks(bmFileBuffer, gBookmarkRoot);
}

to: (add Rebuild() call to rebuild the menu and toolbars)

if (feof(bmFile)) {
delete gBookmarkRoot.child;
delete gBookmarkRoot.next;
gBookmarkRoot.child = NULL;
gBookmarkRoot.next = NULL;

strtok(bmFileBuffer, "\n");
ParseBookmarks(bmFileBuffer, gBookmarkRoot);
Rebuild();
}

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: MonkeeSage
Date: April 29, 2003 04:59AM

asmpgmr:

Yup that seems to work, up at the usual spot. I'll do the favorites nicks thing tomorrow, I'm really tired tonight. We're moving to a new aprt. day after tomorrow so I've been busy. After Wed. I'll also have a new IP there.


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: asmpgmr
Date: May 03, 2003 11:47PM

MonkeeSage,

I see that your page now lists my favorites quicksearch update, I take it you were able to test it and it worked as expected ? I can't test it since I don't have ie on my system, I removed it from my system as well as a lot of other M$ junk.

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: MonkeeSage
Date: May 04, 2003 01:11AM

asmpgmr:

I assume it works, but I haven't tested it either because I don't have the software installed for using IE nicknames (I also don't have any favorites directory because I have it as one of the security items that gets deleted on reboot).


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: jsnj
Date: May 04, 2003 02:54AM

I just tested it. I have IE6 & IE's Quicksearch addon on my system and couldn't get it to work in KM. As far as nicknames, I don't know how that's implemented in IE Favorites. It's not integrated into Windows98se or the IE Quicksearch addon so I don't know how to test it since there's nowhere to put the nick. Also, with the favorites.dll, KM now takes 13 seconds to start on my system. That's on a warm startup. The favorites.dll from SP1 takes 3 seconds.

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: asmpgmr
Date: May 04, 2003 02:08PM

jsnj,

You would also have to download an updated k-meleon.exe for the favorites nickname search to work. IE itself doesn't have a nickname facility, it's all implemented via the quicksearch add-on which uses the registry

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl\<nickname>

The default key for any nickname is the URL which can have a %s in it for substitution. With this screwy scheme nicknames aren't associated with favorites entries as with Mozilla bookmark keywords or Opera hotlist shortcuts.

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: jsnj
Date: May 04, 2003 05:21PM

OK...downloaded the latest k-meleon-no-manifest.exe. The Quicksearch feature still won't work. BTW, IE's Quicksearch addon doesn't allow nickname support. It defaults out of it and searches for the host if there's no space + search terms after the nickname. So typing g into the URL bar of IE launches a search for host g even if it's entered as http://www.google.com in the Quicksearch edit area. But regular %s Quicksearches still won't work in KM with the latest favorites plugin.

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: asmpgmr
Date: May 04, 2003 05:40PM

MonkeeSage,

Here's a minor change to the code, the three lines which add the findnick function remain the same.

#include <wininet.h>
...
void findNick(char *nick, char *url)
{
HKEY hKey;
DWORD dwSize;
char regkey[128] = "Software\\Microsoft\\Internet Explorer\\SearchUrl\\";
*url = 0;
strncat(regkey, nick, 80);
if (RegOpenKey(HKEY_CURRENT_USER, regkey, &hKey) == ERROR_SUCCESS) {
dwSize = INTERNET_MAX_URL_LENGTH;
RegQueryValueEx(hKey, NULL, NULL, NULL, (LPBYTE)url, &dwSize);
RegCloseKey(hKey);
}
}

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: jsnj
Date: May 04, 2003 06:13PM

One other thing about the favorites plugin.....the IE Favorites Settings prompt has problems. The only functional part of it is the Enable Favorites Toolbar. None of the other fields work because they lose the info once you've OK'd out of the prompt.

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: MonkeeSage
Date: May 04, 2003 11:03PM

asmpgmr:

Is this the correct syntax for the Favorites Quicksearch:

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl]
"kmf"="http://kmeleonbrowser.org/forum/read.php?f=%s";


?

That doesn't work for me either if that is correct, and it is running through the favorites nickname code in the main program because I can still go to hotlist nicknames correctly, and the hotlist nickname search occurs after the favorites one...hmm.


jsnj:

Sounds like the ONOK handler is messed up or something like that...I'll check it against the hotlist and bookmarks code.


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: asmpgmr
Date: May 04, 2003 11:11PM

MonkeeSage,

The building the updated ie_utils.cpp code, the main program code is fine since it's exactly the same as the bookmarks lookup code.

The registry syntax is:
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl\kmf]
@="http://kmeleonbrowser.org/forum/read.php?f=%s";

The updated code reflects this even though it's basically the same.

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: asmpgmr
Date: May 04, 2003 11:12PM

MonkeeSage,

Try building the updated ie_utils.cpp code, the main program code is fine since it's exactly the same as the bookmarks lookup code.

The registry syntax is:
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl\kmf]
@="http://kmeleonbrowser.org/forum/read.php?f=%s";

The updated code reflects this even though it's basically the same.

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: MonkeeSage
Date: May 04, 2003 11:23PM

asmpgmr:

Bookmarks.dll is now using the latest code in ie_utils:

void findNick(char *nick, char *url)
{
HKEY hKey;
DWORD dwSize;
char regkey[128] = "Software\\Microsoft\\Internet Explorer\\SearchUrl\\";
*url = 0;
strncat(regkey, nick, 80);
if (RegOpenKey(HKEY_CURRENT_USER, regkey, &hKey) == ERROR_SUCCESS) {
dwSize = INTERNET_MAX_URL_LENGTH;
RegQueryValueEx(hKey, NULL, NULL, NULL, (LPBYTE)url, &dwSize);
RegCloseKey(hKey);
}
}

And I have the key:

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl\kmf]
@="http://kmeleonbrowser.org/forum/read.php?f=%s";

But for some reason it still doesn't seem to be work.


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: asmpgmr
Date: May 04, 2003 11:41PM

MonkeeSage,

Has to be something in the registry code, quicksearch gets the URL from the default unnamed entry under HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl\<nickname>

I assume you meant favorites.dll not bookmarks.dll

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: asmpgmr
Date: May 04, 2003 11:43PM

MonkeeSage,

Has to be something in the registry code, quicksearch gets the URL from the default unnamed entry under HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl\<nickname>

I assume you meant favorites.dll not bookmarks.dll

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: asmpgmr
Date: May 05, 2003 02:58PM

MonkeeSage,

I can't see any problems in the second version of the code. It appends the passed in nickname to form the registry key (variable regkey), opens the registry key (hKey receives the key handle), reads the default unnamed value (param 2) into variable url (param 5) up to INTERNET_MAX_URL_LENGTH bytes (param 6), and closes the registry key.

Do you have the three lines in ie_plugin.cpp after the check for AddLink

else if (stricmp(subject, "FindNick") == 0) {
findNick((char *)data1, (char *)data2);
}

Maybe try this:

void findNick(char *nick, char *url)
{
HKEY hKey;
DWORD dwSize;
char regkey[128] = "Software\\Microsoft\\Internet Explorer\\SearchUrl\\";
*url = 0;
strncat(regkey, nick, 80);
if (RegOpenKey(HKEY_CURRENT_USER, (LPCTSTR)regkey, &hKey) == ERROR_SUCCESS) {
dwSize = INTERNET_MAX_URL_LENGTH;
RegQueryValueEx(hKey, NULL, NULL, NULL, (LPBYTE)url, &dwSize);
RegCloseKey(hKey);
}
}

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: asmpgmr
Date: May 07, 2003 05:01PM

MonkeeSage,

Did you get a chance to try the last version of the favorites nicknames code I posted ?

Also what do you think of this - removing the else { MessageBox("No Menu"); } from BrowserFrm.cpp function Create so that the menu bar can be removed simply by commenting out or removing Main from menus.cfg instead of using the problematic rebar_menu plugin. I suspect that most people use the rebar_menu plugin just to get rid of the menu bar so this should be a better solution.

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: MonkeeSage
Date: May 11, 2003 09:44AM

asmpgmr:

I tried the latest code for the favorites plugin, but still no workie. I don't see anything wrong with it, either, so I don't know why it is not working. I took down the blurb for nick support in favorites from my page till it gets working.

Anyhow, I agree with you on the rebar thing, and in all the current builds (uped today) I commented out the message box in the menu parsing code and the in the rebar menu code (in case someone still wants to use it for some reason or other), for when there is no "Main" defined. So now removing / commenting the "Main" menu definition effectively removes the menu. smiling smiley


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: asmpgmr
Date: May 11, 2003 02:53PM

MonkeeSage,

Try this, I changed it to use RegOpenKeyEx since RegOpenKey is actually an old function which really shouldn't be used anymore.

void findNick(char *nick, char *url)
{
HKEY hKey;
DWORD dwSize;
char regkey[128] = "Software\\Microsoft\\Internet Explorer\\SearchUrl\\";
*url = 0;
strncat(regkey, nick, 80);
if (RegOpenKeyEx(HKEY_CURRENT_USER, (LPCTSTR)regkey, 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
dwSize = INTERNET_MAX_URL_LENGTH;
RegQueryValueEx(hKey, NULL, NULL, NULL, (LPBYTE)url, &dwSize);
RegCloseKey(hKey);
}
}

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: ra
Date: May 11, 2003 05:52PM

MonkeeSage,

the current 1.4b-installer seems to be corrupt. Just downloaded it the 3rd time and always got "installer corrupt or incomplete".

BTW: Is it based on the "final" 1.4b-code or on a newer, nightly build?

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: MonkeeSage
Date: May 12, 2003 12:04AM

asmpgmr:

I'll try that and see that code what happens.


ra:

Must have been an ftp uploading problem, both installers they work locally. I re-uped them, so they should both work now.


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: MonkeeSage
Date: May 12, 2003 12:44AM

asmpgmr:

Hmmm....this is odd...it still didn't work, so over in BrowserView.cpp I put in a message box (call it 'W1'):

theApp.plugins.SendMessage("favorites", "* FindNick", "FindNick", (long)p, (long)&nickUrl);
MessageBox("Works 0", "Testing...");

Then over in ie_ utils.cpp, I put another ('W2'), and commented out the rest of the function:

void findNick(char *nick, char *url)
{
MessageBox(NULL, "Works 1", "Testing...", MB_OK);
/*HKEY hKey;
DWORD dwSize;
char regkey[128] = "Software\\Microsoft\\Internet Explorer\\SearchUrl\\";
*url = 0;
strncat(regkey, nick, 80);
if (RegOpenKeyEx(HKEY_CURRENT_USER, (LPCTSTR)regkey, 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
dwSize = INTERNET_MAX_URL_LENGTH;
RegQueryValueEx(hKey, NULL, NULL, NULL, (LPBYTE)url, &dwSize);
RegCloseKey(hKey);
}*/
}


Now if I understand this, I should be seeing both W1 and W2 whenever there is a url entered and it is not a bookmarks nick--I'm only seeing W1...for some reason it doesn't seem to be triggering the findNick function (???)...but I don't know why, because I have this code in the correct place in ie_plugin.cpp:

else if (stricmp(subject, "FindNick") == 0) {
findNick((char *)data1, (char *)data2);
}


hmmmm.....


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: asmpgmr
Date: May 12, 2003 02:24AM

MonkeeSage,

I noticed on CVS that the .dsp file for ie_favorites is out of date and builds the old ie_favorites.cpp code instead of the new code (ie_file.cpp, ie_plugin.cpp, ie_utils.cpp). Could this be the problem ? The file ie_favorites.cpp is not used by the current favorites plugin.

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: MonkeeSage
Date: May 12, 2003 02:28AM

I figured it out...this is wierd, too...

OK, the favorites are not like the rest of the plugins...we can't look for the FindNick message in the plugin implementation (ie_plugin.cpp), we have to do it in the main window's message loop (ie_favorites.cpp), and define the function in the same scope...

So...removed the following:

ie_utils.cpp:
------------------

-void findNick(char *nick, char *url)
-{
- HKEY hKey;
- DWORD dwSize;
- char regkey[128] = "Software\\Microsoft\\Internet Explorer\\SearchUrl\\";
- *url = 0;
- strncat(regkey, nick, 80);
- if (RegOpenKeyEx(HKEY_CURRENT_USER, (LPCTSTR)regkey, 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
- dwSize = INTERNET_MAX_URL_LENGTH;
- RegQueryValueEx(hKey, NULL, NULL, NULL, (LPBYTE)url, &dwSize);
- RegCloseKey(hKey);
- }
-}


ie_plugin.cpp:
--------------------

- else if (stricmp(subject, "FindNick") == 0) {
- if (data1 && data2)
- findNick((char *)data1, (char *)data2);
- }


Added the following:

ie_favorites.cpp:
-----------------------

+ else if (stricmp(subject, "FindNick") == 0) {
+ if (data1 && data2)
+ findNick((char *)data1, (char *)data2);
+ }

// ... before the definition of Init()

+void findNick(char *nick, char *url)
+{
+ HKEY hKey;
+ DWORD dwSize;
+ char regkey[128] = "Software\\Microsoft\\Internet Explorer\\SearchUrl\\";
+ *url = 0;
+ strncat(regkey, nick, 80);
+ if (RegOpenKeyEx(HKEY_CURRENT_USER, (LPCTSTR)regkey, 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
+ dwSize = INTERNET_MAX_URL_LENGTH;
+ RegQueryValueEx(hKey, NULL, NULL, NULL, (LPBYTE)url, &dwSize);
+ RegCloseKey(hKey);
+ }
+}


I'll up the favorites.dll right now (still haven't tested if the nick thing works, just tessted that both message boths were displayed).


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: MonkeeSage
Date: May 12, 2003 02:32AM

Ahh....that is the problem then....can you list all the currently used files and I'll update my project file...that is prolly also why it has the problem about slow loading, etc. No wonder...thanks for the info!


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: MonkeeSage
Date: May 12, 2003 02:33AM

BTW, the nick quicksearch works correctly now with the old configuration, so it should work as you had it once the project is updated. smiling smiley


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: asmpgmr
Date: May 12, 2003 02:39AM

MonkeeSage,

Everything in the ie_favorites directory except ie_favorites.cpp which is the older code.

You should be able to use RegOpenKey instead of RegOpenKeyEx, even though RegOpenKey is an older function it's still supported and uses fewer parameters so the code is a little smaller.

Options: ReplyQuote
Re: Plugins updates (technical)
Posted by: MonkeeSage
Date: May 12, 2003 03:12AM

Hmmm....getting a wierd linker error now...

mfcs42.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in ie_plugin.obj
mfcs42.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined in ie_plugin.obj; second definition ignored
Creating library Release/favorites.lib and object Release/favorites.exp
..\Release\kplugins\favorites.dll : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.

...looking around online for a solution...


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Pages: 12Next
Current Page: 1 of 2


K-Meleon forum is powered by Phorum.