Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the function of turning screen under WM

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

The purpose of this article is to share with you about how to realize the screen transfer function under WM. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Under WM, users can often turn the screen, but this can also be achieved through code, here is a tested code.

Int ChangeDisplaySettings () {DEVMODE DevMode; int RotationAngles = 0; int CurrentAngle = 0; int NewAngle = 0; / / Check for rotation support by getting the rotation angles supported. Memset (& DevMode, 0, sizeof (DevMode)); DevMode.dmSize = sizeof (DevMode); DevMode.dmFields = DM_DISPLAYQUERYORIENTATION; if (DISP_CHANGE_SUCCESSFUL = = ChangeDisplaySettingsEx (NULL, & DevMode, NULL, CDS_TEST, NULL)) {RotationAngles = DevMode.dmDisplayOrientation;} else {RotationAngles =-1;} / / Get the current rotation angle. Memset (& DevMode, 0, sizeof (DevMode)); DevMode.dmSize = sizeof (DevMode); DevMode.dmFields = DM_DISPLAYORIENTATION; if (DISP_CHANGE_SUCCESSFUL = = ChangeDisplaySettingsEx (NULL, & DevMode, NULL, CDS_TEST, NULL)) {CurrentAngle = DevMode.dmDisplayOrientation;} else {CurrentAngle =-1;} / Rotate to the "next" angle. If ((CurrentAngle > = 0) & & (RotationAngles > = 0)) {NewAngle = CurrentAngle; do {NewAngle

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report