سؤال

I am writing a plugin for 3ds MAX (2013/2014). In my plugin I have a Modeless dialog and a Win32 Edit Control. After showing the dialog when i try to edit the text in the edit control, the text is not updating. The edit caret is in the text box.

I tried spy++ and it shows that all the keyboard events WM_KEYDOWN, WM_CHAR and WM_KEYUP is processed by the edit control.

Actually When I press a key in the edit control, key board shortcuts of 3ds MAX is activated.

If I change the dialog type to Modal, the edit control works perfectly. The edit control provided by 3ds MAX (ICustEdit) works fine in the Modeless dialog.

My Edit control, is a customized one (it supports multiple lines and it will re-size its height according to the number of lines), so I cannot directly use the ICustEdit.

I tried to change the size and position of a ICustEdit using SetWindowPos, but it was not working(the control went invisible :) ).

So to conclude I have two questions,

  1. Why my Win32 Edit control is not working?
  2. Is there a way to sub class the ICustEdit and change its size and position from code just like a normal Edit Control
هل كانت مفيدة؟

المحلول

3dsmax uses what it calls accelerators. These are application wide low level keyboard overrides, used for general hotkey support. As a result, any custom control must disable these overrides whenever it receives focus.

You should call DisableAccelerators() defined in custcont.h, whenever your custom control gets focus (on WM_GOTFOCUS message).

this is why the ICustEdit does work, it calls this internally.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top