Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GetWindowTextA and Word 2007

17 views
Skip to first unread message

Will

unread,
Mar 7, 2011, 9:46:41 AM3/7/11
to
Just recently our organization moved from Office 2000 to Office 2007
and within our application we look to see if MS Word is open and then
we do some actions. I have noticed that API call GetWindowTextA will
always return window title "Document38 - Microsoft Word" with a
machine that has Office 2007 installed(Word 2007) but works correctly
with Word 2000. I have made sure that there is no open Word document
or a Word process. Should I be using an updated DLL or a different
DLL?

Thanks

Noted below is the code:

String Ls_wndw_title = Space(100)
long Ll_handle, Ll_lentitle, Ll_currwnd, Ll_parent, Ll_maxbuff = 100

ll_handle = GetActiveWindow()
ll_lentitle = GetWindowTextA( ll_handle, ls_wndw_title, ll_maxbuff)

IF PosA( Lower( ls_wndw_title), 'microsoft word') > 0 THEN
RETURN false
END IF

LL_CurrWnd = GetWindow(ll_handle, 0)
DO WHILE ll_currwnd > 0
// ll_parent = GetParentA(LL_CurrWnd)
ll_parent = GetWindow( ll_currwnd, 2)
ls_wndw_title = Space(100)
ll_lentitle = GetWindowTextA( ll_parent, ls_wndw_title, ll_maxbuff)
IF PosA( Lower( ls_wndw_title), 'microsoft word') > 0 THEN
RETURN false
END IF
ll_currwnd = ll_parent
LOOP

return true

bruce.a...@yahoo.com

unread,
Mar 9, 2011, 6:29:45 PM3/9/11
to
This group is no longer active on the Sybase server. In addition, the feed between Google and the Sybase server is not currently working. If you post
through Goolge the post will never show up on the Sybase server, and most
people who answer questions in that group will never see it.
Instead, you may want to access the Sybase newsgroups directly at:
http://www.sybase.com/detail_list?id=11507&pageNum=1&multi=true&show=1248
0 new messages