Squeak Class Documentation category index | class index  
 
Win32Window
  category: FFI-Examples-Win32
  superclass: Win32Handle
  subclasses:

Here's a simple Win32 example:
| hwnd dc dst |
hwnd _ Win32Window getFocus. "fetch the window currently having the focus"
dc _ hwnd getDC. "grab the dc or the window"
dst _ 100.
dc moveTo: 0@0.
"draw a rect"
dc lineTo: dst@0. dc lineTo: dst@dst. dc lineTo: 0@dst. dc lineTo: 0@0.
"and a cross"
dc lineTo: dst@dst. dc moveTo: dst@0. dc lineTo: 0@dst.
hwnd releaseDC: dc.

instance methods
  accessing
  getDC
getHDCDuring:
messageBox:
messageBox:title:
messageBox:title:flags:
releaseDC:
screenToClient:

  api calls
  apiGetDC:
apiMessageBox:text:title:flags:
apiReleaseDC:with:
apiScreenToClient:with:

class methods
  accessing
  getDesktopWindow
getFocus

  examples
  coloredEllipses
coloredRectangles
win32Draw

instance methods
  accessing top  
 

getDC

Return the DC associated with the window


 

getHDCDuring:

Provide a Win32 HDC during the execution of aBlock


 

messageBox:

Win32Window getFocus messageBox:'Hello World'


 

messageBox:title:

Win32Window getFocus messageBox:'Hello World' title:'News from Squeak:'


 

messageBox:title:flags:

Win32Window getFocus messageBox:'Are you ready???' title:'News from Squeak:' flags: 3


 

releaseDC:

Release the given DC


 

screenToClient:


  api calls top  
 

apiGetDC:


 

apiMessageBox:text:title:flags:


 

apiReleaseDC:with:


 

apiScreenToClient:with:


class methods
  accessing top  
 

getDesktopWindow

Return the HWND describing the desktop


 

getFocus

Return the HWND currently having the input focus


  examples top  
 

coloredEllipses

Win32Window coloredEllipses


 

coloredRectangles

Win32Window coloredRectangles


 

win32Draw

Win32Window win32Draw