How to send F1 key to 3270 terminal emulator using Microsoft HIS - 3270

I'm using Microsoft Host Integration Server (HIS 2006) to connect to 3270 IBM Mainframe terminal to send keys and get responses programmatically. But I am unable to send the F1 key.
If I am using the HIS server 3270 client manually pressing the F1 key will show me the next page of the response. After recording the manual process in the client I found out it sends #1 as a key programmatically as shown below. But it is not working when I send the key programmatically.
Here is the code snippet (I’m using the classes in Microsoft.HostIntegration.SNA.Session dll)
..
SessionDisplay handler = new SessionDisplay();
....
handler.SendKey("#1");
Does anyone know how to send F1 key programmatically using Microsoft HIS 2006 or which key to send to go from page to page in 3270 terminal emulator programmatically.

Setting the cursor position before sending the F1 key solved the problem

Related

How to trigger Whatsapp Desktop by html link in Windows Google Chrome

According to official Whatsapp documenttion, if you want to make a clickable html link that triggers a new chat window in Whatsapp, regardless of (1) the destination phone number being in your contacts or not and (2) of OS (works in Web, iOS and Android), all you have to do is create a link like this:
Click here to open Whatsapp
In Google Chrome / MacOs, if I have Whatsapp Desktop installed, as soon as I click that link, I get a new tab (due to target = blank) with an Whatsapp web page containing a button 'Click here to chat', but Whatsapp Desktop imediatelly intercepts the link and comes to the foreground and creates a new chat with that phone number. That's the behavior I'm hoping for.
On Google Chrome Windows, on the other hand, Whatsapp Desktop doesn't intercept the link, so Whatsapp's web page just sits there waiting for me to click the button. The problem is that every time you click the button, you have to wait for the full Whatsapp WEB (not desktop) to load, which takes forever, specially if use this feature all the time.
I tried using whatsapp:// syntax but it doesn't work in Windows (does nothing when clicked), and in MacOs it triggers Whatsapp Desktop but errors out unless you have that contact in your contact list already (api.whatsapp.com doesn't have this limitation).
In short: any way to make a clickable link that, on Chrome/Windows, will trigger Whatsapp Desktop instead of forcing the user to load (every time) whatsapp web?
Building on Anand's answer, here is a reg file that adds the necessary entries.
Note: Be sure to replace YOUR_USERNAME_HERE with, um, your real Windows user-name:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\whatsapp]
#="URL:whatsapp"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\whatsapp\shell]
#="open"
[HKEY_CLASSES_ROOT\whatsapp\shell\Open]
[HKEY_CLASSES_ROOT\whatsapp\shell\Open\command]
#="\"C:\\Users\\YOUR_USERNAME_HERE\\AppData\\Local\\WhatsApp\\WhatsApp.exe\" %1"
Taking cue from Rovann Linhalis's answer, following settings worked for me in Windows 10 Pro 1809 with WhatsApp Desktop Installed
In HKEY_CLASSES_ROOT create new key whatsapp
Then in HKEY_CLASSES_ROOT\whatsapp change default string value to URL:whatsapp
In HKEY_CLASSES_ROOT\whatsapp add new string value with value name URL Protocol and value data empty
New Key under HKEY_CLASSES_ROOT\whatsapp with name shell
In HKEY_CLASSES_ROOT\whatsapp\shell change default string value to open
New Key under HKEY_CLASSES_ROOT\whatsapp\shell with name Open
New Key under HKEY_CLASSES_ROOT\whatsapp\shell\Open with name command
In HKEY_CLASSES_ROOT\whatsapp\shell\Open\command change default string value to
"C:\Users\{YOUR-PC-USERNAME}\AppData\Local\WhatsApp\WhatsApp.exe" %1
Make sure to replace placeholder {YOUR-PC-USERNAME} with your username.
Example whatsapp://send/?phone=+{countryCode}{mobileNumber}&text=HELLO%20WORLD
To open whatsapp: // in windows, just add the following registry:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\whatsapp]
"URL Protocol"=""
[HKEY_CLASSES_ROOT\http\DefaultIcon]
#="C:\\Users\\[USERNAME]\\AppData\\Local\\WhatsApp\\WhatsApp.exe,0"
[HKEY_CLASSES_ROOT\whatsapp\shell]
#="open"
[HKEY_CLASSES_ROOT\whatsapp\shell\open]
[HKEY_CLASSES_ROOT\whatsapp\shell\open\command]
#="\"C:\\Users\\[USERNAME]\\AppData\\Local\\WhatsApp\\WhatsApp.exe\" \"%1\""
but I still have trouble starting a conversation after the last update.

How can i keep focus on my own application or regain it when lost in delphi? [duplicate]

I need to create a simple Delphi application, kiosk style.
It is a very simple thing, a single form where the user writes some personal info to register to an event. 4 TEdit and a TButton.
What I want to achieve is to avoid the user does any action different then typing in TEdit or clicking on the TButton. For example I don't want he does ALT TAB (switchin applications), pressing windows key on keyboard, doing ctrl-alt-canc, etc...
I can add a passowrd protected Button that enables/disables this "Kiosk mode", in this way as I need to exit the kiosk mode I simply press that button and exit.
How to achieve this "kiosk mode" in Delphi without intercepting all the keystrokes manually? Or did anyone already develop this so it can be shared?
I think you'd better create a new desktop, and run your app in there. When your app is done, you can bring back user's desktop. That is how Windows login screen works. Of course Windows login screen uses a special secure desktop. Your app in a separate desktop would be isolated. You will have a desktop background with no start menu, taskbar, or desktop icons because explorer.exe is not running there automatically. Of course a can start a new process, using Task Manager, but desktops in Windows are securable objects; therefore, you can make restrictions if you want. Of course if your app has sufficient permissions.
To create a new desktop, you can use CreateDesktop Windows API, and to switch to the newly created desktop, you can use OpenDesktop function.
You can try Change the Windows Shell.
When you start windows, you don't execute the default shell (explorer.exe), you can execute your application.
Al internet you can find alternative Shell (more attractive) to default windows like:
BlueBox or
SharpE
This option is used for purposes similars at the application that you are developing. Kiosks or TPV.
For change the default applicacion you must modify a registry key:
In Win3.x and Win9x, SYSTEM.INI file:
[boot]
shell=MiAplicacion.exe
In Win2k and WinXP, use Registry:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
Shell=MiAplicacion.exe
If you test this option, think the mode to turn the configuration to the original value (button or option). You must reboot to test changes.
ADDED: In addition, if you search on the web some similar at this "Delphi Change default windows shell", you can find more code, samples and information about this.
Regards
P.D: Excuse me for mistakes with english.
Well but if someone can open the taskmgr he could just create a new task and run explorer.exe from there so its not really secure though...
Ok Taskmgr can be stopped with policies...
Well and for disabling the cad sequence you can use saslibex which Remko Weijnen had created you can find it here: SASLibEx
kindest regrads,
s!

Sending a command from a web-browser to an app

I want to be able to send a stream of data from a user computer to a web-service. That should not be too hard - I would use an application written in dot-net that resides on a user's Windows computer.
However, the tricky part is that the stream-of-data should only be sent (by the app) when the user clicks on a button or a link in a WEB PAGE that is open in his browser. The app itself would be minimized in the system tray. And he should be able to stop the stream by clicking on a stop-button (or link) in that web page..
So I found some info on stackoverflow that says that you can put a link in your page, something like: [a href='alert:"Hello World" ' ] and if you register your application (in this example the app would be called "alert.exe") in the registry, then when the user clicks on the link, he will cause the application to start, and to receive "Hello World" as a parameter.
Anyway, there are complications in my case. I want to be able to tell the application when to start sending data, and when to stop sending data, without starting new instances of the application. If the user clicks START, and the app is already open, I don't want it to open again. I do want a message to go saying "start sending" and if the user clicks on a STOP button (or link) to say "stop sending". The user might click on these web-page buttons several times in a session, and I don't want to close and reopen the program each time.
So a couple of questions:
Am I taking the right approach? Would "plug-ins" be a better idea?
If I am taking the correct approach, is there some way to send commands from a web page to an application?
Is it safe to have my app modify the registry of user computers?
If so, is there a set of commands for doing that?
Is the registry supported by Windows 7, Windows 8, etc? I know it is not supported on a Mac.
Thanks in advance.
LL
P.S. (the info on launching apps from your browser was at: http://msdn.microsoft.com/en-us/library/ie/aa767914%28v=vs.85%29.aspx).

how to create DB in visual studio 2010 ultimate

i am using visual studio 2010 ultimate.i have problem to using sql server in VS 2010.i find server explorer in this but i do not know how to create a new connection and what are its authentications.how to create a new data base in server explorer.what is the name of server and authentication for it.please explain?
To connect to a database from Server Explorer
From the View menu, choose Server Explorer.
In Server Explorer right-click Data Connections and choose Add
Connection.
If this is the first connection you make, the Choose Data Source
dialog box appears. Under Data Source choose the kind of data source
to which you are connecting, and then under Data Provider choose the
appropriate provider for the application you are working with.
Finally click Continue.
In the Add Connection dialog box, enter the requested
information.
This information is different for each provider. For more
help on this tab, click the Help icon at the top of the dialog box or
press F1 with the dialog box selected.
Choose the Advanced button to open a list of settings you can change
for the selected provider.
Choose Test Connection to check the connection without closing the
dialog box. This way you can make adjustments to the settings if the
connection does not succeed.
Click OK.
Your connection appears in Server Explorer under the Data Connections node.

How can I know if the user is in Exposé mode?

Is there a way to find out if the user is in the Exposé mode? (i.e., all windows are being shown.) Thank you.
There's no public API for getting this information. What problem are you trying to solve?
You don't need this information. If the user is not in Exposé, F11 (or fn-F11) will enter Exposé. If the user is already in Exposé, F11 (or fn-F11) will exit Exposé. So just send F11 (or fn-F11) unconditionally.
The real challenge is determining the correct key command to send. On a laptop or small Apple Wireless Keyboard, the command may include the fn modifier, but on a desktop machine with a full-size keyboard, the command will more probably be F11 alone. Furthermore, it's user-configurable.
The correct way to toggle Exposé programmatically is a separate question.