Restored from previous forum. Originally posted by Franco.
Don't know if somebody else has posted such a thing...
Code: Select all
; (c) 2002 - Franco's template - absolutely freeware
; Procedure to make your window unmovable...
; Needs the handle of the window
; Remember: If you make a 'GetSystemMenu_(WindowID,#TRUE)' API call
; after you call this Procedure you get the MoveMenuItem back!
; then you have to remove it again...
Procedure DisableMoveSysMenuItem(WindowID)
RemoveMenu_(GetSystemMenu_(WindowID, #False), ;change to #True
1, #MF_DISABLED | #MF_BYPOSITION) ;to re-enable Move
DrawMenuBar_(WindowID)
EndProcedure
OpenWindow(0, #PB_Any, #PB_Any, 200, 100, "Disable Move Item",
#PB_Window_SystemMenu | #PB_Window_ScreenCentered)
DisableMoveSysMenuItem(WindowID(0))
While WaitWindowEvent() ! #PB_Event_CloseWindow : Wend
Franco
Sometimes you have to go a lonely way to accomplish genius things.