Hi
Now all you have to do is to prevent the User from resizing the UWP
I did my work ,no move
did not I ?
(It maybe there is another solution with the DWM)
Code: Select all
Prototype DwmGetWindowAttribute(hWnd,dwAttribute.l,*pvAttribute,cbAttribute.l)
Global DwmGWA.DwmGetWindowAttribute,hWnd,title${#MAX_PATH},class${#MAX_PATH}
#DWMWA_CLOAKED = 14
Global handle
Procedure GetWinHandle(pro$)
hWnd = FindWindow_(0, 0)
Repeat
hWnd = GetWindow_(hWnd, #GW_HWNDNEXT)
If hWnd And IsWindowVisible_(hWnd) And GetWindowLongPtr_(hWnd, #GWL_HWNDPARENT) = 0
GetWindowText_(hWnd, @title$, #MAX_PATH)
GetClassName_(hWnd,@class$,#MAX_PATH)
If class$ = "ApplicationFrameWindow" Or class$ = "Windows.UI.Core.CoreWindow"
dll = OpenLibrary(#PB_Any,"DWMAPI.DLL")
If dll
DwmGWA = GetFunction(dll,"DwmGetWindowAttribute")
If DwmGWA
DwmGWA(hWnd,#DWMWA_CLOAKED,@Cloaked,SizeOf(Cloaked))
If Cloaked = 0 And title$ = pro$
handle = hwnd
ProcedureReturn handle
EndIf
EndIf
CloseLibrary(dll)
EndIf
EndIf
EndIf
Until hWnd = 0
ProcedureReturn #False
EndProcedure
OpenWindow(0,0,0,200,40,"Main Window",#PB_Window_SystemMenu)
RunProgram("calc.exe")
Delay(1000)
GetWinHandle("Calculator")
GetWindowRect_(Handle,r.RECT)
OpenWindow(1,r\left,r\top,r\right-r\top,40,"",#PB_Window_BorderLess)
SetWindowLongPtr_(WindowID(1), #GWL_EXSTYLE,#WS_EX_LAYERED | #WS_EX_TOOLWINDOW | #WS_EX_TOPMOST)
SetLayeredWindowAttributes_(WindowID(1),0, 1, #LWA_ALPHA)
SetWindowPos_(WindowID(1),#HWND_TOPMOST ,-1,-1,-1,-1,#SWP_NOSIZE|#SWP_NOMOVE)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Quit = 1
EndSelect
Until Quit = 1