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 336399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:14:19+00:00 2026-05-12T10:14:19+00:00

I am looking to make a simple application that will capture the video from

  • 0

I am looking to make a simple application that will capture the video from a Skype window every few milliseconds.

My questions are:

  • How do I automatically locate the window handle? That is, which is the best strategy (by name or?) and how do I achieve that programatically?
  • How I keep track of the window location as the user resizes it/moves it?
  • 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-05-12T10:14:20+00:00Added an answer on May 12, 2026 at 10:14 am

    If skype is the active window you can use GetForegroundWindow. If not, using the process name is a good option. You can also combine them and see if you get the same window handle.

    The following code will grab an image from a window handle and save it to disk as an image. If you call this code often and modify the code to create unique images you will get several images like you ask for. GetWindowRect is the key function to get the coordinates for the window. And ofcourse you can save the image in any format you like. The WPF functions for saving images are quicker than the winform code used here.

    public void GrabActiveWindow()
    {   
        IntPtr handle = GetForegroundWindow(); // window handle of active application
        IntPtr handle = WindowsHandleFromProcess("skype.exe");
    
        RECT screenRect = new RECT();
        GetWindowRect(handle, out screenRect);
        long width = screenRect.Right - screenRect.Left;
        long height = screenRect.Bottom - screenRect.Top;
    
        Bitmap bmpScreenshot = new Bitmap( (int)width, (int)height, PixelFormat.Format32bppArgb);
        Graphics gfxScreenshot = Graphics.FromImage(bmpScreenshot);
        Size size = new Size((int)width, (int)height );
        gfxScreenshot.CopyFromScreen(screenRect.Left, screenRect.Top, 0, 0, size, CopyPixelOperation.SourceCopy);
        string path = @"c:\savepath.tiff";
        bmpScreenshot.Save(path, ImageFormat.Tiff);
    }
    
    public IntPtr WindowsHandleFromProcess(string processName)
    {
        foreach (var process in Process.GetProcessesByName(processName))
        {
            return process.MainWindowHandle;
        }
        return IntPtr.Zero;
    }
    
    [DllImport("user32.dll")]
    [return: MarshalAs(UnmanagedType.Bool)]
    static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect);
    
    [DllImport("user32.dll")]
    public static extern IntPtr GetForegroundWindow();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for some kind of text-parser for ASP.NET that can make HTML from
I am writing a distributed Java application that will make heavy use of networking,
I have a Button that is looking at 2 comboboxes to make sure they
I wrote a small PHP application that I'd like to distribute. I'm looking for
I'm creating a simple C# Windows Forms application that connects to a SQL Server
I have a rather strange problem. I have a very simple application that reads
I'm trying to make a simple menu bar only application on xcode 4. Everything
I'm looking to make validation for a page in which one or more fields
I'm looking to make calls out to a subversion repository, but I would like
I'm looking for a make platform. I've read a little about gnu make, and

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.