اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

jjafferr

أوفيسنا
  • Posts

    10000
  • تاريخ الانضمام

  • تاريخ اخر زياره

  • Days Won

    406

كل منشورات العضو jjafferr

  1. عمل رائع 🙂 وبحاجة ماسة له في برامجنا 🙂 جعفر
  2. وعليكم السلام ) واهلا وسهلا بك في المنتدى: للإستفادة القصوى من المنتدى ، رجاء قراءة قوانين المنتدى : اضغط هنـــــــــامن فضلك لقراءة القواعد كاملة بدل كلمة Form ، استخدم .Me ، هكذا: If Form_دخول.tap = "مستخدم" Then me.AllowAdditions = False me.AllowDeletions = False me.AllowEdits = False MsgBox "صلاحيات محدوده", vbInformation, "اهلا و سهلا" End If . جعفر
  3. حذفت المرفق القديم من المشاركة ، ولكن للاسف بقية ايقونته ، فحذفتها الآن 🙂 ولكن الملف الجديد كان ولا يزال هناك 🙂 جعفر
  4. السلام عليكم 🙂 بسبب امكانية فتح الشفت من برنامج خارجي ، فيكون بإمكانك الدخول على جداول Accde او MDE ، لهذا السبب لا تضع كلمة سر البرنامج الآخر في الجدول ، بينما تقدر ان تضع كلمة سر البرنامج الآخر في الكود ، لأن البرنامج بصيغة Accde او MDE لا يوجد به كود 🙂 مافي داعي لقفل الكود بالباسورد ، لأنه اصلا لا يوجد كود في هذه الصيغة 🙂 جعفر
  5. شكرا على التنبيه اخوي عبدالله 🙂 تم إضافة الحل في المشاركة الاولى في الموضوع ، كما تم تغيير المرفق في الرابط الذي ذكرته : جعفر
  6. شكرا جزيلا 🙂 كلامك صحيح اخوي ابوخليل ، ولكن للأسف تكون هناك بعض الاسباب التي تعيق هذا !! شكرا اخوي ابا جودي ، وهذا الشيء غير مستبعد ، لا لهذا البرنامج ولا لغيره ، كون نظام التشغيل وندوز في نمو وتطور 🙂 جعفر
  7. اخوي ازهر ، رجاء تجرب هاي: بدل هذا السطر ShellEx "C:\Program Files\Common Files\Microsoft Shared\ink\TabTip.exe", , True استعمل هذه الاسطر If IsWindows_64bit Then Wow64EnableWow64FsRedirection False ShellEx "C:\Program Files\Common Files\Microsoft Shared\ink\TabTip.exe", , True Wow64EnableWow64FsRedirection True Else ShellEx "C:\Program Files\Common Files\Microsoft Shared\ink\TabTip.exe", , True End If ثم اخبرنا اذا الزر الثاني اشتغل او لا !! احيانا يجب ان تحاول مرتين على الزر الثني ، يعني انقر مرة وانتظر ، واذا ما اشتغل ، انقر مرة ثانية 🙂 جعفر
  8. ولو اني لا احبذ هذه الطريقة ، لأن الوحدات النمطية السابقة كانت مرتبة ، كل وحدة تخص عملها ، ويكون اسهل معرفة مكان الخطأ (ان وُجد) ! وبدون تحمل المسؤولية ، تفضل 🙂 Option Compare Database Option Explicit #If VBA7 And Win64 Then '64 bits Public Declare PtrSafe Function GetProcAddress Lib "kernel32" (ByVal hModule As LongPtr, ByVal lpProcName As String) As LongPtr Public Declare PtrSafe Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As LongPtr Public Declare PtrSafe Function GetCurrentProcess Lib "kernel32" () As LongPtr #Else '32 bits Public Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long Public Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long Public Declare Function GetCurrentProcess Lib "kernel32" () As Long #End If Public Declare PtrSafe Function Wow64EnableWow64FsRedirection Lib "kernel32.dll" (ByVal Enable As Boolean) As Boolean Public Declare PtrSafe Function IsWow64Process Lib "kernel32" (ByVal hProc As Long, bWow64Process As Long) As Long ' ' Module to provide metrics information (from GetSystemMetrics) and conversions - ' twips <-> pixel conversions ' __________________________________________________________________________________ ' CREATED: 6 march 2004, Paul J. Champion ' NEEDS: ' __________________________________________________________________________________ ' HISTORY ' __________________________________________________________________________________ ' OVERVIEW Public Enum AccessSpecifications maxSectionHeight = 31680 maxFormWidth = 31680 maxReportWidth = 31680 RecordSelectorWidth = 300 End Enum Public Const DefaultMargin = 60 '60 twips = 0.1 cm, a nice small but clear margin 'Public Const AccessSpecifications.maxSectionHeight = 31680 Private Type Rect Left As Long Top As Long Right As Long Bottom As Long End Type Public Type Size Width As Long Height As Long End Type ' TWIPS to PIXELS api declares & constants '############################################### 'Conditional compilation #If VBA7 Then 'use PtrSafe & LongPtr Private Declare PtrSafe Function GetDC Lib "user32" (ByVal hwnd As LongPtr) As Long Private Declare PtrSafe Function ReleaseDC Lib "user32" (ByVal hwnd As LongPtr, ByVal hdc As LongPtr) As Long Private Declare PtrSafe Function GetDeviceCaps Lib "gdi32" (ByVal hdc As LongPtr, ByVal nIndex As Long) As Long Private Declare PtrSafe Function apiGetSystemMetrics Lib "user32" Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long #Else Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, ByVal nIndex As Long) As Long Private Declare Function apiGetSystemMetrics Lib "user32" Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long #End If '############################################### Private Const HWND_DESKTOP As Long = 0 Private Const LOGPIXELSX As Long = 88 Private Const LOGPIXELSY As Long = 90 Public Enum SystemConstants SM_CXSCREEN = 0 SM_CYSCREEN = 1 SM_CXVSCROLL = 2 SM_CYHSCROLL = 3 SM_CYCAPTION = 4 SM_CXBORDER = 5 SM_CYBORDER = 6 SM_CXDLGFRAME = 7 SM_CYDLGFRAME = 8 SM_CYVTHUMB = 9 SM_CXHTHUMB = 10 SM_CXICON = 11 SM_CYICON = 12 SM_CXCURSOR = 13 SM_CYCURSOR = 14 SM_CYMENU = 15 SM_CXFULLSCREEN = 16 SM_CYFULLSCREEN = 17 SM_CYKANJIWINDOW = 18 SM_MOUSEPRESENT = 19 SM_CYVSCROLL = 20 SM_CXHSCROLL = 21 SM_DEBUG = 22 SM_SWAPBUTTON = 23 SM_RESERVED1 = 24 SM_RESERVED2 = 25 SM_RESERVED3 = 26 SM_RESERVED4 = 27 SM_CXMIN = 28 SM_CYMIN = 29 SM_CXSIZE = 30 SM_CYSIZE = 31 SM_CXFRAME = 32 SM_CYFRAME = 33 SM_CXMINTRACK = 34 SM_CYMINTRACK = 35 SM_CXDOUBLECLK = 36 SM_CYDOUBLECLK = 37 SM_CXICONSPACING = 38 SM_CYICONSPACING = 39 SM_MENUDROPALIGNMENT = 40 SM_PENWINDOWS = 41 SM_DBCSENABLED = 42 SM_CMOUSEBUTTONS = 43 SM_CMETRICS = 44 SM_CXSIZEFRAME = SM_CXFRAME SM_CYSIZEFRAME = SM_CYFRAME SM_CXFIXEDFRAME = SM_CXDLGFRAME SM_CYFIXEDFRAME = SM_CYDLGFRAME SM_TABLETPC = 86 End Enum 'this is do with the mdi client '############################################### #If VBA7 Then 'use PtrSafe & LongPtr Private Declare PtrSafe Function GetWindowRect Lib "user32" (ByVal hwnd As LongPtr, lpRect As Rect) As Long Private Declare PtrSafe Function GetClientRect Lib "user32" (ByVal hwnd As LongPtr, lpRect As Rect) As Long Private Declare PtrSafe Function GetParent Lib "user32" (ByVal hwnd As LongPtr) As Long #Else Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As Rect) As Long Private Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, lpRect As Rect) As Long Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long #End If '############################################### '############################################### #If VBA7 Then 'use PtrSafe & LongPtr Private Declare PtrSafe Function apiShellExecute Lib "shell32.dll" _ Alias "ShellExecuteA" _ (ByVal hwnd As LongPtr, _ ByVal lpOperation As String, _ ByVal lpFile As String, _ ByVal lpParameters As String, _ ByVal lpDirectory As String, _ ByVal nShowCmd As Long) _ As Long #Else Private Declare Function apiShellExecute Lib "shell32.dll" _ Alias "ShellExecuteA" _ (ByVal hwnd As Long, _ ByVal lpOperation As String, _ ByVal lpFile As String, _ ByVal lpParameters As String, _ ByVal lpDirectory As String, _ ByVal nShowCmd As Long) _ As Long #End If '############################################### Public strApp As String ' Error handling Dim ErrorSource As String ' Public Sub ShellEx(ByVal Path As String, Optional ByVal Parameters As String, Optional ByVal HideWindow As Boolean) If Dir(Path) > "" Then apiShellExecute 0, "open", Path, Parameters, "", IIf(HideWindow, 0, 1) Else MsgBox "Can't find application" End If End Sub Public Function RunOSK() 'opens on screen keyboard if opened in tablet mode 'To test it on a standard PC, disable the 'If ...End If ''If modMetrics.System(SM_TABLETPC) Then ' apiShellExecute 0, vbNullString, "osk.exe", vbNullString, "C:\", 1 ' ' ShellEx "c:\windows\system32\osk.exe", , True ' strApp = "osk.exe" ''End If If IsWindows_64bit Then Wow64EnableWow64FsRedirection False apiShellExecute 0, vbNullString, "osk.exe", vbNullString, "C:\", 1 'Shell "cmd /c osk", 0 Wow64EnableWow64FsRedirection True Else 'Shell "cmd /c osk", 0 apiShellExecute 0, vbNullString, "osk.exe", vbNullString, "C:\", 1 End If strApp = "osk.exe" End Function Public Function OpenTabTip() 'opens tablet screen keyboard in tablet mode 'To test it on a standard PC, disable the 'If ...End If 'If modMetrics.System(SM_TABLETPC) Then ShellEx "C:\Program Files\Common Files\Microsoft Shared\ink\TabTip.exe", , True strApp = "TabTip.exe" 'End If End Function Sub TerminateApp() '--------------------------------------------------------------------------------------- ' Terminates the exe process specified. ' Uses WMI (Windows Management Instrumentation) to query all running processes ' then terminates ALL instances of the exe process held in the variable strTerminateThis. '--------------------------------------------------------------------------------------- Dim strTerminateThis As String 'The variable to hold the process to terminate Dim objWMIcimv2 As Object, objProcess As Object, objList As Object Dim intError As Integer If Nz(strApp, "") = "" Then Exit Sub 'Process to terminate – you could specify and .exe program name here strTerminateThis = strApp 'Connect to CIMV2 Namespace and then find the .exe process Set objWMIcimv2 = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") Set objList = objWMIcimv2.ExecQuery("select * from win32_process where name='" & strTerminateThis & "'") For Each objProcess In objList intError = objProcess.Terminate 'Terminates a process and all of its threads. 'Return value is 0 for success. Any other number is an error. If intError <> 0 Then Exit For Next 'ALL instances of exe (strTerminateThis) have been terminated Set objWMIcimv2 = Nothing Set objList = Nothing Set objProcess = Nothing End Sub ' Returns a size variable containing the width and height of the MDI Client area ' for Microsoft Access at that moment in time. ' _____________________________________________________________________________ ' ARGUMENTS ' InPixels TRUE - return the size in pixels ' FALSE (default) - return the size in twips Public Function AccessAppInsideSize _ (Optional InPixels As Boolean = False) _ As Size Dim rectMDIClient As Rect Dim sizePixels As Size, sizeTwips As Size Dim WidthInPixels As Long, HeightInPixels As Long ' ' Initialize error handling On Error Resume Next ' if an error occurs this routine will return a size of 0,0 ' ' Open a dummy form or use an existing form so we can grab the parent of its window handle (hWnd) Dim F As New Form Dim bCloseForm As Boolean Dim bFoundNonPopUpForm As Boolean If Forms.count > 0 Then ' Find non-PopUp form Dim frm As Access.Form For Each frm In Forms If Not frm.PopUp Then Set F = frm bCloseForm = False bFoundNonPopUpForm = True Exit For End If Next End If If Not bFoundNonPopUpForm Then Set F = CreateForm bCloseForm = True End If ' ' Get the screen coordinates and window size of the rectMDIClient window GetWindowRect GetParent(F.hwnd), rectMDIClient ' Close dummy form without saving If bCloseForm Then DoCmd.Close acForm, F.Name, acSaveNo ' ' Calculate size in pixels sizePixels.Width = rectMDIClient.Right - rectMDIClient.Left - modMetrics.System(SM_CXFRAME, False) sizePixels.Height = rectMDIClient.Bottom - rectMDIClient.Top - modMetrics.System(SM_CYFRAME, False) ' ' Return correct values If InPixels Then ' return result as is AccessAppInsideSize = sizePixels Else ' convert result to twips sizeTwips.Width = modMetrics.converttoTwipsX(sizePixels.Width) sizeTwips.Height = modMetrics.converttoTwipsY(sizePixels.Height) AccessAppInsideSize = sizeTwips End If End Function ' Converts twips to pixels ' __________________________________________________________________________________ ' Public Function converttoPixelX(ByVal TwipsX As Long) As Long Dim lngDC As Long, intPerPixelX As Integer lngDC = GetDC(HWND_DESKTOP) intPerPixelX = 1440 / GetDeviceCaps(lngDC, LOGPIXELSX) ReleaseDC HWND_DESKTOP, lngDC converttoPixelX = TwipsX / intPerPixelX End Function ' Converts pixels to twips ' __________________________________________________________________________________ ' Public Function converttoPixelY(ByVal TwipsY As Long) As Long Dim lngDC As Long, intPerPixelY As Integer lngDC = GetDC(HWND_DESKTOP) intPerPixelY = 1440 / GetDeviceCaps(lngDC, LOGPIXELSY) ReleaseDC HWND_DESKTOP, lngDC converttoPixelY = TwipsY / intPerPixelY End Function ' Converts pixels to twips ' __________________________________________________________________________________ ' Public Function converttoTwipsX(ByVal PixelX As Long) As Long Dim lngDC As Long, intPerPixelX As Integer lngDC = GetDC(HWND_DESKTOP) intPerPixelX = 1440 / GetDeviceCaps(lngDC, LOGPIXELSX) ReleaseDC HWND_DESKTOP, lngDC converttoTwipsX = intPerPixelX * PixelX End Function ' Converts pixels to twips ' __________________________________________________________________________________ ' Public Function converttoTwipsY(ByVal PixelY As Long) As Long Dim lngDC As Long, intPerPixelY As Integer lngDC = GetDC(HWND_DESKTOP) intPerPixelY = 1440 / GetDeviceCaps(lngDC, LOGPIXELSY) ReleaseDC HWND_DESKTOP, lngDC converttoTwipsY = intPerPixelY * PixelY End Function ' Converts point size (from a font) to twips ' __________________________________________________________________________________ ' Public Function converttoTwipsYFromPoint(PointSize As Long) As Long Dim lngDC As Long, intPerPixelY As Integer lngDC = GetDC(HWND_DESKTOP) intPerPixelY = 1440 / GetDeviceCaps(lngDC, LOGPIXELSY) converttoTwipsYFromPoint = intPerPixelY * Int(PointSize * GetDeviceCaps(lngDC, LOGPIXELSY) / 72) ReleaseDC HWND_DESKTOP, lngDC End Function ' Returns the dimensions of the screen, in twips or pixels ' _____________________________________________________________________________ ' Public Function MetricsScreenHeight _ (Optional ConvertToTwips As Boolean = True) MetricsScreenHeight = System(SM_CYSCREEN, ConvertToTwips) End Function Public Function MetricsScreenWidth _ (Optional ConvertToTwips As Boolean = True) MetricsScreenWidth = System(SM_CXSCREEN, ConvertToTwips) End Function ' Returns a result of GetSystemMetrics in twips or pixels ' _____________________________________________________________________________ ' Public Function System(SystemMetricRequired As SystemConstants, Optional ConvertToTwips As Boolean = True) As Variant If ConvertToTwips Then Select Case SystemMetricRequired Case SM_CYSCREEN, SM_CYHSCROLL, SM_CYCAPTION, _ SM_CYBORDER, SM_CXDLGFRAME, SM_CYDLGFRAME, _ SM_CYVTHUMB, SM_CYICON, SM_CYCURSOR, _ SM_CYMENU, SM_CYFULLSCREEN, SM_CYKANJIWINDOW, _ SM_CYVSCROLL, SM_CYMIN, SM_CYSIZE, _ SM_CYFRAME, SM_CYMINTRACK, SM_CYDOUBLECLK, _ SM_CYICONSPACING, SM_CYSIZEFRAME, SM_CYFIXEDFRAME System = converttoTwipsY(apiGetSystemMetrics(SystemMetricRequired)) Case Else: System = converttoTwipsX(apiGetSystemMetrics(SystemMetricRequired)) End Select Else System = apiGetSystemMetrics(SystemMetricRequired) End If End Function ' 'use it like this: ' 'Private Sub Command1_Click() ' If Is64bit Then ' Wow64EnableWow64FsRedirection False ' ShellExecute 0, "open", "osk.exe", "", "", vbNormalFocus ' Wow64EnableWow64FsRedirection True ' Else ' ShellExecute 0, "open", "osk.exe", "", "", vbNormalFocus ' End If 'End Sub Public Function IsWindows_64bit() As Long If GetProcAddress(GetModuleHandle("kernel32"), "IsWow64Process") > 0 Then IsWow64Process GetCurrentProcess(), IsWindows_64bit End If End Function جعفر
  9. لوسمحت تنقر نقرتين على الملف ، شوف اذا يفتح ؟ نعم ، وتقدر ان تجمعها كلها في وحدة نمطية واحدة 🙂 جعفر
  10. رجاء تبحث عن الملف TabTip.exe في جهازك وتخبرنا مساره ، علشان نشوف موضوع الزر الثاني 🙂 جعفر
  11. شكرا جزيلا 🙂 طربقة العمل تقتضي انه لما تنقر على حقل النص ، تظهر لوحة المفاتيح ، فهل قصدك تريدها ثابته على الشاشة دائما ؟ جعفر
  12. ما كان الاتفاق هكذا 😅 الاتفاق كان انك تجرب الزرين 🙂 وتخبرنا عن نسخة الاكسس ، 32بت او 64بت ، ونظام الوندوز ، وكذلك 32بت او 64بت 🙂 جعفر
  13. السلام عليكم 🙂 وبمناسبة ان اخونا العود ابوخليل مشارك ، ومن زمان ما مشاركين في نفس الموضوع ، سأفضي جعبتي 🙂 انزلت برنامج ، واشتغلت عليه علشان يشتغل بطريقتين مختلفات 🙂 فياريت التجربه تصير على اكثر من جهاز 🙂 جرب الزرين لوسمحت 🙂 . . و . جعفر OnScreenKeyboardDEMO_2.zip
  14. وعليكم السلام 🙂 انا قلت: . طيب اذا استعملت هذه الطريقة في عمل برنامجك ، فلن يكون هناك Toolbar لإسم النموذج وآخر لإسم البرنامج ، وبدون نماذج منبثقة فتستطيع ان تجعل اسم النموذج في المنتصف (رجاء تجرب النموذجين ، وشوف اسم النموذج واسم البرنامج على الشريط) : . جعفر TitleBar.zip
  15. وبعد اذن اخي احمد 🙂 التتمة هنا : جعفر
  16. شكرا جزيلا اخوي احمد 🙂 بالفعل طريقة جديدة على المنتدى 🙂 وفي انتظار ان يقوم الاعضاء بتجربة المرفق ، وموافاتنا بالنتيجة 🙂 جعفر
  17. همممم وحسب المعلومة اللي طرحتها في الرابط اعلاه ، فيكفي هذا الكود : Private Sub Form_Load() Me.Caption = Space(127 - Len(Me.Caption)) & Me.Caption End Sub . جرب واعمل تغيير للرقم ، من 127 الى 129 ، وشوف التسمية كيف تكون متآكلة من النهاية 🙂 جعفر
  18. وعليكم السلام 🙂 عندك 3 اختيارات 🙂 1 و 2 ، يعتمد على نسخة الاكسس التي قمت بتثبيتها : اذا بالانجليزي ، فعنوان النموذج يكون على اليسار ، واذا بالعربي ، فعنوان النموذج يكون على اليمين. 3. في الحالتين ا و 2 ، اذا اردت ان تزحف العنوان بعيد عن الاطراف (بس لا تخلي آمال كبيرة 🙂 ) : جعفر
  19. السلام عليكم 🙂 تفضل ، هذه طريقة جعل Listbox من اليمين الى اليسار: . وقد قمت اليوم بموضوع لجعل الرابط اعلاه يعمل على النواتين 32بت و 64بث: جعفر
×
×
  • اضف...

Important Information