delphi4arab منتديات دلفي للعرب
معلومات عن الملفOn MouseHover ؟ - نسخة قابلة للطباعة

+- delphi4arab منتديات دلفي للعرب (https://delphi4arab.net/forum)
+-- قسم : منتديات دلفي للعرب التعليمية (https://delphi4arab.net/forum/forumdisplay.php?fid=3)
+--- قسم : سؤال و جواب حول دلفي (https://delphi4arab.net/forum/forumdisplay.php?fid=15)
+--- الموضوع : معلومات عن الملفOn MouseHover ؟ (/showthread.php?tid=2635)



معلومات عن الملفOn MouseHover ؟ - Happy03 - 09-12-2010

هل من فكرة لكيفية الحصول على حجم الملف بمجرد مرور الفأرة فوق الملف

أقصد اي ملف في اي مكان..سطح المكتب اوفي مجلد..
شكرا


معلومات عن الملفOn MouseHover ؟ - TF6M - 09-12-2010

السلام عليكم
1- إستقبال موضع المؤشر GetCursorPos
2- جلب المقبض إنطلاقا من موضع المؤشر WindowFromPoint
3- جلب مسار الملف/مجلد إنطلقا من مقبض المتحصل عليه في (2) GetFinalPathNameByHandle

- ملاحظة : GetFinalPathNameByHandle متوفرة في Vista فما فوق !! & لم أجرب .
بالتوفيق,,


معلومات عن الملفOn MouseHover ؟ - Happy03 - 09-12-2010

في ما يخص
GetFinalPathNameByHandle
Vista... حصرا؟....ماذا عن أكس بي

لم تنجح معي الدالة
WindowFromPoint
تعطيك فقط الكنترول
وليس الملفات المؤشر عليها
المثال مرفق
[صورة: On_Mouse_Hover_2.bmp]
لا فكرة؟ لأخذ الهندل للملف على سطح المكتب..؟


معلومات عن الملفOn MouseHover ؟ - Happy03 - 10-12-2010

كود :
[align=left]Use the FileFromPoint property to get the path of the file from the cursor. The control fires the StateChange event when the user selects a file or a folder. Use Get property to retrieve the collection of selected items. Use the BrowseFolderPath property to retrieve the browsed folder path. The following VB sample displays the file from the cursor: Private Sub ExFileView1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Dim f As String f = ExFileView1.FileFromPoint(X / Screen.TwipsPerPixelX, Y / Screen.TwipsPerPixelY) If Len(f) > 0 Then Debug.Print f End If End Sub The following C++ sample displays the file from the cursor: void OnMouseMoveExfileview1(short Button, short Shift, long X, long Y) { CString f = m_fileview.GetFileFromPoint( X, Y ); if ( f.GetLength() > 0 ) OutputDebugString( f ); } The following VB.NET sample displays the file from the cursor: Private Sub AxExFileView1_MouseMoveEvent(ByVal sender As Object, ByVal e As AxEXFILEVIEWLib._IExFileViewEvents_MouseMoveEvent) Handles AxExFileView1.MouseMoveEvent Dim f As String = AxExFileView1.get_FileFromPoint(e.x, e.y) If Len(f) > 0 Then Debug.WriteLine(f) End If End Sub The following C# sample displays the file from the cursor: private void axExFileView1_MouseMoveEvent(object sender, AxEXFILEVIEWLib._IExFileViewEvents_MouseMoveEvent e) { string f = axExFileView1.get_FileFromPoint(e.x, e.y); if (f.Length > 0) System.Diagnostics.Debug.WriteLine(f); } The following VFP sample displays the file from the cursor: *** ActiveX Control Event *** LPARAMETERS button, shift, x, y with thisform.ExFileView1 local f f = .FileFromPoint( x, y ) if ( len(f) > 0 ) wait window nowait f endif endwith[/align]

دلفي ؟؟


معلومات عن الملفOn MouseHover ؟ - hanipino - 11-12-2010

إقتباس :sample displays the file from the cursor:

يقصد عندما يكون مؤشر الفئرة فوق المكون ExFileView1 ... و ليس من سطح المكتب .

لتجريب هذه المكونات ...

ثم من الدالفى
Component --> Import Active x Control
ثم اختر ExFileView...

ثم فى حدث MouseMove
كود :
procedure TForm1.ExFileView1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); var f: string; begin f := ExFileView1.FileFromPoint[X, Y]; if Length (f) > 0 then Caption := f; end;



معلومات عن الملفOn MouseHover ؟ - Happy03 - 11-12-2010

نعم
يعني لا توجد دالة FileFromPoint في مقابل WindowFromPoint
لالتقاط الهندل للملف على سطح المكتب او في اكسبلورر " داخل مجلد" ؟


معلومات عن الملفOn MouseHover ؟ - TF6M - 11-12-2010

WindowFromPoint دالة ويندوز أم FileFromPointفهي دالة مضمنة ....
- أشرت إلى GetFinalPathNameByHandle, أيضا يمكن عمل Hook لـ ZwQueryInformationFile
نقرأ المعلومات في بنية FileNameInformation لكن لضيق الوقت لم أحظر مثال بعد .... يمكنك مواصلة
البحث .
بالتوفيق,,


معلومات عن الملفOn MouseHover ؟ - Happy03 - 11-12-2010

شكرا
بالطبع ..سأبحث عن هذه الدوال
وفقك الله