Derek wrote:Anyone else getting this with Vista?
No problem here with Vista HomePremium.
Now that I see exactly what it is you're looking for, I modified my original code...
Window is max size with borders and all gadgets being visible
Window cannot be moved
SysMenu item Move is disabled
Taskbar location (left/right/top/bottom) is taken into account
Code: Select all
SystemParametersInfo_(#SPI_GETWORKAREA,0,@screen.RECT,0)
captionheight=GetSystemMetrics_(#SM_CYCAPTION)
borderwidth=GetSystemMetrics_(#SM_CXFIXEDFRAME)
borderheight=GetSystemMetrics_(#SM_CYFIXEDFRAME)
windowwidth=screen\right-screen\left-(borderwidth*2)
windowheight=screen\bottom-screen\top-captionheight-(borderheight*2)
windowx=screen\left
windowy=screen\top
Procedure.l WinCallback(hwnd,msg,wParam,lParam)
result=#PB_ProcessPureBasicEvents
Select msg
Case #WM_WINDOWPOSCHANGING
result=0
EndSelect
ProcedureReturn result
EndProcedure
Procedure.l DisableMenuMove(hwnd)
hMenu=GetSystemMenu_(hwnd,0)
mii.MENUITEMINFO
mii\cbSize=SizeOf(MENUITEMINFO)
mii\fMask=#MIIM_STRING
mii\dwTypeData=0
GetMenuItemInfo_(hMenu,#SC_MOVE,0,@mii.MENUITEMINFO)
mItem$ = Space(mii\cch+1)
mii\dwTypeData=@mItem$
mii\cch+1
GetMenuItemInfo_(hMenu,#SC_MOVE,0,@mii.MENUITEMINFO)
ModifyMenu_(hMenu,#SC_MOVE,#MF_GRAYED|#MF_BYCOMMAND,0,mItem$)
DrawMenuBar_(hwnd)
EndProcedure
OpenWindow(0,windowx,windowy,windowwidth,windowheight,"",#PB_Window_SystemMenu)
CreateGadgetList(WindowID(0))
ButtonGadget(0,0,0,100,100,"")
ButtonGadget(1,WindowWidth(0)-100,0,100,100,"")
ButtonGadget(2,0,WindowHeight(0)-100,100,100,"")
ButtonGadget(3,WindowWidth(0)-100,WindowHeight(0)-100,100,100,"")
DisableMenuMove(WindowID(0))
SetWindowCallback(@WinCallback())
Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow
What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1