mirror of
https://github.com/WCBROW01/WinPowerDMS.git
synced 2025-12-12 02:18:05 -05:00
Compare commits
4 Commits
01727c04f0
...
v0.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
| cedb800012 | |||
| 5911ca0100 | |||
| e4157e70b3 | |||
| a5555b4ee1 |
@ -2,9 +2,9 @@
|
||||
|
||||
A utility for switching the resolution of your laptop's display based on the current power state.
|
||||
|
||||
Currently a work in progress. Not very useful yet since it doesn't save your preferences. It doesn't even have an icon.
|
||||
Currently a work in progress. It works reasonably well for a standard single display configuration, but other scenarios have not been extensively tested, and there are some edge cases that may need to be worked out.
|
||||
|
||||
This is a simple C program written using Visual Studio 2022 that has no external dependencies. It should support Windows Vista or higher, but this hasn't been tested yet.
|
||||
This is a simple C program written using Visual Studio 2022 that has no external dependencies. It supports Windows Vista or higher.
|
||||
|
||||
## TODO
|
||||
- [x] Save preferences to the Windows registry.
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define _WIN32_WINNT _WIN32_WINNT_VISTA
|
||||
#define NTDDI_VERSION NTDDI_VISTA
|
||||
|
||||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
#include <shellapi.h>
|
||||
@ -333,7 +337,7 @@ static LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM l
|
||||
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||
}
|
||||
|
||||
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
|
||||
int WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nShowCmd) {
|
||||
if (!LoadPrefs()) { // set both battery and AC to current display mode if there are no preferences set
|
||||
DISPLAY_MODE currentMode = GetCurrentDisplayMode();
|
||||
userPrefs.modeAC = currentMode;
|
||||
|
||||
@ -82,9 +82,10 @@
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>ComCtl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<MinimumRequiredVersion>6.0</MinimumRequiredVersion>
|
||||
</Link>
|
||||
<Manifest>
|
||||
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
|
||||
<EnableDpiAwareness>true</EnableDpiAwareness>
|
||||
</Manifest>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
@ -100,9 +101,10 @@
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>ComCtl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<MinimumRequiredVersion>6.0</MinimumRequiredVersion>
|
||||
</Link>
|
||||
<Manifest>
|
||||
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
|
||||
<EnableDpiAwareness>true</EnableDpiAwareness>
|
||||
</Manifest>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
@ -116,9 +118,10 @@
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>ComCtl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<MinimumRequiredVersion>6.0</MinimumRequiredVersion>
|
||||
</Link>
|
||||
<Manifest>
|
||||
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
|
||||
<EnableDpiAwareness>true</EnableDpiAwareness>
|
||||
</Manifest>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
@ -134,9 +137,10 @@
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>ComCtl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<MinimumRequiredVersion>6.0</MinimumRequiredVersion>
|
||||
</Link>
|
||||
<Manifest>
|
||||
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
|
||||
<EnableDpiAwareness>true</EnableDpiAwareness>
|
||||
</Manifest>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user