Jump to content
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
Link to comment
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
Link to comment
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]

Link to comment
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?

Link to comment
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...

Link to comment
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) :-)

Link to comment
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...