Pressing "enter" to close MsgBox is simultaneously pressing "enter" on window - windows-10

I use a Java app in Windows that wants to stay in the foreground.
When I'm using this software, and my ahk MsgBox pops up and I press "Enter" on my keyboard to get rid of it, then this piece of software thinks I'm trying to press Enter there, too.
So, my Enter command is going to both the MsgBox (which I want) and that piece of software (which I don't want).
How can I get my ahk MsgBox to take priority and monopolize that Enter keystroke?

Related

Can't press enter in jshell on Linux-terminal

I'm using Xubuntu. When I start jshell in the terminal, I doesn't recognize when I press the enter key. Every other key gets detected normaly. Any suggestions how to fix that?
Solution for laptop users without an number pad on their keyboard:
Plug in an extra keyboard with a number-pad.
Start jshell, try to press enter on your laptop keyboard.
If it still doesn't work: On the extra keyboard: press "Num" key with which you activate the number pad.
Now pressing enter on your laptop keyboard again.
It should work now, otherwise turn the numberpad off and on again and repeat step 4.
Don't know why it works that way, but it does.
Write the following in your terminal:
numlockx on
Now it will work. To make this permanent, let Xubuntu execute this after booting.

Changing the window style of a shelled program

In Excel VBA, is it possible to change the window style of a shelled program?
Here's the situation in detail:
At the click of a command button, the user should be able to load a third-party scanning program. The software path and file are specified in a named cell called settings_scanningsoftware, as you can see below. However, I'm using the Shell program, which doesn't wait for the third-party software to load before continuing. If it did, my life would be easier. For that reason, I throw up a dialog box in Excel telling the user to wait for the software to load and then ready the item to be scanned before they click Ok. And, since I throw up a dialog box, I load the scanning program minimized so they can see the dialog box (instead of it being hidden behind the software window and they're wondering why nothing's happening). With me so far?
However, once they click Ok, I want Excel to give control to the scanning software and give it a regular-sized window. There's my problem: once the software is loaded minimized, I can't seem to change the window style to give it a regular window.
Here's my code:
On Error Resume Next
Dim ScannerShell As Integer
ScannerShell = Shell(Range("settings_scanningsoftware").Value, **vbMinimizedNoFocus**)
If (ScannerShell <> 0) Then
Dim MessageBoxValue As Integer
MessageBoxValue = MsgBox("When you're ready to scan the receipt, click Ok.", vbOKCancel, "Scan receipt")
If (MessageBoxValue = vbOK) Then
ScannerShell = Shell(Range("settings_scanningsoftware").Value, **vbNormal**)
AppActivate ScannerShell, False
SendKeys ("{TAB}{TAB}{TAB} ")
End If
End If
Notice I've got the vbMinimizedNoFocus bolded above so that the software loads minimized and the user can see the upcoming dialog box. Once they click Ok, though, the software's window should be normalized. But Excel won't do me that favour.
Is there a way to change the window style after it's loaded?
Never mind the SendKeys command. I put that in there to get the scanner to automatically scan once everything is in place (the key sequence is incomplete, but one problem at a time). I know SendKeys is not a great way of sending commands to a program, but I'll figure that out once I get this window style thing fixed.
Does anyone have any solutions for me? Thanks.

How to simulate keyboard button in Bash

I have to simulate button press in my script.
I have a big application running in which I have to put some values in some fields and press enter so proceed to next panel and so on.
I got idea about simulating ENTER using echo "\n", but unable to find out how to simulate buttons like Function keys, arrow keys and pressing alphanumeric characters.
Any idea will be helpful
You can use expect to do this.

Visual Basic 2013 - Pressing ALT gets me out of code

I just installed my Visual Basic and this is a problem I couldnt find an answer to. Everytime I press ALT it gets me out of code, and because I use SHIFT+ALT to change keyboards a lot while writing code, this is really disturbing to have to click in code again to be able to write.
Any ideas ?
Are you referring to the normal Windows way of accessing the menu via keyboard? This has nothing to do with Visual Studio; it will work similarly in almost any Windows application.
E.g. pressing Alt+F will open the File Menu etc. Just pressing Alt will highlight the menu (you should see the shortcut letters underlined for each item) and pressing a letter key will then open the menu. Instead, press Alt again to return to what you were doing before.

Dialog menu not receiving Enter key

I’m currently writing an MFC dialog app which has a menu. The menu displays correctly and the menu entries work correctly via mouse, accelerators, and hotkeys (e.g., to quit: Ctrl+Q or Alt+F,Q).
Unfortunately, the Enter key doesn’t seem to work. That is, pressing Alt+F will open the File menu and pressing ↑ will highlight the Quit entry, but pressing Enter will not select it.
I know that using menus in dialog apps can be a bit tricky, but I’ve done this successfully before. However, that was a long time ago with a customized VS wizard, so I am trying to remember how to do this from scratch. I tried checking my old code, but could not find anything in reference to VK_RETURN. (No, there’s nothing special in PreTranslateMessage.)
These two questions are related, but they want the dialog to receive the key, I need the menu to get it.
Does anyone know what the problem is and how to fix it?

Resources