flat assembler
Message board for the users of flat assembler.

Index > Windows > Window above the screen

Author
Thread Post new topic Reply to topic
Overclick



Joined: 11 Jul 2020
Posts: 522
Location: Ukraine
Overclick
Hi
I move window by SC_DRAGMOVE but then it checks itself for some allowed space. If window's header plased above the screen it replaces window down to shure it's on the screen. But I don't need it. I tried to hook
WM_WINDOWPOSCHANGED
WM_MOVE
WM_WINDOWPOSCHANGING
WM_CAPTURECHANGED
WM_NCCALCSIZE
Also tried to manage WM_GETMINMAXINFO
No luck. If I move window by SetWindowPos it placed where I wandt with no problems. But I still want to use SC_DRAGMOVE. Where can I disable that checking?
Post 20 May 2022, 05:17
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18739
Location: In your JS exploiting you and your system
revolution
Windows has never allowed that.

Your option is to handle the mouse move message yourself and position the Window yourself.

BTW: It is the same for many of the Linux window managers also. There is a lot of resistance to allowing the user to push the window off the screen without some special settings or keystrokes. But manual positioning still works if the app really needs to do it.
Post 20 May 2022, 09:06
View user's profile Send private message Visit poster's website Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 598
Location: Russia
macomics
It is unclear why this is necessary at all. Isn't it easier to hide the window when it goes beyond the screen boundaries?

If you want the title to be displayed on the panel, then just set aplha to 0.
Quote:
SetLayeredWindowAttributes(hwnd, 0, 0, LWA_ALPHA);
SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) or or WS_EX_LAYRED);
Post 20 May 2022, 13:25
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 522
Location: Ukraine
Overclick
My window does not have the title at all But it have transparen background for different sort of animation layers above it.
I was thinking about switches or cutters or separate windows But all of them is looking too choppy and makes additional resizing headache.
It is not big deal to manage mouse moving instead
Post 20 May 2022, 14:08
View user's profile Send private message Visit poster's website Reply with quote
Hrstka



Joined: 05 May 2008
Posts: 33
Location: Czech republic
Hrstka
Do you call DefWindowProc in handling WM_WINDOWPOSCHANGING and WM_WINDOWPOSCHANGED messages?
Post 20 May 2022, 15:27
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 522
Location: Ukraine
Overclick
Quote:

Do you call DefWindowProc in handling WM_WINDOWPOSCHANGING and WM_WINDOWPOSCHANGED messages?

Do I need it?
Post 20 May 2022, 15:53
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 522
Location: Ukraine
Overclick
I give up with SC_DRAGMOVE. My own manager works perfect.
Code:
.dragwindow:
        invoke  SetCapture,[hWnd]
        mov             [GuiLbuttonStatus],1
        mov             [GuiLbuttonUp],.dragwindow.end
        mov             [GuiLbuttonContinueDown],.dragwindow.continue
        invoke  GetCursorPos,MouseTrackOld
        invoke  GetWindowRect,[hWnd],GuiDragwindowRect
        xor             rax,rax
        ret
        .dragwindow.continue:
                invoke  GetCursorPos,MouseTrack
                mov             r8d,[MouseTrack.x]
                mov             r9d,[MouseTrack.y]
                sub             r8d,[MouseTrackOld.x]
                sub             r9d,[MouseTrackOld.y]
                add             r8d,[GuiDragwindowRect.left]
                add             r9d,[GuiDragwindowRect.top]
                invoke  SetWindowPos,[hWnd],0,r8,r9,0,0,\
                                SWP_SHOWWINDOW or SWP_NOSIZE
                xor             rax,rax
                ret
        .dragwindow.end:
                mov             [GuiLbuttonStatus],0
                invoke  ReleaseCapture
                xor             rax,rax
                ret    
Post 21 May 2022, 07:04
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.