I know it is possible to change the console font size under settings, however, that is very tedious. Example
How do I change the console/terminal font size using shortcuts?
Not currently possible, please vote for IDEA-116253 to be notified on any progress with this feature
Related
At the start of the program I want to set width and height of window, as well as font size. I can do this manually in settings but I would like to do it in code. I wont need to resize window after its dimensions are set.
This doesn't have to be in windows.h, but I'd prefer it that way.
Yes. I recommend taking a look at the win32 console API docs. In particular you can use SetCurrentConsoleFontEx to change the font, and a combination of SetConsoleScreenBufferSize and SetConsoleWindowInfo to change the console size. Make sure to read the Remarks section of SetConsoleWindowInfo for why the screen buffer size must be updated as well.
Is it possible to resize the console in a windows console application to fullscreen size?
It is possible to do that in the preferences of the windows, after the console was opened, but I cannot figure out how to do it programmatically.
You can get a handle to the console window using GetConsoleWindow.
Once you have that, you should be able to resize it using SetWindowPos
You may also need to resize the buffer for the console using SetConsoleScreenBufferSize prior to resizing the window.
ETA:
Others have mentioned using SetConsoleDisplayMode to display the console in full-screen (non-windowed) mode. I'm not sure if this is really what you wanted or not though. I haven't seen any apps use non-windowed mode since the windows 98 days.
My software Pomodoro Timer is going to display a dynamic icon on Windows 7 taskbar. You may wonder why the application icon need to be dynamic. It's actually a counting down timer for me to help me focus on current task, so called the pomodoro technique:
My way to change the icon is to simply change the Window icon. It works fine when I start the application, but after I pinned it to taskbar, it will display the default icon for the application. The dynamic counter down number will disappear. More worse, after I unpinned it from taskbar, the default behavior will never be recovered, that is, the dynamic icon will not able to be updated correctly. When I start the application again, it will display the default icon, unless I pinned it and unpinned it again, the counting down icon displays again.
I've searched this forum, and Change pinned taskbar icon (windows 7), and tried to change the overlay icon. It works, but not fulfill my requirement, the overlay icon can only display 16x16, and no enough room to display 4 digits.
I also read the MSDN article Application User Model IDs, but i am still not clear whether it can make it or not.
Anyone can help on this? Thanks a lot!
Windows 7 supports having a green progress bar be shown over an icon, and pinning doesnt effect the progress bar. So, instead of changing the icon every second, why not change it every few seconds, but have the progress bar count down from 100% of the original set counter value?
The pinned items in the Taskbar are stored as a shortcut at:
%appdata%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar
You can try changing the icon of the Shortcut of your program.
My final solution is:
on Windows: use icon overlay. You can get more screen shots here.
on Mac: use different icon. You can get more screen shots here.
I use different solution for Windows and Mac.
Generally an application would make use of the System Tray to show interactive state such as this to the user. There is a whole API set for interacting with it, setting icons, menus, providing text feedback (balloons), and so on.
The following is a good article on how such functionality can be achieved:
http://www.codeproject.com/Articles/74/Adding-Icons-to-the-System-Tray
I'm making a random number generator, the program will create several random numbers and then choose from those random numbers and then displays that number in the window.
I was wondering if there was a way to make that specific piece of text bigger?
I don't want to change the size of all of the text in the window as I have writing in the window that i don't want to change the size of
Thanks for any help you can give
No, but you can make it bold, change the font color, or the background color for the specific text. If all you want is to make that specific piece of text stand out, I'd go with colorizing it.
As for how to do that... It's platform dependent. What platform are you on? Windows? Linux? What shell?
Take a look at the Windows Console API. That should have what you need.
Console text doesn't allow for the rich formatting you are referring to. You would have to move to a graphical output to render the size differences.
Generally, programs can't control the size of the text in the terminal. You may be able to change the color of a specific part of the text, though. Search for terminal escape sequences for information on how to do that on various terminals. Some terminals also handle bold, italics, and underlining.
No, but instead you can change colors of text and text's background. Will this be a good solution for your problem? There are a lot of specific examples available in the internet.
A possible console mode solution could involve FIGlet. You can tweak the output to write in many different fonts.
The output is larger, but no guarantee that it's suitable for your application.
open your console app, go to system menu of console window (left top corner, right click), font tab, choose what you wish. next time you open this (!) console app the font will be as you selected, other console windows are not affected
Right Click the top bar of the window
Click Properties
Click Font and select your font size
This isn't through the code but it will help for your pc.
How to scale font sizes based on current DPI settings in VC++/MFC applications ?
As of now when I change the DPI from 100% yo 150% the font sizes remain the same, although the icons will scale down based on the current dpi ..
Please suggest the best way for above problem.
In Windows Vista and 7, the OS tries to hide the DPI from your program and does adjustments behind the scenes. If you want your program to react properly to DPI changes you must follow the guidelines from Microsoft titled Creating a DPI-Aware Application.
By specifying the text and control sizes in DLU's. That happens by default though, so I assume you are generating dialogs dynamically or from a memory-based DLGTEMPLATE. If you, you're (pardon my French) screwed, because you'll have to muck about with converting DLU's to pixels, a very painful and tedious process. Read the following KB articles:
http://support.microsoft.com/default.aspx?scid=kb;en-us;125681
http://support.microsoft.com/default.aspx?scid=kb;en-us;145994
Don't use DPI for font scaling. Instead, use the settings the user has configured in the "Appearance" section of Control Panel.
You might also want to consider making the font size configurable for just your application.