OSDN Git Service

Add menu of "New". Create new window.
[ckw/ckw.git] / main.cpp
index 40c93a8..61badbf 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -1086,9 +1086,11 @@ static BOOL initialize()
                return(FALSE);
        }
 
+       /*
        wchar_t path[MAX_PATH+1];
        GetSystemDirectory(path, MAX_PATH);
        SetCurrentDirectory(path);
+       */
        return(TRUE);
 }
 
@@ -1156,4 +1158,24 @@ int APIENTRY wWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPWSTR lpCmdLine, int nC
        return(0);
 }
 
+/* \90V\8bK\83E\83C\83\93\83h\83E\82Ì\8dì\90¬ */
+void makeNewWindow()
+{
+       LPWSTR cd = new TCHAR[MAX_PATH+1];
+       GetCurrentDirectory(MAX_PATH, cd);
+
+       STARTUPINFO si;
+       ZeroMemory(&si, sizeof(si));
+       si.cb = sizeof(si);
+
+       PROCESS_INFORMATION pi;
+       ZeroMemory(&pi, sizeof(pi));
+       if(CreateProcess(NULL, GetCommandLine(), NULL, NULL, FALSE, 0,
+                                          NULL, NULL, &si, &pi)){
+               // \8eg\97p\82µ\82È\82¢\82Ì\82Å\81C\82·\82®\82É\83N\83\8d\81[\83Y\82µ\82Ä\82æ\82¢
+               CloseHandle(pi.hProcess);
+               CloseHandle(pi.hThread);
+       }
+}
+
 /* EOF */