首页 > 编程知识 正文

windows窗口大小,move和touch的区别

时间:2023-05-03 22:39:23 阅读:112482 作者:1163

要区分MoveWindow和setwindowpos的区别,首先从msdn开始吧。 1、movewindowthisfunctionchangesthepositionanddimensionsofthespecifiedwindow.foratop-level window, thepositionanddimensionsarerelativetotheupper-leftcornerofthescreen.forachildwindow,theyarerelativetotheupper-left corner

3358 www.Sina.com/hwnd http://www.Sina.com/x http://www.Sina.com/y http://www.Sina.com/nwidth 3358 www.Sina.com sendsWM_windowposchanged、WM_MOVE、WM_SIZE、andWM_ncalcaled MoveWindow函数内部不进行实际的窗口处理,发送一系列消息,处理其他函数其实这个函数是SetWindowPos。 我们可以继续往下看)

2、SetWindowPos

This function changes the size,position,and z-order of a child,pop-up,or top-level window. Child,pop-up, andtop-levelwindowsareorderedaccordingtotheirappearanceonthescreen.thetopmostwindowreceivesthehighestrankandisthefirstwindwindid

3358 www.Sina.com/hwnd 3358 www.Sina.com/hwnd insertafter 3358 www.Sina.com/x http://www.Sina.com/y http://ww cy 33http://http://www.Sina.com/alwayscausesawm _ windowposchangedmessagetobesenttothewindow.theflagspassedinthismessageareeexactlythesameasthosepassedintotedintotow thosepasssedintothis unction.noothermessagesaresentbythisfunction.(setwindowpos包含z-order设置,比移动窗口更强大,维但是,MoveWindow和SetWindowPos的更本质的区别在于,MoveWindow做了更多的附加事情,窗口提供了WM_MOVE、WM_SIZE、and WM_NCCALCSIZE等多种消息

综上所述,MoveWindow和SetWindowPos实现的功能基本一致,但存在微妙的差异。 重要的是,MoveWindow不仅向窗口通知SetWindowPos操作,还发送一条消息,通知窗口的显示发生了变化,使窗口可以在内部操作。 这对于处理ActiveX控件的resize很重要,因为ActiveX控件经常在WM_SIZE消息中处理相关窗口的resize的窗口调整,所以在调用端,ActiveX控件是reresize

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。