AutoHotkey Community

It is currently May 27th, 2012, 10:11 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Closing Outlook
PostPosted: August 3rd, 2006, 7:18 pm 
Offline

Joined: August 3rd, 2006, 7:11 pm
Posts: 1
After having difficulties trying to find the wm_ commands for Outlook 2007 beta and seeing no other ways listed for closing Outlook windows without simply killing the process, I created this little bit of code that works in all situations for closing Outlook that I have experienced.
Code:
PROCESS, EXIST, OUTLOOK.EXE
PID := ERRORLEVEL
IF ERRORLEVEL <> 0
{
       LOOP,
      {
            WINSHOW, AHK_CLASS rctrl_renwnd32
            WINACTIVATE, AHK_CLASS rctrl_renwnd32
            WINWAITACTIVE, AHK_PID %PID% AHK_CLASS rctrl_renwnd32
            WINGETACTIVETITLE, TITLE
            WINCLOSE, %TITLE%
            WINWAIT,, Are you sure you want to permanently delete all the items and subfolders in the "Deleted Items" folder?,3
            CONTROLSEND, , {ENTER}, AHK_CLASS #32770, Are you sure you want to permanently delete all the items and subfolders in the "Deleted Items" folder?
            IF A_INDEX > 30
                  PROCESS, CLOSE, OUTLOOK.EXE

            PROCESS, EXIST, OUTLOOK.EXE
            IF ERRORLEVEL = 0
                  BREAK
      }
}

_________________
Instant gratification takes too long - Loyd Ivey
Lerororororoy Jeeeeeeeeenkins - Leroy Jenkins


Report this post
Top
 Profile  
Reply with quote  
PostPosted: November 5th, 2008, 12:20 pm 
Offline

Joined: June 12th, 2008, 10:29 am
Posts: 52
Thanks for your idea...
I've integrated it into my script... see if you like it now...

This is to solve that annoying problem of outlook not quitting!

Code:
^!z:: ;;Get a list of outlook windows, close outlook if necessary
  WinGet, msgWins, List, ahk_class rctrl_renwnd32
  If (msgWins > 0) {
    i = 1
    msgTip =
    loop %msgWins% {
      cWin := % msgWins%i%
      WinGetTitle, winTxt, ahk_id %cWin%
      if winTxt =
        WinGetText, winTxt, ahk_id %cWin%
      msgTip = %msgTip%`n%winTxt%
      i++
    }
    TrayTip, Outlook Windows %i%, %msgTip%, 3, 1
  }
  Else {
      TrayTip, Outlook Windows, No Outlook windows found, 3, 1
  }
  PROCESS, EXIST, OUTLOOK.EXE
  PID := ERRORLEVEL
  IF ERRORLEVEL <> 0
  {
    LOOP, %msgWins%
    {
      ;WinGet, msgWins, List, ahk_class rctrl_renwnd32
      WINSHOW, AHK_CLASS rctrl_renwnd32
      WINACTIVATE, AHK_CLASS rctrl_renwnd32
      WINWAITACTIVE, AHK_PID %PID% AHK_CLASS rctrl_renwnd32,,3
      IF ERRORLEVEL
      {
        WINGETACTIVETITLE, TITLE
        WINCLOSE, %TITLE%
      }
    }
    ;WINWAIT,, Are you sure you want to permanently delete all the items and subfolders in the "Deleted Items" folder?,3
    ;CONTROLSEND, , {ENTER}, AHK_CLASS #32770, Are you sure you want to permanently delete all the items and subfolders in the "Deleted Items" folder?
    ;IF A_INDEX > 30
    MsgBox, 4,,Kill Outlook process?
    IfMsgBox Yes
      PROCESS, CLOSE, OUTLOOK.EXE

    ;PROCESS, EXIST, OUTLOOK.EXE
    ;IF ERRORLEVEL = 0
    ;BREAK
  }
  return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 5th, 2008, 7:25 pm 
doesnt
Code:
SetTitleMatchMode,2
winclose, Outlook

work?

PS* i only tested on Outlook express, and Window Live Mail


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: specter333, XX0 and 24 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group