@ Alex.Tarantul
I work only in the KM macro language. I have no skill at creating or editing a DLL file.
ActiveIP is the best that I can to to meet the requirement of showing the external IP and allowing for a refresh after 5 minutes.
A menu item "Active IP" shows on the main menu line and if you click on it , you will see "Refresh" ( first time in session only ) or your external IP address. If you click on the "Refresh" or the IP address, the macro will run again to obtain your external IP address. At the same time a reminder for 5 minutes will be started.
Please note that a refresh will cause your system to load a new page in the current window/tab, read that page, and then re-load the page which you were viewing. DON'T DO A REFRESH IN THE MIDDLE OF A TRANSACTION!
At each OnLoad event the external IP address will be displayed in the statusbar.
Version 0.5 is the most complete and stable version of ActiveIP.kmm. I will re-post the code again for those who are interested.
ActiveIP.kmm
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- ActiveIP.kmm
# ---------- K-Meleon Macro Language to show EXTERNAL ip number under MAIN menu ---
# ---------- Clicking on "Refresh" or the IP Number will refresh the IP number
#
# Dependencies : main.kmm
# Resources : "whatismyip.com/automation/n09230945.asp"
# Preferences : "k-meleon.ActiveIP.use"
# Version : 0.5 August 27, 2009
# --------------------------------------------------------------------------------
_ActiveIP_RunLoad {
macroinfo = "Refresh External IP address";
$ActiveIP_OldURL = $URL ;
setpref(BOOL,"k-meleon.ActiveIP.use", true);
open("whatismyip.com/automation/n09230945.asp");
}
_ActiveIP_RunRead {
id(ID_EDIT_SELECT_ALL);
id(ID_EDIT_COPY);
$ActiveIP_Clip = getclipboard();
macros(_ActiveIP_BuildMenuLine);
$_ActiveIP_Milliseconds = 5 * ( 60 * 1000 ) ;
exec("wscript.exe \"".$_ActiveIP_Path."\" \"".$ActiveIP_Clip."\" \"".$_ActiveIP_Milliseconds."\"") ;
open($ActiveIP_OldURL) ;
}
_ActiveIP_Auto_stage {
if (getpref(BOOL,"k-meleon.ActiveIP.use") == true ) {
macros(_ActiveIP_RunRead);
delpref("k-meleon.ActiveIP.use"); }
}
_ActiveIP_StatusBarSet {
if ($ActiveIP_Clip != "Refresh") {
if (length($ActiveIP_Clip) != 0) {
statusbar("External IP ".$ActiveIP_Clip); }
}
}
_ActiveIP_BuildMenu {
$_g="Active IP";
setmenu(Main,popup,$_g,-1);
$__m="TheIP";
macros(_ActiveIP_BuildMenuLine);
}
_ActiveIP_BuildMenuLine {
$_g="Active IP";
$__m="TheIP";
setmenu($_g,inline,$__m);
setmenu($__m,macro,$ActiveIP_Clip,_ActiveIP_RunLoad,-1);
rebuildmenu($__m);
}
_ActiveIP_Initial {
$ActiveIP_Clip = "Refresh" ;
}
_ActiveIP_GetPath {
$__Data=readfile(getfolder(MacroFolder)."\\ActiveIP.kmm");
$_ActiveIP_Path=getfolder($__Data==""?UserMacroFolder:MacroFolder)."\\ActiveIP.js";
}
## - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$OnStartup=$OnStartup."_ActiveIP_GetPath;";
$OnLoad=$OnLoad."_ActiveIP_StatusBarSet;";
$OnLoad=$OnLoad."_ActiveIP_Auto_stage;";
$OnInit=$OnInit."_ActiveIP_Initial;";
$OnInit=$OnInit."_ActiveIP_BuildMenu;";
$macroModules=$macroModules."ActiveIP;";
## *** END OF ActiveIP.kmm ***
ActiveIP.js
/* ActiveIP.js by JamesD, version 1.0 2009-08-20
This script is a helper application for the K-Meleon Macro Module ActiveIP.kmm that
enables you to set a timer .
Windows Script Host 1.0 (or better) required!
WSH is part of Microsoft Internet Explorer 5.0 and newer. Latest version of WSH is
available at http://msdn.microsoft.com/scripting/
*/
if (WScript.Arguments.count()==2) {
var ActiveIP_CurrentIP = WScript.Arguments(0);
var ActiveIP_Milliseconds = WScript.Arguments(1);
WScript.Sleep( ActiveIP_Milliseconds) ;
var d = new Date();
WScript.Echo("Timer expired on IP address \n\n " + ActiveIP_CurrentIP + "\n\n " + d) ;
}
else
{
objArgs = WScript.Arguments ;
WScript.Echo(WScript.Arguments.Count());
for (i=0; i<objArgs.length; i++)
{
WScript.Echo(objArgs(i))
}
}
// *** END OF ActiveIP.js ***