peter
12-01-2011, 10:36
Hi,
I wrote a Dll with Oxygen and wanted to know whether it runs also with thinbasic.
I am satisfied ! Thank you Charles and Eros !
Don't press the close button of this window!
It won't close this application, instead take the escape key.
Peter
Uses "UI","DRAWS"
Declare Function GetDC Lib "user32.dll" Alias "GetDC" (ByVal hwnd As Long) As Long
Declare Function GetKey Lib "user32.dll" Alias "GetAsyncKeyState" (ByVal vKey As Long) As Integer
Declare Function TextOut Lib "gdi32.dll" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
Declare Function TextColor Lib "gdi32.dll" Alias "SetTextColor"(ByVal hdc As Long, ByVal crColor As Long) As Long
Declare Function SetBkMode Lib "gdi32.dll" Alias "SetBkMode" (ByVal hdc As Long, ByVal nBkMode As Long) As Long
Declare Function DrawCircle Lib "Draws.dll" Alias "DrawCircle" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal r As Long, ByVal Color As Long)
Declare Function DrawBox Lib "Draws.dll" Alias "DrawBox" (ByVal hdc As Long, ByVal x1 As Long,ByVal y1 As Long,ByVal x2 As Long,ByVal y2 As Long,ByVal Color As Long)
Declare Function DrawEllipse Lib "Draws.dll" Alias "DrawEllipse" (ByVal hdc As Long, ByVal mx As Long,ByVal my As Long,ByVal r1 As Long,ByVal r2 As Long,ByVal Color As Long)
Declare Function DrawLine Lib "Draws.dll" Alias "DrawLine" (ByVal hdc As Long, ByVal x2 As Long,ByVal y2 As Long,ByVal x3 As Long,ByVal y3 As Long,ByVal Color As Long)
Dim hwnd,hdc,jx As Long
Dim Isay As String
Isay = "PRESS ESCAPE KEY!"
hwnd = Canvas_Window("Dll_Test",0,0,800,600)
hdc = GetDC(hwnd)
TextColor hdc,&H006400
SetBkMode hdc,1
DrawCircle hdc,50, 50,40,&HB00000
DrawCircle hdc,738,50,40,&HC00000
DrawBox hdc,10, 10,768,780,255*34825
DrawLine hdc,10,580,776,580,255*34825
For jx=0 To 49
DrawEllipse hdc,250,300,200+jx,150-jx,&H80FF80*jx
DrawEllipse hdc,620,300,150-jx,200+jx,&HFF80FF*jx
Next
While GetKey(27) =0
TextOut hdc,322,32,Isay,Len(Isay)
Wend
I wrote a Dll with Oxygen and wanted to know whether it runs also with thinbasic.
I am satisfied ! Thank you Charles and Eros !
Don't press the close button of this window!
It won't close this application, instead take the escape key.
Peter
Uses "UI","DRAWS"
Declare Function GetDC Lib "user32.dll" Alias "GetDC" (ByVal hwnd As Long) As Long
Declare Function GetKey Lib "user32.dll" Alias "GetAsyncKeyState" (ByVal vKey As Long) As Integer
Declare Function TextOut Lib "gdi32.dll" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
Declare Function TextColor Lib "gdi32.dll" Alias "SetTextColor"(ByVal hdc As Long, ByVal crColor As Long) As Long
Declare Function SetBkMode Lib "gdi32.dll" Alias "SetBkMode" (ByVal hdc As Long, ByVal nBkMode As Long) As Long
Declare Function DrawCircle Lib "Draws.dll" Alias "DrawCircle" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal r As Long, ByVal Color As Long)
Declare Function DrawBox Lib "Draws.dll" Alias "DrawBox" (ByVal hdc As Long, ByVal x1 As Long,ByVal y1 As Long,ByVal x2 As Long,ByVal y2 As Long,ByVal Color As Long)
Declare Function DrawEllipse Lib "Draws.dll" Alias "DrawEllipse" (ByVal hdc As Long, ByVal mx As Long,ByVal my As Long,ByVal r1 As Long,ByVal r2 As Long,ByVal Color As Long)
Declare Function DrawLine Lib "Draws.dll" Alias "DrawLine" (ByVal hdc As Long, ByVal x2 As Long,ByVal y2 As Long,ByVal x3 As Long,ByVal y3 As Long,ByVal Color As Long)
Dim hwnd,hdc,jx As Long
Dim Isay As String
Isay = "PRESS ESCAPE KEY!"
hwnd = Canvas_Window("Dll_Test",0,0,800,600)
hdc = GetDC(hwnd)
TextColor hdc,&H006400
SetBkMode hdc,1
DrawCircle hdc,50, 50,40,&HB00000
DrawCircle hdc,738,50,40,&HC00000
DrawBox hdc,10, 10,768,780,255*34825
DrawLine hdc,10,580,776,580,255*34825
For jx=0 To 49
DrawEllipse hdc,250,300,200+jx,150-jx,&H80FF80*jx
DrawEllipse hdc,620,300,150-jx,200+jx,&HFF80FF*jx
Next
While GetKey(27) =0
TextOut hdc,322,32,Isay,Len(Isay)
Wend