Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9017695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:20:14+00:00 2026-06-16T04:20:14+00:00

I was wondering whether it is possible to resize programs other than the actual

  • 0

I was wondering whether it is possible to resize programs other than the actual application itself. IE, I want to resize and move Word and my application to fill 70% and 30% of the screen respectively.

Private Sub MinimiseButton_Copy_Click(sender As Object, e As RoutedEventArgs) Handles MinimiseButton_Copy.Click
    Me.Left = SystemParameters.PrimaryScreenWidth - Me.Width + 14
    Me.Top = -14
    Me.Height = SystemParameters.PrimaryScreenHeight

    Dim parry As System.Diagnostics.Process() = System.Diagnostics.Process.GetProcessesByName("winword")
    Dim word As System.Diagnostics.Process = parry(0)
    SetWindowPos(word.Handle, 0, 0, 0, SystemParameters.PrimaryScreenWidth - Me.Width, SystemParameters.PrimaryScreenHeight - 28, &H10)
End Sub

<DllImport("user32.dll", CharSet:=CharSet.Auto)> Public Shared Function SetWindowPos(hWnd As IntPtr, hWndInsertAfter As IntPtr, X As Integer, Y As Integer, W As Integer, H As Integer, uFlags As UInteger) As Boolean
End Function
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:20:16+00:00Added an answer on June 16, 2026 at 4:20 am

    That is indeed possible, try this function:

    [DllImport("user32.dll")]
    private static extern bool GetWindowRect(IntPtr hwnd, ref Rectangle rectangle);
    [DllImport("user32.dll", CharSet = CharSet.Auto)]
    private static extern bool PostMessage(IntPtr hWnd, uint msg, int WPARAM, int LPARAM);
    [DllImport("user32.dll", SetLastError = true)]
    internal static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
    [DllImport("user32.dll")]
    [return: MarshalAs(UnmanagedType.Bool)]
    public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int, Y, int cx, int cy, uint uFlags);
    
    public const uint WM_SYSCOMMAND = 0x0112;
    public const int SC_NEXTWINDOW = 0xF040;
    public static readonly IntPtr HWND_TOPMOST = new IntPtr(-1);
    public static readonly IntPtr HWND_NOTOPMOST = new IntPtr(-2);
    public static readonly IntPtr HWND_TOP = new IntPtr(0);
    public static readonly IntPtr HWND_BOTTOM = new IntPtr(1);
    public const UInt32 TOPMOST_FLAGS = 0x0002 | 0x0001;
    
    Public void resisezeWindow(String procesname, int Width, int Height, Boolean bringtofront)
    {
        foreach (Process proc in Process.GetProcesses())
        {
            IntPtr id = proc.MainWindowHandle;
            Rectangle rect = new Rectangle();
            GetWindowRect(id, ref rect);
            if (proc.MainWindowTitle.Contains(procesname))
            {
                PostMessage(proc.Handle, WM_SYSCOMMAND, SC_NEXTWINDOW, 0);
                        MoveWindow(id, 0, 0, Width, Height, true);
                        if(bringtofront) SetWindowPos(id, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS);
                        proc.Refresh();
            }
        }
    }
    

    If there is a problem, please notify me!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wondering whether it's possible to use built in ASP.NET application services (aspnet_user, aspnet_role
just wondering whether it's possible to change the screen timeout using code in Android
I was wondering whether it is possible to capture audio data from other sources
i'm wondering whether it is possible to use ORDER BY clause (or any other
I was wondering whether it is possible to limit the number of characters we
I am wondering whether it is possible to make dynamic variables in Java. In
I was wondering whether it was possible for projects in Eclipse to have multiple
This is a very general question: I was wondering whether it is possible to
Possible Duplicate: Android ImageButton with a selected state? I was wondering whether there is
I am wondering if it is possible to detect whether the user exits the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.