Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Malfunction occurs on Windows7-Basic-theme. Collapse All
Subject Author Date
tera tera Sep 22, 2010 - 3:09 AM

Hello.


In Windows7-Aero, the malfunction such as the following video does not occur.

http://ifreeta.dee.cc/20100922/Untitled25.html


But , On the Basic themes, the following malfunction occurs.

http://ifreeta.dee.cc/20100922/Untitled25.html

The re-drawing of the screen of RibbonMenu is not performed definitely.

The programs are as follows.


// ---------------------------------------------------------------------------- /**  */ // ---------------------------------------------------------------------------- void ProcessCtl( CString csCommand ) {     DWORD    dwThread = 0;

    BOOL     result;     DWORD    dwExitCode;     STARTUPINFO si;     PROCESS_INFORMATION pi;

    ZeroMemory( &si, sizeof(si) );     si.cb    = sizeof(STARTUPINFO);     si.lpReserved   = NULL;     si.dwX   = CW_USEDEFAULT;     si.dwY   = CW_USEDEFAULT;     si.dwXSize   = CW_USEDEFAULT;     si.dwYSize   = CW_USEDEFAULT;     si.dwFlags   = STARTF_USESHOWWINDOW;     si.wShowWindow  = SW_SHOWNORMAL;     ZeroMemory( &pi, sizeof(pi) );

    result = CreateProcess( NULL, csCommand.GetBuffer( csCommand.GetLength() ), NULL, NULL, FALSE,     DETACHED_PROCESS | HIGH_PRIORITY_CLASS,     NULL, NULL, &si, &pi );

    DWORD   dRet = WaitForSingleObject( pi.hProcess, INFINITE );

    if( dRet != WAIT_FAILED )     {     GetExitCodeProcess( pi.hProcess, &dwExitCode );     }

    CloseHandle( pi.hProcess );         if( dwExitCode >=  0 ){     if( (dwExitCode / 10) == 1 ){     ProcessCtl( csCommand );     }     } }

BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo) {

 if( nID == ID_EDIT_PASTE && nCode == CN_COMMAND && pExtra == NULL )  {   ProcessCtl("NotePad.exe");   return TRUE;  }

 

tera tera Sep 26, 2010 - 6:58 PM

 


Hello.


I tried this source code.

However, re-drawing does not work at the time of specific pattern definitely.


http://ifreeta.dee.cc/20100927/Untitled27.html


Without its starting from VisualStudio , When I started direct Exe, a bug occurs.


    //起動     result = CreateProcess(        NULL, csCommand.GetBuffer( csCommand.GetLength() ), NULL, NULL, FALSE,     DETACHED_PROCESS ,     NULL, NULL, &si, &pi );

    //DWORD   dRet = WaitForSingleObject( pi.hProcess, INFINITE );

 DWORD dRet = WaitForSingleObject( pi.hProcess , 10 );  for( ; dRet == WAIT_TIMEOUT; dRet = WaitForSingleObject( pi.hProcess , 10 ) ){      CExtPaintManager::stat_PassPaintMessages();  }

Technical Support Sep 27, 2010 - 11:58 AM

Redrawing stops working when the message queue is overloaded with messages. The CExtPaintManager::stat_PassPaintMessages() static method handles only painting messages. So, please try the next version:

   result =
                        CreateProcess(
                                    NULL,
                                    csCommand.GetBuffer( csCommand.GetLength() ),
                                    NULL,
                                    NULL,
                                    FALSE,
                                    DETACHED_PROCESS ,
                                    NULL,
                                    NULL,
                                    &si,
                                    &pi
                                    );
            HWND hWndMain = ::AfxGetMainWnd()->GetSafeHwnd();
            DWORD dRet = WaitForSingleObject( pi.hProcess , 10 );
            for( ; dRet == WAIT_TIMEOUT; dRet = WaitForSingleObject( pi.hProcess , 10 ) )
            {
                        if( hWndMain == NULL || ( ! ::IsWindow( hWndMain ) ) )
                                    return;
                        CExtPopupMenuWnd::PassMsgLoop( true );
            }

Technical Support Sep 22, 2010 - 12:12 PM

The following line of code is bad because it switches the main UI thread of the application into the non-responding and non-draw-able state:

DWORD   dRet = WaitForSingleObject( pi.hProcess, INFINITE );

Please replace this bad line of code with the following:
 DWORD   dRet = WaitForSingleObject( pi.hProcess, 10 );
            for( ; dwRet == WAIT_TIMEOUT; dRet = WaitForSingleObject( pi.hProcess, 10 ); )
                        CExtPaintManager::stat_PassPaintMessages();

The main frame window will be able to repaint itself, but the UI will not be click-able. I.e. main frame will behave like disabled. Is that what you need?