Changeset 383 for branches


Ignore:
Timestamp:
Oct 9, 2009, 2:58:02 PM (16 years ago)
Author:
pr
Message:

Add fixMmpmIni to fix missing End Drag sound. Bug 691.

Location:
branches/branch-1-0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/branch-1-0/include/helpers/syssound.h

    r300 r383  
    1212 */
    1313
    14 /*      Copyright (C) 1999-2000 Ulrich M”ller.
     14/*      Copyright (C) 1999-2009 Ulrich M”ller.
    1515 *      This file is part of the "XWorkplace helpers" source package.
    1616 *      This is free software; you can redistribute it and/or modify
     
    110110    APIRET sndDestroySoundScheme(PCSZ pszScheme);
    111111
     112    VOID fixMmpmIni(void);
     113
    112114#endif
    113115
  • branches/branch-1-0/src/helpers/syssound.c

    r300 r383  
    472472    {
    473473        free(pszExisting);
    474         return (TRUE);
    475     }
    476 
    477     return (FALSE);
     474        return TRUE;
     475    }
     476
     477    return FALSE;
    478478    */
    479479
     
    777777}
    778778
    779 
     779/*
     780 *@@ fixMmpmIni:
     781 *      creates the often missing "End drag"
     782 *      sound item in MMPM.INI if it doesn't exist.
     783 *
     784 *@@added XWP V1.0.9 (2009-10-08) [pr]: @@fixes 691
     785 */
     786
     787VOID fixMmpmIni(void)
     788{
     789    HINI hiniMmpm;
     790    CHAR szMMPM[CCHMAXPATH];
     791
     792    sndQueryMmpmIniPath(szMMPM);
     793    if (hiniMmpm = PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP), szMMPM))
     794    {
     795        ULONG   cbData = 0;
     796        CHAR    szKey[10];
     797
     798        sprintf (szKey, "%u", MMSOUND_DROP);
     799        if (   !PrfQueryProfileSize(hiniMmpm,
     800                                    MMINIKEY_SYSSOUNDS,
     801                                    szKey,
     802                                    &cbData)
     803            || (cbData ==0))
     804        {
     805            PSZ pszPos;
     806
     807            if (pszPos = strrchr (szMMPM, '\\'))
     808            {
     809                strcpy (pszPos, "\\SOUNDS\\DESKTOP\\DSK_DROP.WAV");
     810                sndWriteSoundData(hiniMmpm, MMSOUND_DROP, "End drag", szMMPM, 40);
     811            }
     812        }
     813
     814        PrfCloseProfile(hiniMmpm);
     815    }
     816}
     817
Note: See TracChangeset for help on using the changeset viewer.