How can I have a form inside an anchored window handle keys like Tab,Delete, etc.?

M

MickMcGeough

Using Visual Basic 6, Visio 2003.

I have an anchored window added to the visio drawing window. Tab and
delete (among others, I'm sure) keystrokes are caught by Visio and
applied to the drawing window. For example, I can't tab between text
boxes on my anchored form, and the delete key deletes the selected
shape in the drawing window instead of text from a text box.

I'm using the AnchoredWindow_OnKeystrokeMessageForAddon(MSGWrap)
function. I can intercept any keystroke here of course (this works
fine), but I can't figure out how to pass that message on to my form.
I've tried using SendMessage and PostMessage to the form, but these
messages appear to get caught in Visio's message queue and just call
AnchoredWindow_OnKeystrokeMessageForAddong() again and I get an
infinite loop.

I call PostMessage this way inside
AnchoredWindow_OnKeystrokeMessageForAddon():
---
PostMessage MyForm.hwnd, Msg.message, Msg.wParam, Msg.lParam
AnchoredWindow_OnKeystrokeMessageForAddon = True
---

It seems to me like this should pass the MSG to MyForm but Visio still
processes the posted message.

Any suggestions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top