Java 类org.eclipse.swt.internal.win32.TCHAR 实例源码

项目:Black    文件:EmbedEXEIntoSWT.java   
private boolean executeProg(String fileName) throws Exception  
{  
    int hHeap = OS.GetProcessHeap ();  
    TCHAR buffer = new TCHAR (0, fileName, true);  
    int byteCount = buffer.length () * TCHAR.sizeof;  
    int lpFile = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);  
    OS.MoveMemory (lpFile, buffer, byteCount);  
    SHELLEXECUTEINFO info = new SHELLEXECUTEINFO ();  
    info.cbSize = SHELLEXECUTEINFO.sizeof;  
    info.lpFile = lpFile;  
    //��������  
    info.nShow = OS.SW_HIDE;  
    boolean result = OS.ShellExecuteEx (info);  
    if (lpFile != 0) OS.HeapFree (hHeap, 0, lpFile);  
    return result;  
}