Strict Standards: Redefining already defined constructor for class wpdb in /var/www/myfoto.se/jbits.se/blog/wp-includes/wp-db.php on line 56

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/myfoto.se/jbits.se/blog/wp-includes/cache.php on line 36

Strict Standards: Redefining already defined constructor for class WP_Object_Cache in /var/www/myfoto.se/jbits.se/blog/wp-includes/cache.php on line 384

Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with Walker::start_lvl($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 541

Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with Walker::end_lvl($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 541

Strict Standards: Declaration of Walker_Page::start_el() should be compatible with Walker::start_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 541

Strict Standards: Declaration of Walker_Page::end_el() should be compatible with Walker::end_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 541

Strict Standards: Declaration of Walker_PageDropdown::start_el() should be compatible with Walker::start_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 560

Strict Standards: Declaration of Walker_Category::start_lvl() should be compatible with Walker::start_lvl($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 659

Strict Standards: Declaration of Walker_Category::end_lvl() should be compatible with Walker::end_lvl($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 659

Strict Standards: Declaration of Walker_Category::start_el() should be compatible with Walker::start_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 659

Strict Standards: Declaration of Walker_Category::end_el() should be compatible with Walker::end_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 659

Strict Standards: Declaration of Walker_CategoryDropdown::start_el() should be compatible with Walker::start_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 684

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/myfoto.se/jbits.se/blog/wp-includes/query.php on line 21

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/myfoto.se/jbits.se/blog/wp-content/plugins/code-highlighter/codehighlighter.php on line 42
jbits.se » 2007 » January » 18
Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/myfoto.se/jbits.se/blog/wp-includes/kses.php on line 627

jbits.se

Jörgen Björkmans blog

Archive for January 18th, 2007

Jan
18

Remove mailto association and replace with custom script.

Posted by jbjorkman on January 18, 2007 under
Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/myfoto.se/jbits.se/blog/wp-includes/formatting.php on line 82
VBScript, Windows

If you want to remove your default mailto association you need to manually associate
mailto with something else (a script in this example).

When you click a mailto link HKEY_CLASSES_ROOT\mailto is checked to see which associated mail program you have.
HKEY_CLASSES_ROOT is a combined view made from HKLM\Software\Classes and HKCU\Software\Classes.
HKCU\Software\Classes takes precendence because you want to be able to have user-unique associations.

Add the following to HKCU\Software\Classes\mailto
DefaultIcon\(Default) REG_EXPAND_SZ "%ProgramFiles%\INTERN~1\hmmapi.dll,1"
Shell\Open\Command\(Default) REG_EXPAND_SZ "wscript "[Path to Script]\MailAssoc.vbs"  %1

MailAssoc.vbs
Option Explicit
Dim oArgs
Dim sArg
Dim sClipText
Set oArgs=WScript.ArgumentsFor Each sArg in oArgs
  if instr(sArg,"@") then
 sClipText=sArg
 sClipText=trim(replace(lcase(sClipText),"mailto:",""))
  end if
Next
if sClipText<>"" then
  if MsgBox("Press Ok to copy address to your clipboard" & vbCRLF & sClipText,1,"No email program association found.")=1 then
    Dim oIE
    Set oIE=Createobject("internetexplorer.application")
    oIE.navigate "about:blank"
    oIE.document.parentwindow.clipboardData.setData "Text",sClipText
    oIE.quit
    Set oIE=Nothing
  end if
End if