Mircea Ispas
Mircea Ispas

Reputation: 20780

HINSTANCE to HWND

I use ShellExecute to create a new app instance from my current app. I want to get the HWND of that app. Is it possible to get HWND from HINSTANCE or I need to use EnumWindows?

Upvotes: 6

Views: 12329

Answers (2)

Tom
Tom

Reputation: 918

you're right, you need to enum your windows

this question will help you further

Upvotes: 8

David Heffernan
David Heffernan

Reputation: 612934

An application does not have a single HWND. Each window within the app has its own handle, an HWND.

You will need to use EnumWindows() or one of its friends.

Upvotes: 6

Related Questions