Re: Obtaining text from AfxWndW Windows

  • From: "jaffar" <jaffar@xxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Mon, 10 Dec 2007 09:34:29 +0800

Hi.  For mfc, the drawing is done by the DC class.  All other objects like RECT 
and Illipses are derived from it.  The DC class invokes the Wm_paint object 
from the win32 API handler.  It is also worth noting that The OnPaint object, 
another object of the DC class does the painting of the windows and such.  
Cheers!
  ----- Original Message ----- 
  From: Will Pearson 
  To: programmingblind@xxxxxxxxxxxxx 
  Sent: Monday, December 10, 2007 8:48 AM
  Subject: Re: Obtaining text from AfxWndW Windows


  Hi Sean,

  WM_GETTEXT doesn't work with the AfxWnd windows used by MFC.  I think they 
use some sort of different mechanism to handle their window text and drawing.

  You could try looking at the control's MSAA properties using a tool such as 
Inspect or AccExplorer, both of which are part of the MSAA SDK tools.  If these 
shw information then you could get the IAccessible object using something like 
AccessibleObjectFromWindow.  As it's a custom control then whether MSAA is 
present depends on whether the C++ libraries team implemented MSAA for the 
custom controls contained within MFC; The MSAA system won't proxy AfxWnd 
controls to my knowledge.

  The reason why I suspect JAWS picks it up is that it is being detected by the 
off screen model in JAWS.  Whilst JAWS, and several other screen readers, 
intercept the GDI drawing calls at the video driver level you can replicate 
this functionality by hooking into the GDI API.  If you want to go down this 
route then there are documents and things on the web that explain API hooking 
better than I can.

  Will
    ----- Original Message ----- 
    From: Sean Farrow 
    To: programmingblind@xxxxxxxxxxxxx 
    Sent: Sunday, December 09, 2007 11:32 PM
    Subject: Obtaining text from AfxWndW Windows


    Hi: 
    I am trying to obtain text from an AfxWndW window. Previously I have been 
able to obtain text from another control using the SendMessageW function with 
the WM_GETTEXT message. These two particular windows are in the same program 
and are also on the same screen. 
    The program is the microsoft woutlook 2003 calendar. 
    in the window I want, neither the wm_gettext message orthe GetWindowTextW 
functions work. Jaws however gives me the text. Anyone got and ideas how to 
tacle this.
    I tryed msaa with the OBJID_WINDOW but there was no name for the window.
    Any help apreciated
    Sean.

Other related posts: