| |

VerySource

 Forgot password?
 Register
Search
View: 825|Reply: 5

Online etc.: How to make the size of the window unable to be changed

[Copy link]

2

Threads

20

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-9-28 12:30:01
| Show all posts |Read mode
An SDI program, now I want to make the window size fixed, just like minesweeper
I guess it may be necessary to change the parameters of m_pMainWnd->ShowWindow(SW_SHOW), I don’t know if I am right or not
Reply

Use magic Report

0

Threads

9

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-9-28 12:45:01
| Show all posts
In the PreCreateWindow function
cs.style&=~WS_THICKFRAME;//Cannot change the size
Reply

Use magic Report

2

Threads

20

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

 Author| Post time: 2020-9-28 13:00:01
| Show all posts
Sorry, did not achieve the effect
Reply

Use magic Report

1

Threads

11

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-9-28 13:15:01
| Show all posts
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT&cs)
{
if( !CFrameWnd::PreCreateWindow(cs))
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.style&=~WS_THICKFRAME;
return TRUE;
}
Reply

Use magic Report

2

Threads

20

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

 Author| Post time: 2020-9-28 14:15:02
| Show all posts
Thanks, I thought it was CWnd::PreCreateWindow()
Reply

Use magic Report

0

Threads

9

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-9-28 14:45:02
| Show all posts
I just built a simple SDI project, and after adding that code, the window size cannot be changed. After removing it, the size can be changed.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list