source code:
Dim b_Found As Boolean
Dim myHwnd As Long
Dim myHdc As Long
Dim myColor As Color
myHwnd = FindWindow("Qt5154QWindowOwnDCIcon", "BlueStacks 0" )
If myHwnd Then
myHdc = GetWindowDC(myHwnd)
myColor = GetPixel(myHdc, 150, 300)
End If
Error code:
System.Runtime.InteropServices.MarshalDirectiveException
HResult=0x80131535
Message=Cannot marshal 'return value': Invalid managed/unmanaged type combination.
Source=vbtest
StackTrace:
at vbtest.Module1.GetPixel(Int64 hdc, Int32 x, Int32 y)
at vbtest.Form1.Button1_Click(Object sender, EventArgs e) in C:\Users\MrJac\source\repos\vbtest\vbtest\Form1.vb:line 25
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, WM msg, IntPtr wparam, IntPtr lparam)
Can someone pls help me?