C a r d s . d l l E N H A N C E D

An enhanced replacement for Microsoft Windows playing card drawing library - Cards.dll

Version 2005.01

Introduction » «

Cards.dll Enhanced is a replacement for Windows Cards.dll. Windows Cards.dll is located in Windows\System32 folder and is used by several Windows games like Solitaire (sol.exe). Card.dll is also used by FreeCellPro 6.4.

Main improvements are better Card drawing and the ability to use user-defined decks with greater image resolution. Users with desktop resolution settings more than 1024x768 will benefit the most.

Unlike the Windows Card.dll, this enhanced Cards.dll requires MFC42.dll and some CommonControl and OLE dlls that are included in Windows 2000 & XP.

The legacy cdtAnimate function is not implemented in this Cards.dll. cdtAnimate implements card-back animation which was last used on Windows 2000 Solitaire.

Physically replacing the Cards.dll in Windows\System32 folder (WINNT\System32 on some installations) is not recommended.

Installation and Uninstallation » «

Unzip the distribution ZIP file into a convenient location. The ZIP file contains the Cards.dll file, some deck image folders, and Free Cell Pro program.

Run the Free Cell Pro program from this folder. Copy Solitaire program from Windows\System32\sol.exe to the installation folder. Running Solitaire.exe here will pick up the enhanced Cards.dll from this folder instead of the Microsoft Cards.dll in Windows\System32. Create desktop short cuts of programs.

Microsoft freecell.exe and mshearts.exe also work like sol.exe, except their windows do not resize like Solitaire.

To uninstall, just delete the program's folder, zip file, and desktop short cuts.

Usage and Configuration » «

For best results, card images should display at full resolution. Therefore, use the card size displayed with the card deck selection to set the card size in Free Cell Pro. For Microsoft Solitaire, the card will automatically display at greatest possible resolution.

When the enhanced Cards.dll is running, an icon appears in the the desktop tray near the Windows clock. Clicking on this icon displays a Cards.dll Settings dialog.

Depending on the application, some changes to the Cards.dll settings materialize when Cards.dll restarts. Therefore, make changes, then exit the running application and start it again.

• Deck Selection » «

By default the dll uses internal resource images that are derived from the Microsoft card images. If an external deck is selected, these internal images are not used.

Select a deck by clicking on the decks folder in the drop-down combo box in the settings dialog. For example: selecting 'Standard 213x288 Gifs' will load images from that folder. The Dll loads folder names and the previously selected deck at startup.

When a deck loads successfully, the preferred card dimension setting is displayed on the status line below the decks path in the Settings dialog. Use this to match the Card Size in Free Cell Pro.

If the card image folders are not located with the Cards.dll, change the Cards Folder setting by hitting the 'Change Decks Path' button.

Hitting this button starts a 'Card Folders Path Change ...' window. The current setting of the Card Folders Path is displayed. Change it to the desired location and hit 'OK'. Card Folders in the new location are immediately loaded into the drop-down combo box.

• Corner Types » «

The Corner Type setting can be Sharp, Medium, or Rounded. Sharp corners add a 1 pixel border around the card image. Medium corners are 2 pixels while the Rounded corners add a 3 pixel border around the image.

The card image's first pixel (0, 0) is read to determine the color to use in the area between the border lines and the card image.

Sharp corners are forced in Solitaire since the Rounded corners do not work correctly.

• Border Color » «

The Border Color may be changed as per user needs. Note that the border is always a single pixel wide line around the card.

• Settings Save » «

By default the dll saves Settings in a Cards.ini file in the same folder as the dll. If the Cards.dll is copied to another folder or machine, copying the Cards.ini file will copy the dll setting to the new location. Similarly, using multiple Cards.dll on a single machine allows different settings for each Cards.dll folder.

Setting the option to save setting into the Windows Registry will save settings into \HKEY_CURRENT_USER\Software\Ammaxamma\Cards in the Registry. Using this method will make the same settings available to all copies of the Cards.dll.

Deck Design » «

Each folder in the Card.dll install folder contains card deck image sets. New deck images are installed by simply adding a folder to Cards.dll install folder.

Deck design means creating card images into a new folder. New card image dimensions should follow these directives:

- image file names must match the Microsoft resource Ids in Cards.dll
- dimensions of all images should be the same
- image size should be such that the card displays the image at 100%
- image aspect ratio should be same or close to default 71x96
- images should be encoded as .jpg, .bmp, or .gif
- images encoding for all images in a folder should be the same

Recommended card image size for display resolution to 1600x1200 is between 1 to 2.5 times (71x96). Examples: 1.5 - (106x144), 2 - (142x192), 2.5 - (177x240)

Examine images in deck folder to understand the naming convention. Card images 1.jpg thru 52.jpg are the actual card images of AceClub, TwoClub, ... KingSpade.

Image 53.jpg is the Ghost Card. 54.jpg thru 65.jpg are card backs. 67.jpg and 68.jpg are O and X cards used in Solitaire. Other images (3-digit names) are for card back animation and never used or loaded. This dll does not implement the cdtAnimate() API. They are included only for completeness.

Troubleshooting » «

If the tray icon does not appear, then very likely Windows is using the default Cards.dll from the Windows/System32 folder. To ensure the enhanced Cards.dll is used, place the dll and the application, i.e. FreeCellPro or Solitaire, in the same folder as the dll.

Multiple instances of the Cards.dll may be running at the same time. Each instance will have its own tray icon and Settings dialog. If more than one Settings dialog saves settings into the Windows Registry or into the same Cards.ini file, then unexpected results are likely.

Some cards appear with green face in MSHearts.exe when using default deck. For now, this fixed by selecting another deck.

To get Free Cell Pro 6.4 background to the same color as Microsoft Apps, use Registry Editor to change Value:
HKEY_CURRENT_USER\Software\WCallan\FCPro\BGColor
to Value data: 0 128 1

The dll does special handling and configuration things for Microsoft applications. This feature is the default, but can be switched off by manually changing a flag in Card.ini or the Registry.

Reference Links » «

• Cards Dll Tutorials

• Free Cell Pro Reference

• Code Project

• Free Card Images

• MSDN: Images in MFC

License » «

This software is freeware. All the legal-type disclaimers against misuse and suitability responsiblity apply.

The contents of this file must remain intact in any redistribution.