Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 266
  • Last Modified:

HW to get the handle of MainWin

I have an application which uses a DLL. Hw can I get the handle of Main Window of the process from the DLL.
0
bob0001
Asked:
bob0001
1 Solution
 
Roshan DavisCommented:
What about "AfxGetMainWnd()"

Rosh :)
0
 
desabhotlasCommented:
The DLL cannot access the window handle directly as far as i know. expose a function from the DLL which has a [in] parameter as an handle to the window.
0
 
bob0001Author Commented:
AFxGetMainWnd() gets the handle of the active window.
0
 
GloomyFriarCommented:
You can pass the handle to the dll through a parameter of a function.
I mean something like the following:

_imp_MyDllInit(HWND hMainWnd);
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now