?? jcmd.h
字號:
/* * jcmd.h - A command interpreter for use with the Java's platform * Runtime.exec() on the Windows family of operating systems, designed * to prevent the display of console windows when executing console-based * programs; specifically designed to be used with jEdit's Console plugin * Copyright (C) 2001 John Gellene * jgellene@nyc.rr.com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or any later version. * * Notwithstanding the terms of the General Public License, the author grants * permission to compile and link object code generated by the compilation of * this program with object code and libraries that are not subject to the * GNU General Public License, provided that the use and distribution of * the resulting library or executable file shall be subject to the General * Public License. This condition does not require a licensee of this software * to distribute any proprietary software (including header files and libraries) * that is licensed under terms prohibiting redistribution to third parties. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with the jEdit program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id: jcmd.h,v 1.2 2001/09/16 22:59:30 jgellene Exp $ */ /* DATA STRUCTURES */ /* * struct TESTCONSOLE * * A data structure for holding the results * of iteration through a group of windows. */typedef struct _tag_testconsole{ HWND hwnd; int nCount;} TESTCONSOLE, *PTESTCONSOLE;/* * struct JCMD_EXEC_DATA * * Buffers and other data used by the application */typedef struct _tag_jcmd_exec_data { char execPath[MAX_PATH * 2]; char execName[MAX_PATH]; char szCmd[MAX_PATH * 6]; char szParams[MAX_PATH * 4]; char szPathExt[MAX_PATH]; char szTestPath[MAX_PATH]; char szScratch[1024]; char szTestExt[32]; PROCESS_INFORMATION pi; STARTUPINFO si; TESTCONSOLE tc; char* pPaths; int isExec, hasPath, hasExt; DWORD nReturnCode; DWORD nInputThreadID; HANDLE hInputThread;} JCMD_EXEC_DATA, *PJCMD_EXEC_DATA;/* Typedef for pointer to function that * manipulates data object */typedef int(*PJCMD_TEST_FUNC)(PJCMD_EXEC_DATA);/* Functions *//* All parameters are input parameters ([in]) unless stated otherwise *//* Initializing and uninitializing application data */int InitJcmdData(PJCMD_EXEC_DATA pData, int argc, char **argv);void ClearJcmdData(PJCMD_EXEC_DATA pData);/* Operations on application data */int LaunchCommand(PJCMD_EXEC_DATA pData);int SearchCommand(PJCMD_EXEC_DATA pData, char* pExt);int TestSingleExt(PJCMD_EXEC_DATA pData);int TestMultiExt(PJCMD_EXEC_DATA pData);int TestSinglePath(PJCMD_EXEC_DATA pData);int TestMultiPath(PJCMD_EXEC_DATA pData);/* Callback function used to iterate through windows */int CALLBACK FindConsoleWindow(HWND hwnd, LPARAM lparam);int CALLBACK CloseThreadWindow(HWND hwnd, LPARAM lparam);/* Tests TESTCONSOLE data object for presence of console window */int FoundConsole(/* [in] */ PTESTCONSOLE pt);/* Test string for executable extensions */int IsExec(/* [in] */ char* szFileName);/* Repetitive parsing routine for string containing file extensions */char* ExtractExt(/* [out] */ char* pPathExt, /* [in] */char* pExt);/* Advanced string manipulation: takes file path of non-executable file, * finds default command for handling file type, and returns string * containing executable with file as parameter */void MakeFileAssoc(/* [out] */ char* szDest, /* [in] */ char* szSource);/* Writes system error message or custom message to specified * file handle */void WriteProcessError(/* [in] */ HANDLE handle);void WriteMessage(/* [in] */ char* szMsg, /* [in] */ HANDLE handle);/* Input thread procedure */DWORD WINAPI InputThreadProc(LPVOID lp);/* end jcmd.h */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -