تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[كود] ScreenToClient(PictureBox1 .Handle, mPos)
#1
استعمل SetParent لاظهار Notepad فى PictureBox1 اريد عند الضغط على ال PictureBox1 يضغط فى notepad استعمل هذا الكود

كود :
ScreenToClient(PictureBox1 .Handle, zPos)

يظهر هذا الخطاء
إقتباس :Additional information: A call to PInvoke function 'WindowsApplication1!WindowsApplication1.Form1::ScreenToClient' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.

If there is a handler for this exception, the program may be safely continued.
الرد }}}
تم الشكر بواسطة: الضمير المستتر
#2
تم الحل الحمد الله
Dim mPos As POINTAPI
Dim PosX As Long
Dim PosY As Long

' The position in picture box you want to click
PosX = 50 ' 50 pix from left
PosY = 100 ' 100 from top

' find X Y of picture box
ScreenToClient(PictureBox1.Handle.ToInt32, mPos)

' move cursor
SetCursorPos(PosX + Abs(mPos.x), PosY + Abs(mPos.y))


'Click
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
الرد }}}
تم الشكر بواسطة: الضمير المستتر


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  هل هذا السؤال صعب PictureBox1 المهنا 1 1,264 30-06-20, 11:42 AM
آخر رد: المهنا
  Error creating window handle اسامه الهرماوي 3 3,750 09-10-19, 12:57 AM
آخر رد: اسامه الهرماوي
  تعديل كود حفظ الصورة من PictureBox1 ابو خليل99 6 2,520 25-06-19, 01:07 PM
آخر رد: ابو خليل99
  [سؤال] كيف احفظ صورة من picturebox1 الى مجلد ضمن مسار البرنامج بدون ظهور مربع حوار mh66 5 5,975 16-11-18, 07:53 PM
آخر رد: mh66
  طباعة صورة PictureBox1 بعرض الصفحة .. أرجو المساعدة ahmed_elwerfalli 3 3,756 24-12-16, 05:59 PM
آخر رد: ahmed_elwerfalli
  [VB.NET] Label1.Parent=PictureBox1 يختفي الليبل تماما thevirus 1 1,485 21-11-16, 10:56 PM
آخر رد: السرور
  [سؤال] وش عمل هذه الكلمة handle hassan 3 2,539 22-07-15, 05:26 PM
آخر رد: hassan
  [VB.NET] كيف معرفة handle ابراهيم مراد 1 1,859 12-07-14, 01:04 PM
آخر رد: Riad dz
  ارسال صورة من C الى اداة PictureBox1 aftfm 2 2,449 07-01-14, 10:57 PM
آخر رد: aftfm
  [سؤال] Unable to get the window handle for the 'WebBrowser' control. Windowless ActiveX cont سعود 1 2,282 27-10-13, 04:09 PM
آخر رد: الشاكي لله

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم