1. Barry Ellison
  2. PowerBuilder
  3. Thursday, 20 October 2022 12:30 PM UTC

Demo application from WinterTree for Sentry Spelling Checker uses ActiveX 15.0, and this code works to find a handle that's passed to their 'as you type' spell checker.

I'm trying to get it to work using the latest ActiveX 28.0 version in 2019 R3.  Using WinSpy I determine my RTE has a classname of TX28 while the demo program has a class of TX15P.  

<Snippet of demo code to get the RTE handle>

// Obtain the Windows handle of the actual RTE control.
// In PB, the actual RTE control is wrapped inside other objects

ulong llu_hWinRTE

alu_hWin = FindWindowEx(alu_hWin,0, "PBTxTextControl", 0)
if alu_hWin = 0 then return 0

alu_hWin = FindWindowEx(alu_hWin,0, "AfxOleControl42u", 0)
if alu_hWin = 0 then return 0

llu_hWinRTE = FindWindowEx(alu_hWin,0, "TX15P", 0)
if llu_hWinRTE <> 0 then return llu_hWinRTE

... checks for prior versions, too: TX14P, TX13P... TX11P

</snippet>

I added another check above 'TX15P' for 'TX28' but the 2nd FindWindowEx() calll w/'AfxOleControl42u' returns a 0 and exists with a value of 0.  I also removed this check completely all the FindWindowEx() return 0.

I'm at a loss - any thoughts on how to drill down through these wrappers?  (I suspect the AfxOleControl42u name has changed?  How would one determine that?)

 

 

Accepted Answer
Barry Ellison Accepted Answer Pending Moderation
  1. Thursday, 20 October 2022 15:52 PM UTC
  2. PowerBuilder
  3. # Permalink

SOLVED!  Here's the solution.

WinterTree offered the use of a tool, Window Inspector that allowed me to drill into the app looking for class names.  This screen shot should tell you everything you need to know.

 

First, using the handle of the RTE get the handle of the PBTxTextControl, which is then input to the handle of the AfxOleControl90u, which is then used to get the TX28 control.  Pass that to the vendor's call "ll_result = SSCE_CheckCtrlBackgroundNotify(iul_handle_rte, lul_8, lul_0)"

hWin_wrapper = Handle( rte_1 )
IF hWin_wrapper > 0 THEN
    hWin_wrapper = FindWindowEx(hWin_wrapper,0, "PBTxTextControl", 0)
    IF hWin_wrapper > 0 THEN
        hWin_wrapper = FindWindowEx(hWin_wrapper,0, "AfxOleControl90u", 0)
        IF hWin_wrapper > 0 THEN
            hWin_control = FindWindowEx(hWin_wrapper,0, "TX28", 0)
        Else
            // Nope!
        End If
    END IF
END IF

Now I get squiggly lines in my RTE.

 

Comment
  1. Armeen Mazda @Appeon
  2. Thursday, 20 October 2022 15:56 PM UTC
Thanks for sharing the solution! Please mark this as solved. Thanks!
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 20 October 2022 16:12 PM UTC
Hi Barry;

Thank you for the solution!

BTW: For any other PB developers needing to "snoop" around the O/S for various instantiated class internals .. please use my free WinExplorer PB App. It can locate anything in the O/S (and even kill it - LOL).. The App is built from my STD Framework ...

FYI: http://chrispollach.blogspot.com/2020/08/explorer.html

HTH

Regards ... Chris
  1. Helpful 1
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.