Using GetSystemMetrics() in App.cpp #9047
-
Hello, forgive me if this is common knowledge or has already been answered, I'm new to RNW/C++ and I couldn't find a solution anywhere. I'm trying to set the size of the starting screen of the official RNW-demo application by using GetSystemMetrics(SM_CYSCREEN/CXSCREEN) in App.cpp, so I can get both width and height of the screen it is running on. I want the application to start in a screen-sized window on any machine it is running on. The GetSystemMetrics - function is not recognized in App.cpp. I tried including #pragma comment(lib, "user32.lib") together with <winuser.h>, <windows.h> and a couple of others. the function just won't work. Is what I'm trying even possible? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
However if we back up to your stated scenario:
I think what you're looking for is simpler than all of that. Look up documentation on how to create a fullscreen UWP app, such as this |
Beta Was this translation helpful? Give feedback.
GetSystemMetrics
is a desktop Win32 API, whereas RNW apps are UWP apps (see more here). So you'd want the UWP equivalent API for that kind of device information. You can dig in maybe here or here.However if we back up to your stated scenario:
I think what you're looking for is simpler than all of that. Look up documentation on how to create a fullscreen UWP app, such as this