Real Software Forums
http://forums.realsoftware.com/

Windows API, where do I declare it in RS
http://forums.realsoftware.com/viewtopic.php?f=13&t=45653
Page 1 of 1

Author:  TomazVDaSilva [ Sat Oct 20, 2012 2:46 pm ]
Post subject:  Windows API, where do I declare it in RS

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

Author:  charonn0 [ Sat Oct 20, 2012 3:08 pm ]
Post subject:  Re: Windows API, where do I declare it in RS

Yes you can. See my answer to this topic: viewtopic.php?p=249918#p249918

Author:  TomazVDaSilva [ Sat Oct 20, 2012 4:05 pm ]
Post subject:  Re: Windows API, where do I declare it in RS

charonn0 wrote:
Yes you can. See my answer to this topic: viewtopic.php?p=249918#p249918


Thank you !

Author:  TomazVDaSilva [ Sat Oct 20, 2012 5:00 pm ]
Post subject:  Re: Windows API, where do I declare it in RS

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

Author:  charonn0 [ Sat Oct 20, 2012 6:10 pm ]
Post subject:  Re: Windows API, where do I declare it in RS

You have to create an external method for each declare.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/