GetWindowLong problem
-
Hi, I'm trying to get the address of the windows proc of a running application using:
WNDPROC AppWndProc = (WNDPROC)GetWindowLong(m_hWnd, GWL_WNDPROC); DWORD errVal = GetLastError();
The call to GetWindowLong fails (returns null) and the value returned from GetLastError() is 5, which is an access denied result. I'm not sure if i'm missing something, but how is it that this application is preventing me from getting this address ? Is there some way to prevent people from using GetWindowLong ? I want to subclass this app so that when a user moves it i can be notified as well. Thanks -
Hi, I'm trying to get the address of the windows proc of a running application using:
WNDPROC AppWndProc = (WNDPROC)GetWindowLong(m_hWnd, GWL_WNDPROC); DWORD errVal = GetLastError();
The call to GetWindowLong fails (returns null) and the value returned from GetLastError() is 5, which is an access denied result. I'm not sure if i'm missing something, but how is it that this application is preventing me from getting this address ? Is there some way to prevent people from using GetWindowLong ? I want to subclass this app so that when a user moves it i can be notified as well. ThanksAre you in a separate process? If so you will need to do something else to get your DLL loaded in their process. Any address that is returned to you by this function will only be valid in the process that contains the window. Your problem may be related to that fact, but I am not certain.
Build a man a fire, and he will be warm for a day
Light a man on fire, and he will be warm for the rest of his life!