This will ensure that all screens show up in the images even if they aren't connected through an NVIDIA device. I also made the same changes to the AMD mode.
This is a subtle error, caused by either the NVIDIA driver being slow, or windows being slow in updating the location of the windows taskbar edge. This was causing an error in the GetNVIDIASCreenPositions function. Have added a 0.5 second delay to allow windows to update iit's display layout before we try to read it which should help, and also if we can't find the taskbar location in the settings, we just assume it is at the bottom. This should avoid exception.
Added specific checks to find and alert on 0 width or 0 height screens. This will then break other parts of the display layout.
Also moved the cloned screen check higher up to ensure we skip them properly.
Had some mistakes in the way that the profile graphics images were calculated on NVIDIA video cards. This meant that in some situations it calculated the image structures incorrectly, and didn't put the displays in the right places. This now changes that fact.
There is still an outstanding issue that the GetNVIDIAScreenPositions function still doesn't put the taskbar location in the right place yet. I need to fix that tomorrow.
DisplayMagician incorrectly tried copying the old DisplayProfile over to a new file when upgraading from v2.2 format to v2.3 format. This is incorrect as the file format can't be upgraded. This was stopping DisplayMagician from working upon first restart. Now fixed.
Also fixed issue where Display Profile window and the Shortcut Library window wouldn't always be shown on screen when returning from a different shortcut. This made using the application difficult. This has now been rectified.
Made CurrentProfile work even if there was already another instance of DisplayMagician working. Added another the ability to have command line commands that will bypass the SingleInstance mode. Used only for commands that are useful for powershell, and that don't change anything.
There is a caveat with that, that the one that is running first is the one that will generate the console output. This isn't what everyone would want unfortunately, as it may not be caught from a catch/powershell file. The 'DisplayMagician CurrentProfile' command will work perfectly if there are no other DisplayMagician's running, but because we have moved to a SIngleInstance model if there is already another DisplayMagician instance running, the instance started by the batch file will close and the batch file/powershell file won't get an answer :(.
Nothing I can do about that I'm afraid.
There were some issues with memory deallocation where AllocateHGlobal memory was being freed incorrectly with FreeCoTaskMem. This was causing issues with subsequent memory allocations.
The Advanced Target Info object returned by the NVIDIA driver points to memory outside the allocated memory. I need to figure out how the NVIDIA code allocates the memory, so I can account for it on return.