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

  • SEARCH
  • Home
  • 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 8346179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:55:32+00:00 2026-06-09T06:55:32+00:00

This code opens a folder if the TotalFileCount == 0. I want to open

  • 0

This code opens a folder if the “TotalFileCount” == 0. I want to open the folder and have it centered on the screen and I want it to be a specific size. Is there a way to do that in C#?

if (TotalFileCount == 0)
{
    MessageBox.Show("There are no files in this directory. Please add pictures to this folder: " + AppVars.PolicyImagesDirectory + " and try again.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
    btnBrowse.Focus();

    System.Diagnostics.Process process = new System.Diagnostics.Process();
    process.StartInfo.FileName = AppVars.PolicyImagesDirectory;
    process.Start(); 
 }

When the new Windows Explorer window opens, can I make it a specific size and center it on the screen?

  • 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-09T06:55:33+00:00Added an answer on June 9, 2026 at 6:55 am

    get the handle from the process then call the native SetWindowPos from the win32 api

    process.handle //to get the handle of the window.
    
    [DllImport("user32.dll", SetLastError=true)]
    public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int W, int H, uint uFlags);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code to open multiple files one at a time that is
I have this code that opens a directory and checks if the list is
I have 1st popup, and this 1st popup opens 2nd popup Code: <view-state id=paneMaintenance
I have this code: con.Open(); cmd = new MySqlCommand(String.Format(SELECT concat(name,'|',lastname) FROM {0} WHERE ID=
I have made this code to open a database(created in SQLite browser) stored in
I have this code, I open a stream (without closing or disposing it), then
I have this code to send an SMS message with an attachment that is
Let me first describe the problem. I have this application that opens a word
I have this code //file Globals.cs in App_Code folder public class Globals { public
I have working code that opens up a word document programmatically using vbscript, makes

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.