Solved

VB.net :  FindWindowLike function to see if OUTlook is open

Posted on 2008-10-16
2
954 Views
Last Modified: 2012-05-05
I have this:
 OutlookHwnd = FindWindow(vbNullString, "Microsoft Outlook").  
 SetActiveWindow(OutlookHwnd)
            Putfocus(OutlookHwnd)
            SetForegroundWindow(OutlookHwnd)


Outlook's title changes depending on what is selected....
How can I use FindWindowLike to see if OUtlook is open then bring it to the front
0
Comment
Question by:TechMonster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 22734227
Do it this way instead...

        Dim Outlook() As Process = Process.GetProcessesByName("Outlook")
        If Outlook.Length > 0 Then
            ' Just FYI, you can get the main window caption using "MainWindowTitle"...
            Debug.Print(Outlook(0).MainWindowTitle) ' <--- this is the current title

            ' ...but use "MainWindowHandle" to get the window handle
            SetActiveWindow(Outlook(0).MainWindowHandle)
            Putfocus(Outlook(0).MainWindowHandle)
            SetForegroundWindow(Outlook(0).MainWindowHandle)
        End If
0
 

Author Comment

by:TechMonster
ID: 22734723
That is far better than what I had before!  

Seems like an easier way than the Findwindowlike function,


Thanks a bunch!  You are truely a Genius!!
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question