Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Message Box will closed automatically

Hi everyone ! i'm using opencv and visual studio 2010 for my codes . I have wrote some codes to allow the messagebox to pop out after 200 counts when the circles is not detected . But instead of waiting the users to click on the "OK" button to close the pop out message box , i want to program the codes in such a way that the message box will be closed automatically when it sense that the circle is being detected again. Can anyone help me with it . Thanks in advance. This is my message box codes

if ( i == 2)//delay reset if all 2 circle are detected
             delay = 0;
         //printf("check = %d\n", check); //to get the current check count
         if ( i < 2 && check > 50 )//condition for when no circle is detected,<== [ALERT ROUTINE]
             delay ++;
             printf ("delay = %d\n", delay); //to get the current delay count.
             if( delay > 200) // after 200 counts the system confirms that there is no circle.
                 printf(" Remove object\n ");//to test the camera;as long as this printf function runs the message box will reopen on closing.
                 MessageBox (NULL, L" Remove Object! " , L"Warning" , MB_ICONWARNING | MB_OK ); //Message box code