03-29-2017 5:27 PM
Hi,
I need get screen resolution of windows desktop. The object cl_gui_props_consumer not work correctly with taskbar..
Eg.
My current screen resolution of windows is 1366x768 With this eg.
DATA: lref_consumer TYPE REF TO cl_gui_props_consumer,
ls_metric_factors TYPE cntl_metric_factors.
lref_consumer = cl_gui_props_consumer=>create_consumer( ).
ls_metric_factors = lref_consumer->get_metric_factors( ).
WRITE: / ls_metric_factors-screen-x,
ls_metric_factors-screen-y.
Result: 1366x728
If taskbar is hide the result is correct 1366x768 Please i need a result independently the taskbar.
Anything happen to you?Thank!!
Regards
04-03-2017 3:03 PM
03-29-2017 7:58 PM
How exactly is the result affected by the task bar? I'm confused...
03-30-2017 7:24 AM
Supplying insufficient information is a good way of getting your question removed. Please supply specific details of what you're doing and why.
03-30-2017 10:15 AM
Sorry,
My current screen resolution of windows is 1366x768 With this eg.
DATA: lref_consumer TYPE REF TO cl_gui_props_consumer,
ls_metric_factors TYPE cntl_metric_factors.
lref_consumer = cl_gui_props_consumer=>create_consumer( ).
ls_metric_factors = lref_consumer->get_metric_factors( ).
WRITE: / ls_metric_factors-screen-x,
ls_metric_factors-screen-y.
Result: 1366x728
If taskbar is hide the result is correct 1366x768 Please i need a result independently the taskbar.
Thank
03-30-2017 2:18 PM
Ahh...
You are not getting the screen resolution, you are getting the currrent window dimensions and the task bar you are talking about is the windows task bar yes ??
I had to do this once but it's not on my work laptop. I'll check when I get home tonight.
03-30-2017 3:15 PM
Thanks Richard,
That's right, I'm talking about the windows taskbar.
I have tried to get windos resolution by API, but I have not succeeded :(.
Regards
Diego
04-03-2017 3:03 PM
04-03-2017 4:20 PM
Forgives,
I think it is. I need to get windows resolution from Abap, because depending on that I generate buttons in an HTML container with height and width defined by resolution.
04-03-2017 4:43 PM
Search DLL in windows to get resolution and search how to call DLL from ABAP
04-03-2017 4:53 PM
Hi Sandra,
I have already tried using the Api windows and I have also tried to read from the windows registry, but it did not work :(.
Regards
04-04-2017 6:11 AM
If you can't do it using Windows functions, then why would ABAP be able to do it? No, it's certain you just didn't search enough or you didn't ask in Windows forums.
By the way, I'm surprised that you can't do it using javascript (inside HTML). Otherwise, I would "overkill" the by doing it first in VBA/DLL (Word, Excel...), then I would access the result from ABAP. Stephan Schnell has published several posts for DLL/ABAP communication.
04-04-2017 11:15 AM
Hi Sandra
With JavaScript it works, but I need to get the resolution before running the html container. Now I'll look at Stephan Schnell's messages about ABAP / DLL.
Thank you!
04-04-2017 1:44 PM
As suggested by Sandra Rossi you could check this:
How to call DLL functions from the client in ABAP programs
Best regards,
Pablo
04-05-2017 4:24 PM
Hi Pablo,
I tried, but I can not :(. Do you have an example?
Thank!