gdi - "Exclusive" DirectDraw palette isn't actually exclusive -


We are maintaining an old video game which uses a full-screen 256-color graphics mode with direct-draw Does. The problem is that some applications running in the background sometimes try to change the system palette when the game is started, which is the result of corrupted graphics.

By processing WM_PALETTECHANGED messages, it can happen that we (sometimes) find out. Before some update version we added logging (just log the window title / category / process name), which helped users identify and turn off abusive applications. MSN Live Messenger was a common criminal.

When we came to know that Vista Vista (and 7) "problem by itself" problem has worsened WM_PALETTECHANGED parameters point to CSRSS and desktop window. In Vista, a work often used to open any folder (computer, document, etc.) and it was opened while running the game. Looks ridiculous, but it worked - in most cases in Windows 7, even this solution did not work too much. Users have found that preventing certain services (Windows Update and Indexing Service) have also fixed the problem on some configurations.

A while ago, I had started trying for random things in the hope of finding a solution. After knowing that the GDI Palette Set (using the Create / SelectPalette) will recover the palette (WM_PALETTECHANGED handler) after being corrupted before I set the DirectDraw palette (using the IDirectDrawPalette :: SetEntries). SetSystemPalette use SetPalette on the primary surface and got some help from the call However, whenever an application tries to steal the palette, it is still improperly fickle, which is particularly prominent during fades.

Question: "Real" is a way to get exclusive palettes, which completely rejects other applications until our game preserves the focus, changing the Windows palette

Someone has actually set a registry entry for it, here:

< P> Search for "fried color" on that page and you will get the share according to its need.


Since online resources are fleeting, however, here is the full explanation:

For the program under "HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ DirectDraw \ Compatibility \" Create new key

If the program that you are implementing compatibility is a 32-bit program, and you are on 64-bit systems (either manually or applying through a 64-bit program ), Do not forget to add "Wow6432Node" to "Software" and "Direct Draw" to

set these values ​​in that key:

  • Click the "Flag" (REG_BINARY): [00,08,00,00]
  • "Name" (REG_SW): The file name of your program. No way, only executable file names.
  • "REG_BINARY": The application's DirectDraw ID.

To obtain the required DirectDraw ID, run the program and then check this registry key:

  HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ DirectDraw \ MostRecentApplication  

Again, if you are on 64 bit system and the program you are doing is 32-bit one, add "Wow6432Node" after "software".

The key in that key is four bytes. Reverse your order to get the bytes to enter the ID value. 32dd83d5 goes D5,83, DD, 32


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -