2025-11-28 00:35:46 +09:00

66 lines
2.0 KiB
Markdown

---
page_type: sample
languages:
- cpp
- cppwinrt
products:
- windows-api-win32
name: Power grid forecast sample
urlFragment: PowerGrid
description: "Shows how to use power grid forecasts (Win32)."
extendedZipContent:
- path: LICENSE
target: LICENSE
---
# Power grid forecast sample
Shows how to use the PowerGrid Forecast API from Win32.
This sample covers the following:
- Obtaining the power grid forecast
- Registering for ForecastUpdated notifications
- Looking for the lowest severity in a specified timeframe
**Note** This sample requires Visual Studio to build and Windows 11 to execute.
To obtain information about Windows development, go to the [Windows Dev Center](http://go.microsoft.com/fwlink/?LinkID=532421)
To obtain information about Microsoft Visual Studio and the tools for developing Windows apps, go to [Visual Studio](http://go.microsoft.com/fwlink/?LinkID=532422)
## Related topics
### Reference
[PowerGridForecast class](https://learn.microsoft.com/uwp/api/windows.devices.power.powergridforecast)
### Related samples
[Power grid forecast from a UWP app](https://github.com/microsoft/Windows-universal-samples/tree/main/Samples/PowerGrid)
## System requirements
- Windows 11 SDK (build 26100 or higher)
- Windows 11 (build 26100 or higher)
## Build the sample
To build this sample:
1. Start Visual Studio and select **File** \> **Open** \> **Project/Solution**.
2. Go to the directory named for the sample, and double-click the Microsoft Visual Studio Solution (.sln) file.
3. Press F7 or use **Build** \> **Build Solution** to build the sample.
## Run the sample
The next steps depend on whether you just want to deploy the sample or you want to both deploy and run it.
### Deploying the sample
- Select Build \> Deploy Solution.
### Deploying and running the sample
- To debug the sample and then run it, press F5 or select Debug \> Start Debugging. To run the sample without debugging, press Ctrl+F5 or select Debug \> Start Without Debugging.