천객만래 [千客萬來] (It has an interminable succession of visitors)
스스로를 버려 변화를 선도한 마이크로소프트


(예병일의 경제노트, 2005.1.7)

마이크로소프트는 도스(DOS)가 이루어 낸 회사라고 불린다. MS-DOS는 마이크로소프트의 초창기에 빌 게이츠에게 수익의 대부분을 창출해 준 황금알을 낳는 거위였다. 최소한도의 광고나 개발비도 필요하지 않았으니 그야말로 팔리는대로 순이익만 남았다.

그러나 현재는 더 이상 MS-DOS를 팔지 않는다. 과연 누가 마이크로소프트에 막대한 이익을 가져다 주었던 MS-DOS를 무용지물로 만들었단 말인가?

장본인은 다름 아닌 마이크로소프트 자신이었다. 그것도 의도적으로...


데이비드 티렌의 '빌 게이츠 따라잡기' 중에서 (FKI미디어, 50p)


자기 자신의 한 부분을 버리기란 쉽지 않습니다. 나쁜 것도 버리기가 힘든데, 좋은 것, 나에게 커다란 이익을 가져다주는 것을 버리기란 정말 쉽지 않습니다.

마이크로소프트는 MS-DOS가 시장을 석권하자, 어떻게 하면 더 좋은 제품을 개발해서 그 MS-DOS를 '파괴'할 수 있을지 연구하기 시작했습니다. 그리고 윈도로 자신의 MS-DOS를 죽이고 다시 시장을 장악했습니다.
마이크로소프트는 "내가 MS-DOS를 죽이지 않았다면, 다른 누군가가 MS-DOS를 죽였을 것이다"라고 생각했다고 합니다.

하지만 많은 기업들이 스스로를 버리지 못해, 변화를 선도하지 못하고 결국 실패하고 맙니다. 변화의 속도가 더욱 빨라지고 있는 요즘 시대에는 이런 현상이 자주 발생합니다.

스스로를 버려 변화를 선도하는 건 개인의 자기경영에서도 정말 중요한 일입니다.


Posted by SB패밀리

가끔 어떤 폴더의 전체 파일이 아니라 그 폴더의 구조만 복사하고 싶을 때가 있다.

그 구조만으로 전체를 보고 싶을 때가 있기 때문이다.

더 나아가 구조 자체를 갖고 싶을 때가 있다...

이럴 때 사용할 수 있는 방법이다.





[CMD]

C:\>XCOPY /?


명령을 치게 되면 한글윈도우인 경우에 파라미터 설명이 출력됨.

그 중, /T /E 명령으로 해결이 가능.

[CMD]

C:\>XCOPY D:\UTIL C:\DEST /T /E


위와 같이 입력하면 D드라이브의 UTIL 폴더의 구조를 C드라이브 DEST로 폴더만 복사 됨.

즉, XCOPY 원본경로 대상경로 /T /E


Posted by SB패밀리

윈도우 제어판 도구 등 프로그램 실행 파일명


출처: http://oojjrs.tistory.com/115

정보 감사합니다.





윈도우 UI가 달라져도 파일명은 대개 같기 때문에 유용하게 사용한다.


문제라면 사용자의 기억력이 금붕어 수준이면 안 된다는 것 정도.


윈도우가 설치된 설정에 따라 없는 파일이 있을 수도 있다.


대부분의 명령어는 제어판 실행(control)을 붙이지 않아도 되지만 붙여야 동작하는 녀석들도 있다.

(특정 옵션을 주고 싶을 때 붙이기도 하지만, 그 쯤 되면 이미 가벼운 실행보다는 커맨드라인 툴을 위한 것이므로 하단 링크를 참고)



Active Directory 사용자 및 컴퓨터           dsa.msc

IIS 관리자IIS Manager                       inetmgr.exe

iSCSI 초기자                                iscsicpl.exe

Microsoft Exchange                          control mlcfg32.cpl

Microsoft Mail Post Office                  control wgpocpl.cpl

게임 컨트롤러Joystick Properties            joy.cpl

국가 및 언어Regional Settings               intl.cpl

날짜 및 시간Date/Time Properties            timedate.cpl

네트워크 연결Network Properties             ncpa.cpl 또는 netcpl.cpl

디스크 관리                                 diskmgmt.msc

로컬 사용자 및 그룹                         lusrmgr.msc

마우스 속성                                 main.cpl

모뎀 속성Modem Properties                   control modem.cpl

사용자 계정 관리                            netplwiz.exe

서비스                                      services.msc

성능 모니터                                 perfmon.msc

소리Multimedia Properties                   mmsys.cpl

스캐너 및 카메라Scanners and Cameras        control sticpl.cpl

시스템 속성System Properties                sysdm.cpl

원격 데스크톱 연결                          mstsc.exe

윈도우 방화벽 고급 설정                     wf.msc

윈도우 방화벽Windows Firewall               firewall.cpl

이벤트 뷰어                                 eventvwr.msc

익스플로러 인터넷 속성Internet Properties   inetcpl.cpl

장치 관리자                                 devmgmt.msc

장치 및 프린터Printers Folder               control printers

전원 옵션Power Management                   powercfg.cpl

접근성 센터Accessibility Options            control access.cpl

컴퓨터 관리                                 compmgmt.msc

폰트 폴더Fonts Folder                       fonts

프로그램 및 기능Add/Remove Programs         appwiz.cpl

화면 해상도Display Properties               desk.cpl



보기 좋게 정리하려다 무료 블로그 문서 편집 기능의 편의성의 한계를 깨닫고 귀찮아서 관뒀다.



※ 링크

http://support.microsoft.com/KB/192806

http://ss64.com/nt/run.html

Posted by SB패밀리

Thread, Process ID & Handle 



윈도우즈용 응용프로그램, ActiveX, DLL, Windows Service 등을 만들기 위해서 알아두어야 할 기본적인 지식들



출처 : http://radrome.springnote.com/pages/2213794

 윈도우, 프로세스, 모듈
    - 핸들, ID, 파일이름

    파일이름 만으로 전체 경로 얻기 GetFullPathName(  sFileName,   _MAX_PATH,  sFullFull,  0);
                                        -> 문제 : 현재 경로에 파일름만 붙인다.
                        GetFullPath()(만듬) : 파일일 현재 실행된 파일의 경로에 있는 검사해서 붙인다.

 
* 윈도우

    윈도 Instance : (SDK) GetWindowLong(hWndCur, GWL_HINSTANCE),   (MFC)HINSTANCE AfxGetInstanceHandle();
    현재 Window Handle    : GetCurrentWindowHandle(만듬)   
    Process Handle (ID) -> Window Handle : HWND GetWindowHandleFromProcessId(DWORD dwProcId) (만듬)   
* 프로세스

    현재 Process Handle : HANDLE GetCurrentProcess(VOID);
    현재 Process ID        : DWORD GetCurrentProcessId(VOID);
    프로세스(모듈) 파일 이름  : GetModuleBaseName(hProc, 0, sNameOnly, _MAX_PATH);//이름만
                      GetModuleFileName(0, sFullPath, _MAX_PATH);//전체경로
    Win Handle -> Process Handle : GetWindowThreadProcessId

 

   OpenProcess, CreateProcess
    Process ID -> Process Handle : GetProcessId() , API인데 MSDN 설명이 안나옴

    GetCurrentProcessorNumber() ??
    GetCurrentActCtx()??
* 모듈

    현재 Module Handle    : GetCurrentModule(만듬)
    파일이름 -> 모듈핸들 : GetModuleHandle();//현재 프로세스에서만 작동
                        특정프로세스 안에 있는 모듈 핸들 GetModuleHandle()(만듬), 외부 프로세스에서 작동
    모듈ID -> 모듈 핸들 :
* 쓰레드

    현재 쓰레드 핸들    : GetCurrentThread()

    현재 쓰레드 ID        : GetCurrentThreadId()



Posted by SB패밀리

윈도우즈에서 실행중인 프로세스를 강제 종료시키자.
내가 사용하는 방법도 있지만 아래 소스가 잘 정리되어 있어서 그대로 스크랩했다.



출처 : http://koronaii.tistory.com/241

BOOL CGomControl::ProcessKill(CString strProcessName)                                                                       
{                                                                                                                                                           
   HANDLE hProcessSnap = NULL;                                                                                                          
   BOOL bRet = FALSE;                                                                                                                          
   PROCESSENTRY32 pe32 = {0};                                                                                                          
                                                                                                                                                           
   hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);                                              
   if (hProcessSnap == (HANDLE)-1)                                                                                                       
       return false;                                                                                                                                  
   pe32.dwSize = sizeof(PROCESSENTRY32);                                                                                          
                                                                                                                                                           
   //프로세스가 메모리상에 있으면 첫번째 프로세스를 얻는다                                                                        
   if (Process32First(hProcessSnap, &pe32))                                                                                            
   {                                                                                                                                                      
       BOOL bCurrent = FALSE;                                                                                                               
       MODULEENTRY32 me32 = {0};                                                                                                       
                                                                                                                                                           
       do {                                                                                                                                             
           bCurrent = GetProcessModule(pe32.th32ProcessID,strProcessName);                                            
           if(bCurrent) {                                                                                                                            
               HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID);           
               if(hProcess) {                                                                                                                        
                   if(TerminateProcess(hProcess, 0)) {                                                                                    
                       unsigned long nCode; //프로세스 종료 상태                                                                       
                       GetExitCodeProcess(hProcess, &nCode);                                                                         
                   }                                                                                                                                      
                   CloseHandle(hProcess);                                                                                                     
               }                                                                                                                                          
           }                                                                                                                                              
       }                                                                                                                                                  
       //다음 프로세스의 정보를 구하여 있으면 루프를 돈다.                                                                           
       while (Process32Next(hProcessSnap, &pe32));                                                                                 
   }                                                                                                                                                      
                                                                                                                                                           
   CloseHandle (hProcessSnap);                                                                                                             
   return true;                                                                                                                                       
}                                                                                                                                                           
  
                                                                                                                                                         
BOOL CGomControl::GetProcessModule(DWORD dwPID, CString sProcessName)                                        
{                                                                                                                                                           
   HANDLE hModuleSnap = NULL;                                                                                                           
   MODULEENTRY32 me32 = {0};                                                                                                           
                                                                                                                                                           
   hModuleSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, dwPID);                                          
   if(hModuleSnap == (HANDLE)-1)                                                                                                         
       return (FALSE);                                                                                                                             
   me32.dwSize = sizeof(MODULEENTRY32);                                                                                           
                                                                                                                                                           
   //해당 프로세스의 모듈리스트를 루프로 돌려서 프로세스이름과 동일하면                                                     
   //true를 리턴한다.                                                                                                                              
   if(Module32First(hModuleSnap, &me32)) {                                                                                           
       do {                                                                                                                                             
           if(me32.szModule == sProcessName)                                                                                          
           {                                                                                                                                              
               CloseHandle (hModuleSnap);                                                                                                  
               return true;                                                                                                                           
           }                                                                                                                                              
       }                                                                                                                                                  
                                                                                                                                                           
       while(Module32Next(hModuleSnap, &me32));                                                                                   
   }                                                                                                                                                      
                                                                                                                                                           
   CloseHandle (hModuleSnap);                                                                                                              
   return false;                                                                                                                                      
}                                                                                                                                                           
                                                                                                                                                           
                                                                                                                                                           
                                                                                                                                                           
bool CGomControl::GomClose(){                                                                                                           
   return ProcessKill(_T("GOM.exe"));//실제 죽이는 구문      

Posted by SB패밀리

윈도우즈용 응용프로그램, ActiveX, DLL, Windows Service 등을 만들기 위해서 알아두어야 할 기본적인 지식들

출처 : http://radrome.springnote.com/pages/2213794

 윈도우, 프로세스, 모듈
    - 핸들, ID, 파일이름

    파일이름 만으로 전체 경로 얻기 GetFullPathName(  sFileName,   _MAX_PATH,  sFullFull,  0);
                                        -> 문제 : 현재 경로에 파일름만 붙인다.
                        GetFullPath()(만듬) : 파일일 현재 실행된 파일의 경로에 있는 검사해서 붙인다.

 
* 윈도우

    윈도 Instance : (SDK) GetWindowLong(hWndCur, GWL_HINSTANCE),   (MFC)HINSTANCE AfxGetInstanceHandle();
    현재 Window Handle    : GetCurrentWindowHandle(만듬)  
    Process Handle (ID) -> Window Handle : HWND GetWindowHandleFromProcessId(DWORD dwProcId) (만듬)  
* 프로세스

    현재 Process Handle : HANDLE GetCurrentProcess(VOID);
    현재 Process ID        : DWORD GetCurrentProcessId(VOID);
    프로세스(모듈) 파일 이름  : GetModuleBaseName(hProc, 0, sNameOnly, _MAX_PATH);//이름만
                      GetModuleFileName(0, sFullPath, _MAX_PATH);//전체경로
    Win Handle -> Process Handle : GetWindowThreadProcessId

 

   OpenProcess, CreateProcess
    Process ID -> Process Handle : GetProcessId() , API인데 MSDN 설명이 안나옴

    GetCurrentProcessorNumber() ??
    GetCurrentActCtx()??
* 모듈

    현재 Module Handle    : GetCurrentModule(만듬)
    파일이름 -> 모듈핸들 : GetModuleHandle();//현재 프로세스에서만 작동
                        특정프로세스 안에 있는 모듈 핸들 GetModuleHandle()(만듬), 외부 프로세스에서 작동
    모듈ID -> 모듈 핸들 :
* 쓰레드

    현재 쓰레드 핸들    : GetCurrentThread()

    현재 쓰레드 ID        : GetCurrentThreadId()

Posted by SB패밀리

윈도우즈에서 실행중인 프로세스를 강제 종료시키자.
내가 사용하는 방법도 있지만 아래 소스가 잘 정리되어 있어서 그대로 스크랩했다.

출처 : http://koronaii.tistory.com/241

BOOL CGomControl::ProcessKill(CString strProcessName)                                                                      
{                                                                                                                                                          
   HANDLE hProcessSnap = NULL;                                                                                                         
   BOOL bRet = FALSE;                                                                                                                         
   PROCESSENTRY32 pe32 = {0};                                                                                                         
                                                                                                                                                          
   hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);                                             
   if (hProcessSnap == (HANDLE)-1)                                                                                                      
       return false;                                                                                                                                 
   pe32.dwSize = sizeof(PROCESSENTRY32);                                                                                         
                                                                                                                                                          
   //프로세스가 메모리상에 있으면 첫번째 프로세스를 얻는다                                                                       
   if (Process32First(hProcessSnap, &pe32))                                                                                           
   {                                                                                                                                                     
       BOOL bCurrent = FALSE;                                                                                                              
       MODULEENTRY32 me32 = {0};                                                                                                      
                                                                                                                                                          
       do {                                                                                                                                            
           bCurrent = GetProcessModule(pe32.th32ProcessID,strProcessName);                                           
           if(bCurrent) {                                                                                                                           
               HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID);          
               if(hProcess) {                                                                                                                       
                   if(TerminateProcess(hProcess, 0)) {                                                                                   
                       unsigned long nCode; //프로세스 종료 상태                                                                      
                       GetExitCodeProcess(hProcess, &nCode);                                                                        
                   }                                                                                                                                     
                   CloseHandle(hProcess);                                                                                                    
               }                                                                                                                                         
           }                                                                                                                                             
       }                                                                                                                                                 
       //다음 프로세스의 정보를 구하여 있으면 루프를 돈다.                                                                          
       while (Process32Next(hProcessSnap, &pe32));                                                                                
   }                                                                                                                                                     
                                                                                                                                                          
   CloseHandle (hProcessSnap);                                                                                                            
   return true;                                                                                                                                      
}                                                                                                                                                           
  
                                                                                                                                                        
BOOL CGomControl::GetProcessModule(DWORD dwPID, CString sProcessName)                                       
{                                                                                                                                                          
   HANDLE hModuleSnap = NULL;                                                                                                          
   MODULEENTRY32 me32 = {0};                                                                                                          
                                                                                                                                                          
   hModuleSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, dwPID);                                         
   if(hModuleSnap == (HANDLE)-1)                                                                                                        
       return (FALSE);                                                                                                                            
   me32.dwSize = sizeof(MODULEENTRY32);                                                                                          
                                                                                                                                                          
   //해당 프로세스의 모듈리스트를 루프로 돌려서 프로세스이름과 동일하면                                                    
   //true를 리턴한다.                                                                                                                             
   if(Module32First(hModuleSnap, &me32)) {                                                                                          
       do {                                                                                                                                            
           if(me32.szModule == sProcessName)                                                                                         
           {                                                                                                                                             
               CloseHandle (hModuleSnap);                                                                                                 
               return true;                                                                                                                          
           }                                                                                                                                             
       }                                                                                                                                                 
                                                                                                                                                          
       while(Module32Next(hModuleSnap, &me32));                                                                                  
   }                                                                                                                                                     
                                                                                                                                                          
   CloseHandle (hModuleSnap);                                                                                                             
   return false;                                                                                                                                     
}                                                                                                                                                          
                                                                                                                                                          
                                                                                                                                                          
                                                                                                                                                          
bool CGomControl::GomClose(){                                                                                                          
   return ProcessKill(_T("GOM.exe"));//실제 죽이는 구문                                                                           
                                                                                                                                                          

Posted by SB패밀리