Solved

Sublassing a window question

Posted on 1998-12-30
2
193 Views
Last Modified: 2013-11-20
Hello EveryBody !
When I try to subclass a normal window ( Dialog that is existent on my desktop ) I fail at the stage of check whether the HWND is already attached to a permanent CWND* .
Is there any way to make such a subclass ?
I want to get messages that go to the specific window that was opened by another application . I dont want to use System Hooks method .
Any ideas ?

Thank you in advance ,
Oleg
0
Comment
Question by:Maizlish
[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
2 Comments
 

Expert Comment

by:koskia
ID: 1326993
As far as I know you're trying something that you can't do
subclassing a window is only within your application
if it wasn't so, you could get into other applications (Photoshop, Netscape, IE, etc. ...)
anything really, and control them through your app.
the given answer is that a window can only be subclassed once.
0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
ID: 1326994
Sorry, but under Win32 you will need to break the process boundaries between applications somehow. One way is to use a system hook. Since you indicated you didn't want to use this method, there are others.

1. Inject a DLL into all applications by using the registry
  HKLM\Software\Microsoft\Windows NT\CurrentVersion\Windows\AppInit_DLLs
Note that this only works for NT systems.

2. Use CreateRemoteThread(). This again is only on NT systems as Win9x does not support this method.

3. If you are interested in a particular process, you can use the debugging APIs and force it to do a LoadLibrary() of your DLL at the start. This is completely portable, but only affects programs you start explicitly.

4. Use SetWindowsHookEx(). This is portable and affects all applications.

PS. It is possible to subclass a window multiple times. What you are running into is that MFC does not allow you subclass windows you did not create, which is why it is necessary to break through process boundaries.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

617 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