Jump to content
Tuts 4 You

Static Label Text from Memory?


Recommended Posts


i have a application that drops all Window Messages like WM_GETTEXTLENGTH etc. to prevent that another application read this control.

Is there a way to get the text from memory ? I have only the control handle.

WinSpy++ tells me, its a normal "Static"-Control Class.

Link to comment
  • 3 weeks later...

I saw this thread when you posted it a couple of weeks ago and was stumped.

Just now, something has occurred to me that seems frightfully obvious.

Why not sub-class it?

That is to say,

1) Change the WndProc used to handle the window (Use SetWindowLong with GWLP_WNDPROC)

2) Grab the text from it

3) Restore the WndProc as retrieved in step 1.

I was going to suggest using the GetWindowSubclass and SetWindowSubclass, though it seems that this approach may fail since the original WndProc will still be called. With that in mind, I'd use the old (before ComCtl32.dll ver 6) method.

More here: http://msdn.microsoft.com/en-us/library/windows/desktop/bb773183(v=vs.85).aspx#prior_v6

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...