General Question about a GUI to execute a batch file - user-interface

I'm new to programming and have taken some classes in it so I'm not sure if this is possible. I want to use a COTS software called 010 Hex Editor and write a script for the program to automate a couple tasks. These tasks can be run from a batch file according to their documentation.
Then I want to instruct the user to eject the device and reinsert it to clear the cache. (This I want done just with a simple pop-up window.
Then I also want to format the device which I assume can be done in a batch file as it can be done through dos on Windows.
My question is, with these 3 steps, can I build a simple GUI that has a button that says, "Start" or something like that, then the pop up window comes up to eject and reinsert, and then another button to format, and another button to exit. I'm not really familiar with what language this could be done in, and how to do this as the C++/Java classes I've taken have been more about syntax and OOP. Thanks!

You can use the windows messenger service to put up an alert - but on newer windows (vista/7) it's a pain to set all the permissions to allow this.
There are lots of free utilities that will popup a dialog from the command line, with a given message and wait for a response.
They are generally called messagebox or msgbox - sorry can't recommend any in particular

Related

Win CLI open file with "How to open"?

I need to open the file using Windows 10 cmd. But when the file opens, I need Windows to show me a modal window "How do you want to open this file?". The system should do this even if it already has a program selected by default to open a certain type of file. Is it possible to do this?
To clarify my problem:
I need the console to run for example ".py" not through the standard Python.File="C:\Windows\py.exe " "%L" %*, and for example via VS Code. You might tell me about the VS Code CLI. But how to handle an event where the user will not have VS Code, but for example Pycharm, and the user will want to open it through it? That is why the question was posed in such a way that the user could choose through what to open the file already through the built-in modal window in Windows. In any case, I will be glad of any suggestion to solve my problem.
I tried to find something similar, but apart from the standard start something.som I didn't find it. And this is not a solution to the problem, because start starts the file in the program that is specified by default in the system. This program may not even be the one that the user ever chose later. I came across a similar question in Stackoverflow, where a person wanted to see which program was responsible for opening a file with a certain extension, where assoc and ftype were used, but they did not give the desired result.

How do I monitor the status of a program running in Windows 10?

I know we look at the list of process with tasklist command.
However, what I would like to know is what happens within the process.
First part:
For example, I am running MS Word.
So I click on "File" button. It will cause the drop down box to open.
However, what happens in OS and is there anyway of monitoring this?
(Like a debugger or a log message to track the action that will show like
"MouseClicked Button File" and "Drop down opened")
Second part (If there is no solution to the first part):
As programmers we write programs in different languages like java, C/C++ and so on but all of them are compiled into .exe/.jar files.
So I should be right to say that all of this compiled are readable by the OS so we should be able to write the program to create a software that will be able to do the above all of them are read by the OS.
Third Part:
Please give me some tips to start working on this project that will show the status of a running program.

Taking notes to a background text editor without switching windows

I am looking for a solution to a specific use case:
When I read something on my browser or pdf reader, I want to take notes without switching windows. I want to type right on my browser or pdf reader, but the typed text should go to the background text editor like notepad.
Is this possible?
Do you know any existing automation script that handles this use case?
You should create an application that uses some keylogger-like techniques (e.g. global hooks) to monitor the keypresses and, depending on some condition (a setting you may have set, the currenctly active window, ...), it may pass them normally to the application or suppress them to store them in a buffer. Such buffer, then, would be shown to the user as needed.
Still, in my opinion a much more convenient way to perform a similar task would be to create an application consisting of a semitransparent edit box, that could be shown and hide simply with a hotkey. This would avoid all the hooks stuff and the potential problems that may arise from them.
you might try using autohotkey scripting language... I can write a little script that would do exactly what you need and afaik in this particular case it wouldnt need keyboard hooks.
--EDIT--
Autohotkey is VERY simple to use/learn so even if you want to do the script yourself you can do it in a very short time even if you dont have any knowledge of ahk. Then again, I can help you with it.

Creating quick GUI front ends

I wanted to have a GUI front-end for a script that accepts numerous command-line options, most of them are UNIX paths. So I thought rather than typing them in (even with auto-completion) every time, I'd create a GUI front end which contains text boxes with buttons beside them, which when clicked will invoke the file browser dialogue. Later, I thought I'd extend this to other scripts which would sure require a different set of GUI elements. This made me think if there's any existing app that would let me create a GUI dialog, after parsing some kind of description of the items that I want that window should contain.
I know of programs like Zenity, but I think it's doesn't give me what I want. For example, if I were to use it for the first script, it'll end up flashing sequence of windows in succession rather than getting everything done from a single window.
So, basically I'm looking at some corss-platform program that lets me create a window from a text description, probably XML or the like. Please suggest.
Thanks
Jeenu
Mozilla's XUL is a cross platform application framework - . You could write an app as a Firefox plugin or a standalone XUL application.
mono and monodevelop could work for this. Or even something super simple like shoes.

Which programming language is most fit for implementing a windows form dialog?

And how?
I want to implement an simple enough dialog with several buttons.
vb.net or c#.net both use .net framework. You can create a windows forms project that has rich user interface for buttons,forms,labels,grids... it is also very simple to start with using visual studio beucase visual studio has options to write parts of the code for you.
One of the easiest ways to get some simple dialogs and a bit of associated code running in Windows is AutoHotKey. It's free-as-in-beer, too.
It's a macro script environment where you can write little programs as scripts (and hook them to keys, that's where it got its name and original purpose).
AHK is a BASIC-like tiny scripting language that's all about simplicity and ease of use. Good enough for most small projects you'd care to do.
One use case/experience
I'm not a Windows programmer at all; I used to program in Delphi a bit, but now I'm mostly working in Java. Recently my girlfriend needed a bit of hacking: She bought a product with a registration key, and part of that key was smudged off the sticker. What we needed was a program to brute-force try all the possible missing letters/numbers in the program's registration dialog. Legitimate hacking, if you will.
I considered doing this in Delphi, then I started thinking about which arcane system calls I'd be needing to reach into the GUI of another program and to poke text into the input dialog... it turned out to be very easy in AHK. I needed about 10 minutes to write my hacking program, and it took about 5 minutes to find the right key.
If I remember correctly, my little program even included a dialog for specifying what we knew of the key, and which places had to be trial-and-errored. And of course a "start" button.
Update with example
I really wish I still had that little script I wrote as described above, but it's been several years and I've thrown it away.
I dug up this little gem on the net:
This is a working example script that uses a timer to change the names of the buttons in a MsgBox dialog. Although the button names are changed, the IfMsgBox command still requires that the buttons be referred to by their original names.
#SingleInstance
SetTimer, ChangeButtonNames, 50
MsgBox, 4, Add or Delete, Choose a button:
IfMsgBox, YES
MsgBox, You chose Add.
else
MsgBox, You chose Delete.
return
ChangeButtonNames:
IfWinNotExist, Add or Delete
return ; Keep waiting.
SetTimer, ChangeButtonNames, off
WinActivate
ControlSetText, Button1, &Add
ControlSetText, Button2, &Delete
return
I agree that this is a silly and useless program; I found it quite hard to find useful small examples on the 'net. Most of the people who write AHK scripts seem to enjoy hanging bells and whistles off their creations until they end up being full-fledged applications and no longer suitable as small examples.
A lot of useful snippets of code, though, can be found in AHK's Tutorial and overview:
http://www.autohotkey.com/docs/Tutorial.htm
Much of what they talk about is hanging certain capabilities off certain keys. This is how AHK started, but meanwhile it's a (mostly) full-fledged Windows programming language. So don't pay too much attention to the key mapping stuff.
Here's a cute little script to run Notepad and then issue a message box:
RunWait Notepad
MsgBox The user has finished (Notepad has been closed).
Here's a small dialog to get some input from a user:
MsgBox, 4, , Would you like to continue?
IfMsgBox, No
return
; Otherwise, the user picked yes.
MsgBox You pressed YES.

Resources