A
A
ArmanDK2017-02-08 19:30:33
User interface
ArmanDK, 2017-02-08 19:30:33

How to display command line output in CheckedListBox or textbox IDE visual studio 2012 c++ project?

I have a C++ GUI program written in visual studio 2012. Screenshot attached (mal.jpg). The program performs signature-based scanning of malicious files (malware) using the yara tool and the rules by which we determine the type of malware. You must have heard of him. When I click on the "scanning for malware" button, I open the command line, in the code I wrote - system("cmd.exe"); Further we write already in com. line yara64 -r virusbase.yara C:\Users\.. folder name. and scan the folder for malware. If the scanner finds a virus, then it will definitely display its name and path to it in a com. line. link to screenshot https://cloud.mail.ru/public/6uWE/KXr9Sdwjt
Question: Is it possible to write in the code so as to display all the contents of the com. lines directly to the program interface, let's say inside checkedlistbox1 so that later you can select the desired malware with a checkmark and, when you click on button1, delete it? how to implement it? is this at all possible? I want to make sure that the command line does not open and we do not manually enter everything, but somehow write in the code the command to scan "yara64 -r virusbase.yara C:\Users\.. folder name." and so that the whole process, the whole output displayed immediately on checkedlistbox1 or on textbox. then I would like to mark malware further and delete this file through the interface of my program. In general, at least for a start, except for deleting through the button, can everything else be done? In general, help friends. I will be grateful for any help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
Xano, 2017-02-10
@Xano

"Is it possible to write in the code so as to display all the contents of the command line directly on the program interface"
https://msdn.microsoft.com/ru-ru/library/windows/d...
instead of "szCmdline" - your command
" I want to make sure that the command line does not open"
in the specified example, add the line "siStartInfo.wShowWindow |= SW_HIDE; "
P.S. learn to tame the stream of consciousness and formulate thoughts more clearly;)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question