Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. GetWindowLong problem

GetWindowLong problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dan_P
    wrote on last edited by
    #1

    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

    P 1 Reply Last reply
    0
    • D Dan_P

      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

      P Offline
      P Offline
      Paul M Watt
      wrote on last edited by
      #2

      Are 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!

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups