Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2008.07.27;
Скачать: CL | DM;

Вниз

Своё cmd-окошко   Найти похожие ветки 

 
Ega23 ©   (2008-06-11 16:02) [0]

Достаточно давно в качестве простого текстового редактора использую Notepad++. Тут случайно наткнулся в нём на фишку - консольное окошко, встраивается в основное IDE. Список команд явно отличается от стандартного cmd-shell:

================ READY ================
help
-------- Console keys --------
Enter  -  executes entered command
Tab  -  auto-completes current command/looks through the commands history
Arrow Up  -  previous command (when Console Commands History is enabled)
Arrow Down  -  next command (when Console Commands History is enabled)
Ctrl+C  -  copy selected text to the clipboard
Ctrl+V  -  paste from the clipboard
Ctrl+F, F3, F7  -  shows Console"s Find dialog
Esc  -  hides Console"s Find dialog
Enter (in Console"s Find dialog)  -  find next
-------- Console commands --------
help  -  show available commands
help <command>  -  show detailed information about specified command
ver  -  show plugin"s version
CTRL+C  -  terminate current child process
CTRL+BREAK  -  terminate current child process
-------- General commands --------
cls  -  clear Console screen
cd  -  shows current path
cd <absolute_path or relative_path>  -  changes current path
dir  -  lists files and subdirs
dir <mask or path\mask>  -  lists files/subdirs matched the mask
echo <text>  -  prints a text in the Console
set  -  shows all user"s variables
set <var>  -  shows the value of user"s variable <var>
set <var> = <value>  -  sets the value of user"s variable <var>
unset <var>  -  removes user"s variable <var>
unset <var> = <value>  -  removes user"s variable <var>
con_loadfrom <file>  -  loads a file"s content to the Console
con_load <file>  -  see "con_loadfrom"
con_saveto <file>  -  saves the Console"s content to a file
con_save <file>  -  see "con_saveto"
npp_exec <script>  -  execute commands from specified script
npp_exec <file>  -  execute commands from specified file
npp_exec <script/file> <args>  -  passes additional arguments <args>
npp_open <file>  -  (re)open specified file in Notepad++
npp_open <mask or path\mask>  -  opens file(s) matched the mask
npp_run <command>  -  run external process/command
npp_save  -  save current file in Notepad++
npp_save <file>  -  save specified file opened in Notepad++
npp_saveall  -  save all modified files
npp_switch <file>  -  switch to specified opened file
npe_debuglog <on/off>  -  enable/disable Debug Log
npe_debug <1/0>  -  see "npe_debuglog"
npe_noemptyvars <1/0>  -  enable/disable replacement of unset vars
-------- Environment variables --------
$(FULL_CURRENT_PATH)  :  E:\my Web\main\welcome.html
$(CURRENT_DIRECTORY)  :  E:\my Web\main
$(FILE_NAME)  :  welcome.html
$(NAME_PART)  :  welcome
$(EXT_PART)  :  html
$(NPP_DIRECTORY)  :  the full path of Notepad++"s directory
$(CURRENT_WORD)  :  word(s) you selected in Notepad++
$(#N)  :  full path of the Nth opened document (N=1,2,3...)
$(#0)  :  full path to notepad++.exe
$(LEFT_VIEW_FILE)  :  current file path-name in primary (left) view
$(RIGHT_VIEW_FILE)  :  current file path-name in secondary (right) view
$(ARGC)  :  number of arguments passed to the NPP_EXEC command
$(ARGV)  :  all arguments passed to the NPP_EXEC command after the script name
$(ARGV[0])  :  script name - first parameter of the NPP_EXEC command
$(ARGV[N])  :  Nth argument (N=1,2,3...)
$(RARGV)  :  all arguments in reverse order (except the script name)
$(RARGV[N])  :  Nth argument in reverse order (N=1,2,3...)
$(SYS.<var>)  :  system"s environment variable, e.g. $(SYS.PATH)

================ READY ================


И вот задумался: а можно ли как-нибудь сделать своё cmd-окно, которое будет поддерживать все команды shell, но при этом со своим интерфейсом, подсветкой и т.п.
Т.е. что-то типа создать окшко в невидимом режиме, к нему подцепиться, передавать что-то в stdin, получать stdout.
Вообще это возможно или нет?


 
Поросенок Винни-Пух ©   (2008-06-11 16:10) [1]

что-то типа этого
http://delphimaster.net/view/15-1212841734/


 
Ega23 ©   (2008-06-11 16:14) [2]

Ну что-то типа - да. В принципе, интересует сама возможность - можно подцепиться к окошку, или нельзя?


 
atruhin1   (2008-06-11 19:02) [3]

Сам не занимался, но смотрел несколько подобных плагинов, к Total Commander и т.п.
У всех свои глюки, т.е. для простых системных комманд проблем нет, но в cmd могут
запускаться и 16 бит DOS приложения, и что то там еще.


 
Mystic ©   (2008-06-11 20:03) [4]

Передавать в stdin, получать stdout возможно. Компонент сам когда-то писал:
http://mu.webest.net/prog/mu-console.1.00a.zip
Но как оно работает с 16-бит и прочей экзотикой не знаю :)


 
TUser ©   (2008-06-11 20:18) [5]

FAR

Он реально обрабатывает сам команды типа cd (можешь попробовать, например, в не ту сторону слеши прописать, cmd ругается, far - кушает).

cygwin

запускает обычные cmd, но подсветку делает, а команды - это просто проги + они у него еще и свои ФС понимают

Собственно, если все дело в подсветке, то она делается легко - надо посмотреть соответствующие команды в MSDN.


 
Dmitry S ©   (2008-06-11 20:26) [6]

Перекрыть процессу функции:

> AllocConsole
> CreateConsoleScreenBuffer
> FillConsoleOutputAttribute
> FillConsoleOutputCharacter
> FlushConsoleInputBuffer
> FreeConsole
> GenerateConsoleCtrlEvent
> GetConsoleCP
> GetConsoleCursorInfo
> GetConsoleMode
> GetConsoleOutputCP
> GetConsoleScreenBufferInfo
> GetConsoleTitle
> GetLargestConsoleWindowSize
> GetNumberOfConsoleInputEvents
> GetNumberOfConsoleMouseButtons
> GetStdHandle
> HandlerRoutine
> PeekConsoleInput
> ReadConsole
> ReadConsoleInput
> ReadConsoleOutput
> ReadConsoleOutputAttribute
> ReadConsoleOutputCharacter
> ScrollConsoleScreenBuffer
> SetConsoleActiveScreenBuffer
> SetConsoleCP
> SetConsoleCtrlHandler
> SetConsoleCursorInfo
> SetConsoleCursorPosition
> SetConsoleMode
> SetConsoleOutputCP
> SetConsoleScreenBufferSize
> SetConsoleTextAttribute
> SetConsoleTitle
> SetConsoleWindowInfo
> SetStdHandle
> WriteConsole
> WriteConsoleInput
> WriteConsoleOutput
> WriteConsoleOutputAttribute
> WriteConsoleOutputCharacter

:)


 
sniknik ©   (2008-06-12 00:33) [7]

> своё cmd-окно, которое будет поддерживать все команды shell, но при этом со своим интерфейсом, подсветкой и т.п.
пример
http://www.filefactory.com/file/86cf7b/


 
Mystic ©   (2008-06-12 12:02) [8]


> Перекрыть процессу функции:


А если это DOS-программа?


 
Тыщ ©   (2008-06-12 17:27) [9]

Mystic ©   (12.06.08 12:02) [8]

> А если это DOS-программа?

Перекрыть NTVDM"у?



Страницы: 1 вся ветка

Текущий архив: 2008.07.27;
Скачать: CL | DM;

Наверх




Память: 0.49 MB
Время: 0.018 c
2-1214306845
kzmd
2008-06-24 15:27
2008.07.27
Вот хотелось бы начать , но незнаю как начать !


2-1214447178
AlexAA
2008-06-26 06:26
2008.07.27
Как отправить письмо по электронной почте?


15-1213101506
Slider007
2008-06-10 16:38
2008.07.27
С днем рождения ! 10 июня 2008 вторник


2-1214227493
abhtr
2008-06-23 17:24
2008.07.27
ошибка: "Text exceeds memo capacity"


1-1195488425
DevilDevil
2007-11-19 19:07
2008.07.27
Получить Call-Stack