1

How to get HANDLE for an application say Outlook from my program

subbu
  • 3,049
  • 12
  • 47
  • 68
  • process HANDLE or window (HWND)? –  Oct 12 '10 at 09:53
  • possible duplicate of [How can I get a process handle by its name in C++?](http://stackoverflow.com/questions/865152/how-can-i-get-a-process-handle-by-its-name-in-c) – Steve Townsend Oct 12 '10 at 11:34

3 Answers3

1

You need to get the process id of the process you want to get the handle for and use OpenProcess.

Here's an example for this as well: http://msdn.microsoft.com/en-us/library/ms686701(v=VS.85).aspx

Vinzenz
  • 2,709
  • 16
  • 23
0

Use WIN32 API FindWindow().

Noel Abrahams
  • 7,423
  • 3
  • 34
  • 36
0

Probably try this:

HANDLE hOutlook = FindWindow("rctrl_renwnd32", NULL);
wengseng
  • 1,330
  • 14
  • 27