Skip to Content
-2

Get screen resolution windows desktop

Mar 29, 2017 at 04:27 PM

210

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded

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

1

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

0
Former Member

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

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Sandra Rossi Apr 03, 2017 at 02:03 PM
1

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

Show 7 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

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

0
Former Member
Sandra Rossi

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

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
Former Member
Sandra Rossi

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!

0

As suggested by Sandra Rossi you could check this:

How to call DLL functions from the client in ABAP programs

Best regards,

Pablo

1
Former Member
Pablo Casamayor

Hi Pablo,

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

Thank!

0
Richard Harper Mar 30, 2017 at 01:18 PM
1

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.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

0