Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Fri Jul 21, 2017 5:38 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Windows API, where do I declare it in RS
PostPosted: Sat Oct 20, 2012 2:46 pm 
Offline
User avatar

Joined: Thu Dec 29, 2011 6:46 pm
Posts: 191
Location: Edmonton, AB, Canada
I have a application in VBA and I want recreate it in RealBasic.

I have all my API declarations inside of a module.
Can I do the same thing with RB and create a separate module with all the declarations ?


Declare Function AlphaBlend Lib "MSIMG32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal w As Long, ByVal h As Long, _
ByVal hdcS As Long, ByVal xS As Long, ByVal yS As Long, ByVal wS As Long, ByVal hS As Long, ByVal BLENDFUNCTION As Long) As Long
Declare Function BitBlt Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal w As Long, ByVal h As Long, ByVal hdcS As Long, ByVal xS As Long, ByVal yS As Long, ByVal dwRop As Long) As Long
Declare Function CreateBitmap Lib "gdi32" (ByVal w As Long, ByVal h As Long, ByVal nPlanes As Long, ByVal nBitCount As Long, lpBits As Any) As Long
Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal w As Long, ByVal h As Long) As Long
Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
Declare Function CreateFont Lib "gdi32.dll" Alias "CreateFontA" (ByVal nHeight As Long, ByVal nWidth As Long, ByVal nEscapement As Long, _
ByVal nOrientation As Long, ByVal fnWeight As Long, ByVal fdwItalic As Long, _
ByVal fwUnderline As Long, ByVal fdwStrinkeOut As Long, ByVal CharSet As Long, _
ByVal OutputPrecision As Long, ByVal ClipPrecision As Long, ByVal Quality As Long, _
ByVal fdwPitchAndFamily As Long, ByVal lpszFace As String) As Long
Declare Function CreatePen Lib "gdi32" (ByVal fnPenStyle As Long, ByVal w As Long, ByVal crColor As Long) As Long
Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Declare Function Ellipse Lib "gdi32" (ByVal hdc As Long, ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long) As Long
Declare Function GetActiveWindow Lib "user32" () As Long
Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Long
Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Declare Function GetStockObject Lib "gdi32" (ByVal fnObject As Long) As Long
Declare Function GetTickCount Lib "kernel32" () As Long
Declare Function PatBlt Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal w As Long, ByVal h As Long, ByVal dwRop As Long) As Long
Declare Function Rectangle Lib "gdi32" (ByVal hdc As Long, ByVal nLeftRect As Long, ByVal nTopRect As Long, ByVal nRightRect As Long, ByVal nBottomRect As Long) As Long
Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long
Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Declare Function SetBkColor Lib "gdi32" (ByVal hdc As Long, ByVal crColor As Long) As Long
Declare Function SetBkMode Lib "gdi32" (ByVal hdc As Long, ByVal iBkMode As Long) As Long
Declare Function SetTextColor Lib "gdi32.dll" (ByVal hdc As Long, ByVal crColor As Long) As Long
Declare Function TextOut Lib "gdi32.dll" Alias "TextOutA" (ByVal hdc As Long, ByVal nXStart As Long, ByVal nYStart As Long, ByVal lpString As String, ByVal cbString As Long) As Long
Declare Sub Sleep Lib "kernel32" (ByVal ms As Long)
Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, _
ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long

_________________
Regards,
TomazVDaSilva


Clean Code: Robert C. Martin
It is not the language that makes programs appear simple.
It is the programmer that make the language appear simple!


Top
 Profile  
Reply with quote  
 Post subject: Re: Windows API, where do I declare it in RS
PostPosted: Sat Oct 20, 2012 3:08 pm 
Offline
User avatar

Joined: Mon Apr 02, 2007 2:08 am
Posts: 1225
Location: San Francisco, CA, USA
Yes you can. See my answer to this topic: viewtopic.php?p=249918#p249918

_________________
Boredom Software


Top
 Profile  
Reply with quote  
 Post subject: Re: Windows API, where do I declare it in RS
PostPosted: Sat Oct 20, 2012 4:05 pm 
Offline
User avatar

Joined: Thu Dec 29, 2011 6:46 pm
Posts: 191
Location: Edmonton, AB, Canada
charonn0 wrote:
Yes you can. See my answer to this topic: viewtopic.php?p=249918#p249918


Thank you !

_________________
Regards,
TomazVDaSilva


Clean Code: Robert C. Martin
It is not the language that makes programs appear simple.
It is the programmer that make the language appear simple!


Top
 Profile  
Reply with quote  
 Post subject: Re: Windows API, where do I declare it in RS
PostPosted: Sat Oct 20, 2012 5:00 pm 
Offline
User avatar

Joined: Thu Dec 29, 2011 6:46 pm
Posts: 191
Location: Edmonton, AB, Canada
Is there OK if I trow all the declarations in a single method or do I have to create a external method for each declaration ?

I am asking this because

#If 64BitsSystem then
[ all declarations for 64bits ]

#Else
[ all declarations for 32bits ]

#End if

_________________
Regards,
TomazVDaSilva


Clean Code: Robert C. Martin
It is not the language that makes programs appear simple.
It is the programmer that make the language appear simple!


Top
 Profile  
Reply with quote  
 Post subject: Re: Windows API, where do I declare it in RS
PostPosted: Sat Oct 20, 2012 6:10 pm 
Offline
User avatar

Joined: Mon Apr 02, 2007 2:08 am
Posts: 1225
Location: San Francisco, CA, USA
You have to create an external method for each declare.

_________________
Boredom Software


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group