flat assembler
Message board for the users of flat assembler.
Index
> Windows > Titleless Tool Windows |
Author |
|
bitRAKE 30 Mar 2023, 18:52
The simple fact is that I don't like window decorations. MS has sought a look for Windows [as part of their branding] that isn't universally conducive to the effectiveness of the user, imho. Once I'm comfortable with an application I want the decoration to not imped my focus.
This examples is a simple step in that direction by using the tool menu to host icons for window control. The first problem is how to move the tool window. By holding a shift-key the menu can be grabbed to move the window. This is not as much a problem as it might seem - tool windows are put where they need to be and live there. The icons are built into the system and just need to be added to the menu: Code: Main.mII MENUITEMINFO \ cbSize: sizeof MENUITEMINFO,\ fMask: MIIM_FTYPE or MIIM_BITMAP or MIIM_ID,\ fType: 0,\ fState: MFS_ENABLED,\ wID: IDM_SYS_SYSTEM,\ hbmpItem: HBMMENU_SYSTEM LoadMenuIndirectW ADDR .MenuTemplate mov [g_hMenu], rax InsertMenuItemW [g_hMenu], 0, TRUE, ADDR .mII mov [.mII.fType], MFT_RIGHTJUSTIFY iterate <BITMAP, COMMAND>,\ HBMMENU_MBAR_RESTORE, IDM_SYS_RESTORE,\ HBMMENU_MBAR_MINIMIZE, IDM_SYS_MINIMIZE,\ HBMMENU_MBAR_CLOSE, IDM_SYS_CLOSE mov [.mII.hbmpItem], BITMAP mov [.mII.wID], COMMAND InsertMenuItemW [g_hMenu], -1, TRUE, ADDR .mII end iterate ; HBITMAP HBMMENU_SYSTEM:=1 HBMMENU_MBAR_RESTORE:=2 HBMMENU_MBAR_MINIMIZE:=3 ; HBMMENU_MBAR_?:=4 HBMMENU_MBAR_CLOSE:=5 HBMMENU_MBAR_CLOSE_D:=6 HBMMENU_MBAR_MINIMIZE_D:=7 HBMMENU_POPUP_CLOSE:=8 HBMMENU_POPUP_RESTORE:=9 HBMMENU_POPUP_MAXIMIZE:=10 HBMMENU_POPUP_MINIMIZE:=11 HBMMENU_CALLBACK:=-1 Code: IDM_SYS_SYSTEM := 0xF090 ; SC_MOUSEMENU | SC_KEYMENU IDM_SYS_RESTORE := 0xF120 ; SC_RESTORE IDM_SYS_MINIMIZE := 0xF020 ; SC_MINIMIZE IDM_SYS_CLOSE := 0xF060 ; SC_CLOSE .WM_COMMAND: cmp r8w, IDM_FILE_QUIT jz .WM_DESTROY cmp r8w, 0xF000 jc .default SendMessageW rcx, WM_SYSCOMMAND, r8, r9 ; mimic standard WS_SYSMENU use jmp .processed (With supporting includes needed.)
_________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
||||||||||||||||||||
30 Mar 2023, 18:52 |
|
ProMiNick 04 Apr 2023, 19:46
same one but with working restore/maximize. but without win98like pictures for RESTORE,MINIMIZE & CLOSE.
And because variant for win11 already exist. my one is for win32 subsys with user32.dll (win98-win10,wine,reactos - they all fit requirement).
_________________ I don`t like to refer by "you" to one person. My soul requires acronim "thou" instead. |
|||||||||||
04 Apr 2023, 19:46 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.