Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically getting "Operating System Context" in C++

Tags:

c++

windows

How can in retrieve the Operating system context for my application programmatically?

enter image description here

like image 608
koby meir Avatar asked Oct 21 '13 09:10

koby meir


1 Answers

As others have posted this site answers the question: http://msdn.microsoft.com/en-us/library/windows/desktop/dn424972(v=vs.85).aspx

Use the Version Helper API

To know whether this will actually suit your needs though -Why- you want to do this needs to be examined. If this is related to feature support testing, then you may want to read the suggestions here: http://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx. The article discusses some various ways to perform feature detection such as:

  1. A combination of LoadLibrary and GetProcAddress
  2. GetSystemMetrics e.g. GetSystemMetrics(SM_CMONITORS)

Of course, this is more relevant if you are directly coding outside of the .NET world.

like image 54
metaomniliquant Avatar answered Oct 25 '22 23:10

metaomniliquant