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

الردود الموصى بها

قام بنشر

السلام عليكم 

بعد اذن حضراتكم احتاج الي كود او مكرو أضعه مكرو لزر عند الضغط عليه ينفذ أمر بتصغير الفورم عند شريط المهام  مع بقاء الملف مفتوح مع امكانية استرجاع الفورم مرة أخري عند الحاجة إليه وشكرا جزيلا لكم جميعا

قام بنشر (معدل)

وعليكم السلام ورحمة الله تعالى وبركاته 

 بعد معاينة آخر مشاركاتك على المنتدى إليك الكود ليتوافق مع جميع الإصدارات سواءا 32bit أو  64bit

جرب هدا ربما يناسبك 

Option Explicit
#If VBA7 Then
    Private Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPtr
    Private Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As LongPtr, ByVal nIndex As Long) As Long
    Private Declare PtrSafe Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As LongPtr, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    Private Declare PtrSafe Function DrawMenuBar Lib "user32" (ByVal hWnd As LongPtr) As Long
#Else
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
    Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    Private Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
#End If

Private Const Style As Long = -16
Private Const Menu As Long = &H80000
Private Const MIN As Long = &H20000
Private Const MAX As Long = &H10000
Private Sub UserForm_Activate()
    Dim xForm As LongPtr, tmps As Long
    xForm = FindWindow("ThunderDFrame", Me.Caption)
    If xForm <> 0 Then
        tmps = GetWindowLong(xForm, Style)
        tmps = tmps Or Menu Or MIN Or MAX
        SetWindowLong xForm, Style, tmps
        DrawMenuBar xForm
    End If
End Sub

 

TEST Minimize.xlsb

تم تعديل بواسطه محمد هشام.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information