Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


detecting screen resolution in vb 6

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  

Have you tried the code.
Yes i have.
0%
 0%  [ 0 ]
No i haven't.
100%
 100%  [ 2 ]
Total Votes : 2

Author Message
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Wed Jan 23, 2008 1:31 pm    Post subject: detecting screen resolution in vb 6 Reply with quote

This will detect your current screen resolution and might come handy if you for instance wanna be able to size any of ur controls.

Here is how to save it onto variables.
Code:
dim intWidth as integer
dim intHeight as integer
intWidth = Screen.Width / 15
intHeight = Screen.Height / 15


Here is how show the resolution on a textbox named text1
Code:
text1 = "Screen resolution : " & Screen.Width / 15 & "*" & Screen.Height / 15


Last edited by NINTENDO on Thu Jan 24, 2008 9:29 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
Trow
Grandmaster Cheater
Reputation: 2

Joined: 17 Aug 2006
Posts: 957

PostPosted: Thu Jan 24, 2008 8:54 am    Post subject: Reply with quote

failed to detect my resolution (2048*768)
_________________
Get kidnapped often.
Back to top
View user's profile Send private message
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Thu Jan 24, 2008 8:58 am    Post subject: Reply with quote

blland wrote:
failed to detect my resolution (2048*768)

Well i tested in with that resolution and gues what? It worked fine.
So just try it again

_________________
Intel over amd yes.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Thu Jan 24, 2008 9:18 am    Post subject: Reply with quote

I bet screen width / 15 is the correct width...
Its like saying aHundred = 100 / 15.
Back to top
View user's profile Send private message
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Thu Jan 24, 2008 9:21 am    Post subject: Reply with quote

Symbol wrote:
I bet screen width / 15 is the correct width...
Its like saying aHundred = 100 / 15.

/15 is correct. Did u even try the code before posting?

_________________
Intel over amd yes.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
Trow
Grandmaster Cheater
Reputation: 2

Joined: 17 Aug 2006
Posts: 957

PostPosted: Thu Jan 24, 2008 9:59 am    Post subject: Reply with quote

i mean i have two screens. "screen" only detects the first one, which is 1024*768.
_________________
Get kidnapped often.
Back to top
View user's profile Send private message
AtheistCrusader
Grandmaster Cheater
Reputation: 6

Joined: 23 Sep 2006
Posts: 681

PostPosted: Thu Jan 24, 2008 10:03 am    Post subject: Reply with quote

It does work.
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Thu Jan 24, 2008 10:03 am    Post subject: Reply with quote

No thanks, I used my brain.
If it is correct then vb is so lame, its getting the screen width * 15? Rolling Eyes
Back to top
View user's profile Send private message
Trow
Grandmaster Cheater
Reputation: 2

Joined: 17 Aug 2006
Posts: 957

PostPosted: Thu Jan 24, 2008 10:06 am    Post subject: Reply with quote

vb default unit is "twips" (pixels / twipsperpixel) and default "twipsperpixel" is 15 so yeah

that shit's gone now in .net

_________________
Get kidnapped often.
Back to top
View user's profile Send private message
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Thu Jan 24, 2008 10:30 am    Post subject: Reply with quote

blland wrote:
that shit's gone now in .net

WTF...
Then this was sooo waste of time.
FUCK YOU MICROSOFT!!

_________________
Intel over amd yes.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Thu Jan 24, 2008 7:35 pm    Post subject: Reply with quote

Code:
    Dim dwWinWidth  As Long
    Dim dwWinHeight As Long
    dwWinWidth = (Screen.Width / Screen.TwipsPerPixelX)
    dwWinHeight = (Screen.Height / Screen.TwipsPerPixelY)


In VB6 coords (x,y) are stored and such in Twips where as in .NET versions of VB, they are stored in pixels. But, the TwipsPerPixelX/Y functions are still in .NET for conversion functions that anyone might need to use.

They can be located in the Support namespace.

Support.TwipsPerPixelX()
Support.TwipsPerPixelY()

They are Single returns (floats) in .NET though unlike VB6 they were Longs.

You can also look at the Microsoft.VisualBasic.Compatibility.VB6 namespace for more VB6 to .NET conversions and such.

More info here:
http://msdn2.microsoft.com/en-us/library/microsoft.visualbasic.compatibility.vb6.support.twipsperpixelx.aspx

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Fri Jan 25, 2008 8:41 am    Post subject: Reply with quote

How cares? it's all gone in NET Wink
_________________
Intel over amd yes.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites