CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2013
    Posts
    6

    edit control inside an edit control

    I saw something that I'm trying to duplicate and I'm not sure how they did it. In a older application, Microsoft Mail 5.0, they embedded three edit controls into a multiline edit (MLE). At first, I thought MFC and a CDialogBar but given the date of the application (it carries an NE signature) it would be at best VC++ 2.0 and MFC 3.0 and I don't think the CDialogBar existed yet. Plus, going through the .EXE, it doesn't look like it links in a MFC*.DLL but it does use some vform.dll that I'm guessing is Visual Basic. So in short, it looks to be written in C/C++ with subclassing is my estimate but I could be wrong.

    The app looks like this at start up:

    Name:  MS1.JPG
Views: 1074
Size:  19.8 KB

    But as stuff is entered, the single line edits move up and scroll with the MLE or the user can tab back to the single edits like this:

    Name:  MS2.JPG
Views: 1168
Size:  33.3 KB

    My edits either sit on top of the MLE and aren't part of it or when the MLE gets the focus, the cursor and whatever is being typed, is initially hidden by the "To" "Subject" and "Cc" controls. I've been making changes to the .RC and DialogProc but it not behaving as it should. Any ideas how they did this ?

    René

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: edit control inside an edit control

    Quote Originally Posted by René Vecchi View Post
    I saw something that I'm trying to duplicate and I'm not sure how they did it. In a older application, Microsoft Mail 5.0, they embedded three edit controls into a multiline edit (MLE). At first, I thought MFC and a CDialogBar but given the date of the application (it carries an NE signature) it would be at best VC++ 2.0 and MFC 3.0 and I don't think the CDialogBar existed yet. Plus, going through the .EXE, it doesn't look like it links in a MFC*.DLL but it does use some vform.dll that I'm guessing is Visual Basic. So in short, it looks to be written in C/C++ with subclassing is my estimate but I could be wrong.
    Did you try to use Spy++ to detect the window class of those controls?
    Victor Nijegorodov

  3. #3
    Join Date
    Aug 2000
    Location
    New York, NY, USA
    Posts
    5,656

    Re: edit control inside an edit control

    Quote Originally Posted by René Vecchi View Post
    ... they embedded three edit controls into a multiline edit (MLE)...
    I think that all four of these edit controls are siblings (children of another window).
    Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
    Convenience and productivity tools for Microsoft Visual Studio:
    FeinWindows - replacement windows manager for Visual Studio, and more...

  4. #4
    Join Date
    Jul 2013
    Posts
    6

    Re: edit control inside an edit control

    I'll investigate VictorN's idea of Spy++ and see what class info there is. Also Vladimir's suggestion that they are WS_CHILD windows. Thinking about the application, it's more like when you write a toolbar form scratch and place it on the main window: it stays with the main window but it has its own WndProc(). And where the toolbar has child controls of PUSHBUTTON, the dialog here substitutes edit controls for the buttons. I'm not sure if the MLE will be the parent or if its a sibling ... but I'll see how it behaves when coded.

    René

  5. #5
    Join Date
    Jul 2013
    Posts
    6

    Re: edit control inside an edit control

    Name:  SPY.BMP
Views: 1019
Size:  22.6 KB

    The results from Spy++. These correspond to the the JPG above:

    window E94 size 17 x 404 "Scrollbar"

    window E94 size 509 x 402 message area
    window E98 size 398 x 22 edit control
    window E9C size 398 x 22 edit control
    window EA0 size 398 x 22 edit control
    window EA4 size 509 x 309 MLE

    From the chart hierarchy, I assume that the message area (E94) is a
    parent to four siblings: the three single line edit controls ("To"
    "Cc" and "Subject") and the multi-line edit EA4. The message area is
    in turn a sibling to the overall dialog "Send Note".

    This makes sense, but what is odd is that the "Scrollbar" isn't also
    a sibling of the message area but is instead under control of the
    dialog. This seems to me that the scrollbar messages are passed down
    to the message area (window E94) which does a ScrollWindow() or
    ScrollDC() and moves up or down all four of its siblings.

    I'll see what kind of code I can hack out to follow up on this idea

    René

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured