January 1, 2005

WinTask - DrawText

'
' DrawText
'
' Draw some text on the Desktop
'
' Author: Joe Strazzere
'

dim ptr as unsigned
dim ptr2 as unsigned
ptr=allocate(16)
ptr2=ptr+0
pokeinteger(ptr2,0,4)
ptr2=ptr+4
pokeinteger(ptr2,0,4)
ptr2=ptr+8
pokeinteger(ptr2,640,4)
ptr2=ptr+12
pokeinteger(ptr2,32,4)
hdc=External("gdi32","CreateDCA","DISPLAY",0,0,0)
'Private Type RECT
'    Left As Long
'    Top As Long
'    Right As Long
'    Bottom As Long
'End Type
'Flag:
'    0 = left
'    1 = center
'    2 = right
mytext$="This is a test"
External("user32","DrawTextA",hdc, mytext$,len(mytext$),ptr,0)
   
External("gdi32","DeleteDC")