Re: Modeless dialog problems

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On Tue, 4 Jul 2006 00:35:02 -0700, suamikim
<suamikim@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

You are right, i use C++ with mfc, but i thought that this is a pure
eVC-newsgroup, so i didn't lost a word about it...?

The group is _primarily_ for C/C++ and eVB. But folks using C# and
VB.NET do show up. Also, some of the C/C++ users use MFC, and some
(like me) don't.



BTT:
I've allready solved my second problem, with the resizing of the dialog:
With some testing i figured out, that the resizing allways appeared after
the OnPaint-Message arrived, so i just catch the OnPaint-Message and allways
set the Window-Position (with the desired size) in the following way:

SetWindowPos(&CWnd::wndTop, 0, 26, 240, 23, NULL);

I don't handle WM_PAINT messages much. But calling SetWindowPos in
your handler (OnPaint function) makes me nervous about infinite loops,
or at least extra "ringing".

If I remember and understand your original description, the dialog
boxes are resized when activated (not your words, but my
interpretation of your words). If so, then you should at least try
calling SetWindowPos in your response to WM_ACTIVATE (OnActivate
function?).



I'm not really sure, if thats the best way, to solve my problem, but at the
moment it works just fine, so i can't find any reason to try smth. else.

I also solved my 1. problem, but in a really weired way (which i don't
really want to describe, unless someone is really interested in it), so i
would be grateful, to find a better solution:

"I don't follow your details, but I have a few dialog boxes that show
popup menus. Not as nice as a _real_ menu, but good enough."

The problem aren't the "normal" popup-menus. The problems start with the
toolbar Popups, which i partially implement by myself in the OnCreate-Routine
of my MainFrame. So to see them in the new Dialog, i have to implement and
catch the messages from the new menu, there too (what i actually do at the
moment, as long as i don't find a better solution).

I hope, that explanation is clearer now, cause i really don't know, how to
describe it any better (even in my native language, german, i think, i
couldn't do it any better...).

"Resize all secondary menus so the menu on the primary dialog shows,
and then modify that menu as each dialog shows."

Oops!! Dialog boxes, not menus. As in "resize all secondary dialog
boxes so the menu on the primary dialog shows."



That sounds good, but unfortunately i don't know how to resize the secondary
menus and what i have to modify at them? I hope, you can help me here any
further, cause that solution sounds just fine for me, if it works.

My correction should help.



Thanks, regards,

mike

-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 478
Boston, MA 02116
www.penfact.com
.



Relevant Pages

  • Re: Maximize box with all windows
    ... You need to resize the boxes as appropriate. ... Create an OnSize handler and resize the controls there. ... Use GetWindowRect to get the window sizes, and don't assume you know what they are. ... It also lengthens the edit control c_Filename to fit all the way ...
    (microsoft.public.vc.mfc)
  • Re: Harvesting and Comparing Screenshots of menus and dialog boxes
    ... expansive with lots of menus, dialog boxes, etc in the GUI. ... the software's menus and dialog boxes change due to enhancements. ... any screenshots in our documentation and training materials. ...
    (comp.programming)
  • Re: Asian fonts and menus added to Word
    ... Remove Japanese (and any other Asian languages) ... The next day when I opened Word, my menus and dialog boxes were ... like to have my system restored to the "non-Asian" dialog boxes and menus. ...
    (microsoft.public.word.docmanagement)
  • MS Outlook Publishing HTML Forms
    ... This form is in HTML (i also have a word version, ... It has a few drop down menus, ... boxes, and text fields. ... e-mailed to the appropriate company employees. ...
    (microsoft.public.outlook)
  • Dialog Box Issue...
    ... now I need to resolve the issue to be able to gather data ... being unable to resize that dialog box. ... in another particular program (Steganos Security Suite) ... and since I am unable to resize the various boxes, ...
    (microsoft.public.windowsxp.general)