opening email app in Windows

Peter Brigham pmbrig at comcast.net
Sun May 21 18:34:06 EDT 2006


On Sat, 20 May 2006 21:45:24 -0500 Ken Ray <kray at hidden> wrote:

****
********
Re: opening email app in Windows

On 5/20/06 1:02 AM, "Peter Brigham" <pmbrig at hiddenwrote:

All I want is
to be able to activate the email app's frontmost window (which will
be the mostly-completed message).
********

Well, this isn't quite as easy as it might sound because each window in
Windows has its own "handle" which is (oddly enough) accessible based  
on the
title in the titlebar of the window. You can also activate the window  
if you
know what the process ID of the window is. In either case, you can  
use this
code (which uses VBScript to do the dirty work):

on VBS_AppActivate pTitleOrID
   put format("set WshShell = WScript.CreateObject(\"WScript.Shell 
\")") into
tVBS
   if isNumber(pTitleOrID) then
     put tVBS & cr & "WshShell.AppActivate" && pTitleOrID into tVBS
   else
     put tVBS & cr & "WshShell.AppActivate" && quote & pTitleOrID & \
       quote into tVBS
   end if
   put "C:\vbs_temp.vbs" into tVBSPath
   put tVBS into url ("file:" & tVBSPath)
   set the hideConsoleWindows to true
   get shell("cscript.exe //nologo" && tVBSPath)
   put it into tResult
   if there is a file tVBSPath then
     send "delete file" && quote & tVBSPath & quote to me in 1 second
   end if
   if tResult <> "" then return "Error: " & tResult
end VBS_AppActivate

HTH,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at hidden
****

Wow, this taps into stuff I know nothing about. Is there an easy way  
to find out the window title or ID of the frontmost window for the  
email app? I'm getting the sense I'd best leave well enough alone  
here and forgo trying to get this minor feature implemented for  
Windows....

-- Peter

Peter M. Brigham
pmbrig at comcast.net
http://home.comcast.net/~pmbrig/

~~~~
Two wrongs don't make a right, but three lefts do.
~~~~



More information about the use-livecode mailing list