Ignore:
Timestamp:
Sep 30, 2023, 11:06:42 PM (2 years ago)
Author:
erdmann
Message:

Created branch v2.9_Lars.

Location:
branches/v2.9_Lars
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/v2.9_Lars/classes/mm-progs/audioconverter/audconv.c

    r48 r74  
    1818 * along with this program; see the file COPYING.  If not, write to
    1919 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
    20  */         
     20 */
    2121/*
    2222 * If you need another license for your project/product (commercial,
    2323 * noncommercial, whatever) contact me at
    24  * 
     24 *
    2525 * http://www.os2world.com/cdwriting
    2626 * http://www.geocities.com/SiliconValley/Sector/5785/
     
    7070//#define INI_NAME_COLOR        "color"
    7171
    72 void HlpSendCommandToObject(char* chrObject, char* command);
     72void HlpSendCommandToObject(PSZ chrObject, PSZ command);
    7373BOOL percentRegisterBarClass(void);
    74 BOOL IniSaveWindowPos(char * iniFile, char* chrApp, char *chrKey, HWND hwnd);
    75 BOOL IniRestoreWindowPos(char * iniFile, char* chrApp, char *chrKey, HWND hwnd);
    76 BOOL IniSaveWindowClrs(char * chrIniFile, char* chrApp , HWND hwnd);
    77 BOOL IniRestoreWindowClrs(char * chrIniFile, char* chrApp , HWND hwnd);
    78 BOOL HlpBuildMMProgIniFileName(char* chrProgname, char * chrBuffer, ULONG ulBufferSize);
    79 HMODULE queryResModuleHandle(char *chrExePath);
     74BOOL IniSaveWindowPos(PSZ iniFile, PSZ chrApp, PSZ chrKey, HWND hwnd);
     75BOOL IniRestoreWindowPos(PSZ iniFile, PSZ chrApp, PSZ chrKey, HWND hwnd);
     76BOOL IniSaveWindowClrs(PSZ chrIniFile, PSZ chrApp , HWND hwnd);
     77BOOL IniRestoreWindowClrs(PSZ chrIniFile, PSZ chrApp , HWND hwnd);
     78BOOL HlpBuildMMProgIniFileName(PSZ chrProgname, PSZ chrBuffer, ULONG ulBufferSize);
     79HMODULE queryResModuleHandle(PSZ chrExePath);
    8080void freeResHandle();
    81 BOOL getMessage(char* text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd);
    82 ULONG messageBox( char* text, ULONG ulTextID , LONG lSizeText,
    83                   char* title, ULONG ulTitleID, LONG lSizeTitle,
     81BOOL getMessage(PSZ text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd);
     82ULONG messageBox( PSZ text, ULONG ulTextID , LONG lSizeText,
     83                  PSZ title, ULONG ulTitleID, LONG lSizeTitle,
    8484                  HMODULE hResource, HWND hwnd, ULONG ulFlags);
    8585
     
    9090BOOL bHaveWindowPos=FALSE;
    9191
    92 char chrTargetName[CCHMAXPATH]={0};
    93 char chrSourceName[CCHMAXPATH]={0};
    94 char chrProcName[CCHMAXPATH]={0};
    95 char chrIniFile[CCHMAXPATH];
     92UCHAR chrTargetName[CCHMAXPATH]={0};
     93UCHAR chrSourceName[CCHMAXPATH]={0};
     94UCHAR chrProcName[CCHMAXPATH]={0};
     95UCHAR chrIniFile[CCHMAXPATH];
    9696
    9797int numArgs;
     
    118118void pmUsage();
    119119
    120 BOOL createTargetName(char *sourceName, char *chrExt)
     120BOOL createTargetName(PSZ sourceName, PSZ chrExt)
    121121{
    122   char *textPtr;
    123 
    124   strcpy(chrTargetName, sourceName);
    125   if((textPtr=strrchr(chrTargetName, '.'))!=NULLHANDLE)
     122  PCHAR textPtr=NULL;
     123
     124  strcpy((PCHAR)chrTargetName, (PCHAR)sourceName);
     125  if((textPtr=strrchr((PCHAR)chrTargetName, '.'))!=NULL)
    126126    *textPtr=0;
    127127  else
    128     textPtr=chrTargetName;
     128    textPtr=(PCHAR)chrTargetName;
    129129  strcat(textPtr,".");
    130   strcat(textPtr, chrExt);
     130  strcat(textPtr, (PCHAR)chrExt);
    131131#if 0
    132132        WinMessageBox( HWND_DESKTOP, HWND_DESKTOP, textPtr,
     
    153153            '\0',
    154154            sizeof(MMFORMATINFO) );
    155    
     155
    156156    mmFormatInfo.ulMediaType |= MMIO_MEDIATYPE_AUDIO;
    157     mmFormatInfo.ulFlags|=MMIO_CANWRITETRANSLATED;   
     157    mmFormatInfo.ulFlags|=MMIO_CANWRITETRANSLATED;
    158158    ulReturnCode = mmioQueryFormatCount ( &mmFormatInfo,
    159159                                          &lNumIOProcs,
    160160                                          0,
    161161                                          0 );
    162    
     162
    163163    if( ulReturnCode != MMIO_SUCCESS )
    164164      {
     
    181181        return FALSE;
    182182      }
    183    
     183
    184184    /*
    185185     * call mmioGetFormats to get info on the formats supported.
     
    199199        return FALSE;
    200200      }
    201    
     201
    202202    if( lFormatsRead != lNumIOProcs )
    203203      {
     
    214214    for ( index = 0, sIdx=0; index <lNumIOProcs; index++ )
    215215      {
    216         char szName[CCHMAXPATH];
    217 
    218         mmioGetFormatName(pmmFormatInfoArray, szName, &lBytesRead, 0L, 0L);       
     216        UCHAR szName[CCHMAXPATH];
     217
     218        mmioGetFormatName(pmmFormatInfoArray, szName, &lBytesRead, 0L, 0L);
    219219        /* Insert NULL string terminator */
    220         *( szName + lBytesRead ) = (CHAR)NULL;
     220        *( szName + lBytesRead ) = 0;
    221221
    222222#ifdef DEBUG
    223         SysWriteToTrapLog("%d  IO-Proc: %s, %s\n", index, 
     223        SysWriteToTrapLog("%d  IO-Proc: %s, %s\n", index,
    224224                          pmmFormatInfoArray->szDefaultFormatExt,
    225225                          szName);
     
    231231            WinSendMsg(hwndDrop, LM_INSERTITEM,(MPARAM)LIT_END,
    232232                       (MPARAM)szName);
    233            
    234            
     233
     234
    235235            iPrivIOProc[sIdx]=index;
    236            
     236
    237237#ifdef DEBUG
    238238            SysWriteToTrapLog("-- %d  %d, sIdx: %d %s\n", index, iPrivIOProc[sIdx], sIdx,
     
    240240                              );
    241241#endif
    242            
    243            
     242
     243
    244244            /* Set text field */
    245245            if(bNoProcGiven) {
    246246              WinSetWindowText(hwndDrop, szName);
    247               createTargetName(chrSourceName, pmmFormatInfoArray->szDefaultFormatExt);
     247              createTargetName(chrSourceName, (PSZ)pmmFormatInfoArray->szDefaultFormatExt);
    248248              iIoProc=iPrivIOProc[sIdx];
    249249              bNoProcGiven=FALSE;
    250250            }
    251251            else {
    252               if(!stricmp(szName, chrProcName)) {
     252              if(!stricmp((PCHAR)szName, (PCHAR)chrProcName)) {
    253253                WinSetWindowText(hwndDrop, szName);
    254254                /* Create target name */
    255                 createTargetName(chrSourceName, pmmFormatInfoArray->szDefaultFormatExt);
     255                createTargetName(chrSourceName, (PSZ)pmmFormatInfoArray->szDefaultFormatExt);
    256256                iIoProc=iPrivIOProc[sIdx];
    257257              }
     
    262262        /*
    263263         *  advance to next entry in mmFormatInfo array
    264          */       
     264         */
    265265        pmmFormatInfoArray++;
    266266      }
     
    268268}
    269269
    270 BOOL queryAudioInfo(char *chrFile)
     270BOOL queryAudioInfo(PSZ chrFile)
    271271{
    272272  HMMIO hmmio;
     
    275275  LONG lBytesRead=0;
    276276  APIRET rc;
    277  
     277
    278278  memset(&mmioinfo,0, sizeof(mmioinfo));
    279279  mmioinfo.ulTranslate = MMIO_TRANSLATEHEADER;
     
    321321#endif
    322322
    323 void _Optlink convertThreadFunc (void *arg)
     323void convertThreadFunc (void *arg)
    324324{
    325325  HAB  hab;
     
    337337      LONG lBytesWritten=0;
    338338      ULONG rc;
    339       PBYTE buffer;
     339      PCHAR buffer=NULL;
    340340
    341341      do {
     
    349349        if((hmmio=mmioOpen(chrSourceName, &mmioinfo,MMIO_READ))==NULLHANDLE)
    350350          {
    351             char text[500];
    352             snprintf(text, sizeof(text)-1,"mmioOpen error with file %s\n", chrSourceName);
    353             WinMessageBox(hwnd, hwnd, "",
     351            UCHAR text[500];
     352            snprintf((PCHAR)text, sizeof(text)-1,"mmioOpen error with file %s\n", chrSourceName);
     353            WinMessageBox(hwnd, hwnd, (PSZ)"",
    354354                          text,
    355355                          0UL, MB_OK | MB_ICONEXCLAMATION|MB_MOVEABLE );
     
    360360                           &lBytesRead, 0, 0);
    361361        if(rc!=MMIO_SUCCESS) {
    362           char text[500];
     362          UCHAR text[500];
    363363          mmioClose(hmmio, 0);
    364           snprintf(text, sizeof(text)-1,"mmioGetHeader error!");
    365           WinMessageBox(hwnd, hwnd, "",
     364          snprintf((PCHAR)text, sizeof(text)-1,"mmioGetHeader error!");
     365          WinMessageBox(hwnd, hwnd, (PSZ)"",
    366366                        text,
    367367                        0UL, MB_OK | MB_ICONEXCLAMATION|MB_MOVEABLE );
     
    380380        if((hmmioTarget=mmioOpen(chrTargetName, &mmioinfo, MMIO_WRITE|MMIO_CREATE))==NULLHANDLE)
    381381          {
    382             char chrError[CCHMAXPATH];
    383             char text[500];
     382            UCHAR chrError[CCHMAXPATH];
     383            UCHAR text[CCHMAXPATH*2];
    384384            rc=mmioGetLastError(hmmioTarget);
    385385            mciGetErrorString(mmioinfo.ulErrorRet ,chrError, sizeof(chrError));
    386             snprintf(text, sizeof(text)-1,"mmioOpen error with file %s:\n%s\n%d", chrTargetName, chrError,mmioinfo.ulErrorRet);
     386            snprintf((PCHAR)text, sizeof(text)-1,"mmioOpen error with file %s:\n%s\n%lu", chrTargetName, chrError,mmioinfo.ulErrorRet);
    387387            mmioClose(hmmio,0);
    388             WinMessageBox(hwnd, hwnd, "",
     388            WinMessageBox(hwnd, hwnd, (PSZ)"",
    389389                          text,
    390390                          0UL, MB_OK | MB_ICONEXCLAMATION|MB_MOVEABLE );
     
    394394        rc = mmioSetHeader(hmmioTarget, &mmAudioHeader,sizeof(MMAUDIOHEADER),
    395395                           &lBytesWritten, 0, 0);
    396        
     396
    397397        /* Get buffer */
    398         if((buffer=(void*)malloc(CONVERTBUFFERSIZE))==NULLHANDLE) {
    399           char text[500];
     398        if((buffer=(PCHAR)malloc(CONVERTBUFFERSIZE))==NULLHANDLE) {
     399          UCHAR text[500];
    400400          mmioClose(hmmio, 0);
    401401          mmioClose(hmmioTarget,0);
    402           snprintf(text, sizeof(text)-1,"Can't get memory buffer!");
    403           WinMessageBox(hwnd, hwnd, "",
     402          snprintf((PCHAR)text, sizeof(text)-1,"Can't get memory buffer!");
     403          WinMessageBox(hwnd, hwnd, (PSZ)"",
    404404                        text,
    405405                        0UL, MB_OK | MB_ICONEXCLAMATION|MB_MOVEABLE );
    406          
     406
    407407          break;
    408408        }
     
    421421        }while(rc!=0 && rc!=MMIO_ERROR && !bBreak/*&& lBytesWritten <1000000*/);
    422422        if(rc==MMIO_ERROR) {
    423           char text[500];
    424           snprintf(text, sizeof(text)-1,"Error while reading audio data!");
    425           WinMessageBox(hwnd, hwnd, "",
     423          UCHAR text[500];
     424          snprintf((PCHAR)text, sizeof(text)-1,"Error while reading audio data!");
     425          WinMessageBox(hwnd, hwnd, (PSZ)"",
    426426                        text,
    427427                        0UL, MB_OK | MB_ICONEXCLAMATION|MB_MOVEABLE );
    428428        }
    429429        if(!bBreak) {
    430           char chrCommand[CCHMAXPATH*2];
     430          UCHAR chrCommand[CCHMAXPATH*2];
    431431          WinSendMsg(hwnd, WM_APPTERMINATENOTIFY, MPFROMLONG(MSG_CONVERTPERCENT), MPFROMLONG(100));
    432432          /* Refresh details view */
    433           HlpSendCommandToObject(chrTargetName, "CWAUDIOREFRESH=1");
    434           sprintf(chrCommand,"CWAUDIOCOPYTAGTO=%s;", chrTargetName);
     433          HlpSendCommandToObject(chrTargetName, (PSZ)"CWAUDIOREFRESH=1");
     434          sprintf((PCHAR)chrCommand,"CWAUDIOCOPYTAGTO=%s;", chrTargetName);
    435435          HlpSendCommandToObject(chrSourceName, chrCommand);
    436436        }
     
    443443      }
    444444      while(TRUE);
    445       WinSendMsg(hwnd, WM_APPTERMINATENOTIFY, MPFROMLONG(MSG_CONVERTDONE), 0);     
     445      WinSendMsg(hwnd, WM_APPTERMINATENOTIFY, MPFROMLONG(MSG_CONVERTDONE), 0);
    446446      WinDestroyMsgQueue(hmq);
    447447    }
     
    464464MRESULT EXPENTRY decodeStatusDialogProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    465465{
    466   char text[CCHMAXPATH*4 +10];
    467   char title[CCHMAXPATH*4];
     466  UCHAR text[CCHMAXPATH*4 +10];
     467  UCHAR title[CCHMAXPATH*4];
    468468  SWCNTRL swctl;
    469469  PID pid;
     
    471471
    472472  switch (msg)
    473     {     
     473    {
    474474    case WM_INITDLG:
    475475
     
    493493
    494494      WinSendMsg(WinWindowFromID(hwnd,IDST_CONVERTNAME),EM_SETTEXTLIMIT,MPFROMSHORT((SHORT)CCHMAXPATH),0);
    495      
    496       WinSetWindowText(WinWindowFromID(hwnd,IDST_CONVERTCDBITS), "");
    497      
     495
     496      WinSetWindowText(WinWindowFromID(hwnd,IDST_CONVERTCDBITS), (PSZ)"");
     497
    498498      /* Filename */
    499499      WinSetWindowText(WinWindowFromID(hwnd,IDST_CONVERTNAME), chrSourceName);
    500      
     500
    501501      /* Set dialog font to WarpSans for Warp 4 and above */
    502502      if(SysQueryOSRelease()>=40) {
     
    507507
    508508      /* Set percent bars to 0. */
    509       WinSetWindowText(WinWindowFromID(hwnd,IDBAR_CONVERTPROGRESS),"0#0%");
     509      WinSetWindowText(WinWindowFromID(hwnd,IDBAR_CONVERTPROGRESS),(PSZ)"0#0%");
    510510
    511511      WinSendMsg(WinWindowFromID(hwnd,IDEF_CONVERTTARGETNAME), EM_SETTEXTLIMIT,MPFROMSHORT((SHORT)CCHMAXPATH),0);
     
    516516      /* Channels */
    517517      getMessage(title, IDSTR_CONVERTCHANNELS, sizeof(title), RESSOURCEHANDLE, hwnd);
    518       sprintf(text, title, sChannels);
     518      sprintf((PCHAR)text, (PCHAR)title, sChannels);
    519519      WinSetWindowText(WinWindowFromID(hwnd,IDST_CONVERTCHANNELS),text);
    520520
    521521      /* Samplerate */
    522522      getMessage(title, IDSTR_CONVERTSAMPLERATE, sizeof(title), RESSOURCEHANDLE, hwnd);
    523       sprintf(text, title, iSampleRate);
     523      sprintf((PCHAR)text, (PCHAR)title, iSampleRate);
    524524      WinSetWindowText(WinWindowFromID(hwnd,IDST_CONVERTSAMPLERATE),text);
    525525
    526526      /* Playtime */
    527527      getMessage(title, IDSTR_CONVERTPLAYTIME, sizeof(title), RESSOURCEHANDLE, hwnd);   
    528       sprintf(text, title, lSec/60, lSec%60);
     528      sprintf((PCHAR)text, (PCHAR)title, lSec/60, lSec%60);
    529529      WinSetWindowText(WinWindowFromID(hwnd,IDST_CONVERTPLAYTIME),text);
    530530
     
    551551            iPercent=0;
    552552
    553           /* Update track percent bar value. The helper prog sends us the actual decoded %. */         
     553          /* Update track percent bar value. The helper prog sends us the actual decoded %. */
    554554          sprintf(text,"%d#%d%%", iPercent, iPercent);
    555555          WinSetWindowText(WinWindowFromID(hwnd,IDBAR_CONVERTPROGRESS), text);
     
    593593
    594594           createTargetName(chrSourceName, pMemFormatInfo[iIoProc].szDefaultFormatExt);
    595            WinSetWindowText( WinWindowFromID(hwnd,IDEF_CONVERTTARGETNAME), chrTargetName );           
     595           WinSetWindowText( WinWindowFromID(hwnd,IDEF_CONVERTTARGETNAME), chrTargetName );
    596596         }
    597597        }
     
    613613        case IDPB_CONVERTBROWSE:
    614614          {
    615             char chrTitle[200];
     615            UCHAR chrTitle[200];
    616616            FILEDLG fd = { 0 };
    617617            /* User pressed the browse button */
     
    652652            ULONG ulDiskNum;
    653653            char cLetter;
    654            
     654
    655655            WinQueryWindowText( WinWindowFromID(hwnd,IDEF_CONVERTTARGETNAME), sizeof(chrTargetName), chrTargetName );
    656656
     
    669669            if(lFreeSpace<lAudioSize) {
    670670              /*
    671                 Text:   
    672                 Title: 
    673                 */       
     671                Text:
     672                Title:
     673                */
    674674              getMessage(title, IDSTR_CONVERTNOSPACETEXT,sizeof(title), RESSOURCEHANDLE, hwnd);
    675675              sprintf(text,title,lAudioSize/1000000 );
     
    681681            else {
    682682              /* Start decoding an audio file */
    683               WinEnableWindow( WinWindowFromID(hwnd,IDPB_CONVERTOK), FALSE);           
     683              WinEnableWindow( WinWindowFromID(hwnd,IDPB_CONVERTOK), FALSE);
    684684              WinEnableWindow( WinWindowFromID(hwnd,IDPB_CONVERTABORT), TRUE);
    685685              convertAudioFile(hwnd);
    686686            }
    687            
     687
    688688            break;
    689689          }
     
    695695      break;
    696696    }/* switch */
    697  
     697
    698698  return WinDefDlgProc( hwnd, msg, mp1, mp2);
    699699}
     
    726726  if(hab) {
    727727    hmq=WinCreateMsgQueue(hab,0);
    728     if(hmq) { 
    729       /* Check if user started prog by hand */   
     728    if(hmq) {
     729      /* Check if user started prog by hand */
    730730      if(argc<NUMPARAMS-1) {/* Not the actual num of params */
    731731        pmUsage();
     
    740740          strcpy(chrProcName, "");
    741741        }
    742         /* Get our ressource dll */ 
     742        /* Get our ressource dll */
    743743        //   RESSOURCEHANDLE=0;
    744744        RESSOURCEHANDLE=queryResModuleHandle(argv[0]);
     
    751751            {
    752752              /*
    753                 Text:   
    754                 Title:  "Installation problem"                       
    755                 */             
     753                Text:
     754                Title:  "Installation problem"
     755                */
    756756              messageBox( text, IDSTR_CONVERTDIALOGERROR , sizeof(text),
    757757                          title, IDSTR_INSTALLERRORTITLE , sizeof(title),
     
    762762              DosBeep(100,600);
    763763              return( 1 );
    764             }   
     764            }
    765765        }
    766766      }
  • branches/v2.9_Lars/classes/mm-progs/imageconverter/imgconv.c

    r2 r74  
    2323 * If you need another license for your project/product (commercial,
    2424 * noncommercial, whatever) contact me at
    25  * 
     25 *
    2626 * http://www.os2world.com/cdwriting
    2727 * http://www.geocities.com/SiliconValley/Sector/5785/
     
    143143    SIZEL         ImageSize;
    144144    ULONG         dwHeight, dwWidth;
    145     SHORT          wBitCount;
     145    SHORT         wBitCount;
    146146    FOURCC        fccStorageSystem;
    147147    ULONG         dwPadBytes;
    148148    ULONG         dwRowBits;
    149149    ULONG         ulReturnCode;
    150     ULONG         dwReturnCode;
    151     HBITMAP       hbReturnCode;
    152     LONG          lReturnCode;
    153150    FOURCC        fccIOProc;
    154151    HDC           hdc;
     
    212209
    213210
    214     dwReturnCode = mmioQueryHeaderLength ( hmmio,
     211    ulReturnCode = mmioQueryHeaderLength ( hmmio,
    215212                                         (PLONG)&ulImageHeaderLength,
    216213                                           0L,
     
    288285        return(0L);
    289286      }
    290    
     287
    291288
    292289    // ***************************************************
     
    294291    // the memory device context obtained above.
    295292    // ***************************************************
    296    
     293
    297294    ImageSize.cx = dwWidth;
    298295    ImageSize.cy = dwHeight;
     
    312309                       (ULONG) MB_OK | MB_MOVEABLE |
    313310                       MB_ERROR );
    314 #endif   
     311#endif
    315312        DevCloseDC(hdc);
    316313        DosFreeMem(pRowBuffer);
     
    350347    // Select the bitmap into the memory device context.
    351348    // ***************************************************
    352     hbReturnCode = GpiSetBitmap ( hps,
     349    ulReturnCode = GpiSetBitmap ( hps,
    353350                                  hbm );
    354351
     
    371368          *  it to work. Perhaps will get to it when time is available...
    372369          */
    373          lReturnCode = GpiSetBitmapBits ( hps,
     370         ulReturnCode = GpiSetBitmapBits ( hps,
    374371                                          (LONG) dwRowCount,
    375372                                          (LONG) 1,
     
    379376
    380377    /* Clean up */
    381     hbReturnCode = GpiSetBitmap ( hps,
     378    ulReturnCode = GpiSetBitmap ( hps,
    382379                                  NULLHANDLE );
    383380    ulReturnCode = mmioClose (hmmio, 0L);
     
    396393                          PBITMAPINFOHEADER2 pBmpInfoHeader2,
    397394                          HWND hwnd)
    398                           //                          ULONG ulWidth, 
     395                          //                          ULONG ulWidth,
    399396                          //     ULONG ulHeight)
    400397{
    401398  HBITMAP       hbmTarget;
    402399  SIZEL         ImageSize;
    403   HBITMAP       hbReturnCode;
    404400  HDC           hdc;
    405401  HPS           hps;
     
    413409   */
    414410  WinQueryWindowPos ( hwnd, &swp);
    415  
     411
    416412  /* Image size */
    417  
     413
    418414  ulHeight = bmpInfoHeader2.cy;
    419415  ulWidth = bmpInfoHeader2.cx;
     
    423419      aptl[0].x=0;
    424420      aptl[1].x=aptl[0].x+ulWidth;
    425      
     421
    426422      aptl[0].y=0;
    427423      aptl[1].y=aptl[0].y+ulHeight;
     
    429425  else {
    430426    float fWidth, fHeight, fRes;
    431    
     427
    432428    fWidth=(float)swp.cx/(float)ulWidth;
    433429    fHeight=(float)swp.cy/(float)ulHeight;
    434430    fRes=( fWidth>fHeight ? fHeight : fWidth);
    435    
    436    
     431
     432
    437433    aptl[0].x=0;
    438434    aptl[1].x=aptl[0].x+ulWidth*fRes;
    439    
     435
    440436      aptl[0].y=0;
    441437      aptl[1].y=aptl[0].y+ulHeight*fRes;
    442438    }
    443    
     439
    444440    aptl[2].x = 0;              // source lower left
    445441    aptl[2].y = 0;
    446    
     442
    447443    aptl[3].x = ulWidth;   // source upper right
    448444    aptl[3].y = ulHeight;
     
    468464        return(0L);
    469465      }
    470    
     466
    471467    // ***************************************************
    472468    // Create a memory presentation space that includes
     
    486482
    487483    /* Now scale the bitmap */
    488     memcpy(&bmpih2, pBmpInfoHeader2, sizeof(BITMAPINFOHEADER2));   
     484    memcpy(&bmpih2, pBmpInfoHeader2, sizeof(BITMAPINFOHEADER2));
    489485
    490486    bmpih2.cx=aptl[1].x-aptl[0].x;
     
    509505
    510506    /* Blit it */
    511     hbReturnCode = GpiSetBitmap ( hps, hbmTarget );
     507    GpiSetBitmap ( hps, hbmTarget );
    512508
    513509    GpiWCBitBlt(hps, hbm,4L, aptl, ROP_SRCCOPY, BBO_IGNORE);
    514510
    515     hbReturnCode = GpiSetBitmap( hps, NULLHANDLE );
     511    GpiSetBitmap( hps, NULLHANDLE );
    516512    GpiDestroyPS(hps);
    517513    DevCloseDC(hdc);
     
    545541  strcat(textPtr,".");
    546542  strcat(textPtr, chrExt);
    547  
     543
    548544  return TRUE;
    549545}
     
    564560            '\0',
    565561            sizeof(MMFORMATINFO) );
    566    
     562
    567563    mmFormatInfo.ulMediaType |= MMIO_MEDIATYPE_IMAGE;
    568     mmFormatInfo.ulFlags|=MMIO_CANWRITETRANSLATED;   
     564    mmFormatInfo.ulFlags|=MMIO_CANWRITETRANSLATED;
    569565    ulReturnCode = mmioQueryFormatCount ( &mmFormatInfo,
    570566                                          &lNumIOProcs,
    571567                                          0,
    572568                                          0 );
    573    
     569
    574570    if( ulReturnCode != MMIO_SUCCESS )
    575571      {
     
    592588        return FALSE;
    593589      }
    594    
     590
    595591    /*
    596592     * call mmioGetFormats to get info on the formats supported.
     
    610606        return FALSE;
    611607      }
    612    
     608
    613609    if( lFormatsRead != lNumIOProcs )
    614610      {
     
    627623        char szName[CCHMAXPATH];
    628624
    629         mmioGetFormatName(pmmFormatInfoArray, szName, &lBytesRead, 0L, 0L);       
     625        mmioGetFormatName(pmmFormatInfoArray, szName, &lBytesRead, 0L, 0L);
    630626        /* Insert NULL string terminator */
    631         *( szName + lBytesRead ) = (CHAR)NULL;
     627        *( szName + lBytesRead ) = 0;
    632628
    633629
     
    643639
    644640#ifdef DEBUG
    645         HlpWriteToTrapLog("------ %d private idx: %d, IO-Proc: %s %s\n", index, sIdx, 
     641        HlpWriteToTrapLog("------ %d private idx: %d, IO-Proc: %s %s\n", index, sIdx,
    646642                          pmmFormatInfoArray->szDefaultFormatExt,
    647643                          szName);
    648644#endif
    649            
     645
    650646            iPrivIOProc[sIdx]=index;
    651647
     
    669665        /*
    670666         *  advance to next entry in mmFormatInfo array
    671          */       
     667         */
    672668        pmmFormatInfoArray++;
    673669      }
     
    700696  ULONG         iIndex, iCount, iCount2;
    701697
    702   MMFORMATINFO  mmFormatInfo; 
     698  MMFORMATINFO  mmFormatInfo;
    703699  FOURCC fccSourceIOProc;
    704700  FOURCC        fccStorageSystem;
     
    728724  mmioinfoSource.fccIOProc = fccSourceIOProc;
    729725  mmioinfoSource.ulTranslate = MMIO_TRANSLATEHEADER | MMIO_TRANSLATEDATA;
    730  
     726
    731727  hmmioSource = mmioOpen ((PSZ)pszSource, &mmioinfoSource,
    732728                          MMIO_READ | MMIO_DENYWRITE
    733729                          | MMIO_NOIDENTIFY);
    734  
     730
    735731  if (!hmmioSource)
    736732    return (FALSE);
    737  
     733
    738734  /*******************************/
    739735  /* Set up/open the TARGET file */
     
    743739  mmioinfoTarget.fccIOProc = fccTargetIOProc;
    744740  mmioinfoTarget.ulTranslate = MMIO_TRANSLATEHEADER | MMIO_TRANSLATEDATA;
    745  
     741
    746742  hmmioTarget = mmioOpen ((PSZ)pszTarget,
    747743                          &mmioinfoTarget,
    748744                          MMIO_CREATE | MMIO_WRITE |
    749745                          MMIO_DENYWRITE | MMIO_NOIDENTIFY);
    750  
     746
    751747  if (!hmmioTarget)
    752748    {
     
    762758  rcSrcQueryCount = mmioSendMessage(hmmioSource, MMIOM_QUERYIMAGECOUNT, (LONG)&iCount, (LONG)0);
    763759  if (rcSrcQueryCount) iCount = 1;
    764  
     760
    765761  // find out if the target has multiple image support
    766762  rcTrgQueryCount = mmioSendMessage(hmmioTarget, MMIOM_QUERYIMAGECOUNT, (LONG)&iCount2, (LONG)0);
    767  
     763
    768764  for (iIndex=0; iIndex<iCount; iIndex++) { /* loop through known images */
    769765
    770766    if (!rcSrcQueryCount && !rcTrgQueryCount) {  /* if Both support images */
    771      
     767
    772768      /* Determine if the target can write arrays, and if not */
    773769      /* then write the the default image from the source     */
    774770
    775771      if (rcTrgSetImage && iIndex > 0) break;  /* Target Can't Write array */
    776      
     772
    777773      /* Now, determine if the target can write arrays */
    778774      rcTrgSetImage = mmioSendMessage (hmmioTarget, MMIOM_SETIMAGE, (LONG)iIndex, (LONG)0);
    779      
     775
    780776      if (!rcTrgSetImage) mmioSendMessage (hmmioSource, MMIOM_SETIMAGE, (LONG)iIndex, (LONG)0);
    781      
     777
    782778    } else if (!rcSrcQueryCount) {      /* Source does but target doesn't */
    783779      /* Use the default image from source to copy to target */
     
    806802                              (LONG)sizeof (MMIMAGEHEADER), (PLONG)&ulBytesRead,
    807803                              0L, 0L);
    808    
     804
    809805    if (rc != MMIO_SUCCESS)
    810806      /* Header unavailable */
     
    814810        return (FALSE);
    815811      }
    816    
     812
    817813
    818814    /*************************/
     
    828824      }
    829825
    830    
     826
    831827    /* Use the SAME data as came from the SOURCE FILE.  It must be
    832828       compatible with the OS/2 bitmaps, etc.   */
     
    834830                              (LONG)sizeof (MMIMAGEHEADER), (PLONG)&ulBytesRead,
    835831                              0L, 0L);
    836    
     832
    837833    if (rc != MMIO_SUCCESS)
    838834      /* Header unavailable */
     
    846842        HlpWriteToTrapLog("Target header set.\n");
    847843#endif
    848    
     844
    849845    /* Determine the number of bytes required, per row */
    850846    /*      PLANES MUST ALWAYS BE = 1 */
     
    853849    dwRowBits = dwWidth * mmImgHdr.mmXDIBHeader.BMPInfoHeader2.cBitCount;
    854850    dwNumRowBytes = dwRowBits >> 3;
    855    
     851
    856852    /* Account for odd bits used in 1bpp or 4bpp images that are NOT on byte boundaries. */
    857853    if (dwRowBits % 8)
    858854      dwNumRowBytes++;
    859    
     855
    860856    /* Ensure the row length in bytes accounts for byte padding.  All bitmap data rows
    861857       must are aligned on LONG/4-BYTE boundaries.   The data FROM an IOProc
     
    898894  mmioClose (hmmioSource, 0L);
    899895  DosFreeMem(pRowBuffer);
    900  
     896
    901897  return(TRUE);
    902898}
    903899
    904 void _Optlink convertThreadFunc (void *arg)
     900void convertThreadFunc (void *arg)
    905901{
    906902  HAB  hab;
     
    916912                chrSourceName,
    917913                chrTargetName,  pMemFormatInfo[iIoProc].fccIOProc);
    918      
    919      
    920 
    921       WinPostMsg(hwnd, WM_APPTERMINATENOTIFY, MPFROMLONG(MSG_CONVERTDONE), 0);     
     914
     915
     916
     917      WinPostMsg(hwnd, WM_APPTERMINATENOTIFY, MPFROMLONG(MSG_CONVERTDONE), 0);
    922918      DosSleep(1000);
    923919      WinDestroyMsgQueue(hmq);
     
    944940    POINTL aptl[4];
    945941    HPS    hps;
    946     BOOL   bReturnCode;
    947942    ULONG  ulHeight;
    948943    ULONG  ulWidth;
     
    954949     *  Get position of image frame
    955950     */
    956     bReturnCode = WinQueryWindowPos ( hwnd, &swp);
     951    WinQueryWindowPos ( hwnd, &swp);
    957952
    958953    /* Center image */
     
    963958        aptl[0].x=(swp.cx-ulWidth)/2;
    964959        aptl[1].x=aptl[0].x+ulWidth;
    965        
     960
    966961        aptl[0].y=(swp.cy-ulHeight)/2;
    967962        aptl[1].y=aptl[0].y+ulHeight;
     
    977972      aptl[0].x=(swp.cx-ulWidth*fRes)/2;
    978973      aptl[1].x=aptl[0].x+ulWidth*fRes;
    979      
     974
    980975      aptl[0].y=(swp.cy-ulHeight*fRes)/2;
    981976      aptl[1].y=aptl[0].y+ulHeight*fRes;
    982977    }
    983    
     978
    984979    aptl[2].x = 0;              // source lower left
    985980    aptl[2].y = 0;
    986    
     981
    987982    aptl[3].x = ulWidth;   // source upper right
    988983    aptl[3].y = ulHeight;
     
    1004999    //       WinDrawBitmap(hps, hBitmap, NULLHANDLE, (PPOINTL)aptl, 0, 0, DBM_NORMAL/*|DBM_STRETCH*/);
    10051000#endif
    1006     bReturnCode = WinEndPaint (hps);
     1001    WinEndPaint (hps);
    10071002}
    10081003
     
    10111006
    10121007  switch (msg)
    1013     {     
     1008    {
    10141009    case WM_PAINT:
    10151010      {
     
    10361031
    10371032  switch (msg)
    1038     {     
     1033    {
    10391034    case WM_INITDLG:
    10401035#if 0
     
    10471042
    10481043      WinSendMsg(WinWindowFromID(hwnd,IDST_IMGCONVERTNAME),EM_SETTEXTLIMIT,MPFROMSHORT((SHORT)CCHMAXPATH),0);
    1049      
     1044
    10501045      /* Filename */
    10511046      WinSetWindowText(WinWindowFromID(hwnd,IDST_IMGCONVERTNAME), chrSourceName);
    1052      
     1047
    10531048      /* Set dialog font to WarpSans for Warp 4 and above */
    10541049      if(SysQueryOSRelease()>=40) {
     
    11121107            iPercent=0;
    11131108
    1114           /* Update track percent bar value. The helper prog sends us the actual decoded %. */         
     1109          /* Update track percent bar value. The helper prog sends us the actual decoded %. */
    11151110          sprintf(text,"%d#%d%%", iPercent, iPercent);
    11161111          WinSetWindowText(WinWindowFromID(hwnd,IDBAR_IMGCONVERTPROGRESS), text);
     
    11491144
    11501145           createTargetName(chrSourceName, pMemFormatInfo[iIoProc].szDefaultFormatExt);
    1151            WinSetWindowText( WinWindowFromID(hwnd,IDEF_IMGCONVERTTARGETNAME), chrTargetName );           
     1146           WinSetWindowText( WinWindowFromID(hwnd,IDEF_IMGCONVERTTARGETNAME), chrTargetName );
    11521147         }
    11531148        }
     
    12101205            // ULONG ulDiskNum;
    12111206            // char cLetter;
    1212            
     1207
    12131208            /* Get target name */
    1214             WinQueryWindowText( WinWindowFromID(hwnd,IDEF_IMGCONVERTTARGETNAME), 
     1209            WinQueryWindowText( WinWindowFromID(hwnd,IDEF_IMGCONVERTTARGETNAME),
    12151210                                sizeof(chrTargetName), chrTargetName );
    12161211#if 0
     
    12251220             if(lFreeSpace<lAudioSize) {
    12261221               /*
    1227                  Text:   
    1228                  Title: 
    1229                  */       
     1222                 Text:
     1223                 Title:
     1224                 */
    12301225               getMessage(title, IDSTR_CONVERTNOSPACETEXT,sizeof(title), RESSOURCEHANDLE, hwnd);
    12311226               sprintf(text,title,lAudioSize/1000000 );
     
    12371232             else {
    12381233               /* Start decoding an audio file */
    1239                WinEnableWindow( WinWindowFromID(hwnd,IDPB_CONVERTOK), FALSE);           
     1234               WinEnableWindow( WinWindowFromID(hwnd,IDPB_CONVERTOK), FALSE);
    12401235               WinEnableWindow( WinWindowFromID(hwnd,IDPB_CONVERTABORT), TRUE);
    12411236               convertAudioFile(hwnd);
     
    12441239             /* Start converting image file */
    12451240             WinPostMsg(hwnd, WM_APPTERMINATENOTIFY, MPFROMLONG(MSG_CONVERTPERCENT), MPFROMLONG(0));
    1246              WinEnableWindow( WinWindowFromID(hwnd,IDPB_IMGCONVERTOK), FALSE);           
     1241             WinEnableWindow( WinWindowFromID(hwnd,IDPB_IMGCONVERTOK), FALSE);
    12471242             WinEnableWindow( WinWindowFromID(hwnd,IDPB_IMGCONVERTABORT), TRUE);
    12481243             convertImageFile(hwnd);
     
    12561251      break;
    12571252    }/* switch */
    1258  
     1253
    12591254  return WinDefDlgProc( hwnd, msg, mp1, mp2);
    12601255}
     
    12831278  if(hab) {
    12841279    hmq=WinCreateMsgQueue(hab,0);
    1285     if(hmq) { 
    1286       /* Check if user started prog by hand */   
     1280    if(hmq) {
     1281      /* Check if user started prog by hand */
    12871282      if(argc<NUMPARAMS-1) {/* Not the right num of params */
    12881283        pmUsage();
     
    12971292          strcpy(chrProcName, "");
    12981293        }
    1299         /* Get our ressource dll */ 
     1294        /* Get our ressource dll */
    13001295        //   RESSOURCEHANDLE=0;
    13011296        RESSOURCEHANDLE=queryResModuleHandle(argv[0]);
     
    13041299        /* Register the percent bar window class */
    13051300        percentRegisterBarClass();
    1306        
    1307         globalHab=WinQueryAnchorBlock(HWND_DESKTOP);       
     1301
     1302        globalHab=WinQueryAnchorBlock(HWND_DESKTOP);
    13081303        hBitmap=loadBitmap ( chrSourceName, &bmpInfoHeader2);
    1309        
    1310         if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, decodeStatusDialogProc, 
     1304
     1305        if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, decodeStatusDialogProc,
    13111306                       RESSOURCEHANDLE, IDDLG_IMGCONVERT, 0) == DID_ERROR )
    13121307          {
     
    13141309            char title[CCHMAXPATH];
    13151310            /*
    1316               Text:   
    1317               Title:  "Installation problem"                       
    1318               */             
     1311              Text:
     1312              Title:  "Installation problem"
     1313              */
    13191314            messageBox( text, IDSTR_CONVERTDIALOGERROR , sizeof(text),
    13201315                        title, IDSTR_INSTALLERRORTITLE , sizeof(title),
     
    13291324            return( 1 );
    13301325          }
    1331         if(pMemFormatInfo)   
     1326        if(pMemFormatInfo)
    13321327          free(pMemFormatInfo);
    13331328        if(hBitmap)
  • branches/v2.9_Lars/classes/mm-progs/include/mmprogs_defaults.h

    r4 r74  
    1717 * If you need another license for your project/product (commercial,
    1818 * noncommercial, whatever) contact me at
    19  * 
     19 *
    2020 * http://www.os2world.com/cdwriting
    2121 * http://www.geocities.com/SiliconValley/Sector/5785/
     
    3434/* Audio player */
    3535#define DEFAULT_VOLUME    75      /* Default volume for audio player (not volume object) */
    36 #define INI_MMPLAYER_APP      "mmplayer"     /* App name to use                       */
    37 #define INI_DISPLAY_KEY   "displaytype"  /* Key for storing which display to show */
    38 #define INI_VOLUME_KEY    "volume"       /* Key for storing the volume            */
     36#define INI_MMPLAYER_APP      (PSZ)"mmplayer"     /* App name to use                       */
     37#define INI_DISPLAY_KEY       (PSZ)"displaytype"  /* Key for storing which display to show */
     38#define INI_VOLUME_KEY        (PSZ)"volume"       /* Key for storing the volume            */
    3939
    4040/* Image converter */
    41 #define INI_IMGCONV_APP        "imageconv"
     41#define INI_IMGCONV_APP       (PSZ)"imageconv"
    4242
    4343/* Audio converter */
    44 #define INI_AUDIOCONV_APP        "audioconv"
     44#define INI_AUDIOCONV_APP     (PSZ)"audioconv"
    4545
    4646/* Master volume */
    47 #define INI_VOLUME_APP        "volume"
     47#define INI_VOLUME_APP        (PSZ)"volume"
    4848
    4949/* Volume for classes */
    50 #define INI_CLASSVOLUME_APP        "classvolume"
     50#define INI_CLASSVOLUME_APP   (PSZ)"classvolume"
    5151
    5252/* For setting volume */
    53 #define SETUP_MMAUDIOVOLUME         "MMAUDIOVOLUME"
     53#define SETUP_MMAUDIOVOLUME   (PSZ)"MMAUDIOVOLUME"
  • branches/v2.9_Lars/classes/mm-progs/makefile

    r2 r74  
    77
    88CC           = gcc
    9 LIB_DIR      = $d:/emx/lib
    10 #CPPFLAGS     = -Ge- /Gm+ -G4 -Gl  /O+ -Oc+ -Ol
    11 CPPFLAGS     = -O -Wall -Zomf -Zcrtdll -s
     9CPPFLAGS     = -O -Wno-pointer-sign -Wall -Zomf -Zcrtdll -s
    1210INC             =       ./include -I ../../classes/inc -I ../../common_functions/include
    13 DEFS         = 
    14 PROGS        = 
     11DEFS         =
     12PROGS        =
    1513ODIR            = .
    1614CPPDIR  = .
     
    2220
    2321$(LIBDIR)/%.obj:        $(COMMONSRC)/%.c
    24         gcc -c -Wall -o$@ -Zomf -I$(INC) $<             
     22        gcc -c -Wno-pointer-sign -Wall -o$@ -Zomf -I$(INC) $<           
    2523
    2624all:    $(LIBOBJS)
     
    4846        -cd ./mmplayer && make cleaner
    4947        -cd ./master_volume && make cleaner
    50         -rm ./include/*.*~ 
     48        -rm ./include/*.*~
    5149
    5250       
  • branches/v2.9_Lars/classes/mm-progs/master_volume/volume.c

    r2 r74  
    1717 * along with this program; see the file COPYING.  If not, write to
    1818 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
    19  */         
     19 */
    2020/*
    2121 * If you need another license for your project/product (commercial,
    2222 * noncommercial, whatever) contact me at
    23  * 
     23 *
    2424 * http://www.os2world.com/cdwriting
    2525 * http://www.geocities.com/SiliconValley/Sector/5785/
     
    3535#define INCL_MMIOOS2
    3636#define INCL_MCIOS2
    37 #define INCL_SECONDARYWINDOW   
    38 #define INCL_GRAPHICBUTTON 
     37#define INCL_SECONDARYWINDOW
     38#define INCL_GRAPHICBUTTON
    3939#include <os2.h>
    4040#include <sw.h>
     
    7373BOOL bHaveWindowPos=FALSE;
    7474
    75 BOOL bMute=FALSE; 
     75BOOL bMute=FALSE;
    7676HMODULE RESSOURCEHANDLE=0;
    7777int bTBVisible=0;
     
    134134
    135135/* Masteraudio does not support NOTIFY so use a thread to prevent PM freeze */
    136 MRESULT EXPENTRY volumeObjectProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 
     136MRESULT EXPENTRY volumeObjectProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    137137{
    138138  switch(msg)
     
    153153              ULONG mastervolume;              /* Set to master volumepercentage
    154154                                                  percentage by this example      */
    155              
     155
    156156              USHORT usDeviceID=0;
    157157              MCI_MASTERAUDIO_PARMS masteraudioparms;
     
    161161              memset(&openParms,0, sizeof(openParms));
    162162              openParms.pszDeviceType="Masteraudio";
    163  
     163
    164164              rc=mciSendCommand(0,       /* Device                          */
    165165                             MCI_OPEN,                /* Master audio message            */
     
    171171              mciGetErrorString(rc,chrCommand, sizeof(chrCommand));
    172172              //sprintf(chrCommand, "%x", rc);
    173               WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, chrCommand, "", 1234, MB_MOVEABLE);             
     173              WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, chrCommand, "", 1234, MB_MOVEABLE);
    174174              DosBeep(5000, 10);
    175175              usDeviceID=openParms.usDeviceID;
     
    178178              /* Get current system master
    179179                 volume setting                  */
    180              
     180
    181181              mciSendCommand(usDeviceID,       /* Device                          */
    182182                             MCI_MASTERAUDIO,                /* Master audio message            */
     
    188188              /* Get current system master
    189189                 volume setting                  */
    190              
     190
    191191              mciSendCommand(usDeviceID,       /* Device                          */
    192192                             MCI_MASTERAUDIO,                /* Master audio message            */
     
    195195                             (PVOID) &masteraudioparms,      /* Data structure                  */
    196196                             0);                             /* User parm                       */
    197              
     197
    198198              mastervolume = masteraudioparms.ulReturn;
    199199                          DosBeep(500, 10);
     
    228228}
    229229
    230 void _Optlink volumeThreadFunc (void *arg)
     230void volumeThreadFunc (void *arg)
    231231{
    232232  HAB  hab;
     
    238238    hmq=WinCreateMsgQueue(hab,0);
    239239    if(hmq) {
    240      
     240
    241241      if((hwndThread=WinCreateWindow(HWND_OBJECT, WC_STATIC, "", 0,0,0,0,0, NULLHANDLE,
    242242                                     HWND_BOTTOM, 1, NULLHANDLE, NULLHANDLE))==NULLHANDLE) {
     
    245245      }
    246246      WinSubclassWindow(hwndThread,&volumeObjectProc);
    247       /* Window created. */             
     247      /* Window created. */
    248248
    249249      while(WinGetMsg(hab,&qmsg,(HWND)NULL,0,0))
    250250        WinDispatchMsg(hab,&qmsg);
    251251      WinDestroyWindow(hwndThread);
    252      
     252
    253253      WinDestroyMsgQueue(hmq);
    254254    }
     
    267267  if((hwndTitleBar=WinWindowFromID(hwnd, FID_TITLEBAR))==NULLHANDLE)
    268268    return;
    269      
     269
    270270  hwndPopup = WinLoadMenu(hwnd, RESSOURCEHANDLE, IDM_POPUP);
    271271  if (hwndPopup == NULLHANDLE)
    272272    return;
    273  
     273
    274274  bVisible=WinIsWindowVisible(hwndTitleBar);
    275275
    276276  if(!bVisible)
    277     WinSendMsg(hwndPopup,MM_SETITEMATTR,MPFROM2SHORT(IDM_ITEMTITLEBAR,FALSE), 
     277    WinSendMsg(hwndPopup,MM_SETITEMATTR,MPFROM2SHORT(IDM_ITEMTITLEBAR,FALSE),
    278278               MPFROM2SHORT(MIA_CHECKED,MIA_CHECKED));
    279279
    280280  WinQueryPointerPos(HWND_DESKTOP, &ptl) ;
    281281  WinMapWindowPoints(HWND_DESKTOP,hwnd,&ptl,1);
    282   WinPopupMenu(hwnd, hwnd, hwndPopup, 
     282  WinPopupMenu(hwnd, hwnd, hwndPopup,
    283283               ptl.x, ptl.y, IDM_ITEMEXIT, PU_HCONSTRAIN | PU_VCONSTRAIN |
    284284               PU_KEYBOARD | PU_MOUSEBUTTON1 | PU_MOUSEBUTTON2 | PU_NONE  );
     
    296296      if(!WinQueryWindowPos(hwndTitleBar,&swp))
    297297        return FALSE;
    298      
     298
    299299      if(!WinQueryWindowPos(hwnd,&swpFrame))
    300300        return FALSE;
    301      
     301
    302302      /* Shrink or expand the frame */
    303303      if(!bTBVisible) {
    304         WinSetWindowPos(hwnd, NULLHANDLE, swpFrame.x, swpFrame.y,//-swp.cy, 
     304        WinSetWindowPos(hwnd, NULLHANDLE, swpFrame.x, swpFrame.y,//-swp.cy,
    305305                        swpFrame.cx, swpFrame.cy+swp.cy, SWP_SIZE|SWP_MOVE);
    306306        bTBVisible=TRUE;
     
    308308      else
    309309        {
    310           WinSetWindowPos(hwnd, NULLHANDLE, swpFrame.x, swpFrame.y,//+swp.cy, 
     310          WinSetWindowPos(hwnd, NULLHANDLE, swpFrame.x, swpFrame.y,//+swp.cy,
    311311                          swpFrame.cx, swpFrame.cy-swp.cy, SWP_SIZE|SWP_MOVE);
    312312          bTBVisible=FALSE;
    313313        }
    314314    }
    315   WinSendMsg(hwnd,WM_UPDATEFRAME,0,0);     
     315  WinSendMsg(hwnd,WM_UPDATEFRAME,0,0);
    316316  return TRUE;
    317317}
     
    326326
    327327  switch (msg)
    328     {     
     328    {
    329329    case WM_INITDLG:
    330330      {
     
    345345                    (MPARAM) 0L,
    346346                    (MPARAM) 100L);
    347        
     347
    348348        WinSendMsg( WinWindowFromID(hwnd, IDCS_VOLUME),
    349349                    CSM_SETINCREMENT,
    350350                    (MPARAM) 10L,
    351351                    (MPARAM) 1L);
    352        
    353        
     352
     353
    354354        WinSendMsg( WinWindowFromID(hwnd, IDCS_VOLUME),
    355355                    CSM_SETVALUE,
    356356                    (MPARAM) queryMasterVolume(),
    357357                    (MPARAM) NULL);
    358        
    359        
     358
     359
    360360        // getMessage(title, IDSTR_CONVERTCHANNELS, sizeof(title), RESSOURCEHANDLE, hwnd);
    361361        /* Set dialog font to WarpSans for Warp 4 and above */
     
    365365                          DEFAULT_DIALOG_FONT );
    366366        }
    367        
     367
    368368        hpProgramIcon =
    369369          WinLoadPointer(
     
    371371                         (HMODULE) NULL,              /* Resource is kept in .Exe file. */
    372372                         ID_ICONVOLUME );                   /* Which icon to use.             */
    373        
     373
    374374        WinSendMsg(
    375375                   hwnd,                    /* Dialog window handle.                 */
     
    399399                            PP_BACKGROUNDCOLOR,(ULONG)sizeof(rgb), &rgb);
    400400          }
    401         ulSize=sizeof(RGB);       
     401        ulSize=sizeof(RGB);
    402402        if(IniRestoreData(chrIniFile, INI_VOLUME_APP, INI_BTNFGCLR_KEY, &rgb, &ulSize))
    403403          {
     
    428428        /* Remove top frame controls if titlebar is hidden */
    429429        SHORT countSwp;
    430                
     430
    431431        countSwp = (int) WinDefDlgProc(hwnd, msg, mp1, mp2);
    432432        if(countSwp) {
    433           if(bTBVisible==0) { 
    434             /* Hide frame controls */       
     433          if(bTBVisible==0) {
     434            /* Hide frame controls */
    435435            /* countSWP:  number of standard framecontrols
    436436               pswp:      Array of SWP describing the framecontrols.
     
    485485    case WM_BUTTON1MOTIONSTART:
    486486      /* Drag the window without titlebar */
    487       WinSendMsg(hwnd, WM_TRACKFRAME, 
     487      WinSendMsg(hwnd, WM_TRACKFRAME,
    488488                 MPFROMSHORT(TF_MOVE   /*| TF_SETPOINTERPOS */), NULL) ;
    489489      return (MRESULT) 0 ;
     
    504504           {
    505505             if (SHORT2FROMMP(mp1)==GBN_BUTTONDOWN) {
    506                bMute=TRUE; 
     506               bMute=TRUE;
    507507               setMasterVolume(hwnd, 0);
    508508             }
    509509             else if (SHORT2FROMMP(mp1)==GBN_BUTTONUP) {
    510510               SHORT sValue;
    511                
     511
    512512               bMute=FALSE;
    513513               WinSendMsg(WinWindowFromID(hwnd, IDCS_VOLUME),CSM_QUERYVALUE ,MPFROMP(&sValue) ,0);
     
    524524        memset(&masteraudioparms,0, sizeof(masteraudioparms));
    525525        /* Save master audio level */
    526         mciSendCommand( 0,       
     526        mciSendCommand( 0,
    527527                       MCI_MASTERAUDIO,                /* Master audio message            */
    528528                       MCI_WAIT |  MCI_MASTERVOL | MCI_SAVESETTING,
     
    594594      bTBVisible=IniRestoreInt(chrIniFile, INI_VOLUME_APP, INI_TBVISIBLE_KEY, 1);
    595595
    596       if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, 
     596      if( WinDlgBox( HWND_DESKTOP, NULLHANDLE,
    597597                     volumeDialogProc, RESSOURCEHANDLE, IDDLG_VOLUME, 0) == DID_ERROR )
    598598        {
    599599          /*
    600             Text:   
    601             Title:  "Installation problem"                       
     600            Text:
     601            Title:  "Installation problem"
    602602            */
    603603#if 0
     
    605605                      title, IDSTR_INSTALLERRORTITLE , sizeof(title),
    606606                      RESSOURCEHANDLE, HWND_DESKTOP, MB_OK | MB_ICONEXCLAMATION | MB_MOVEABLE);
    607 #endif       
     607#endif
    608608          WinDestroyMsgQueue( hmq );
    609609          WinTerminate( hab );
     
    637637                  (MPARAM) NULL);
    638638      while ( WinGetMsg( hab, (PQMSG) &qmsg, (HWND) NULL, 0, 0) )
    639         WinDispatchMsg( hab, (PQMSG) &qmsg ); 
     639        WinDispatchMsg( hab, (PQMSG) &qmsg );
    640640#endif
    641641      freeResHandle();
  • branches/v2.9_Lars/classes/mm-progs/mmfind/image.c

    r4 r74  
    2626    POINTL aptl[4];
    2727    HPS    hps;
    28     BOOL   bReturnCode;
    2928    ULONG  ulHeight;
    3029    ULONG  ulWidth;
     
    3736     *  Get position of image frame
    3837     */
    39     bReturnCode = WinQueryWindowPos ( hwnd, &swp);
     38    WinQueryWindowPos ( hwnd, &swp);
    4039
    4140    WinQueryWindowRect(hwnd, &rectl);
     
    4847        aptl[0].x=(swp.cx-ulWidth)/2;
    4948        aptl[1].x=aptl[0].x+ulWidth;
    50        
     49
    5150        aptl[0].y=(swp.cy-ulHeight)/2;
    5251        aptl[1].y=aptl[0].y+ulHeight;
     
    6261      aptl[0].x=(swp.cx-ulWidth*fRes)/2;
    6362      aptl[1].x=aptl[0].x+ulWidth*fRes;
    64      
     63
    6564      aptl[0].y=(swp.cy-ulHeight*fRes)/2;
    6665      aptl[1].y=aptl[0].y+ulHeight*fRes;
    6766    }
    68    
     67
    6968    aptl[2].x = 0;              // source lower left
    7069    aptl[2].y = 0;
    71    
     70
    7271    aptl[3].x = ulWidth;   // source upper right
    7372    aptl[3].y = ulHeight;
     
    8988    //       WinDrawBitmap(hps, hBitmap, NULLHANDLE, (PPOINTL)aptl, 0, 0, DBM_NORMAL/*|DBM_STRETCH*/);
    9089#endif
    91     bReturnCode = WinEndPaint (hps);
     90    WinEndPaint (hps);
    9291}
    9392
     
    9695
    9796  switch (msg)
    98     {     
     97    {
    9998    case WM_PAINT:
    10099      {
     
    276275        return(0L);
    277276      }
    278    
     277
    279278
    280279    // ***************************************************
     
    282281    // the memory device context obtained above.
    283282    // ***************************************************
    284    
     283
    285284    ImageSize.cx = dwWidth;
    286285    ImageSize.cy = dwHeight;
     
    300299                       (ULONG) MB_OK | MB_MOVEABLE |
    301300                       MB_ERROR );
    302 #endif   
     301#endif
    303302        DevCloseDC(hdc);
    304303        DosFreeMem(pRowBuffer);
  • branches/v2.9_Lars/classes/mm-progs/mmfind/mmfind.c

    r4 r74  
    2121 * If you need another license for your project/product (commercial,
    2222 * noncommercial, whatever) contact me at
    23  * 
     23 *
    2424 * http://www.os2world.com/cdwriting
    2525 * http://www.geocities.com/SiliconValley/Sector/5785/
     
    7373BOOL bIsMidi=FALSE;             /* No MIDI support atm */
    7474BOOL bIsPlaying=FALSE;          /* TRUE if currently playing */
    75 BOOL bPaused=FALSE;             
     75BOOL bPaused=FALSE;
    7676ULONG ulPos;
    7777ULONG ulTotalLength;
     
    120120  hps=WinGetPS(HWND_DESKTOP);
    121121
    122   /* Play */ 
     122  /* Play */
    123123  hbmPlay=GpiLoadBitmap(hps, hResource, IDBMP_PLAY, 0, 0);
    124124
     
    143143    ulStyle|=(BS_BITMAP);
    144144    ulStyle&=~BS_TEXT;
    145    
     145
    146146    if(WinSetWindowULong(hwndTemp, QWL_STYLE, ulStyle)) {
    147147      memset(&btCtrl, 0, sizeof(btCtrl));
     
    163163    ulStyle|=(BS_BITMAP);
    164164    ulStyle&=~BS_TEXT;
    165    
     165
    166166    if(WinSetWindowULong(hwndTemp, QWL_STYLE, ulStyle)) {
    167167      memset(&btCtrl, 0, sizeof(btCtrl));
     
    199199  if(!MsgGetMessage(audioText, IDSTR_AUDIOINFOTEXT, sizeof(audioText), hResMod,HWND_DESKTOP))
    200200    strcpy(audioText, TEXT_INFOTEXT);
    201   if(!MsgGetMessage(chrMediaFileTypes[MT_AUDIO], IDSTR_TYPEAUDIO, 
     201  if(!MsgGetMessage(chrMediaFileTypes[MT_AUDIO], IDSTR_TYPEAUDIO,
    202202                 sizeof(chrMediaFileTypes[MT_AUDIO]), hResMod, HWND_DESKTOP))
    203203    strcpy(chrMediaFileTypes[MT_AUDIO], TEXT_TYPEAUDIO);
    204   if(!MsgGetMessage(chrMediaFileTypes[MT_IMAGE], IDSTR_TYPEIMAGE, 
     204  if(!MsgGetMessage(chrMediaFileTypes[MT_IMAGE], IDSTR_TYPEIMAGE,
    205205                 sizeof(chrMediaFileTypes[MT_IMAGE]), hResMod, HWND_DESKTOP))
    206206    strcpy(chrMediaFileTypes[MT_AUDIO], TEXT_TYPEIMAGE);
    207   if(!MsgGetMessage(chrMediaFileTypes[MT_VIDEO], IDSTR_TYPEVIDEO, 
     207  if(!MsgGetMessage(chrMediaFileTypes[MT_VIDEO], IDSTR_TYPEVIDEO,
    208208                 sizeof(chrMediaFileTypes[MT_VIDEO]), hResMod, HWND_DESKTOP))
    209209    strcpy(chrMediaFileTypes[MT_VIDEO], TEXT_TYPEVIDEO);
     
    272272  char chrCommand[50];
    273273  char retMsg[100];
    274   ULONG rc;
    275274
    276275  if(bIsPlaying) {
    277276    sprintf(chrCommand,"stop wave%ld wait", hwndNotify);
    278     rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
    279    
     277    mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
     278
    280279    sprintf(chrCommand,"close wave%ld wait", hwndNotify);
    281     rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
    282 
    283 #if 0   
     280    mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
     281
     282#if 0
    284283    _resetDisplay(hwndFrame);
    285284    showPlayTimeDisplay( hwndFrame, TRUE);
     
    287286#endif
    288287    bIsPlaying=FALSE;
    289     bPaused=FALSE; 
     288    bPaused=FALSE;
    290289  }
    291290
     
    319318    strncpy(chrDevice,"WAVEAUDIO", sizeof(chrDevice));
    320319
    321   /* Start audio file */ 
     320  /* Start audio file */
    322321  sprintf(chrCommand,"open \"%s\"  type %s alias wave%ld SHAREABLE wait", chrSourceName, chrDevice, hwndNotify);
    323322
     
    326325  if((rc & 0x0000ffff)!=MCIERR_SUCCESS)
    327326    return 0;
    328  
     327
    329328  /* Set time format */
    330329  sprintf(chrCommand,"SET wave%ld TIME FORMAT MILLISECONDS wait", hwndNotify);
     
    334333    rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
    335334    return 0;
    336   }     
     335  }
    337336
    338337#if 0
     
    420419
    421420/* Every folder has one running play thread to handle play commands */
    422 void _Optlink playThreadFunc (void *arg)
     421void playThreadFunc (void *arg)
    423422{
    424423  HAB  hab;
     
    488487  if(MMIO_SUCCESS!=mmioIdentifyFile(chrFile, &mmioInfo, &mmFormatInfo, &fourCC, 0,0))
    489488    {
    490       return MT_UNKNOWN; 
     489      return MT_UNKNOWN;
    491490    }
    492491
     
    539538        }
    540539        /* Fill combo box with media types (audio, image, video) */
    541         for(a=0;a<NUMMEDIATYPES;a++) 
    542           WinSendMsg(WinWindowFromID(hwnd, IDCB_TYPEOFFILE), LM_INSERTITEM, MRFROMSHORT(LIT_SORTASCENDING), 
     540        for(a=0;a<NUMMEDIATYPES;a++)
     541          WinSendMsg(WinWindowFromID(hwnd, IDCB_TYPEOFFILE), LM_INSERTITEM, MRFROMSHORT(LIT_SORTASCENDING),
    543542                     MPFROMP(chrMediaFileTypes[a]));
    544543        WinSetWindowText(WinWindowFromID(hwnd, IDCB_TYPEOFFILE), chrMediaFileTypes[0]);
     
    681680                  mmio.ulFlags=MMIO_READ;
    682681                  mmio.ulTranslate=MMIO_TRANSLATEHEADER;
    683                  
     682
    684683                  hmmio = mmioOpen(chrFullName, &mmio, MMIO_READ);
    685684                  if(!hmmio)
     
    689688                  rc = mmioGetHeader(hmmio, &mmAudioHeader,sizeof(MMAUDIOHEADER),
    690689                                     &lBytesRead, 0, 0);
    691                  
     690
    692691                  mmioClose(hmmio, 0);
    693692                  if(rc!=MMIO_SUCCESS) {
     
    785784  APIRET   rc;                        /* return code from REXX     */
    786785  SHORT    rexxrc = 0;                /* return code from function */
    787   char theScript[CCHMAXPATH]; 
     786  char theScript[CCHMAXPATH];
    788787  /* By setting the strlength of the output RXSTRING to zero, we   */
    789788  /* force the interpreter to allocate memory and return it to us. */
    790789  /* We could provide a buffer for the interpreter to use instead. */
    791790  rexxretval.strlength = 0L;          /* initialize return to empty*/
    792    
     791
    793792  sprintf(theScript, "%s\\%s", pszBinDir, rexxFile);
    794793
     
    807806#if 0
    808807  if(rc) {
    809     sprintf(text,"Error in the Rexx skript %s\n\n Get more information with 'help REX%04d'.\n", 
     808    sprintf(text,"Error in the Rexx skript %s\n\n Get more information with 'help REX%04d'.\n",
    810809            tPt->rexxSkript, rc*-1);
    811810    WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, text, "", 1234, MB_OK|MB_MOVEABLE|MB_ERROR);
     
    822821  }
    823822  if(rexxretval.strptr)
    824     DosFreeMem(rexxretval.strptr);          /* Release storage given to us by REXX.  */     
     823    DosFreeMem(rexxretval.strptr);          /* Release storage given to us by REXX.  */
    825824  if(!rc)
    826825    return TRUE;
     
    845844            '\0',
    846845            sizeof(MMFORMATINFO) );
    847    
     846
    848847    mmFormatInfo.ulMediaType |= MMIO_MEDIATYPE_IMAGE;
    849     mmFormatInfo.ulFlags|=MMIO_CANREADTRANSLATED;/* Read !!!*/   
     848    mmFormatInfo.ulFlags|=MMIO_CANREADTRANSLATED;/* Read !!!*/
    850849    ulReturnCode = mmioQueryFormatCount ( &mmFormatInfo,
    851850                                          &lNumIOProcs,
    852851                                          0,
    853852                                          0 );
    854    
     853
    855854    if( ulReturnCode != MMIO_SUCCESS )
    856855      {
     
    873872        return FALSE;
    874873      }
    875    
     874
    876875    /*
    877876     * call mmioGetFormats to get info on the formats supported.
     
    891890        return FALSE;
    892891      }
    893    
     892
    894893    if( lFormatsRead != lNumIOProcs )
    895894      {
     
    919918            }
    920919          }
    921         } 
     920        }
    922921        /*
    923922         *  advance to next entry in mmFormatInfo array
    924          */       
     923         */
    925924        pmmFormatInfoArray++;
    926925      }
     
    952951  if(hab) {
    953952    hmq=WinCreateMsgQueue(hab,0);
    954     if(hmq) { 
    955       /* Check if user started prog by hand */   
     953    if(hmq) {
     954      /* Check if user started prog by hand */
    956955      if(argc!=NUMPARAMS) {/* Not the right num of params */
    957956        pmUsage();
    958957      }
    959958      else {
    960         HWND hwndDlg;       
    961 
    962         /* Get our ressource dll */ 
     959        HWND hwndDlg;
     960
     961        /* Get our ressource dll */
    963962        RESSOURCEHANDLE=queryResModuleHandle(argv[0]);
    964963        /* Load NLV strings */
     
    10311030          {
    10321031            if(hBitmap)
    1033               GpiDeleteBitmap(hBitmap); 
     1032              GpiDeleteBitmap(hBitmap);
    10341033            if( fd.lReturn == DID_OK )
    10351034              {
  • branches/v2.9_Lars/classes/mm-progs/volume/classvol.c

    r2 r74  
    2222 * If you need another license for your project/product (commercial,
    2323 * noncommercial, whatever) contact me at
    24  * 
     24 *
    2525 * http://www.os2world.com/cdwriting
    2626 * http://www.geocities.com/SiliconValley/Sector/5785/
     
    5454//#include "cwaudioinc.h"
    5555
    56 #ifndef OPEN_DEFAULT 
     56#ifndef OPEN_DEFAULT
    5757/*  Open views for the wpOpen() method */
    5858      #define OPEN_UNKNOWN      -1
     
    162162  hResource=BMP_RESSOURCEHANDLE; //_queryResModuleHandle();
    163163  hps=WinGetPS(HWND_DESKTOP);
    164  
     164
    165165  /* The main BMP */
    166166  allBMPs[MAIN_BMP_IDX].hbm=GpiLoadBitmap(hps, hResource, IDBMP_MAIN, 0, 0);
     
    265265  WinSetWindowPos(WinWindowFromID(hwnd, ci.id),HWND_TOP, ci.rclSource.xLeft,ci.rclSource.yBottom,
    266266                  ci.rclSource.xRight-ci.rclSource.xLeft,
    267                   ci.rclSource.yTop-ci.rclSource.yBottom, SWP_MOVE|SWP_SIZE); 
     267                  ci.rclSource.yTop-ci.rclSource.yBottom, SWP_MOVE|SWP_SIZE);
    268268  oldPlayTimeProc=WinSubclassWindow(WinWindowFromID(hwnd, IDST_MMPLAYERPLAYTIME), playTimeTextProc);
    269269
    270270  /* Pos slider */
    271271  ci=ciControls[CTRLIDX_POSSLIDER];//ciPosSlider;
    272   WinCreateWindow(hwnd, SLIDER_CLASS, "", WS_VISIBLE | WS_TABSTOP, 0,0, 10, 10, 
     272  WinCreateWindow(hwnd, SLIDER_CLASS, "", WS_VISIBLE | WS_TABSTOP, 0,0, 10, 10,
    273273                  hwnd, HWND_TOP, ci.id, NULLHANDLE, NULLHANDLE);
    274274  WinSetWindowPos(WinWindowFromID(hwnd, ci.id),HWND_TOP, ci.rclDest.xLeft, ci.rclDest.yBottom,
    275275                  ci.rclSource.xRight-ci.rclSource.xLeft,
    276276                  ci.rclSource.yTop-ci.rclSource.yBottom, SWP_MOVE | SWP_SIZE);
    277  
     277
    278278  WinSendMsg(WinWindowFromID(hwnd, ci.id),SLM_SETSLIDERINFO,
    279279             MPFROM2SHORT(SMA_SLIDERARMDIMENSIONS,0),
    280              MPFROM2SHORT( 9, 9)); 
     280             MPFROM2SHORT( 9, 9));
    281281#endif
    282282
    283283  /* Vol slider */
    284284  ci=ciControls[CTRLIDX_VOLSLIDER];//ciVolSlider;
    285   WinCreateWindow(hwnd, SLIDER_CLASS, "", WS_VISIBLE | WS_TABSTOP, 0,0, 10, 10, 
     285  WinCreateWindow(hwnd, SLIDER_CLASS, "", WS_VISIBLE | WS_TABSTOP, 0,0, 10, 10,
    286286                  hwnd, HWND_TOP, ci.id, NULLHANDLE, NULLHANDLE);
    287287  WinSetWindowPos(WinWindowFromID(hwnd, ci.id),HWND_TOP, ci.rclDest.xLeft, ci.rclDest.yBottom,
     
    290290  WinSendMsg(WinWindowFromID(hwnd, ci.id),SLM_SETSLIDERINFO,
    291291             MPFROM2SHORT(SMA_SLIDERARMDIMENSIONS,0),
    292              MPFROM2SHORT( 9, 9)); 
     292             MPFROM2SHORT( 9, 9));
    293293
    294294}
     
    328328             MPFROM2SHORT(SC_SIZE, TRUE),
    329329             MPFROMP(NULL));
    330  
     330
    331331  WinSendMsg(hwndMenu, /* Delete Minimize from the system menu */
    332332             MM_DELETEITEM,
    333333             MPFROM2SHORT(SC_MINIMIZE, TRUE),
    334334             MPFROMP(NULL));
    335  
     335
    336336  WinSendMsg(hwndMenu, /* Delete Maximize from the system menu */
    337337             MM_DELETEITEM,
     
    368368
    369369  switch (msg)
    370     {     
     370    {
    371371    case WM_INITDLG:
    372372      {
     
    381381        swctl.fbJump=SWL_JUMPABLE;
    382382        WinAddSwitchEntry(&swctl);
    383        
     383
    384384        adjustDialogControlPos(hwnd);
    385        
     385
    386386        /* Set volume slider*/
    387387        WinSendMsg( WinWindowFromID(hwnd, IDSL_MMPLAYERVOLUME),
     
    389389                    MPFROM2SHORT(SMA_SLIDERARMPOSITION,SMA_INCREMENTVALUE),
    390390                    MPFROMLONG( ulVolume));
    391                        
     391
    392392        FixSysMenu(hwnd);
    393393
     
    397397          POINTL ptl;
    398398
    399           WinQueryWindowPos(WinWindowFromID(hwnd, FID_TITLEBAR), &swp);         
    400           WinSetWindowPos(WinWindowFromID(hwnd, ID_CLASSVOLCLIENT), NULLHANDLE, 
    401                           WinQuerySysValue(HWND_DESKTOP, SV_CXDLGFRAME), 
    402                           WinQuerySysValue(HWND_DESKTOP, SV_CYDLGFRAME), 
     399          WinQueryWindowPos(WinWindowFromID(hwnd, FID_TITLEBAR), &swp);
     400          WinSetWindowPos(WinWindowFromID(hwnd, ID_CLASSVOLCLIENT), NULLHANDLE,
     401                          WinQuerySysValue(HWND_DESKTOP, SV_CXDLGFRAME),
     402                          WinQuerySysValue(HWND_DESKTOP, SV_CYDLGFRAME),
    403403                          allBMPs[MAIN_BMP_IDX].bmpInfoHdr.cx,
    404404                          allBMPs[MAIN_BMP_IDX].bmpInfoHdr.cy,
    405405                          SWP_SIZE|SWP_MOVE);
    406406          orgBgProc=WinSubclassWindow(WinWindowFromID(hwnd, ID_CLASSVOLCLIENT), bgProc);
    407          
     407
    408408          /* Get mouse position */
    409409          WinQueryPointerPos(HWND_DESKTOP, &ptl);
     
    459459        default:
    460460          break;
    461         }             
     461        }
    462462      break;
    463463
     
    468468      {
    469469        SWP swp;
    470        
     470
    471471        switch(SHORT2FROMMP(mp1))
    472472          {
     
    492492
    493493                      ulVolume=ulValue;
    494                       sprintf(command,"MMAUDIOVOLUME=%d", ulVolume);
     494                      sprintf(command,"MMAUDIOVOLUME=%lu", ulVolume);
    495495                      sendCommandToObject(chrSourceName, command);
    496496                      break;
     
    509509                    {
    510510                      ULONG ulValue;
    511                      
     511
    512512                      ulValue=LONGFROMMP(mp2);
    513513                      ulVolume=ulValue;
     
    529529      break;
    530530    }/* switch */
    531  
     531
    532532  return WinDefDlgProc( hwnd, msg, mp1, mp2);
    533533}
     
    541541BOOL writeVolumeToIni(char * iniFile,  ULONG ulVolume)
    542542{
    543  
     543
    544544  return IniSaveInt(iniFile, INI_CLASSVOLUME_APP, INI_VOLUME_KEY, ulVolume);
    545545}
     
    580580  if(hab) {
    581581    hmq=WinCreateMsgQueue(hab,0);
    582     if(hmq) { 
    583       /* Check if user started prog by hand */   
     582    if(hmq) {
     583      /* Check if user started prog by hand */
    584584      if(argc!=NUMPARAMS ) {/* Not the right num of params */
    585585        pmUsage();
     
    591591        //    ++chrPtrName;
    592592        //SysWriteToTrapLog("Name: %s\n", chrSourceName);
    593         /* Get our ressource dll */ 
     593        /* Get our ressource dll */
    594594        RESSOURCEHANDLE=queryResModuleHandle(argv[0]);
    595595        /* Get data from INI file */
     
    604604        _loadBmps();
    605605
    606         if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, decodeStatusDialogProc, 
     606        if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, decodeStatusDialogProc,
    607607                       RESSOURCEHANDLE, IDDLG_CLASSVOLUME, 0) == DID_ERROR )
    608608          {
    609609            /*
    610               Text:   
    611               Title:  "Installation problem"                       
    612               */             
     610              Text:
     611              Title:  "Installation problem"
     612              */
    613613            messageBox( text, IDSTR_CONVERTDIALOGERROR , sizeof(text),
    614614                        title, IDSTR_INSTALLERRORTITLE , sizeof(title),
Note: See TracChangeset for help on using the changeset viewer.