Application Development and Automation 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: 
Read only

Get screen resolution windows desktop

0 Likes
3,289

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
Read only

Sandra_Rossi
Active Contributor
2,852

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

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

13 REPLIES 13
Read only

Jelena_Perfiljeva
Active Contributor
2,852

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

Read only

matt
Active Contributor
0 Likes
2,852

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

Read only

0 Likes
2,852

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

Read only

Former Member
2,852

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.

Read only

0 Likes
2,852

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

Read only

Sandra_Rossi
Active Contributor
2,853

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

Read only

0 Likes
2,852

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.

Read only

0 Likes
2,852

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

Read only

0 Likes
2,852

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

Read only

0 Likes
2,852

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.

Read only

0 Likes
2,852

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!

Read only

2,852

As suggested by Sandra Rossi you could check this:

How to call DLL functions from the client in ABAP programs

Best regards,

Pablo

Read only

0 Likes
2,852

Hi Pablo,

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

Thank!