Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Get screen resolution windows desktop

0 Kudos

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

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor

refer to windows forums; it's not an ABAP question.

13 REPLIES 13

Jelena
Active Contributor

How exactly is the result affected by the task bar? I'm confused...

matt
Active Contributor
0 Kudos

Supplying insufficient information is a good way of getting your question removed. Please supply specific details of what you're doing and why.

0 Kudos

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

former_member182550
Active Contributor

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.

0 Kudos

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

Sandra_Rossi
Active Contributor

refer to windows forums; it's not an ABAP question.

0 Kudos

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.

0 Kudos

Search DLL in windows to get resolution and search how to call DLL from ABAP

0 Kudos

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

0 Kudos

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.

0 Kudos

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!

As suggested by Sandra Rossi you could check this:

How to call DLL functions from the client in ABAP programs

Best regards,

Pablo

0 Kudos

Hi Pablo,

I tried, but I can not :(. Do you have an example?

Thank!