![]() thats why i edited this post, instead of creating a new one. we could discuss this the whole night, but it wouldnt get us anywhere. so how is your code any less complicated?! not to mention the unnecessary libraries like the desktop library. do your research.Įdit2: you have 50 api calls, i have 12, and 4 of them can be replaced by your own values. and like i said, the "titlebar in a borderless window" as you call it, is the recommended way. you will have to do some adjustments to fit your needs. or you can maximize and restore the window by double-clicking in the upper area of the window (invisible titlebar). i just thought it was pretty amusing.Įdit1: you can maximize, minimize, or close the window, by clicking in the context menu of the app in the taskbar. you can post whatever you want, and personally i couldnt care less what you post. not to mention that you never do any form of error checking. even though the recommended solution has already been posted, you always felt the need to post your solution, that offered a third of the original functionality, and had a lot of drawbacks and unnecessary api calls. i saw you do this a lot over the past few years, even when i barely visited this site. and this has nothing to do with me or my code. > I do not see that you are good helper in any way.Īt least i try to follow good standards and practices, while you post simply for the sake of posting. my criticism was constructive, but you can choose to ignore it of course. I tried your code, and everything i told you is true. > And before you comment the others try what you suggest first and you will see that it want work. The WM_NCCALCSIZE method is the recommended way by microsoft, and is used in visual studio itself, and in steam, and in pretty much every professional application, that requires a borderless, sizeable, and skinable window. > Why do not you take care of your rubbish code first No offense, but sometimes i wonder, if you look at other peoples code and think to yourself, how can i get rid of all the features and post a really mediocre version of it. ![]() all in all, you are using waaay too much api, for a very simple task. and last but not least, the aero-snap functionality is missing. a task like this should be done in the WndProc(), as the message queue could block, and your solution could temporarily stop working. ![]() i dont really know why you are transfering a flag like that, when the messages offer all the information you need. Your margin for detecting the mouse-over corner is pretty off. dragging the window by clicking anywhere in the client area, might not be the desired effect either. you cant double-click on the titlebar area, to maximize the window, because you dont have a designated titlebar area. people could have multiple monitors, and re-adjusting the window might not be the desired effect.Īlso your implementation is missing a context menu, and the possibility to minimize, maximize, and restore the window. Snapping should happen during the movement of the window, and not after. SendMessage_(hWnd, #WM_SYSCOMMAND, #SC_DnLeftsize,0) SendMessage_(hWnd, #WM_SYSCOMMAND, #SC_UpRightsize,0) SetCursor_(LoadCursor_(0, #IDC_SIZENESW)) SendMessage_(hWnd, #WM_SYSCOMMAND, #SC_DnRightsize,0) SendMessage_(hWnd, #WM_SYSCOMMAND, #SC_UpLeftsize,0) SetCursor_(LoadCursor_(0, #IDC_SIZENWSE)) SendMessage_(hWnd, #WM_SYSCOMMAND, #SC_Rightsize,0) SendMessage_(hWnd, #WM_SYSCOMMAND, #SC_Leftsize,0) SendMessage_(hWnd, #WM_SYSCOMMAND, #SC_Dnsize,0) ![]() SendMessage_(hWnd, #WM_SYSCOMMAND, #SC_Upsize,0) SendMessage_(hWnd, #WM_SYSCOMMAND, #SC_DragMove,0) If mx > r\left sww And mx r\top-sw And my r\left sww And mx r\bottom-sw And my r\left-sw And mx r\top sww And my r\right-sw And mx r\top sww And my r\left-sw And mx r\top-sw And my r\right-sw And mx r\bottom-sw And my r\right-sw And mx r\top-sw And my r\left-sw And mx r\bottom-sw And my 0 If r\top h >= (mi\rcWork\bottom - snap): r\top = mi\rcWork\bottom - h 2 : EndIf If mi\rcWork\top snap > r\top : r\top = mi\rcWork\top - 2 : EndIf If r\left w >= (mi\rcWork\right - snap): r\left = mi\rcWork\right - w 2: EndIf If mi\rcWork\left snap > r\left : r\left = mi\rcWork\left - 2: EndIf Hmon = MonitorFromWindow_(hWnd,#MONITOR_DEFAULTTONEAREST) Global hwnd,r.RECT,hmon,mi.MONITORINFO,x,y,w,h,snap MessageRequester("Info","Unicode compiler option not set",#MB_ICONINFORMATION)
0 Comments
Leave a Reply. |