Windows Tools

Oh.exe: Open Handles

Overview | Notes | Syntax | Examples | Related Tools Open Command Prompt

This command-line tool shows the handles of all open windows. The tool can also be used to show only information relating to a specific process, object type, or object name. This feature is useful for finding the process that has a file open when a sharing violation occurs.

To function properly, OH must enable a kernel option that maintains a linked list of all objects sorted by object type. If the kernel option is not turned on, OH enables the kernel option and notifies you to restart the computer so that OH functions and displays information.

Corresponding UI

There is no corresponding user interface for OH.

Concepts

A handle is a 32-bit positive integer that Windows uses to identify a window or other object, such as a font or bitmap.

In Windows, a window is any window that you see on the screen as well as many objects that you cannot see. A window can be a bounded rectangular area of the screen (such as a Microsoft Word window) or a control on a form (such as a list box or a scroll bar) although not all types of controls are windows. The desktop and the icons that appear on it are windows.

Because all of these types of objects are windows, Windows can treat them similarly. Windows gives every window a unique handle when it is created and uses that handle to control that window. When the window is destroyed, Windows frees the handle it used to control the window. A window retains the same handle during its lifetime, but each time the window is recreated, a new handle is assigned. In other words, a window probably will not have the same handle if it is destroyed and recreated.

System Requirements

The following are the system requirements for OH:

File required