There is no such thing as "2D" or "3D" when it comes to whether something is hardware accelerated by GPU. All it requires is tapping into appropriate API, such as Direct3D or OpenGL. It's the API that ultimately controls how what you see in your screen is rendered. If an app happens to be a game, most of the time you are dealing with a framework like SDL or SFML or pre-made rendering engine like Unity, Unreal Engine, etc that do most of the work of tapping into API's for you. But when that is not the case, you can still check if there are usable wrappers for your preferred programming language that helps you with that.
If we're talking about normal Windows app, then your app should be hardware accelerated by GPU as long as desktop composition is enabled and you follow Microsoft's coding guidelines. Those who have used Windows OS since Vista (which means most of us), have at some point or another noticed how Windows switches desktop composition off. This is very obvious as when this happens the interface becomes very plain looking. This happens because Windows encountered misbehaving application that did not play the ball with desktop composition. Soon after misbehaving application is closed, Windows switches desktop composition back on.
Bottom line, most of the time you don't need to know much if anything at all about underlying API's to make use of them. It's when you code with a language that is not using framework (SDL, SFML), virtual machine (Java, .NET/Mono) or wrapper. Common example of such language would be C/C++.