Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Limit to GDI Handles and User Handles

Limit to GDI Handles and User Handles

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Patje
    wrote on last edited by
    #1

    Hi, My software is a highly interactive application that uses lots of windows with sub windows (a few hundred windows is not an exception). Not all windows are visible at the same time, but at certain moments the user must be able to quickly switch to another window so I keep the relevant windows invisible and make them visible when needed. Due to the structure of the software, it is not possible to decrease the number of windows. Nevertheless I have succeeded to decrease the used pens, brushes, .... Cleaning up the used menu handles and icon handles is planned for the medium- to long-term. To prevent my application from starving the available GDI and/or User Handles, I want to check the amount of free GDI/User handles (both for the process as for the global system). I found out that there is a function (GetGUIResources) where you can get the number of used resources, but there does not seem to be a function to get the number of free resources? Does such a function exist or is there another way of obtaining that value? Or is there a simple trick to minimize the number of used resources (or to increase the number of available resources)? Thanks in advance. Enjoy life, this is not a rehearsal !!!

    B 1 Reply Last reply
    0
    • P Patje

      Hi, My software is a highly interactive application that uses lots of windows with sub windows (a few hundred windows is not an exception). Not all windows are visible at the same time, but at certain moments the user must be able to quickly switch to another window so I keep the relevant windows invisible and make them visible when needed. Due to the structure of the software, it is not possible to decrease the number of windows. Nevertheless I have succeeded to decrease the used pens, brushes, .... Cleaning up the used menu handles and icon handles is planned for the medium- to long-term. To prevent my application from starving the available GDI and/or User Handles, I want to check the amount of free GDI/User handles (both for the process as for the global system). I found out that there is a function (GetGUIResources) where you can get the number of used resources, but there does not seem to be a function to get the number of free resources? Does such a function exist or is there another way of obtaining that value? Or is there a simple trick to minimize the number of used resources (or to increase the number of available resources)? Thanks in advance. Enjoy life, this is not a rehearsal !!!

      B Offline
      B Offline
      Blake Miller
      wrote on last edited by
      #2

      Simple Trick - Install video card with more Video RAM. Avoid using DDB, use DIB bitmaps isntead (they can reside in regular memory). 'Share' handles to objects - instead of duplicating a 1-pixel wide black pen 200 times, etc. No shirt, no shoes, no brains, no service.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups