Show the Windows 8 brightness slider via native c++ - winapi

I'm working on an app where I need to change the brightness. However, I want the user to be aware of the relative brightness by seeing the built in brightness slider they're used to. Also- this designed to run only on laptops or tablets so the displays should support programmatic brightness.
*Note: This image was stolen from this post.
I was hoping it would automatically show up when I changed the brightness programmatically but no luck there. I tried doing so with WmiSetBrightness() and with PowerWriteACValueIndex() but neither of them showed the slider.
TL;DR I want to programmatically invoke the slider to show the user what the current brightness level is. Any ideas?

Related

WinJs: Ignore Font scaling from Windows

I've developed a WinJs app for the Surface pro 4. The app Runs in fullscreen and is layoutet with the screen resolution of 2736x1824 (surface resolution).
Now when i start the App on the surface the DPI scaling comes into play and messes up my Layout.
Is there a way to disable the scaling for the app?
I've tried:
Windows.UI.ViewManagement.ApplicationViewScaling.trySetDisableLayoutScaling(true);
but that doesn't seem to work.
Actually, making your app layout only for one resolution, especially for such a big resolution is not really great idea since the app can run on device with, for example 1920x1080 resolution where even with DPI scaling disabled your layout will be messed up.
So I recommend making the app layout responsive so it will look right on every resolution.
Not sure if you're still looking at this issue but I've found that the code that you see all over the place is actually XBox only (Link To Docs)
And the Microsoft Devs have been saying for a while that it's a user based setting and they don't plan on allowing you to ds(Forum Link)
You can detect the scaling value though with ResolutionScale (docsLink)
Windows.Graphics.Display.DisplayInformation.getForCurrentView().resolutionScale
Here's a link to a sample that detects it and adjusts.
So what you can do (and what I did) was where needed I used css scale to adjust the system to fit. Most of my app is responsive so it didn't matter, but if you use an iFrame and set it to be 1000px wide with this scale factor it will actually be 1400px or even 1800px wide and totally cut off..
I have listeners setup for the resize events and just adjust as needed.
Hope that helps!
-Dennis

How to apply an effect on screen image in Windows on the fly?

I'm developing a Windows application that needs to apply an effect on screen image. More specifically, I need to do the following: grab a screen image, apply a gaussian blur on it, and display it on the screen. Something similar to f.lux, only in my case the effect applied is different.
Since I'm new in Windows development, I'd like to know what is the recommended way to do it? What libraries/frameworks should I use? Can you point to some code samples of similar applications?
Thanks!

How to test what a webpage/web app will look like with Firefox on a specific screen resolution

I have the task of testing a web application where it is given that this app should fit a screen with the resolution of 1280*1024.
My work monitor is, however, a 20 inch screen with resolution 1680*1050.
Will resizing the Firefox window to 1280*1024 meet the test criteria or should I always change the resolution of my monitor? (Obviously, the second option is not preferred).
And also: Is there a Firefox plugin which will help me to set the window size appropriately?
Sometimes asking the question out loud helps to realise what you really want :)
There is Firefox addon called More Display Resolutions which helps to show the page in given resolution, even in 1280*1024
After you install it, just go to Tools -> Web Developer- > Responsive Design View and here you can turn on the preffered resolution:
Ok, the above died. What now?
Since time of writing this answer I changed jobs and do not have to test specific resolutions. But I did quick google search and this site seems to be working: http://quirktools.com/screenfly/
Responsive Design Mode is a stock part of Firefox which is available from the Menu Bar: Tools -> Web Developer -> Responsive Design View in all Firefox versions (keyboard shortcut: Ctrl + Shift + M, (or Cmd + Opt + M on OS X)). No extension is needed to access this mode.
Within Responsive Design Mode, you can set the exact display area used for the webpage. There are several preset dimensions. Alternately, custom display dimensions can be used by either directly typing the dimensions in, or dragging the display to the size desired. What is being set is the pixel dimensions used for the area containing the display of the webpage.
These dimensions are not the same as setting the pixel dimensions used for the entire screen, which would include the Firefox user interface. If you set it to the dimensions of a specific physical display size it is the same as would be displayed using Full Screen mode (on desktop versions, keyboard shortcut F11). If you want to see what your page will look like including the Firefox user interface, you will need to determine how many pixels the user interface consumes at the screen resolution you are interested in and on the platform you are intending to use (e.g. desktop, Android, iOS). You will then need to use a custom display size. Note that the amount of room used for the Firefox user interface will depend on many factors which include—in addition to the OS and resolution of the physical display—any theme the user has installed, which toolbars the user has chosen to display, and, potentially, which add-ons the user has installed.
This is what Responsive Design Mode looks like:

Animate Windows Wallpaper with QT

i want to make an animated wallpaper for windows. So far i have only expreience with Mac OS X programming and i'm new to windows. So i decided to work with QT because it seems that there is more help out there.
Until now i have created the app in a borderless window in qt. It work quiet fine.
But is there a way in QT to change the level of the window so that its appear above the windows wallpaper but behind the icons?
EDIT:
Ok if found a simple solution.
After some testing with the hints form kusg1 I figured out when there is a transparent window mouse events going still to the desktop.
I actualy want have this website has wallpaper: Ticketack. - So i created a frameless window which stays on bottom and has a transparent background and displays the text. Beside this i can change the windows wallpaper directly to get the background of the clock.
So clock text is not behind the icons but i think this will be ok.
Just some ideas: Use the windows flag as Qt::Window | Qt::FramelessWindowHint + Windows Stay at bottom hint, and set the content of the widget with your animated content (the suitable candidate is to use QGraphicsView).
The widget needs two main tasks:
Upon launching, it grabs the desktop background as pixmap and do overlay with the animated content (this needs to have the desktop to be wallpaper-less for simple scenario).
The widget needs to capture mouse and focus event and channel back to actual window command if the user wants to click the icon on the desktop.
Update:
Some pointers for the implementation:
For managing desktop icon, there is a good article here! (also found from SO).
Qt example and demos has an example on the taking desktop snapshot, the snippet is: QPixmap::grabWindow(QApplication::desktop()->winId());
Answer to your question: no, there isn't.
However, you can try something like this using Windows API: How to draw directly on the Windows desktop, C#?

Control screen brightness in WP7

Is is possible to control the brightness of the screen on the WP7? The app I am making would be so much better if the user could change the brightness of the screen without having the leave the app.
No, this isn't a "flashlight" :)
It is not possible to control this programatically with the current SDK.
The user has exclusive control over the brightness setting.

Resources