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 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

Ask A Question

Stats

  • Questions 187k
  • Answers 187k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can find a whole host of programming paradigms in… May 12, 2026 at 5:19 pm
  • Editorial Team
    Editorial Team added an answer The line: sum += f3 % 2 == 0 ?… May 12, 2026 at 5:19 pm
  • Editorial Team
    Editorial Team added an answer Here's a solution: $regex = array( "`^([\t\s]+)`ism"=>'', "`^\/\*(.+?)\*\/`ism"=>"", "`([\n\A;]+)\/\*(.+?)\*\/`ism"=>"$1", "`([\n\A;\s]+)//(.+?)[\n\r]`ism"=>"$1\n",… May 12, 2026 at 5:19 pm

Related Questions

I'm looking to implement a simple web-based application. The main reason I want to
I am implementing a simple plugin architecture in an application. The plugin requirements are
I am looking for a simple solution to do Exception Logging combined with Error
I have to enable all the text in a winforms application to be replaced;

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.