Hallo zusammen,
Ich habe da ein VB Programm gefunden, dessen Funktionalit�t ich gerne in c#
nachprogrammiert h�tte. Es verwendet eine Vielzahl von Apifunktionen.
Kann man das in C# nachbilden? Schon oder?
Was �berhaupt mit dem Programm gemacht wird:
Ein Screenshot von einem anderen Programm, dessen "Inhalt" wird dann optisch nach
Merkmalen abgesucht.
Unten jetzt nur mal die Definitionen, den ich denke, wenn ich das kapiert habe, klappt
der Rest wahrscheinlich leicht.
Problematisch ist z.B. GetBitmapBits da dort ein Parameter Any verwendet wird. In MSDN
ist das ein LPVOID // buffer to receive bits
Oder gibt es da einen einfacheren Weg unter c#?
Lg
Alex
'Api's type's constants and globals
Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As
Long) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd
As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function CreateDIBSection Lib "gdi32" (ByVal hdc As Long, pBitmapInfo
As BITMAPINFO, ByVal un As Long, ByVal lplpVoid As Long, ByVal handle As Long, ByVal
dw As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As
Long) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long,
ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long,
ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function GetBitmapBits Lib "gdi32" (ByVal hBitmap As Long, ByVal
dwCount As Long, lpBits As Any) As Long
Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Type BITMAPINFOHEADER '40 bytes
biSize As Long
biWidth As Long
biHeight As Long
biPlanes As Integer
biBitCount As Integer
biCompression As Long
biSizeImage As Long
biXPelsPerMeter As Long
biYPelsPerMeter As Long
biClrUsed As Long
biClrImportant As Long
End Type
Private Type RGBQUAD
rgbBlue As Byte
rgbGreen As Byte
rgbRed As Byte
rgbReserved As Byte
End Type
Private Type BITMAPINFO
bmiHeader As BITMAPINFOHEADER
bmiColors As RGBQUAD
End Type
Private Const BI_RGB = 0&
Private Const DIB_RGB_COLORS = 0 ' color table in RGBs
_______________________________________________
Csharp.net mailing list
[EMAIL PROTECTED]
http://www.glengamoi.com/mailman/listinfo/csharp.net