We have an application that draws a colored border around specific application windows and dialogs.
We use GetWindowRect to get the rectangle of an application window. But on Windows 10 this function includes the shadowing border resulting in a large gap between our colored border and the application window. So we need to compensate for the shadowing border.
Which API can we use to determine the width of the shadowing border around application windows and dialogs in Windows 10?
I found the solution. Use DwmGetWindowAttribute with DWMWA_EXTENDED_FRAME_BOUNDS to get the correct size:
DwmGetWindowAttribute(hWnd, DWMWA_EXTENDED_FRAME_BOUNDS, &rect, sizeof(rect));
Related
how do i change FlxG width and height in runtime as resizeGame doesn't do anything
i have the project by default set to 1600 x 900 and i have a state for settings where i can change the resolution and have managed to make it so that i can change what the width and height will be on startup however i want to be able to resize it during runtime so it will be higher/lower res.
the problem is since FlxG width and height aren't modifiable directly so resizeGame is the only option but it doesn't do anything, even after calling it and tracing FlxG width and height there is no difference nor is there any visual difference asside from the game being offset to the very top left corner of the window and messing up detecting where the mouse is until i maximise and restore down where it goes back to normal
does anyone have any idea why this isn't working and how i should go about fixing it
i'm compiling to c++ (windows)
edit: it has been a couple of months and i have started mostly rewriting the program and yet this issue is still a thing on a fresh start and i am in serious need of an answer
I wonder about this bottom and left gap, and also wanna remove it
It occurs only when i open "vim", not Iterm itself
Is there any solution?
The general principle is that the screen of a terminal emulator is a grid where each cell has the same dimensions as the others and those dimensions are determined by the font and font size used. If the window's dimensions and the grid's dimension are incompatible, then the window can't be filled with the grid and you have that kind of gap.
In this case, the cell dimensions are 16px * 38px so the grid can only fit in a box whose dimensions are a multiple of 16 in width and a multiple of 38 in height.
Now, your screen's dimensions appear to be 1630px * 2862px, which is rather unusual. The width is not a multiple of 16 and the height is not a multiple of 38, so, with your current font settings it is impossible to fill the screen.
For that to be theoretically possible, you would need font settings that make individual cells 16.3px wide and 38.16px tall, or some other "impossible" ratio.
Note that you also have a padding, here, that effectively prevents the grid to ever fill the window anyway.
None of that is really a problem when the program you run in your terminal emulator doesn't paint the background of those cells but your Vim colorscheme does, which makes the effect described above apparent.
The only practical workarounds are:
Define the same background in Vim and in your terminal emulator.
Make Vim's background transparent.
I'm using Xamarin, writing for iOS.
I'm trying to make keyboard view with numbers,
it will be 4x4.
How can I make that 4 buttons in line will be same width depending on screen width?
Edit: Seems like it can be done that way: make layout with hardcoded height, and width constraints calculate in runtime.
I am developing an app using Qt 5.5
I have a main window with a dock, and a dockable window which can be dragged out/popped out, floating in its own separate window. (QDockWidget)
The resize border width of the main window is perfectly adequate, so resizing the main window using the mouse is very easy.
Resize margin width of main window (ie: when docked):
The space within the red border here represents the area where the mouse cursor changes to a resize cursor.
Resize margin width of undocked window (ie: when hovering):
When I pop out my docked window (QDockWidget), so that it's now floating, the resize border width drops down to a single pixel
As such, it is almost impossible to resize a floating dock window.
I am running Ubuntu Gnome 14.04, so using Gnome 3 with (I think?) Adwaita theme.
I have tested this on default Ubuntu 14.04, so using Unity, and this is not an issue there (the resize border width is several pixels, so much easier to "find" with the mouse)
Question:
How can I configure Gnome 3 / Adwaita to increase this border width?
I have a chart show info of apps, but when run it on devices android. The position of text on chart not consistently.
These images illustrate the problem: https://drive.google.com/folderview?id=0B7-CxJHQ5ZnjYjVlTlFQdElWRGM&usp=sharing
I use TextLabelWidget in AndroidPlot. How to keep position of TextLabelWidget on chart with the same image1 in link above on devices?
The problem appears to be that your plot area is set to fill the width of the screen and since the bars are evenly distributed in that space, their x positions are essentially fractions of the screen width.
At the same time you have labels that appear to be positioned using absolute positioning. As an example, this code will position 4 labels at 0%, 25%, 50% and 75% screen width, 80 pixels down from the top of the screen:
txtWidget1.position(0, XLayoutStyle.RELATIVE_TO_LEFT, PixelUtils.dpToPix(80), YLayoutStyle.ABSOLUTE_FROM_TOP, AnchorPosition.LEFT_TOP);
txtWidget2.position(0.25f, XLayoutStyle.RELATIVE_TO_LEFT, PixelUtils.dpToPix(80), YLayoutStyle.ABSOLUTE_FROM_TOP, AnchorPosition.LEFT_TOP);
txtWidget3.position(0.50f, XLayoutStyle.RELATIVE_TO_LEFT, PixelUtils.dpToPix(80), YLayoutStyle.ABSOLUTE_FROM_TOP, AnchorPosition.LEFT_TOP);
txtWidget4.position(0.75f, XLayoutStyle.RELATIVE_TO_LEFT, PixelUtils.dpToPix(80), YLayoutStyle.ABSOLUTE_FROM_TOP, AnchorPosition.LEFT_TOP);
There are some other factors that you are also probably going to need to deal with such as bar width but this should get you closer. You may find this doc useful as far as a guide for the different positioning methods.
Another tool to consider using if you aren't using it already is the Configurator. This will let you set your positions etc. inside xml and override values based on screen size, orientation, etc.