Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Detecting Screen Resolution

Does anybody have a routine for detecting the PC's current screen resolution in VB? I have OCX's that do that at the moment, but I want to put my own little piece of code in, so that I don't have to include the OCX in the program. Thanx in advance.


Comments

  • Actually, the easiest way (I know of) is to divide the width of the screen (screen.width) in twips with the numbers of twips per X pixel (screen.twipsperpixelx) and to do the same with sceen.height and screen.twipsperpixely.


    : Does anybody have a routine for detecting the PC's current screen resolution in VB? I have OCX's that do that at the moment, but I want to put my own little piece of code in, so that I don't have to include the OCX in the program. Thanx in advance.







  • try this


    Private Type RECT

    Left As Long

    top As Long

    Right As Long

    Bottom As Long

    End Type


    dim vrect as rect

    dim screenhandle as long


    Private Declare Function GetDesktopWindow Lib "user32" () As Long

    Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long




  • Andre YoungAndre Young USAMember Posts: 0

    ________ \ http://forcoder.org \ free video tutorials and ebooks about < Java C# Visual Basic Scratch C++ Python MATLAB Ruby Delphi Visual Basic .NET Assembly JavaScript Perl Go PHP PL/SQL C Swift Objective-C R Crystal Clojure Awk ABAP FoxPro Erlang VBScript Scala Alice Bash Transact-SQL Scheme Ada COBOL ML Logo Prolog F# Apex Kotlin Lisp D Dart LabVIEW Hack Julia Lua Fortran Rust SAS /> ___________

Sign In or Register to comment.