flat assembler
Message board for the users of flat assembler.

Index > Windows > I have not my window with flag HWND_TOPMOST.

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1285
Roman 22 Jul 2022, 05:40
I want set HWND_TOPMOST to HWND_NOTOPMOST
if my program loose focus or not activate.

Because window HWND_TOPMOST overlaps all windows !
I want fix this.

When i click on my window set HWND_TOPMOST

How do this ?

I try this but work bad.
FEDITStatus_hwnd db 0,0
Code:
 cmp     edx,WM_SETFOCUS ;WM_KILLFOCUS
       jnz     .UpFocus
       cmp     byte [FEDITStatus_hwnd+1],1
       jz      .UpFocus
       invoke SetWindowPos,[FEDITHwnd],HWND_TOPMOST,548-6, 90-29+29, 850+83-5+MoreSizeWnd, 558, 0
       mov     byte [FEDITStatus_hwnd+1],1
       mov     byte [FEDITStatus_hwnd],0
       ret
.UpFocus:
       cmp     edx,WM_NCACTIVATE ;WM_KILLFOCUS
       jnz     .NoLstFocus
       cmp     byte [FEDITStatus_hwnd],1
       jz      .NoLstFocus
       invoke SetWindowPos,[FEDITHwnd],HWND_NOTOPMOST,548-6, 90-29+29, 850+83-5+MoreSizeWnd, 558, 0
       mov     byte [FEDITStatus_hwnd],1
       mov     byte [FEDITStatus_hwnd+1],0
       ret
.NoLstFocus:              
    
Post 22 Jul 2022, 05:40
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1285
Roman 22 Jul 2022, 05:45
And how check window have HWND_TOPMOST or HWND_NOTOPMOST ?
Post 22 Jul 2022, 05:45
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 675
Location: Russia
macomics 22 Jul 2022, 05:50
Use HWND_TOP or call SetForegroundWindow


Last edited by macomics on 22 Jul 2022, 05:53; edited 1 time in total
Post 22 Jul 2022, 05:50
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1285
Roman 22 Jul 2022, 05:53
HWND_TOP too overlaps all windows !
Post 22 Jul 2022, 05:53
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18948
Location: In your JS exploiting you and your system
revolution 22 Jul 2022, 05:57
You don't want TOPMOST. You want the normal setfocus.
Post 22 Jul 2022, 05:57
View user's profile Send private message Visit poster's website Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 675
Location: Russia
macomics 22 Jul 2022, 06:05
But! HWND_TOPMOST there is a difference between HWND_TOP. Check it out.
Post 22 Jul 2022, 06:05
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1285
Roman 22 Jul 2022, 06:06
Yes. I know this
HWND_TOP = 0
HWND_TOPMOST = -1
Post 22 Jul 2022, 06:06
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 675
Location: Russia
macomics 22 Jul 2022, 06:08
I didn't mean the values of constants, but their action
SetWindowPos


Last edited by macomics on 22 Jul 2022, 06:10; edited 1 time in total
Post 22 Jul 2022, 06:08
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1285
Roman 22 Jul 2022, 06:10
i found GetWindowInfo,[hwnd],ptr_tagWINDOWINFO

typedef struct tagWINDOWINFO {
DWORD cbSize;
RECT rcWindow;
RECT rcClient;
DWORD dwStyle;
DWORD dwExStyle;
DWORD dwWindowStatus; //WS_ACTIVECAPTION
UINT cxWindowBorders;
UINT cyWindowBorders;
ATOM atomWindowType;
WORD wCreatorVersion;
}

The window status. If this member is WS_ACTIVECAPTION (0x0001), the window is active. Otherwise, this member is zero.
Post 22 Jul 2022, 06:10
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 675
Location: Russia
macomics 22 Jul 2022, 06:15
Post 22 Jul 2022, 06:15
View user's profile Send private message Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 1951
Furs 23 Jul 2022, 16:02
Roman wrote:
And how check window have HWND_TOPMOST or HWND_NOTOPMOST ?
Use GetWindowLong with GWL_EXSTYLE and check if it has WS_EX_TOPMOST.
Post 23 Jul 2022, 16:02
View user's profile Send private message 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.