Created
June 8, 2022 09:43
-
-
Save bitRAKE/06ec28e525359a9b867a894b0d3300e7 to your computer and use it in GitHub Desktop.
Taskbar show/hide app icon example:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The other method uses ITaskBarList COM interface:
https://github.com/tgrysztar/fasmg/blob/master/packages/x86/examples/windows/usecom/usecom.asm