Outlook font size for add in - outlook

I need help with the text size for my outlook add in.
I have a table view in my add in which is unreadable with bigger screen resolutions. Is there a way to zoom so the font size gets bigger?
With a selected email from my inbox it is possible to zoom with the zoom slider in the bottom right corner. Is there a way to activate the zoom slider at any time? Or is there any way to access and change/set the font size outside of the email body?

It looks like your add-in is not DPI-aware. Desktop applications using older Windows programming technologies (raw Win32 programming, Windows Forms, Windows Presentation Framework (WPF), etc.) are unable to automatically handle DPI scaling without additional developer work. Without such work, applications will appear blurry or incorrectly-sized in many common usage scenarios. To make things working better you must read the following articles:
High DPI Desktop Application Development on Windows
Writing DPI-Aware Desktop and Win32 Applications
Most probably the table view is used on a windows form, see Automatic scaling in Windows Forms for more information.

Related

Set a window as destop background (Windows)

is there any way to place a window behind the desktop icons or as the backgroud of the desktop?
For example I have a window and I want it to always in the back and below the destop icons.
No. Background is background, and is controlled by Windows itself, mostly through theme engine. You can put at best a slideshow - changing wallpaper roughly through API is not so smooth and often produces a flash, while slideshow use transition effects.
It was possible to display web pages in older Windows versions (it was named "Active Desktop"), but it's long dead now because of obvious security reasons.
Otherwise, everything you can create with an application will be ABOVE desktop icons. By design.
You can anyway use some programs that can somewhat perform suitable behavior:
SysInternals BgInfo: Allow to display various informations as an overlay to current wallpaper. Can display various system informations. Can also save you from creating some purely static display components for next tool.
Rainmeter: Allow to heavily customize your desktop with skins and "widgets" - they are still above icons, so see next one.
Desktop Restore: Allow to save/restore icons' positions for multiple configurations / resolutions. Can allow you to let Rainmeters' components in "blank" zones, free of icons.

Scaling the non-client area (title bar, menu bar) for per-monitor high-DPI support

Windows 8.1 introduced the ability to have different DPI settings for different monitors. This feature is known as "per-monitor high-DPI support." It persists and has been further refined in Windows 10.
If an application does not opt in (i.e., is either DPI-unaware or high-DPI aware), it will be automatically scaled up by DWM to the proper DPI. Most applications fall into one of these two categories, including most of the utilities bundled with Windows (e.g., Notepad). On my test system, the high-DPI monitor is set to 150% scale (144 DPI), while the normal monitor is set to the system DPI (100% scale, 96 DPI). Therefore, when you open one of these applications on the high-DPI screen (or drag it over there), virtualization kicks in, magnifying everything, but also making it incredibly blurry.
On the other hand, if an application explicitly indicates that it supports per-monitor high-DPI, then no virtualization is performed and the developer is responsible for scaling. Microsoft has a fairly comprehensive explanation here*, but for the benefit of a self-contained question, I'll summarize. First, you indicate support by setting <dpiAware>True/PM</dpiAware> in the manifest. This opts you into receiving WM_DPICHANGED messages, which tells you both the new DPI setting as well as a suggested new size and position for your window. It also allows you to call the GetDpiForMonitor function and obtain the actual DPI, without being lied to for compatibility reasons. Kenny Kerr has also written up a comprehensive tutorial.
I've gotten all of this going successfully in a little C++ test app. It's a lot of boilerplate and mostly project settings, so I don't see much point in posting a full example here. If you want to test it out, either follow Kenny's instructions, this tutorial on MSDN, or download the official SDK sample. Now, the text in the client area looks good (because of my handling of WM_DPICHANGED), but because virtualization is no longer performed, there is no scaling of the non-client area. The result is that the title/caption bar and the menu bar are the wrong size—they do not get larger on the high-DPI screen:
So the question is, how do I get the non-client area of the window to scale to the new DPI?
It doesn't matter whether you create your own window class or use a dialog—they have identical behavior in this respect.
It has been suggested that there is no answer—that your only choice is to custom draw the entire window, including the non-client area. While this is certainly possible, and indeed what UWP apps (those previously known as Metro) do, like the Windows 10 Calculator, it is not a workable option for desktop applications that use many non-client widgets and hope to look native.
Aside from that, it is demonstrably false. Custom-drawn title bars cannot be the only way of getting the correct behavior, since the Windows shell team has done it. The humble Run dialog behaves exactly as expected, properly resizing both the client and non-client areas as you drag it between monitors with different DPIs:
Investigation with Spy++ confirms this is just a bog-standard Win32 dialog—nothing fancy. All of the controls are standard Win32 SDK controls. It is not a UWP app, nor have they custom-drawn the title bar—it still has the WS_CAPTION style. It is launched by the explorer.exe process, which is marked as per-monitor high-DPI aware (verified with Process Explorer and GetProcessDpiAwareness). This blog post confirms that both the Run dialog and the Command Prompt have been rewritten in Windows 10 to scale correctly (see "Command shells et al."). What is the Run dialog doing to resize its title bar?
The Common Item Dialog API, responsible for new-style Open and Save dialogs, also scales correctly when launched from a process that is per-monitor high-DPI aware, as you can see when clicking the "Browse" button from the Run dialog. Same thing for the Task Dialog API, creating the odd situation where an app launches a dialog box with a different-size title bar. (The legacy MessageBox API has not been updated, however, and exhibits the same behavior as my test app.)
If the shell team is doing it, it has to be possible. I just cannot imagine that the team responsible for designing/implementing per-monitor DPI support neglected to provide a reasonable way for developers to produce compatible applications. Features like this require developer support, or they are broken out-of-the-box. Even WPF applications are broken—Microsoft's Per-Monitor Aware WPF Sample project fails to scale the non-client area, resulting in a title bar that is the wrong size. I'm not much for conspiracy theories, but this smells of a marketing move to discourage desktop app development. If so, and there is no official way, I'll accept answers that rely on undocumented behavior.
Speaking of undocumented behavior, logging window messages when the Run dialog is dragged between monitors with different DPI settings shows that it receives an undocumented message, 0x02E1. This is somewhat interesting because this message ID is exactly one greater than the documented WM_DPICHANGED message (0x02E0). My test app never gets this message, though, regardless of its DPI-awareness settings. (Curiously, close inspection does reveal that Windows slightly increases the size of the minimize/maximize/close glyphs on the title bar as the window moves onto the high-DPI monitor. They're still not as big as they are when they are virtualized, but they're slightly bigger than the glyphs that it uses for unscaled system-DPI applications.)
So far, my best idea has been to handle the WM_NCCALCSIZE message to adjust the size of the non-client area. By using the SWP_FRAMECHANGED flag with the SetWindowPos function, I can force the window to resize and redraw its non-client area in response to WM_DPICHANGED. This works fine to reduce the height of the title bar, or even remove it altogether, but it will never make it any taller. The caption seems to peak out at the height determined by the system DPI. Even if it worked, this wouldn't be the ideal solution, because it wouldn't help with the system-drawn menu bar or scroll bars…but at least it would be a start. Other ideas?
* I know that this article says "Note that the non-client area of a per monitor–DPI aware application is not scaled by Windows, and will appear proportionately smaller on a high DPI display." See above for why that is (1) wrong and (2) unsatisfactory. I'm looking for a workaround other than custom-drawing the non-client area.
In any up-to-date Windows Insider builds (build >= 14342, SDK version# >= 14332) there is an EnableNonClientDpiScaling API (which takes an HWND as its argument) that will enable non-client DPI scaling for top-level HWNDs. This functionality requires that the top-level window be running in per-monitor DPI-awareness mode. This API should be called from the WM_NCCREATE handler for the window. When this API is called on a top-level window, its caption bar, top-level scrollbars, system menu and menubar will DPI scale when the application’s DPI changes (this can happen when the app is moved to a display with a different display scaling value or when the DPI changes for other reasons such as the user making a settings change or when an RDP connection changes the scale factor).
This API does not support scaling non-client area for child windows, such as scroll bars in a child window.
To my knowledge there is no way to have non-client area DPI scale automatically without this API.
Note that this API has not yet been finalized, and it may change prior to being released in the Windows 10 Anniversary update. Keep your eye on MSDN for official documentation when it becomes final.
With Per Monitor V2 DPI awareness in Windows 10 Creators Update (build 15063) you can resolve this easily without the EnableNonClientDpiScaling.
To enable Per Monitor V2 DPI awareness, while still supporting old Per Monitor DPI awareness on older Windows 10 builds and Windows 8.1 and DPI awareness on yet older versions of Windows, make your application manifest like this:
<assembly ...>
<!-- ... --->
<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>True/PM</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2,PerMonitor</dpiAwareness>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
References:
High DPI Improvements for Desktop App Developers in the Windows 10 Creators Update – video (archived)
Application Manifests – reference
High DPI Desktop Application Development on Windows – documentation
Note that in WinForms targeting .NET 4.7 and later, you can achieve the same by adding
<add key="DpiAwareness" value="PerMonitorV2" />
to <System.Windows.Forms.ApplicationConfigurationSection> tag in app.config. I assume that in the end, this change modifies the manifest in the target binary as described above.

Adding custom Button to AppBarButton in Windows Phone 8.1

Just getting into Windows Phone 8.1 development.
I quite like it but I am struggling getting accurate development info.
I am working with the Page.BottomAppBar.
I want to use an png image I have created as one of the buttons.
Does this image I created have to be:
A certain size
A certain format
A certain choice of colors i.e. i can use multiple colors and not just black and white
I am looking to create a 'Login' button you see.
thanks
Please, check the official Microsoft guidelines for app bars for Windows store and guidelines for windows phone. Guidelines cover icons, sizes and formats. It's better to follow them in designing visual style of your app.

Porting a GUI from a pc to a wince device - issue is with the size of the screen

I have to port a GUI that is currently running on a pc, to a wince device. I have already compiled the code on a win CE platform, the problem is now with the size of the screen of the device which is smaller than some of the dialog boxes of the GUI. I could resize some them in resource view of visual studio 2005. I am unable to proceed further as a lot of screens have bitmaps mapped to them and i cannot just resize the dialog boxes without changing the corresponding bitmaps.
What is the best way to proceed- my last resort would be to disable the bitmaps and redraw them at a later stage.
is there some method of automatically mapping the size of the screen to all the dialog boxes so that they would automatically resize (alongwith the assocaiated buttons etc)
Honestly I think my advise would be to stop and think about the differences between the two contexts before event considering how you would scale the interfaces.
PCs and phones have completely different interaction paradigms and simply scaling from a PC to a phone is very unlikely to work. Even if you could, it's likely to produce an unsatisfactory user experience.
I would expect that the best way to proceed is to sit down and draft up a new UI for the phones. Then bring you back ground code across from the PC and code up the interface part to work with the new UI. If you code is designed according to MVC principles then you are just looking at recoding the controllers and redesigning the views.

Which APIs can be used to display different desktop wallpapers on a multi-monitor system?

It seems Windows is unable to display different background images on different monitors on a multi-monitor system out of the box. But I noticed there are quite a few commercial applications available which provide this feature.
Which APIs can be (mis-)used to provide this functionality? If there's no special API for this feature, can it be done by hooking into another Win32 API function? If so, which one?
You could also try to programaticaly create an image the size of the virtual desktop joining several images making the divide fall where each monitor ends and then set that image as a wallpaper.
Simple and low tech.
Wallpaper replacement applications on Windows don't hook into the Windows API, they make a window the size of the desktop and render an image on it. There's APIs in Win32 to make such a window unclickable and living below everything else, and sized correctly for the desktop.

Resources