首页 > DUI > DUI-控制窗口最大最小化屏幕区域
2012一月6

DUI-控制窗口最大最小化屏幕区域

在Windows中,无论什么时候以何种方式改变窗口的尺寸或大小,是拖拽窗口边缘也好,或是在代码中调用改变窗口尺寸的函数也好,总之不管你用什么方法,Windows都会首先发送WM_GETMINMAXINFO消息。大多数应用程序都不用显式处理这个WM_GETMINMAXINFO消息(也就是说让DefWindowProc窗口过程进行缺省处理),而Windows在进行缺省处理时是不会让一个窗口视图比屏幕还大的,所以我们会碰上前面讲的那个问题。

WM_GETMINMAXINFO

    WPARAM wParam//This parameter is not used.
    LPARAM lParam;//MINMAXINFOstructure that contains the default maximized position and dimensions, and the 
                    default minimum and maximum tracking sizes. An application can override the 
                    defaults by setting the members of this structure.

解决的方法是:不要让Windows对WM_GETMINMAXINFO消息进行缺省处理,而是由我们自己处理,方法如下:主要是控制窗口显示时的大小(ptMaxSize),最大化时的位置(ptMaxPosition),鼠标控制窗口大小的最大(ptMaxTrackSize)、最小(ptMinTrackSize)位置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
case WM_GETMINMAXINFO:
	 MINMAXINFO *mminfo;
		 mminfo=(PMINMAXINFO)lParam;
 
	 mminfo->ptMinTrackSize.x=200;
	 mminfo->ptMinTrackSize.y=200;
 
	 mminfo->ptMaxSize.x=300;
	 mminfo->ptMaxSize.y=300;
 
	 mminfo->ptMaxPosition.x=0;
	 mminfo->ptMaxPosition.y=0;
 
	 mminfo->ptMaxTrackSize.x=300;
	 mminfo->ptMaxTrackSize.y=300;
 
	 break;

利用以上的代码就可以控制窗口的大小(300,300),最大化后会出现在(0,0)位置处,鼠标拖动改变窗口大小时,最大为(300,300),最小为(200,200)。其中的单位都是像素。








文章作者:hgy413
本文地址:http://hgy413.com/1870.html
版权所有 © 转载时必须以链接形式注明作者和原始出处!

50 Responses to “DUI-控制窗口最大最小化屏幕区域”

  1. #1 minecraft 回复 | 引用 Post:2018-10-06 21:21

    Thank you a lot for sharing this with all of us you really know what you are talking about!

    Bookmarked. Please additionally consult with my website =).

    We may have a link change agreement among us

  2. Helpful info. Fortunate me I discovered your website by accident, and I am surprised why
    this coincidence didn’t came about earlier! I bookmarked it.

  3. Wow! After all I got a web site from where I know how to truly get valuable facts concerning my study and
    knowledge.

  4. I must thank you for the efforts you’ve put in writing this blog.
    I’m hoping to check out the same high-grade content by you later on as
    well. In fact, your creative writing abilities has inspired me to get my
    own site now 😉

  5. #5 tinder dating site 回复 | 引用 Post:2018-10-17 13:54

    Hi I am so delighted I found your blog page, I really found you
    by accident, while I was browsing on Google for something else,
    Regardless I am here now and would just like to say kudos for a marvelous post and a all round entertaining blog
    (I also love the theme/design), I don’t have time to browse it all at the moment but I have saved
    it and also added in your RSS feeds, so when I have time
    I will be back to read much more, Please do keep up the awesome work.

  6. We are a gaggle of volunteers and starting a brand new scheme in our community.
    Your site provided us with useful information to
    work on. You’ve done an impressive task and our whole community shall be grateful to
    you.

  7. #7 Coconut Oil 回复 | 引用 Post:2018-10-22 22:26

    I’m impressed, I have to admit. Seldom do I come across a blog that’s both equally educative and interesting, and
    without a doubt, you have hit the nail on the head.
    The problem is something which not enough men and women are
    speaking intelligently about. Now i’m very happy I
    came across this during my hunt for something
    regarding this.

  8. #8 Benefits of Coconut Oil 回复 | 引用 Post:2018-10-24 10:52

    Do you have a spam problem on this blog; I also am a blogger, and I was curious
    about your situation; many of us have developed some nice
    procedures and we are looking to exchange strategies with other folks, why not
    shoot me an e-mail if interested.

  9. #9 Coconut Oil 回复 | 引用 Post:2018-10-24 14:51

    Hello, Neat post. There is a problem along with your web site in internet explorer, would check this?

    IE nonetheless is the market leader and a huge component of people will pass over your magnificent writing because of this problem.

  10. #10 Coconut Oil Benefits 回复 | 引用 Post:2018-10-25 10:45

    If you want to improve your knowledge only keep
    visiting this site and be updated with the hottest information posted here.

  11. #11 quest bars cheap 回复 | 引用 Post:2018-11-03 11:44

    Hello, i think that i noticed you visited my site thus i came to
    go back the want?.I am trying to in finding issues
    to enhance my web site!I assume its adequate to use a few of
    your ideas!!

  12. It’s an amazing post in favor of all the internet users; they will obtain benefit
    from it I am sure.

  13. magnificent submit, very informative. I’m wondering why the other specialists of this sector don’t notice this.
    You should continue your writing. I am sure, you have a huge readers’ base already!

  14. Greetings! I know this is kinda off topic but I
    was wondering which blog platform are you using for this website?
    I’m getting fed up of WordPress because I’ve had problems with hackers and I’m looking at options
    for another platform. I would be great if you could point me in the direction of a good platform.

  15. I do not even know how I ended up here, but I thought this post was good.
    I don’t know who you are but certainly you are going to a famous blogger if you aren’t already 😉 Cheers!

  16. Its not my first time to pay a visit this web site, i
    am browsing this site dailly and get pleasant facts from here every
    day.

  17. #17 Sling TV 回复 | 引用 Post:2018-12-05 09:06

    Hi, Neat post. There’s an issue together with your website in internet explorer, may check this?
    IE still is the marketplace chief and a large component of people will pass over
    your excellent writing due to this problem.

  18. It’s remarkable designed for me to have a web site, which is good for my experience.
    thanks admin

  19. What’s up to every body, it’s my first go to see of this blog; this web site consists of remarkable and
    actually fine data in support of readers.

  20. #20 descargar facebook 回复 | 引用 Post:2019-08-19 09:55

    I love what you guys tend to be up too. This kind of clever
    work and reporting! Keep up the awesome works guys I’ve incorporated you guys to my blogroll.

  21. #21 descargar facebook 回复 | 引用 Post:2019-08-19 10:18

    Way cool! Some extremely valid points! I appreciate you penning this article plus the rest of the website is extremely good.

  22. #22 minecraft games 回复 | 引用 Post:2019-09-01 00:55

    We are a bunch of volunteers and starting a new scheme in our community.
    Your web site offered us with useful information to work on. You’ve performed a formidable job and our whole group will probably be grateful to you.

  23. #23 quest bars cheap 回复 | 引用 Post:2019-09-06 02:29

    Hello, yes this article is actually pleasant and I have learned
    lot of things from it about blogging. thanks.

  24. #24 ETIAS Visa 回复 | 引用 Post:2019-09-07 06:19

    Hey! I know this is kinda off topic however ,
    I’d figured I’d ask. Would you be interested in trading links or maybe guest
    authoring a blog post or vice-versa? My blog discusses a lot of the same subjects
    as yours and I feel we could greatly benefit from each other.
    If you’re interested feel free to shoot me an email.

    I look forward to hearing from you! Terrific blog by the way!

  25. #25 quest bars cheap 回复 | 引用 Post:2019-09-07 15:56

    hey there and thank you for your info – I have definitely picked up anything new from right here.
    I did however expertise several technical points using this site,
    as I experienced to reload the site lots of times previous to I
    could get it to load properly. I had been wondering if your web host is OK?
    Not that I’m complaining, but slow loading instances times will often affect your placement
    in google and could damage your high-quality
    score if ads and marketing with Adwords. Well I’m adding this
    RSS to my e-mail and can look out for a lot more of
    your respective intriguing content. Make sure you update this again very soon.

  26. #26 chair builder 回复 | 引用 Post:2019-09-16 13:13

    It’s very trouble-free to find out any matter on net as compared to books, as
    I found this piece of writing at this web site.

  27. #27 ESTA Applicatiom 回复 | 引用 Post:2019-09-18 14:11

    Awesome article.

  28. #28 homo 回复 | 引用 Post:2019-09-21 02:08

    certainly like your website but you have to check the spelling on several of your posts.
    Several of them are rife with spelling issues and I find it very troublesome
    to inform the reality however I’ll definitely come
    back again.

  29. #29 viagra 回复 | 引用 Post:2019-09-25 14:05

    When someone writes an post he/she maintains the plan of a user in his/her mind that how a user can be aware of it.
    Thus that’s why this paragraph is perfect. Thanks!

  30. #30 viagra 回复 | 引用 Post:2019-09-26 16:55

    I enjoy looking through an article that will make men and women think.
    Also, thanks for allowing for me to comment!

  31. #31 quest bars cheap 回复 | 引用 Post:2019-09-28 08:19

    I got this site from my pal who shared with me on the topic of this web page and now this time I am browsing
    this site and reading very informative articles at this time.

  32. Thanks for sharing your thoughts about Exterminator Bradenton. Regards

  33. #33 event planning 回复 | 引用 Post:2019-10-23 03:44

    It’s amazing to visit this website and reading the views of all mates concerning this article, while I
    am also eager of getting familiarity.

  34. My brother recommended I may like this web site.

    He used to be entirely right. This put up truly made my day.
    You can not believe just how much time I had spent for this info!

    Thanks!

  35. Please let me know if you’re looking for a writer for your weblog.
    You have some really great articles and I feel I would be
    a good asset. If you ever want to take some of the
    load off, I’d really like to write some articles for your blog in exchange for a
    link back to mine. Please shoot me an e-mail if interested.

    Cheers!

  36. #36 quest nutrition 回复 | 引用 Post:2019-10-28 03:02

    Admiring the dedication you put into your site and in depth information you offer.

    It’s awesome to come across a blog every once
    in a while that isn’t the same out of date rehashed material.
    Fantastic read! I’ve bookmarked your site and I’m including your RSS feeds to my Google account.

  37. #37 cbd capsules 回复 | 引用 Post:2019-11-05 00:57

    I’m not sure exactly why but this website is
    loading incredibly slow for me. Is anyone else having this issue or is it
    a problem on my end? I’ll check back later and see if the problem still exists.

  38. #38 where to buy cbd oil 回复 | 引用 Post:2019-11-05 10:16

    Wow, incredible blog layout! How long have you been blogging for?

    you made blogging look easy. The overall look of your website is
    magnificent, let alone the content!

  39. After looking over a few of the blog posts on your blog, I seriously like your way of
    writing a blog. I bookmarked it to my bookmark webpage list
    and will be checking back soon. Take a look at my web site too and let me know what you think.

  40. Pretty nice post. I just stumbled upon your
    blog and wished to mention that I have truly loved browsing your blog
    posts. In any case I will be subscribing for your feed and
    I’m hoping you write again very soon!

  41. Thanks a bunch for sharing this with all folks you actually understand what you’re talking approximately!
    Bookmarked. Please additionally visit my site =). We could have a link trade arrangement among us

  42. #42 for coconut oil 回复 | 引用 Post:2019-11-14 06:29

    Whats up are using WordPress for your site platform?

    I’m new to the blog world but I’m trying to get started and set up my
    own. Do you require any coding expertise to make your own blog?
    Any help would be greatly appreciated!

  43. #43 of coconut oil 回复 | 引用 Post:2019-11-14 06:42

    Great post. I was checking constantly this blog and I’m impressed!
    Very helpful info specifically the last part :) I care for such
    information a lot. I was seeking this particular
    info for a long time. Thank you and best of luck.

  44. #44 on coconut oil 回复 | 引用 Post:2019-11-15 01:34

    What’s up to every , for the reason that I am
    truly eager of reading this blog’s post to be updated regularly.
    It contains fastidious material.

  45. #45 coconut oil for 回复 | 引用 Post:2019-11-15 08:32

    This post will help the internet people for setting up new blog or even a weblog from start to end.

  46. #46 Miami Movers 回复 | 引用 Post:2019-11-15 10:12

    I am sure this paragraph has touched all the internet users, its really really good article on building up new web site.

  47. #47 and coconut oil 回复 | 引用 Post:2019-11-16 04:41

    This is really interesting, You are a very skilled blogger.
    I’ve joined your rss feed and look forward to seeking more of your excellent post.
    Also, I have shared your site in my social networks!

  48. Hello exceptional blog! Does running a blog such as this require a great deal
    of work? I’ve no knowledge of coding but I was hoping to start my own blog in the near future.

    Anyway, should you have any suggestions or tips for new blog owners
    please share. I understand this is off subject but I simply wanted to
    ask. Thanks a lot!

  49. Wonderful article! This is the type of information that are supposed
    to be shared across the web. Disgrace on Google for not positioning
    this put up higher! Come on over and discuss with my site .
    Thank you =)

  50. #50 tinyurl.com 回复 | 引用 Post:2019-11-20 15:09

    Wonderful site you have here but I was curious if you knew of any discussion boards that cover
    the same topics discussed in this article? I’d really love to be a part of group where I can get comments
    from other experienced individuals that share the same interest.
    If you have any suggestions, please let me know.

    Cheers!

发表评论