How to set the size and position of the main window that comes out at the beginning in MFC

Updated on amusement 2024-05-15
6 answers
  1. Anonymous users2024-02-10

    - - The simplest design interface can be changed first.

  2. Anonymous users2024-02-09

    initinstance()

    function, add movewindow function m pmainwnd->showwindow(sw show) in the form display part;

    m_pmainwnd->setwindowtext("...");

    m_pmainwnd->movewindow(crect(60,10,950,710));

    m_pmainwnd->updatewindow();//

  3. Anonymous users2024-02-08

    For this you must first know:

    1,You have to know that the system itself has set the display position of the window,It's when you createwindow,But you'd better not change that position,Because that's the source provided by Microsoft**,After you change that,Then all your window displays are your current settings;

    2. You can only set the position of the window after it has been successfully created, just like: when something doesn't exist, you can't make any requirements for it;

    3,You have to find where the window was just created successfully,Where is it displayed when it is displayed,I can tell you,It's done in the instance() function,But,This is just instantiating this application.,There's only one domodal() in this.,Basically, there's nothing to change in this.,There's also a position where the oninitdialog() function is.,It's to initialize this dialog., Naturally, the position and size of its display can be controlled, so you can call movewindow() here.

    As for another function, it's setWindowPoS(), which I've just tried, and it doesn't work for applications with dialogs, which should be used when using pop-ups in single-document and multi-document applications.

    Use movewindow(1,1,100,100) in oninitdialog() to display a dialog box with a width of 100 and a height of 100 in the position of (1,1).

  4. Anonymous users2024-02-07

    Some programs will record the location and size of the window when it is closed, and will revert to the last position when it is opened the next time, such as the notepad that comes with Windows. But not all programs have this feature.

  5. Anonymous users2024-02-06

    In the PrecreateWindow, after the todo comment section, add: &= ws thickframe; Remove resizable borders |= ws_dlgframe;Add a border that cannot be changed in size.

  6. Anonymous users2024-02-05

    When you drag the window, there is an onsize message, in the function that the message responds to or the handle of the outer window, and then set the size of the outer window through the handle.

Related questions
29 answers2024-05-15

Uh: Some make sense, some don't......

In the beginning, buy a character, -5000 >>>More

9 answers2024-05-15

First of all, it is necessary to make it clear that it is to return to the feeling of liking each other in the first place, not the novelty. In the past, people often asked me how I could maintain a relationship for more than 3 years, I think it is to keep improving, constantly improve yourself, and bring yourself continuous shining points, how can you get tired of being new every day? Of course, it must be two people who make progress together, and the synchronization of thoughts is the skill to maintain, and making progress together is the best. >>>More

31 answers2024-05-15

Of course, there are many such women, because they don't believe in marriage or men, so they only want children to continue their next generation.

50 answers2024-05-15

Blind date must be like this, people have no relationship with you now, you have no money to marry her to live, this is a very real problem, who doesn't want to let themselves live the best point? Although vulgar, but this is because there is no emotional foundation, so people always think about reality, if it is true love, it will slowly merge

20 answers2024-05-15

In fact, if you have read "C Expert Programming", it is very simple, and this problem has been carefully described above. It's stored in memory as shown in the figure. n[0][5] is actually *(*n+0)+5), which is the sixth cell. >>>More