User Tools

Site Tools


prop_handle.htm
Navigation:  Language Reference > App C - PROP: Runtime Properties > Complete Property List >====== PROP:Handle ====== Previous pageReturn to chapter overviewNext page

Returns the window or control handle for use with low-level Windows API calls that require it.

It is also used when assigning the handle of one BLOB to another.

Example:

WinView   WINDOW('View'),AT(0,0,320,200),MDI,MAX,HVSCROLL
     END
MessageText   CSTRING('You cannot exit the program from this window ')
MessageCaption CSTRING('No EVENT:CloseDown Allowed ')
TextAddress   LONG
CaptionAddress LONG
RetVal     SHORT
CODE
OPEN(WinView)
ACCEPT
 CASE EVENT()
 OF EVENT:CloseDown
  TextAddress = ADDRESS(MessageText)
  CaptionAddress = ADDRESS(MessageCaption)
  RetVal = MessageBox(WinView{PROP:Handle},TextAddress,CaptionAddress,MB_OK)
                   !Windows API call using a window handle
  CYCLE            !Disallow program closedown from this window
 END
END
!*
!Make Window Always on Top
SetWindowPos(Window{PROP:Handle},HWND_TOPMOST,0,0,0,0,SWP_NOMOVE + SWP_NOSIZE)
!*
!Remove MIN Button on window with ICON()
Sty = GetWindowLong(Window{prop:handle}, GWL_STYLE)
SetWindowLong(Window{prop:handle}, GWL_STYLE, BAND(Sty,BXOR(-1,WS_MINIMIZEBOX)))
!*
 BlobPtr = GlobalLock(Pre:Blob{PROP:Handle})
 DO WorkOnBlob
 GlobalUnlock(Pre:Blob{PROP:Handle})

See Also: PROP: ClientHandle

prop_handle.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1