تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
كيف تغير الحجم
#1
كيف تغير الحجم برنامج [How To resize Process]
مثلآ لو عندى كود مثل هذا
كود :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        For Each Resize As Process In Process.GetProcessesByName("HiPlayer")
            If ComboBox1.SelectedItem = ("640 × 480") Then

            End If
            If ComboBox1.SelectedItem = ("800 × 600") Then

            End If
            If ComboBox1.SelectedItem = ("1024 × 768") Then

            End If
            If ComboBox1.SelectedItem = ("1600 × 1200") Then

            End If
            If ComboBox1.SelectedItem = (Screen.PrimaryScreen.Bounds.Width & " × " & Screen.PrimaryScreen.Bounds.Height) Then

            End If
        Next
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ComboBox1.Items.Add("640 × 480")
        ComboBox1.Items.Add("800 × 600")
        ComboBox1.Items.Add("1024 × 768")
        ComboBox1.Items.Add("1600 × 1200")
        ComboBox1.Items.Add(Screen.PrimaryScreen.Bounds.Width & " × " & Screen.PrimaryScreen.Bounds.Height)
    End Sub
ما الكزد الذى يضاف لى هضا الكود لكي يغير حجم البرنامج
الرد }}}
تم الشكر بواسطة:
#2
كود :
Private Declare Function GetForegroundWindow Lib "user32.dll" () As IntPtr
    Private Declare Function GetWindowThreadProcessId Lib "user32.dll" (ByVal ByValhwnd As IntPtr, ByRef lpdwProcessID As Integer) As Integer

    Dim _focusedWindow As IntPtr = GetForegroundWindow()
    Dim _activeWindowName As String
    Dim _processID As Integer = 0


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim _focusedWindow As IntPtr = GetForegroundWindow()
        If _focusedWindow <> IntPtr.Zero Then
            If GetWindowThreadProcessId(_focusedWindow, _processID) <> 0 Then
                Dim proc As Process = Process.GetProcessById(_processID)
                If proc Is Nothing Then Exit Sub
                _activeWindowName = proc.ProcessName
                '
                'Get access to the window properties somehow!
                '    
            End If
        End If
    End Sub
وجد هذا الكود
و هذا
كود :
Imports System.Runtime.InteropServices

Public Class Form1

    Dim tom As New Process
    Dim tomstyle As New ProcessWindowStyle
    Dim hndtom As IntPtr

    Public Declare Auto Function SetWindowPos Lib "user32.dll" ( _
    ByVal hWnd As IntPtr, _
    ByVal hWndInsertAfter As IntPtr, _
    ByVal X As Int32, _
    ByVal Y As Int32, _
    ByVal cx As Int32, _
    ByVal cy As Int32, _
    ByVal uFlags As UInt32 _
    ) As Boolean

    Public Declare Auto Function MoveWindow Lib "user32.dll" ( _
    ByVal hWnd As IntPtr, _
    ByVal X As Int32, _
    ByVal Y As Int32, _
    ByVal nWidth As Int32, _
    ByVal nHeight As Int32, _
    ByVal bRepaint As Boolean _
    ) As Boolean


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        tomstyle = ProcessWindowStyle.Normal

        tom = Process.Start("c:\program files\internet explorer\iexplore.exe")

        hndtom = tom.MainWindowHandle

        MsgBox(MoveWindow(hndtom, 10, 10, 300, 400, True))

    End Sub

End Class
الرد }}}
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  مبيعات الاصناف بناء على الحجم h2551996 8 820 31-07-23, 11:41 AM
آخر رد: h2551996
  اريد تغير حجم ال Panel عند التفيذ من داخل الكود moh61 2 403 23-07-23, 12:22 AM
آخر رد: أبووسم
Rainbow [كود] النص المكتوب يكون على شكل وميض او تغير في الالوان محمد مسافر 1 460 13-05-23, 01:30 AM
آخر رد: عبدالله الدوسري
  [VB.NET] مشكلة بعد تغير NET Framework 4 Client Profile MOHAMMED ALZWI 0 366 28-02-23, 11:32 AM
آخر رد: MOHAMMED ALZWI
  [VB.NET] مشكلة بعد تغير NET Framework 4 Client Profile MOHAMMED ALZWI 0 296 28-02-23, 11:31 AM
آخر رد: MOHAMMED ALZWI
  [VB.NET] ممكن كود تغير خلفية شاشة تامين ويندوز jam3h 1 517 11-10-22, 04:09 AM
آخر رد: jam3h
  تغير لون خلفية داتا قريد فيو ali_ahmed12 0 437 03-10-22, 04:34 PM
آخر رد: ali_ahmed12
  التحكم بالبرنامج ( عند المستخدم ) عن طريق برنامج اخر (تعديل - حذف - اضافه - تغير كود) mohamedallams 2 1,133 06-09-22, 10:32 PM
آخر رد: رضوان الجماعي
  تغير خلفية form aymen_libya 6 1,007 24-08-22, 10:23 PM
آخر رد: Taha Okla
  تغير اتجاه البيانات Abdallah61 1 721 02-06-22, 08:35 PM
آخر رد: نيمو

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


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