Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming
View Poll Results: Where did you use this program for testing?
at Work 1 100.00%
at College assignment 0 0%
Utility development 0 0%
others 0 0%
Voters: 1. You may not vote on this poll


Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 1st, 2004, 09:24 AM
benoyraj benoyraj is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: US
Posts: 15 benoyraj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Screen Resolution in VB 6.0 (600X800)

'This is the small program to identify the screen resolution
'if resolution is less then 800x600
~~~~~~~~~~~~~~~~~
Private function IsValidScreenResolution as boolean

dim intWidth, intHeight as Integer

intWidth = GetSystemMetrics(SM_CXSCREEN)
intHeight = GetSystemMetrics(SM_CYSCREEN)


If (intWidth < 800) Or (intHeight < 600) Then
msgbox "Screen resolution is less then 800x600"
else
IsValidScreenResolution=true
End If

End Function
~~~~~~~~~~~~~~~~~
PS: D nt forget include "GetSystemMetrics" system function (un user32.dll)...

if any other issues or problems, pls feel to contact me
@binoy_rb@h tmail.com

thanks
Binoy

Reply With Quote
  #2  
Old April 1st, 2004, 09:32 AM
benoyraj benoyraj is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: US
Posts: 15 benoyraj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation Including system library file

Public Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long

Reply With Quote
  #3  
Old July 26th, 2007, 01:59 AM
ashik143 ashik143 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 2 ashik143 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 11 sec
Reputation Power: 0
Thumbs up not working for me :(

Quote:
Originally Posted by benoyraj
Public Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long


hi binoyraj,

i am puuting your code as:

'=============

'Including system library file
Public Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long

'This is the small program to identify the screen resolution
'if resolution is less then 800x600
'~~~~~~~~~~~~~~~~~
Private Function IsValidScreenResolution() As Boolean

Dim intWidth, intHeight As Integer

intWidth = GetSystemMetrics(SM_CXSCREEN)
intHeight = GetSystemMetrics(SM_CYSCREEN)

If (intWidth < 800) Or (intHeight < 600) Then
MsgBox "Screen resolution is less then 800 x 600"
Else
IsValidScreenResolution = True
End If
End Function
'''~~~~~~~~~~~~~~~~~

Private Sub Form_Load()

Call IsValidScreenResolution

End Sub

'=============

But, when i Run the program, it is giving me Compile Error saying:

Constants, fixed-length strings, arrays, user-defined types and declare statements not allow as Public members of object modules.


Then i removed the 'Public' from the declaring statement. Still, its not working.

Also, i want to change the machine's resolution to 1280 x 1024, irrespective of the current machine's resolution.

can u help me to do this ?

thanx in adv.

-@shik143.

Reply With Quote
  #4  
Old July 26th, 2007, 06:55 AM
ashik143 ashik143 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 2 ashik143 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 11 sec
Reputation Power: 0
hey,

is there no one 2 solve this query ?

Reply With Quote
  #5  
Old July 26th, 2007, 09:43 AM
Darius Darius is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 108 Darius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 16 m 54 sec
Reputation Power: 5
Quote:
Originally Posted by ashik143
hey,

is there no one 2 solve this query ?


No api needed

Code:
Function IsValidScreenResolution(ByVal X_Max As Integer, ByVal Y_max As Integer) As Boolean
  IsValidScreenResolution = (Screen.Height / Screen.TwipsPerPixelY >= Y_max) And (Screen.Width / Screen.TwipsPerPixelX >= X_Max)
End Function

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Screen Resolution in VB 6.0 (600X800)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT