تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
كيف تغير الحجم
#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
الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
كيف تغير الحجم - بواسطة مبتدئ - 15-02-13, 12:17 AM
كيف تغير الحجم - بواسطة مبتدئ - 15-02-13, 12:45 PM

المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  تغير شكل الليبول الي شكل اخر غير المسطيل fireswored1 3 551 09-02-25, 06:43 AM
آخر رد: fireswored1
  [VB.NET] مساعدة في تغير لون جميع شاشة المشروع MOHAMMED ALZWI 2 491 29-08-24, 02:33 PM
آخر رد: MOHAMMED ALZWI
  تغير DateTimePicker1 من نظام 24 ساعه الى 12 ساعه ABDULLAH HASSAN 2 378 21-04-24, 09:53 PM
آخر رد: ABDULLAH HASSAN
  مبيعات الاصناف بناء على الحجم h2551996 8 1,282 31-07-23, 11:41 AM
آخر رد: h2551996
  اريد تغير حجم ال Panel عند التفيذ من داخل الكود moh61 2 698 23-07-23, 12:22 AM
آخر رد: أبووسم
Rainbow [كود] النص المكتوب يكون على شكل وميض او تغير في الالوان محمد مسافر 1 765 13-05-23, 01:30 AM
آخر رد: عبدالله الدوسري
  [VB.NET] مشكلة بعد تغير NET Framework 4 Client Profile MOHAMMED ALZWI 0 566 28-02-23, 11:32 AM
آخر رد: MOHAMMED ALZWI
  [VB.NET] مشكلة بعد تغير NET Framework 4 Client Profile MOHAMMED ALZWI 0 472 28-02-23, 11:31 AM
آخر رد: MOHAMMED ALZWI
  [VB.NET] ممكن كود تغير خلفية شاشة تامين ويندوز jam3h 1 766 11-10-22, 04:09 AM
آخر رد: jam3h
  تغير لون خلفية داتا قريد فيو ali_ahmed12 0 648 03-10-22, 04:34 PM
آخر رد: ali_ahmed12

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


يقوم بقرائة الموضوع: