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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:49:09+00:00 2026-05-29T21:49:09+00:00

How do you check if an opencv window has been closed? I would like

  • 0

How do you check if an opencv window has been closed?

I would like to do:

cvNamedWindow("main", 1);

while(!cvWindowIsClosed("main"))
{
    cvShowImage("main", myImage);   
}

but these is no such cvWindowIsClosed(…) 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-05-29T21:49:10+00:00Added an answer on May 29, 2026 at 9:49 pm

    What you are trying to do can be achieved with cvGetWindowHandle():

    The function cvGetWindowHandle returns the native window handle (HWND in case of Win32 and GtkWidget in case of GTK+). [Qt Backend Only] qt-specific details: The function cvGetWindowHandle returns the native window handle inheriting from the Qt class QWidget.

    The idea is to get the handle of the window and then use specific platform API functions to check if that handle is still valid.

    EDIT:

    Or you could use the tradicional cvWaitKey() approach:

    char exit_key_press = 0;
    while (exit_key_press != 'q') // or key != ESC
    {
       // retrieve frame
    
       // display frame
    
       exit_key_press = cvWaitKey(10);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First check out this code. I seems like it should work for me, but
I have been developing some computer vision tools with openCV, but every time that
I'm just beginning to learn OpenCV and I would like to ask about how
for a project in OpenCV I would like to segment moving objects as good
I'm new to OpenCV, and I would like to compare the results of a
I am trying to build some big libraries, like Boost and OpenCV , from
I've been for the past few hours trying to figure out why openCV doesn't
Check the rounded corners of the main tabs in this site Those are background
Check out the treatments menu on right hand side of this website. It has
Check it out Check the above url, You can find the options like list

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.