Tip2009. 2. 17. 17:49

최근에 윈도우 업데이트로 오피스 업데이트를 하고나면 정품인 아닌경우

시스템 트레이에 별모양의 정품인증 프로세서가 상주하게되며

인증못할경우 경고문구팝업이 계속 나타나더군요.

저야... 오피스사자에서 나름 저렴하게 구입해서 몰랐습니다만

친구녀석이 짜증나 죽을려고 하더군요.

다행이 이번녀석은 깔끔하게 해결되더군요.

우선 c:\windows\system32 폴더를 보시면 WGAtray.exe파일이 있습니다.

이녀석만 삭제해 주시면 더이상 경고문구가 뜨지 않습니다.

만약 프로세서가 사용중이라 삭제가 안되면 윈도우 작업관리자를 띄우신후에

(컨트롤+알트+del키를 동시에 누르면 됩니다.)

프로세서에 보시면 wgatray.exe가 실행중일겁니다... 이녀석 죽이신후에

파일 삭제하시면 됩니다.

그럼 정품인증 스트레스에서 벗어나시길... ^^

[출처] 오피스 정품인증 팝업해결하기

Posted by skensita
Programming/MFC2009. 1. 31. 16:53

MFC

  1. m_vtFileName.clear();
    m_UserThumbnail.clear();
  2. // 파일 목록을 찾는다.
    CFileFind finder;
    CString strWildCard( m_strDirectory );
  3. strWildCard += "\\*.*";

  4. BOOL bWorking = finder.FindFile( strWildCard );
  5. while( bWorking )
    {
    bWorking = finder.FindNextFile();
  6.   if( finder.IsDots() || finder.IsDirectory() )
      continue;  
     else
     {
      CString filePath = finder.GetFileName();
      filePath.MakeLower();   //대문자 -> 소문자
  7.    //if( IsImageGDIPLUSValid( m_strDirectory + "\\" + filePath ) )  
      if( filePath.Find(".jpg") > 0)
       m_vtFileName.push_back( filePath );  
     }

    finder.Close();
  8.  

API

  1.  m_strThumbnailDir = dir;
    if( m_strThumbnailDir == "" )
    {
     //AfxMessageBox(_T("not define strpath!"));
     m_vtImageName->clear();
     return false;
    }
  2.  CString strExt;
    CString strName;
    CString strPattern;
  3.  BOOL bRC = TRUE;
  4.  HANDLE     hFind = NULL;
    WIN32_FIND_DATA   FindFileData;
    std::vector<CString> VectorImageNames;
  5.  if( m_strThumbnailDir[ m_strThumbnailDir.GetLength() - 1 ] == TCHAR('\\') )
     strPattern.Format( _T("%s*.*"), m_strThumbnailDir );
    else
     strPattern.Format( _T("%s\\*.*"), m_strThumbnailDir );
  6.  hFind = FindFirstFile(strPattern,&FindFileData);
    if(hFind == INVALID_HANDLE_VALUE)
    {
     LPVOID  msg;
     ::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
          NULL,
          GetLastError(),
          MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
          (LPTSTR)&msg,
          0,
          NULL);
     MessageBox((LPTSTR)msg, _T("fileload error"), MB_OK|MB_ICONSTOP);
     ::LocalFree(msg);
     return FALSE;
    }
    // filter off the system files and directories
    if (!(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)  &&
     !(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM)     &&
     !(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)     &&
     !(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_TEMPORARY))
    {   
     // test file extension
     strName = FindFileData.cFileName;
     strExt = strName.Right(3);
  7.   if( FindType( strExt ) ){
  8.    // save the image file name
      VectorImageNames.push_back( strName );
     }
    }
  9.  // loop through to add all of them to our vector
    while (bRC)
    {
     bRC = ::FindNextFile(hFind, &FindFileData);
     if (bRC)
     {
      // filter off the system files and directories
      if (!(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)  &&
       !(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM)     &&
       !(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)     &&
       !(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_TEMPORARY))
      {
       // test file extension
       strName = FindFileData.cFileName;
       strExt = strName.Right(3);
  10.     if(FindType(strExt)){
        // save the image file name
        VectorImageNames.push_back(strName);
       }
      }
     }
     else
     {
      DWORD err = ::GetLastError();
      if (err !=  ERROR_NO_MORE_FILES)
      {
       LPVOID msg;
       ::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
        NULL, err,
        MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
        (LPTSTR)&msg, 0, NULL);
       MessageBox((LPTSTR)msg, _T("fileload error"), MB_OK|MB_ICONSTOP);
       ::LocalFree(msg);
       ::FindClose(hFind);
       return FALSE;
      }
     }
    } // end of while loop
  11.  // close the search handle
    ::FindClose(hFind);
  12.  // update the names, if any
    if ( !VectorImageNames.empty() )
    {
     // reset the image name vector
     m_vtImageName->clear();
     *m_vtImageName = VectorImageNames;
     return TRUE;
    }
    else
    {
     m_vtImageName->clear();
     return TRUE;
    }
  13.  return FALSE; 
Posted by skensita
Programming/MFC2009. 1. 31. 15:13



Visual Studio 6에서 만들어진 다이알로그 베이스 MFC 프로그램.



Visual Studio 2008에서 만들어진 다이알로그 베이스 MFC 프로그램.


보는것처럼 버튼의 모양이 다른것을 확인할 수 있다. 이외에 여러 컨트롤들이 다른 모양으로 표시 될 것입다.

Visual Studio 6에서 만들어진 프로그램에 저런 컨터트롤을 사용하기 위해서는 아래의 방법을 거치면

같은 모양의 컨트롤을 볼 수 있습니다.

----------------------------------------------------------------------------------------------

해당 첨부된 파일이름을 적당히 바꾸시고, 에디터로 열으셔서

이름 같은거 바꿔주시면 일단 시작입니다.

그리고, 해당 프로젝트의 적당한 경로, res 같은 곳으로 복사해주세요.

1. 해당 프로젝트를 엽니다.

2. 리소스 편집창으로 이동합니다.

3. 우측 마우스 메뉴의 인서트를 선택합니다.

4. 해당 다이알로그의 Import 버튼을 클릭합니다.

5. 파일 열기 창의 하단부 Open As을 오토에서 커스텀으로 변경합니다.

6. 복사한 메니페스트 파일을 선택합니다.

7. 리소스타입을 24라고 숫자로 입력합니다. 

8. 해당 리소스 편집창에 24 타입으로 대충 IDR_241 과 같은 형태로 추가되었을 것입니다.
    해당 리소스의 프로퍼티를 열으셔서 위의 아이디를 숫자 1로 바꿔줍니다.

9. 빌드를 다시 수행합니다.

10. XP에 테마가 있는 상태라면 원하시는 모양으로 바뀐 다얄로그를 보실 수 있을겁니다.



메니페스트라의내용은 강좌란이나 인터넷에서 검색해 보면 깔끔한 자료를 찾으실 수 있을겁니다.

Posted by skensita