Solved

HW to get the handle of MainWin

Posted on 2003-12-09
7
259 Views
Last Modified: 2013-11-20
I have an application which uses a DLL. Hw can I get the handle of Main Window of the process from the DLL.
0
Comment
Question by:bob0001
7 Comments
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 45 total points
ID: 9910355
What about "AfxGetMainWnd()"

Rosh :)
0
 

Expert Comment

by:desabhotlas
ID: 9910373
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
 

Author Comment

by:bob0001
ID: 9910478
AFxGetMainWnd() gets the handle of the active window.
0
 
LVL 6

Expert Comment

by:GloomyFriar
ID: 9911296
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sumNumber challenge 16 111
noX challenge 17 92
Change to event 1 101
Remove Password Protection from pdf (with password) using an command line executable 5 30
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now