Thread: Function to find resolution

  1. #1
    Registered User Bag a Bones's Avatar
    Join Date
    Dec 2005
    Posts
    15

    Function to find resolution

    Im working on a program called mouse odometer, which will find how much you move your mouse (like in meters or kilometers or whatever) and its going to find how many pixels your mouse moves and then multiply that by whatever number to get distance, but since the resolution and moniter size determine size of pixels, I need a function to find the resolution that is being run. Can someone tell me a function to do this? Thanks

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    It depends on if you're writing a Windows application or something else. Try google.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    Registered User Bag a Bones's Avatar
    Join Date
    Dec 2005
    Posts
    15
    Why does everyone love google so much? Google never helps me that much when im looking for stuff like this. The most it ever helped me was to find this site. I did just look there, but I guess ill just go back to it...

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Search for something specific, like "get return find screen resolution c programming".
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > Why does everyone love google so much?
    Because that's how we get to find out stuff, read books, manual pages, STFW.
    Do you think some of us are born with this information?
    No, those who answer are simply more adept (and motivated) to dig out this information from ourselves.

  6. #6
    Registered User
    Join Date
    Dec 2005
    Posts
    50
    i don't know, is this what you are looking for:

    Code:
      int cx = GetSystemMetrics(SM_CXSCREEN);
      int cy = GetSystemMetrics(SM_CYSCREEN);
    BTW google helped me to find it...

  7. #7
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Why does everyone love google so much? Google never helps me that much when im looking for stuff like this. The most it ever helped me was to find this site. I did just look there, but I guess ill just go back to it...
    Cuz it rocks.

    If google hasn't helped you find information then I'm afraid you are research impaired and should go see a doctor. Ya know how good Google really is? It's so good that even Microsoft is feeling threatened by it.

    The Windows API has functions that return the relative positions of the mouse which when multiplied by the logical device units, also retrieveable from the API, will yield the distance traveled.
    I'm sure mouse manufacturers have actually coded this type of thing to test how durable their product is.
    Last edited by VirtualAce; 01-17-2006 at 06:10 AM.

  8. #8
    Registered User Bag a Bones's Avatar
    Join Date
    Dec 2005
    Posts
    15
    Ok, sorry I was whining, Im just a little stressed and tired because there are a lot of projects due lately and exams are starting...

    BTW thanks what3v3r

    Bubba, I actualy had a program that did this, but i lost it and can't find it again, so I decided to make it on my own. I was concidering making it a portable application for a flash drive or somthing like that.
    Last edited by Bag a Bones; 01-19-2006 at 12:56 PM.
    Current project - Mouse Odometer

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Undefined Reference Compiling Error
    By AlakaAlaki in forum C++ Programming
    Replies: 1
    Last Post: 06-27-2008, 11:45 AM
  2. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  3. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM
  4. C++ compilation issues
    By Rupan in forum C++ Programming
    Replies: 1
    Last Post: 08-22-2005, 05:45 AM
  5. Replies: 5
    Last Post: 02-08-2003, 07:42 PM