Hotkey to run program in SAS? - sas

I know in R I can use control+r to run my program code. I am wondering if there is an equivalent hotkey in SAS? If not, is there a way to 'program' one into SAS?

The default hot key for run (submit program) is the F8 key.
If you're using Base SAS (not EG), then you can type 'keys' into the box in the upper left hand corner, or by default hit F9, and bring up a window where you can set most of your hotkeys. You can also customize the toolbar buttons at the top of the window by right clicking on the toolbar and selecting 'customize'.
See http://www2.sas.com/proceedings/sugi28/240-28.pdf for more options.

Related

Disabling menu compression in MFC

My English is not perfect. I am using Visual C++ 2019 and MFC. At my MDI-program, the menus are compressed: I do not see all the items, there is a double-arrow-like something on bottom of the menu, I always must click to them. I can not disable this. At Resource View, I can not open the whole menu's Properties Page, only for the File, etc. menu's Properties Page. I did not find the disabling on the Properties Page. In the code, in MainFrm.cpp, CBRS_SIZE_DYNAMIC and CBRS_FLYBY occur 2+2 times. I tried to put to comment them, but this did not solve the problem. How can I disable the compression? Thank you.
I can not open Properties Page of the whole menu. Maybe it has not Properties Page, or the cause is the lack of High DPI support in Visual Studio. For example, I can not edit icons: the icon editor is unusable. At the generated program, it seems the High DPI support of toolbar is depend on the style. At WinAPI programs, there are 3 pixel stairs: emulates 1/3 resolution. There is 3*96 dpi = 288 dpi at me, 0,16 mm * 3 = 0,48 mm.
Use CMFCMenuBar::SetShowAllCommands
Remarks
If a menu does not display all the menu commands, it hides the commands that are rarely used.
Whether the application should display all menu items or just the most recently used ones (and the user will have to expand the rest) is an option that can be set by the user: Toolbar Options->Add or Remove Buttons->Customize->Options->Personalized Menus and Toolbars->Menus show recently used commands first. This option is saved in the registry under HKEY_CURRENT_USER\SOFTWARE\CompanyName\ApplicationName\Workspace\MFCToolBarParameters\RecentlyUsedMenus, so the application "remembers" it.
Programmatically it can be changed using the CMFCMenuBar::SetRecentlyUsedMenus() function - it's a static function.
It would be best to let the user decide how the application should work, so I would recommend that you do... nothing about it. Or, you could set it to FALSE, but only for the very first time the application is run. Add a new boolean value in the registry, under ...ApplicationName\Workspace or ...ApplicationName\Settings, with a value always set to TRUE. The best place to do this is the SaveCustomState() member function of your application class. In the LoadCustomState() read that value (default FALSE), and if it is TRUE call CMFCMenuBar::SetRecentlyUsedMenus(FALSE);.

Menu shortcuts in Unix-based systems

In Stata one can programmatically create a menu entry for a dialogue box or a program as follows:
window menu append item "stUser" "&Pearly's Program" "db myprogram"
In addition, by using the character & before P, a shortcut is also created.
This can subsequently be activated simply by pressing Alt + P.
Nevertheless, as Stata's Resources and Support online FAQ states:
"Note: The ampersand & that appears ... is a Windows-only feature..."
Is there a way to assign shortcuts for menu items in Unix-based
versions of Stata (macOS, Linux)?
The only way I have come up with so far is to assign a shortcut using a function key (say F5):
global F5 "db myprogram;"
Note that the semi-colon tells Stata to also press enter.
For persistent assignment, the aforementioned code line should be included in the profile.do file.
This ensures that it is executed every time Stata starts.

Set Key to submit selection in editor and make editor the active window again

I am trying to configure the F3 key so that it
Submits code in the editor window (either all or selection)
Updates the results window
Put focus back on the editor/or let focus remain in editor
The default behavior of the F3 button is to submit the code in editor, but then to focus on the results window, forcing me to reach for the mouse, to continue editing.
I have tried to configure F3 key like this but it does not work, because focus is on results windows after submitting:
F3 submit; wpgm ;
Any ideas?
I'm using:
SAS 9.4 TS Level 1M3
X64_8PRO platform
Windows 10
I think this is also called "Display Manager", although I used to refer to it as SAS Base.

How to make SAS to open with maximized window?

How to make SAS to open with the main window and the editor window automatically maximized?
One way to do this is to push the command AWSMAXIMIZE at startup. You could place this statement in your autoexec.sas
dm "awsmaximize";
I was also able to do this by editing the start menu entry and adding to the end of the SAS command: -initstmt "dm 'awsmaximize';"
More here: http://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/viewer.htm#a000115355.htm#win-af-wincmds
Not sure if you can do this automatically at startup, but you can set a hotkey to do it.
Tools -> Options -> Keys
Choose a key and type this into the command:
AWSMAXIMIZE ON; WPGM; ZOOM
"AWSMAXIMIZE ON" is the SAS for Windows command to maximize itself.
"WPGM" is the command to bring focus to the Enhanced Program Manager
"ZOOM" is the command to maximize the in-focus window.

Capturing keyboard input without focus on the programwindow

I am doing a VoIP client and I want to start/stop on WM_KEYDOWN and WM_KEYUP messages for a certain input, say K. When the main window has focus, this is np, but how do I enable it outside of the window? For example, if the window is not in focus and I'm just looking at the desktop or am in a videogame. How does one perform something like this? I am not sure where to begin.
Also -- I guess you somehow has to poll every input even outside the program, is that expensive?
win32 c++ btw
You need to install keyboard hooks: http://msdn.microsoft.com/en-us/library/ms644990(v=VS.85).aspx
This can be very troubling though for every running application if something steals its keyboard messages.
I don't think you want this - if I'm typing a document into Word and I hit K, I'm going to be very angry when your application pops up instead of a "k" appearing in my document.
Windows allows you to assign shortcut keys to an icon on the desktop, but it limits them to the function keys or to combinations containing both Alt and Ctrl. Right-click on a desktop icon and go to Properties, and look for the field marked "Shortcut key".