INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Metamorphis GetScreenWidth/Height Functions  (Read 2439 times)

ZRocker

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1257
Metamorphis GetScreenWidth/Height Functions
« on: April 17, 2002, 03:37:41 am »

A while back, Nikolay implemented Metamorphis engine support for GetScreenWidth() and GetScreenHeight() functions so I could position the LowerLeft mini-me skin for new users reliably (e.g., for users using multiple monitors).  Well, as implemented these functions are useless because they do not return the screen metrics based on the useable client area.  Rather, they are the metrics for the entire screen size with the taskbar included.

Can we get these functions fixed or new functions implemented (like GetScreenClientWidth() and GetScreenClientHeight()) that allow the skin programmer to use the metrics to position their skin properly for first-time users (if desired)?

Thanks...
Logged

Nikolay

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1681
  • Former CTO, JRiver, Inc.
RE:Metamorphis GetScreenWidth/Height Functions
« Reply #1 on: April 17, 2002, 06:14:22 pm »

ZRocker,

I could not find a way how to get useable client area yet, I'll try again.

Does anybody have way of doing that?

Nikolay
Logged

ZRocker

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1257
RE:Metamorphis GetScreenWidth/Height Functions
« Reply #2 on: April 17, 2002, 06:38:40 pm »

Maybe...

SystemParametersInfo() with SPI_GETWORKAREA
-- or --
GetSystemMetrics() call with SM_CXFULLSCREEN, SM_CYFULLSCREEN or one of the other SM_CY... options...one of those has to be it.

What are you using currently?
Logged

Nikolay

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1681
  • Former CTO, JRiver, Inc.
RE:Metamorphis GetScreenWidth/Height Functions
« Reply #3 on: April 18, 2002, 05:12:52 am »

I'm using SM_CXVIRTUALSCREEN and it looks like it does not work.

I'll try other functions.

Nikolay
Logged

Nikolay

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1681
  • Former CTO, JRiver, Inc.
RE:Metamorphis GetScreenWidth/Height Functions
« Reply #4 on: April 18, 2002, 05:32:38 am »

OK, I fixed it.

There will be two new functions available, GetScreenTop and GetScreenLeft that will allow you to position the window perfectly.

Nikolay
Logged

ZRocker

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1257
RE:Metamorphis GetScreenWidth/Height Functions
« Reply #5 on: April 18, 2002, 07:23:21 am »

Thanks...Nikolay!!
Logged

ZRocker

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1257
RE:Metamorphis GetScreenWidth/Height Functions
« Reply #6 on: April 18, 2002, 04:00:22 pm »

Nikolay,

I was hoping the documentation would explain what GetScreenTop/Left are for, but the documentation didn't help.  I must say...I don't get it.  Isn't the screen area always start at 0,0 (top/left) as far as the application is concerned (ie, Windows adjusts where 0,0 is)?  Can you please tell me how I can use GetScreenTop/Left to position (for example) flush bottom & right with these new functions?  Seems like you still need to know the correct useable (desktop) width & height...what am I missing here?  Also, you are taking into account that the taskbar can be positioned on *any* edge (left, right, top...not just at the bottom where you normally see it), right?
Logged

Nikolay

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1681
  • Former CTO, JRiver, Inc.
RE:Metamorphis GetScreenWidth/Height Functions
« Reply #7 on: April 18, 2002, 05:09:21 pm »

No, it's not, for example you can place system toolbar there, you can also drug you system toolbar to the top of the screen.

Nikolay
Logged

ZRocker

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1257
RE:Metamorphis GetScreenWidth/Height Functions
« Reply #8 on: April 18, 2002, 06:02:14 pm »

Nikolay,

Sorry, man, I don't understand your answer...I was telling you you can put the taskbar top, bottom, left or right edge (sounds like you are restating what I stated).  How do I use GetScreenTop and GetScreenLeft to figure the useable desktop size?  Was GetScreenWidth/Height also fixed too...is that what you are implying too?

:{
Logged

ZRocker

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1257
RE:Metamorphis GetScreenWidth/Height Functions
« Reply #9 on: April 18, 2002, 06:37:13 pm »

Well, I decided to experiment with 253 and it works!!  I added the GetScreenLeft() value into the X-coord calculation and GetScreenTop() into the Y-coord calculation and the position I desire is achieved (with the Windows taskbar on any of the 4 screen edges).  I guess the GetScreenLeft/Top values must be negative (but I did not verify) as that the only way I can figure the new calculations account for the Windows taskbar size (unless GetScreenWidth and GetScreenHeight were 'fixed').

Thanks...
Logged

Nikolay

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1681
  • Former CTO, JRiver, Inc.
RE:Metamorphis GetScreenWidth/Height Functions
« Reply #10 on: April 19, 2002, 03:12:30 pm »

ZRocker,

GetScreenTop - returns top coordinate where usable screen area starts.
GetScreenLeft - returns left coordinate where usable screen area  starts.

GetScreenWidth and GetScreenHeight were fixed.

if you want to calculate coordinates of your window it should be something like that:
var Top = GetScreenTop() |PLS| GetScreenHeight() - PlayerHeight;
var Left = GetScreenLeft() |PLS| GetScreenWidth() - PlayerWidth;

Nikolay
Logged

ZRocker

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1257
RE:Metamorphis GetScreenWidth/Height Functions
« Reply #11 on: April 19, 2002, 05:50:10 pm »

Nikolay,

That's what I thought...GetScreenWidth() and GetScreenHeight() must have been fixed too.

Thanks...all is well now and I posted new LowerLeft and LowerRight skins that use the new and fixed GetScreenXxxxx() functions.
Logged

Nikolay

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1681
  • Former CTO, JRiver, Inc.
RE:Metamorphis GetScreenWidth/Height Functions
« Reply #12 on: April 19, 2002, 05:55:45 pm »

Works great. Wonderful skin. Great addition to MJ!!!

Thanks a lot for your support.

Nikolay
Logged
Pages: [1]   Go Up