Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
sjesper

GetResolution

Recommended Posts

[sCAR]procedure GetResolution(out w, h: Integer);

var

{$IFNDEF SCAR335_UP}

HWDC: Integer;

{$ENDIF}

begin

{$IFNDEF SCAR335_UP}

HWDC := GetClientWindowHandle;

SetDesktopAsClient;

GetClientDimensions(w, h);

SetClientWindowHandle(HWDC);

{$ELSE}

GetWindowSize(GetShellWindow, w, h);

{$ENDIF}

end;[/sCAR]

 

This gets your current resolution. This function will work when 3.35 comes out (Thanks to Freddy :D).

Edited by sjesper

Share this post


Link to post
Share on other sites

This will be a lot easier once 3.35 is done :)

 

EDIT:

[scar]procedure GetResolution(out w, h: Integer);

var

{$IFNDEF SCAR335_UP}

HWDC: Integer;

{$ENDIF}

begin

{$IFNDEF SCAR335_UP}

HWDC := GetClientWindowHandle;

SetDesktopAsClient;

GetClientDimensions(w, h);

SetClientWindowHandle(HWDC);

{$ELSE}

GetBoxSize(GetWindowBox(GetShellWnd), w, h);

{$ENDIF}

end;[/scar]

 

This should do the same thing in the next build of 3.35.

Edited by Freddy

Share this post


Link to post
Share on other sites

Ahh thanks :-) And yeah it's lot easier to get the size of a not set client instead of you have to activate it, get infos and go back to the old.

 

Great work at 3.35 :D

Share this post


Link to post
Share on other sites

Next build will make it even easier :P

 

[scar]procedure GetResolution(out w, h: Integer);

var

{$IFNDEF SCAR335_UP}

HWDC: Integer;

{$ENDIF}

begin

{$IFNDEF SCAR335_UP}

HWDC := GetClientWindowHandle;

SetDesktopAsClient;

GetClientDimensions(w, h);

SetClientWindowHandle(HWDC);

{$ELSE}

GetWindowSize(GetShellWnd, w, h);

{$ENDIF}

end;[/scar]

Share this post


Link to post
Share on other sites
Next build will make it even easier :P

 

[scar]procedure GetResolution(out w, h: Integer);

var

{$IFNDEF SCAR335_UP}

HWDC: Integer;

{$ENDIF}

begin

{$IFNDEF SCAR335_UP}

HWDC := GetClientWindowHandle;

SetDesktopAsClient;

GetClientDimensions(w, h);

SetClientWindowHandle(HWDC);

{$ELSE}

GetWindowSize(GetShellWnd, w, h);

{$ENDIF}

end;[/scar]

 

This looks great =) I can't believe you made that many new window functions. Great job on the new 3.35 :-)

 

Are you going to make more updates with the functions using this function or is this unknown :P?

Share this post


Link to post
Share on other sites
This looks great =) I can't believe you made that many new window functions. Great job on the new 3.35 :-)

 

Are you going to make more updates with the functions using this function or is this unknown :P?

 

I'm still adding more window functions, almost done though ;) I'm not sure I understand the question though...

Share this post


Link to post
Share on other sites
I'm still adding more window functions, almost done though ;) I'm not sure I understand the question though...

 

Ah nice. And you just answered my badly formulated answers =) (Asked if u would change anything else in the window functions) :-)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...