WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Samples from Users
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Write Text to the Screen


IntControl(12,1 + 4,0,0,0) ;Suppress OK to close messages
IntControl(1003,0,0,0,0) ;Prevents WinBatch icon from being opened
IntControl(1008,1,0,0,0) ;Enables Close command

#DefineFunction rgb(red,green,blue)
   Return((red mod 256) + (green mod 256) * 256 + (blue mod 256) * 256 * 256)
#EndFunction

#DefineFunction DrawText(x,y,text)
   transparent = 1
   fheight = 28
   fweight = 700
   fitalic = 0
   funderline = 0
   fstrikeout = 0
   fface = "Tahoma"
   color = rgb(0,255,255)
   gdi32=DllLoad(StrCat(DirWindows(1),"gdi32.dll"))
   user32=DllLoad(StrCat(DirWindows(1),"user32.dll"))
   HDC = DllCall(user32,long:"GetDC",lpnull)
   hfont = DllCall(gdi32,long:"CreateFontA",long:fheight,long:0,long:0,long:0,long:fweight,long:fitalic,long:funderline,long:fstrikeout,long:0,long:0,long:0,long:0,long:0,lpstr:fface)
   DllCall(gdi32,long:"SetTextColor",long:hdc,long:color)
   DllCall(gdi32,long:"SelectObject",long:hdc,long:hfont)
   DllCall(gdi32,long:"SetBkMode",long:hdc,long:TRANSPARENT)
   DllCall(gdi32,long:"TextOutA",long:HDC,long:x,long:y,lpstr:text,long:StrLen(text))
   DllCall(gdi32,long:"DeleteObject",long:hfont)
   DllCall(user32,long:"ReleaseDC",lpnull,long:HDC)
   DllFree(gdi32)
   DllFree(user32)
#EndFunction



text = 1

While text < 100
TimeDelay(.01)
Mouse = MouseInfo(3)
x = ItemExtract(1,Mouse," ")
y = ItemExtract(2,Mouse," ")
text = text + 1
mytext = DrawText(x + 20,y,text)
EndWhile

Exit

Article ID:   W18255
Filename:   Write Text to the Screen.txt
File Created: 2008:11:25:12:01:52
Last Updated: 2008:11:25:12:01:52