Always on Top Windows10

Post your working scripts, libraries and tools
malcev
Posts: 709
Joined: 12 Aug 2014, 12:37

Always on Top Windows10

08 May 2020, 16:28

Undocumented CreateWindowInBand.
CreateWindowInBand
This is a private api function found in user32.dll.
CreateWindowInBand function is the same as CreateWindowEx except it has 1 more parameter, dwBand, that is where you specify the band on which the window should stay (ZBID).

HWND WINAPI CreateWindowInBand(
DWORD dwExStyle,
LPCWSTR lpClassName,
LPCWSTR lpWindowName,
DWORD dwStyle,
int x,
int y,
int nWidth,
int nHeight,
HWND hWndParent,
HMENU hMenu,
HINSTANCE hInstance,
LPVOID lpParam,
DWORD dwBand);
https://blog.adeltax.com/window-z-order-in-windows-10/

Script should be run with UI Access

Code: Select all

#persistent
hwnd := DllCall("CreateWindowInBand", "uint", 0, "str", "Autohotkey", "str", "title", "uint", 0, "int", 0, "int", 0, "int", 200, "int", 200, "ptr", 0, "ptr", 0, "ptr", 0, "ptr", 0, "int", ZBID_UIACCESS := 2, "ptr")
if !a_lasterror
   WinShow ahk_id %hwnd%
else 
   msgbox % a_lasterror
guest3456
Posts: 3144
Joined: 09 Oct 2013, 10:31

Re: Always on Top Windows10

08 May 2020, 20:49

interesting


Return to “Scripts and Functions”

Who is online

Users browsing this forum: Orbort, poida97 and 16 guests