flat assembler
Message board for the users of flat assembler.

Index > Windows > [solved]Taskbar issue

Author
Thread Post new topic Reply to topic
Overclick



Joined: 11 Jul 2020
Posts: 577
Location: Ukraine
Overclick
Hi
I trying to change visibility of taskbar button(minimized window) but something wrong
Code:
To present:
        invoke  SetWindowLong,[hWnd],GWL_EXSTYLE,\
                        WS_EX_LAYERED or WS_EX_APPWINDOW
        invoke  SetWindowPos,[hWnd],0,0,0,0,0,\
                        SWP_NOMOVE+SWP_NOSIZE+SWP_NOZORDER+SWP_FRAMECHANGED

To remove:
        invoke  SetWindowLong,[hWnd],GWL_EXSTYLE,\
                        WS_EX_LAYERED or WS_EX_NOACTIVATE
        invoke  SetWindowPos,[hWnd],0,0,0,0,0,\
                        SWP_NOMOVE+SWP_NOSIZE+SWP_NOZORDER+SWP_FRAMECHANGED    


Last edited by Overclick on 07 Jun 2022, 21:00; edited 1 time in total
Post 07 Jun 2022, 01:34
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3489
Location: vpcmipstrm
bitRAKE
At least momentarily set WS_EX_TOOLWINDOW to force windows to re-examine the taskbar button visibility. Or look at the "usecom" example in the fasmg distribution (using ITaskBarList).

_________________
¯\(°_o)/¯ unlicense.org
Post 07 Jun 2022, 09:22
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 577
Location: Ukraine
Overclick
Cheers mate, it works perfect. I planned to use COM for it some day, thanks. The example exist on fasm_1 not fasmg.
WS_EX_TOOLWINDOW does nothing even for temporary solution.

Code:
To present:
        cominvk  ShellTaskBar,HrInit
        cominvk  ShellTaskBar,AddTab,[hMainWnd]
        cominvk  ShellTaskBar,ActivateTab,[hMainWnd]

To remove:
        cominvk  ShellTaskBar,HrInit
        cominvk  ShellTaskBar,DeleteTab,[hMainWnd]    
Post 07 Jun 2022, 20:59
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3489
Location: vpcmipstrm
bitRAKE
Of course it works, it's like a sticky flag that is only effected by WS_EX_APPWINDOW/WS_EX_TOOLWINDOW:
Code:
format PE64 GUI 6.2 at 0x1234_56780000
include 'mywin.inc'

GWL_EXSTYLE := -20

TaskbarDemo:
        iterate msg, WM_INITDIALOG,WM_COMMAND,WM_CLOSE
                cmp edx,msg
                jz .msg
        end iterate
        xor eax,eax
        retn

label .WM_INITDIALOG at .message_processed

.WM_CLOSE:
        enter 32,0
        EndDialog rcx,0
.message_processed_leave:
        leave
.message_processed:
        push 1
        pop rax
        retn

.WM_COMMAND:
        iterate cmd, ID_EXIT,ID_SHOW,ID_HIDE
                cmp r8d,BN_CLICKED shl 16 + cmd
                jz .CMD_#cmd
        end iterate
        jmp .message_processed

label .CMD_ID_EXIT at .WM_CLOSE

.CMD_ID_SHOW:
        enter 32,0
        SetWindowLongA rcx,GWL_EXSTYLE,WS_EX_APPWINDOW
        jmp .message_processed_leave

.CMD_ID_HIDE:
        enter 32,0
        SetWindowLongA rcx,GWL_EXSTYLE,WS_EX_TOOLWINDOW
        jmp .message_processed_leave



WinMain:entry $
        virtual at RBP-.FRAME
                        rq 4
                .P5     dq ?
                _align 16
        .FRAME := $ - $$
        end virtual
        enter .FRAME,0
        GetModuleHandleA 0
        xchg rcx,rax
        DialogBoxParamA rcx,IDD_TBDEMO,HWND_DESKTOP,ADDR TaskbarDemo,0
        ExitProcess 0
        int3

.end _winx.entry ; _winx.end? _end ; generate import section

section '.rsrc' resource data readable

ID_EXIT := IDCANCEL
ID_SHOW := 100
ID_HIDE := 101

IDD_TBDEMO := 1

directory RT_DIALOG,dialogs

resource dialogs,\
        IDD_TBDEMO,LANG_ENGLISH+SUBLANG_DEFAULT,tbdemo

dialog tbdemo,'Taskbar item control',70,70,170,24,WS_CAPTION+WS_POPUP+WS_SYSMENU+DS_MODALFRAME
        dialogitem 'BUTTON','Show',ID_SHOW,4,4,45,15,WS_VISIBLE+WS_TABSTOP
        dialogitem 'BUTTON','Hide',ID_HIDE,54,4,45,15,WS_VISIBLE+WS_TABSTOP
        dialogitem 'BUTTON','Exit',ID_EXIT,120,4,45,15,WS_VISIBLE+WS_TABSTOP
enddialog    

_________________
¯\(°_o)/¯ unlicense.org
Post 08 Jun 2022, 05:05
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 577
Location: Ukraine
Overclick
Not for my layered window.
Post 08 Jun 2022, 10:06
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3489
Location: vpcmipstrm
bitRAKE
That's why posting fragments of code is bad communication.
Adding the WS_EX_LAYERED flag, and it still works.

I'm glad you solved your problem.


Description:
Download
Filename: gui_taskbar.zip
Filesize: 1.63 KB
Downloaded: 45 Time(s)


_________________
¯\(°_o)/¯ unlicense.org
Post 08 Jun 2022, 14:53
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 577
Location: Ukraine
Overclick
Maybe Tray icon/menu confuse it? I don't know. I have to use COM for future things on taskbar anyway so that is ok.
Post 08 Jun 2022, 19:13
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.