Solved

HW to get the handle of MainWin

Posted on 2003-12-09
7
263 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Suggested Courses

752 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