Changeset 74 for branches/v2.9_Lars/classes/mm-progs
- Timestamp:
- Sep 30, 2023, 11:06:42 PM (2 years ago)
- 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 18 18 * along with this program; see the file COPYING. If not, write to 19 19 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 20 */ 20 */ 21 21 /* 22 22 * If you need another license for your project/product (commercial, 23 23 * noncommercial, whatever) contact me at 24 * 24 * 25 25 * http://www.os2world.com/cdwriting 26 26 * http://www.geocities.com/SiliconValley/Sector/5785/ … … 70 70 //#define INI_NAME_COLOR "color" 71 71 72 void HlpSendCommandToObject( char* chrObject, char*command);72 void HlpSendCommandToObject(PSZ chrObject, PSZ command); 73 73 BOOL 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);74 BOOL IniSaveWindowPos(PSZ iniFile, PSZ chrApp, PSZ chrKey, HWND hwnd); 75 BOOL IniRestoreWindowPos(PSZ iniFile, PSZ chrApp, PSZ chrKey, HWND hwnd); 76 BOOL IniSaveWindowClrs(PSZ chrIniFile, PSZ chrApp , HWND hwnd); 77 BOOL IniRestoreWindowClrs(PSZ chrIniFile, PSZ chrApp , HWND hwnd); 78 BOOL HlpBuildMMProgIniFileName(PSZ chrProgname, PSZ chrBuffer, ULONG ulBufferSize); 79 HMODULE queryResModuleHandle(PSZ chrExePath); 80 80 void 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,81 BOOL getMessage(PSZ text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd); 82 ULONG messageBox( PSZ text, ULONG ulTextID , LONG lSizeText, 83 PSZ title, ULONG ulTitleID, LONG lSizeTitle, 84 84 HMODULE hResource, HWND hwnd, ULONG ulFlags); 85 85 … … 90 90 BOOL bHaveWindowPos=FALSE; 91 91 92 charchrTargetName[CCHMAXPATH]={0};93 charchrSourceName[CCHMAXPATH]={0};94 charchrProcName[CCHMAXPATH]={0};95 charchrIniFile[CCHMAXPATH];92 UCHAR chrTargetName[CCHMAXPATH]={0}; 93 UCHAR chrSourceName[CCHMAXPATH]={0}; 94 UCHAR chrProcName[CCHMAXPATH]={0}; 95 UCHAR chrIniFile[CCHMAXPATH]; 96 96 97 97 int numArgs; … … 118 118 void pmUsage(); 119 119 120 BOOL createTargetName( char *sourceName, char *chrExt)120 BOOL createTargetName(PSZ sourceName, PSZ chrExt) 121 121 { 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) 126 126 *textPtr=0; 127 127 else 128 textPtr= chrTargetName;128 textPtr=(PCHAR)chrTargetName; 129 129 strcat(textPtr,"."); 130 strcat(textPtr, chrExt);130 strcat(textPtr, (PCHAR)chrExt); 131 131 #if 0 132 132 WinMessageBox( HWND_DESKTOP, HWND_DESKTOP, textPtr, … … 153 153 '\0', 154 154 sizeof(MMFORMATINFO) ); 155 155 156 156 mmFormatInfo.ulMediaType |= MMIO_MEDIATYPE_AUDIO; 157 mmFormatInfo.ulFlags|=MMIO_CANWRITETRANSLATED; 157 mmFormatInfo.ulFlags|=MMIO_CANWRITETRANSLATED; 158 158 ulReturnCode = mmioQueryFormatCount ( &mmFormatInfo, 159 159 &lNumIOProcs, 160 160 0, 161 161 0 ); 162 162 163 163 if( ulReturnCode != MMIO_SUCCESS ) 164 164 { … … 181 181 return FALSE; 182 182 } 183 183 184 184 /* 185 185 * call mmioGetFormats to get info on the formats supported. … … 199 199 return FALSE; 200 200 } 201 201 202 202 if( lFormatsRead != lNumIOProcs ) 203 203 { … … 214 214 for ( index = 0, sIdx=0; index <lNumIOProcs; index++ ) 215 215 { 216 charszName[CCHMAXPATH];217 218 mmioGetFormatName(pmmFormatInfoArray, szName, &lBytesRead, 0L, 0L); 216 UCHAR szName[CCHMAXPATH]; 217 218 mmioGetFormatName(pmmFormatInfoArray, szName, &lBytesRead, 0L, 0L); 219 219 /* Insert NULL string terminator */ 220 *( szName + lBytesRead ) = (CHAR)NULL;220 *( szName + lBytesRead ) = 0; 221 221 222 222 #ifdef DEBUG 223 SysWriteToTrapLog("%d IO-Proc: %s, %s\n", index, 223 SysWriteToTrapLog("%d IO-Proc: %s, %s\n", index, 224 224 pmmFormatInfoArray->szDefaultFormatExt, 225 225 szName); … … 231 231 WinSendMsg(hwndDrop, LM_INSERTITEM,(MPARAM)LIT_END, 232 232 (MPARAM)szName); 233 234 233 234 235 235 iPrivIOProc[sIdx]=index; 236 236 237 237 #ifdef DEBUG 238 238 SysWriteToTrapLog("-- %d %d, sIdx: %d %s\n", index, iPrivIOProc[sIdx], sIdx, … … 240 240 ); 241 241 #endif 242 243 242 243 244 244 /* Set text field */ 245 245 if(bNoProcGiven) { 246 246 WinSetWindowText(hwndDrop, szName); 247 createTargetName(chrSourceName, pmmFormatInfoArray->szDefaultFormatExt);247 createTargetName(chrSourceName, (PSZ)pmmFormatInfoArray->szDefaultFormatExt); 248 248 iIoProc=iPrivIOProc[sIdx]; 249 249 bNoProcGiven=FALSE; 250 250 } 251 251 else { 252 if(!stricmp( szName,chrProcName)) {252 if(!stricmp((PCHAR)szName, (PCHAR)chrProcName)) { 253 253 WinSetWindowText(hwndDrop, szName); 254 254 /* Create target name */ 255 createTargetName(chrSourceName, pmmFormatInfoArray->szDefaultFormatExt);255 createTargetName(chrSourceName, (PSZ)pmmFormatInfoArray->szDefaultFormatExt); 256 256 iIoProc=iPrivIOProc[sIdx]; 257 257 } … … 262 262 /* 263 263 * advance to next entry in mmFormatInfo array 264 */ 264 */ 265 265 pmmFormatInfoArray++; 266 266 } … … 268 268 } 269 269 270 BOOL queryAudioInfo( char *chrFile)270 BOOL queryAudioInfo(PSZ chrFile) 271 271 { 272 272 HMMIO hmmio; … … 275 275 LONG lBytesRead=0; 276 276 APIRET rc; 277 277 278 278 memset(&mmioinfo,0, sizeof(mmioinfo)); 279 279 mmioinfo.ulTranslate = MMIO_TRANSLATEHEADER; … … 321 321 #endif 322 322 323 void _OptlinkconvertThreadFunc (void *arg)323 void convertThreadFunc (void *arg) 324 324 { 325 325 HAB hab; … … 337 337 LONG lBytesWritten=0; 338 338 ULONG rc; 339 P BYTE buffer;339 PCHAR buffer=NULL; 340 340 341 341 do { … … 349 349 if((hmmio=mmioOpen(chrSourceName, &mmioinfo,MMIO_READ))==NULLHANDLE) 350 350 { 351 chartext[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)"", 354 354 text, 355 355 0UL, MB_OK | MB_ICONEXCLAMATION|MB_MOVEABLE ); … … 360 360 &lBytesRead, 0, 0); 361 361 if(rc!=MMIO_SUCCESS) { 362 chartext[500];362 UCHAR text[500]; 363 363 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)"", 366 366 text, 367 367 0UL, MB_OK | MB_ICONEXCLAMATION|MB_MOVEABLE ); … … 380 380 if((hmmioTarget=mmioOpen(chrTargetName, &mmioinfo, MMIO_WRITE|MMIO_CREATE))==NULLHANDLE) 381 381 { 382 charchrError[CCHMAXPATH];383 char text[500];382 UCHAR chrError[CCHMAXPATH]; 383 UCHAR text[CCHMAXPATH*2]; 384 384 rc=mmioGetLastError(hmmioTarget); 385 385 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); 387 387 mmioClose(hmmio,0); 388 WinMessageBox(hwnd, hwnd, "",388 WinMessageBox(hwnd, hwnd, (PSZ)"", 389 389 text, 390 390 0UL, MB_OK | MB_ICONEXCLAMATION|MB_MOVEABLE ); … … 394 394 rc = mmioSetHeader(hmmioTarget, &mmAudioHeader,sizeof(MMAUDIOHEADER), 395 395 &lBytesWritten, 0, 0); 396 396 397 397 /* Get buffer */ 398 if((buffer=( void*)malloc(CONVERTBUFFERSIZE))==NULLHANDLE) {399 chartext[500];398 if((buffer=(PCHAR)malloc(CONVERTBUFFERSIZE))==NULLHANDLE) { 399 UCHAR text[500]; 400 400 mmioClose(hmmio, 0); 401 401 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)"", 404 404 text, 405 405 0UL, MB_OK | MB_ICONEXCLAMATION|MB_MOVEABLE ); 406 406 407 407 break; 408 408 } … … 421 421 }while(rc!=0 && rc!=MMIO_ERROR && !bBreak/*&& lBytesWritten <1000000*/); 422 422 if(rc==MMIO_ERROR) { 423 chartext[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)"", 426 426 text, 427 427 0UL, MB_OK | MB_ICONEXCLAMATION|MB_MOVEABLE ); 428 428 } 429 429 if(!bBreak) { 430 charchrCommand[CCHMAXPATH*2];430 UCHAR chrCommand[CCHMAXPATH*2]; 431 431 WinSendMsg(hwnd, WM_APPTERMINATENOTIFY, MPFROMLONG(MSG_CONVERTPERCENT), MPFROMLONG(100)); 432 432 /* 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); 435 435 HlpSendCommandToObject(chrSourceName, chrCommand); 436 436 } … … 443 443 } 444 444 while(TRUE); 445 WinSendMsg(hwnd, WM_APPTERMINATENOTIFY, MPFROMLONG(MSG_CONVERTDONE), 0); 445 WinSendMsg(hwnd, WM_APPTERMINATENOTIFY, MPFROMLONG(MSG_CONVERTDONE), 0); 446 446 WinDestroyMsgQueue(hmq); 447 447 } … … 464 464 MRESULT EXPENTRY decodeStatusDialogProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 465 465 { 466 chartext[CCHMAXPATH*4 +10];467 chartitle[CCHMAXPATH*4];466 UCHAR text[CCHMAXPATH*4 +10]; 467 UCHAR title[CCHMAXPATH*4]; 468 468 SWCNTRL swctl; 469 469 PID pid; … … 471 471 472 472 switch (msg) 473 { 473 { 474 474 case WM_INITDLG: 475 475 … … 493 493 494 494 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 498 498 /* Filename */ 499 499 WinSetWindowText(WinWindowFromID(hwnd,IDST_CONVERTNAME), chrSourceName); 500 500 501 501 /* Set dialog font to WarpSans for Warp 4 and above */ 502 502 if(SysQueryOSRelease()>=40) { … … 507 507 508 508 /* Set percent bars to 0. */ 509 WinSetWindowText(WinWindowFromID(hwnd,IDBAR_CONVERTPROGRESS), "0#0%");509 WinSetWindowText(WinWindowFromID(hwnd,IDBAR_CONVERTPROGRESS),(PSZ)"0#0%"); 510 510 511 511 WinSendMsg(WinWindowFromID(hwnd,IDEF_CONVERTTARGETNAME), EM_SETTEXTLIMIT,MPFROMSHORT((SHORT)CCHMAXPATH),0); … … 516 516 /* Channels */ 517 517 getMessage(title, IDSTR_CONVERTCHANNELS, sizeof(title), RESSOURCEHANDLE, hwnd); 518 sprintf( text,title, sChannels);518 sprintf((PCHAR)text, (PCHAR)title, sChannels); 519 519 WinSetWindowText(WinWindowFromID(hwnd,IDST_CONVERTCHANNELS),text); 520 520 521 521 /* Samplerate */ 522 522 getMessage(title, IDSTR_CONVERTSAMPLERATE, sizeof(title), RESSOURCEHANDLE, hwnd); 523 sprintf( text,title, iSampleRate);523 sprintf((PCHAR)text, (PCHAR)title, iSampleRate); 524 524 WinSetWindowText(WinWindowFromID(hwnd,IDST_CONVERTSAMPLERATE),text); 525 525 526 526 /* Playtime */ 527 527 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); 529 529 WinSetWindowText(WinWindowFromID(hwnd,IDST_CONVERTPLAYTIME),text); 530 530 … … 551 551 iPercent=0; 552 552 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 %. */ 554 554 sprintf(text,"%d#%d%%", iPercent, iPercent); 555 555 WinSetWindowText(WinWindowFromID(hwnd,IDBAR_CONVERTPROGRESS), text); … … 593 593 594 594 createTargetName(chrSourceName, pMemFormatInfo[iIoProc].szDefaultFormatExt); 595 WinSetWindowText( WinWindowFromID(hwnd,IDEF_CONVERTTARGETNAME), chrTargetName ); 595 WinSetWindowText( WinWindowFromID(hwnd,IDEF_CONVERTTARGETNAME), chrTargetName ); 596 596 } 597 597 } … … 613 613 case IDPB_CONVERTBROWSE: 614 614 { 615 charchrTitle[200];615 UCHAR chrTitle[200]; 616 616 FILEDLG fd = { 0 }; 617 617 /* User pressed the browse button */ … … 652 652 ULONG ulDiskNum; 653 653 char cLetter; 654 654 655 655 WinQueryWindowText( WinWindowFromID(hwnd,IDEF_CONVERTTARGETNAME), sizeof(chrTargetName), chrTargetName ); 656 656 … … 669 669 if(lFreeSpace<lAudioSize) { 670 670 /* 671 Text: 672 Title: 673 */ 671 Text: 672 Title: 673 */ 674 674 getMessage(title, IDSTR_CONVERTNOSPACETEXT,sizeof(title), RESSOURCEHANDLE, hwnd); 675 675 sprintf(text,title,lAudioSize/1000000 ); … … 681 681 else { 682 682 /* Start decoding an audio file */ 683 WinEnableWindow( WinWindowFromID(hwnd,IDPB_CONVERTOK), FALSE); 683 WinEnableWindow( WinWindowFromID(hwnd,IDPB_CONVERTOK), FALSE); 684 684 WinEnableWindow( WinWindowFromID(hwnd,IDPB_CONVERTABORT), TRUE); 685 685 convertAudioFile(hwnd); 686 686 } 687 687 688 688 break; 689 689 } … … 695 695 break; 696 696 }/* switch */ 697 697 698 698 return WinDefDlgProc( hwnd, msg, mp1, mp2); 699 699 } … … 726 726 if(hab) { 727 727 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 */ 730 730 if(argc<NUMPARAMS-1) {/* Not the actual num of params */ 731 731 pmUsage(); … … 740 740 strcpy(chrProcName, ""); 741 741 } 742 /* Get our ressource dll */ 742 /* Get our ressource dll */ 743 743 // RESSOURCEHANDLE=0; 744 744 RESSOURCEHANDLE=queryResModuleHandle(argv[0]); … … 751 751 { 752 752 /* 753 Text: 754 Title: "Installation problem" 755 */ 753 Text: 754 Title: "Installation problem" 755 */ 756 756 messageBox( text, IDSTR_CONVERTDIALOGERROR , sizeof(text), 757 757 title, IDSTR_INSTALLERRORTITLE , sizeof(title), … … 762 762 DosBeep(100,600); 763 763 return( 1 ); 764 } 764 } 765 765 } 766 766 } -
branches/v2.9_Lars/classes/mm-progs/imageconverter/imgconv.c
r2 r74 23 23 * If you need another license for your project/product (commercial, 24 24 * noncommercial, whatever) contact me at 25 * 25 * 26 26 * http://www.os2world.com/cdwriting 27 27 * http://www.geocities.com/SiliconValley/Sector/5785/ … … 143 143 SIZEL ImageSize; 144 144 ULONG dwHeight, dwWidth; 145 SHORT 145 SHORT wBitCount; 146 146 FOURCC fccStorageSystem; 147 147 ULONG dwPadBytes; 148 148 ULONG dwRowBits; 149 149 ULONG ulReturnCode; 150 ULONG dwReturnCode;151 HBITMAP hbReturnCode;152 LONG lReturnCode;153 150 FOURCC fccIOProc; 154 151 HDC hdc; … … 212 209 213 210 214 dwReturnCode = mmioQueryHeaderLength ( hmmio,211 ulReturnCode = mmioQueryHeaderLength ( hmmio, 215 212 (PLONG)&ulImageHeaderLength, 216 213 0L, … … 288 285 return(0L); 289 286 } 290 287 291 288 292 289 // *************************************************** … … 294 291 // the memory device context obtained above. 295 292 // *************************************************** 296 293 297 294 ImageSize.cx = dwWidth; 298 295 ImageSize.cy = dwHeight; … … 312 309 (ULONG) MB_OK | MB_MOVEABLE | 313 310 MB_ERROR ); 314 #endif 311 #endif 315 312 DevCloseDC(hdc); 316 313 DosFreeMem(pRowBuffer); … … 350 347 // Select the bitmap into the memory device context. 351 348 // *************************************************** 352 hbReturnCode = GpiSetBitmap ( hps,349 ulReturnCode = GpiSetBitmap ( hps, 353 350 hbm ); 354 351 … … 371 368 * it to work. Perhaps will get to it when time is available... 372 369 */ 373 lReturnCode = GpiSetBitmapBits ( hps,370 ulReturnCode = GpiSetBitmapBits ( hps, 374 371 (LONG) dwRowCount, 375 372 (LONG) 1, … … 379 376 380 377 /* Clean up */ 381 hbReturnCode = GpiSetBitmap ( hps,378 ulReturnCode = GpiSetBitmap ( hps, 382 379 NULLHANDLE ); 383 380 ulReturnCode = mmioClose (hmmio, 0L); … … 396 393 PBITMAPINFOHEADER2 pBmpInfoHeader2, 397 394 HWND hwnd) 398 // ULONG ulWidth, 395 // ULONG ulWidth, 399 396 // ULONG ulHeight) 400 397 { 401 398 HBITMAP hbmTarget; 402 399 SIZEL ImageSize; 403 HBITMAP hbReturnCode;404 400 HDC hdc; 405 401 HPS hps; … … 413 409 */ 414 410 WinQueryWindowPos ( hwnd, &swp); 415 411 416 412 /* Image size */ 417 413 418 414 ulHeight = bmpInfoHeader2.cy; 419 415 ulWidth = bmpInfoHeader2.cx; … … 423 419 aptl[0].x=0; 424 420 aptl[1].x=aptl[0].x+ulWidth; 425 421 426 422 aptl[0].y=0; 427 423 aptl[1].y=aptl[0].y+ulHeight; … … 429 425 else { 430 426 float fWidth, fHeight, fRes; 431 427 432 428 fWidth=(float)swp.cx/(float)ulWidth; 433 429 fHeight=(float)swp.cy/(float)ulHeight; 434 430 fRes=( fWidth>fHeight ? fHeight : fWidth); 435 436 431 432 437 433 aptl[0].x=0; 438 434 aptl[1].x=aptl[0].x+ulWidth*fRes; 439 435 440 436 aptl[0].y=0; 441 437 aptl[1].y=aptl[0].y+ulHeight*fRes; 442 438 } 443 439 444 440 aptl[2].x = 0; // source lower left 445 441 aptl[2].y = 0; 446 442 447 443 aptl[3].x = ulWidth; // source upper right 448 444 aptl[3].y = ulHeight; … … 468 464 return(0L); 469 465 } 470 466 471 467 // *************************************************** 472 468 // Create a memory presentation space that includes … … 486 482 487 483 /* Now scale the bitmap */ 488 memcpy(&bmpih2, pBmpInfoHeader2, sizeof(BITMAPINFOHEADER2)); 484 memcpy(&bmpih2, pBmpInfoHeader2, sizeof(BITMAPINFOHEADER2)); 489 485 490 486 bmpih2.cx=aptl[1].x-aptl[0].x; … … 509 505 510 506 /* Blit it */ 511 hbReturnCode =GpiSetBitmap ( hps, hbmTarget );507 GpiSetBitmap ( hps, hbmTarget ); 512 508 513 509 GpiWCBitBlt(hps, hbm,4L, aptl, ROP_SRCCOPY, BBO_IGNORE); 514 510 515 hbReturnCode =GpiSetBitmap( hps, NULLHANDLE );511 GpiSetBitmap( hps, NULLHANDLE ); 516 512 GpiDestroyPS(hps); 517 513 DevCloseDC(hdc); … … 545 541 strcat(textPtr,"."); 546 542 strcat(textPtr, chrExt); 547 543 548 544 return TRUE; 549 545 } … … 564 560 '\0', 565 561 sizeof(MMFORMATINFO) ); 566 562 567 563 mmFormatInfo.ulMediaType |= MMIO_MEDIATYPE_IMAGE; 568 mmFormatInfo.ulFlags|=MMIO_CANWRITETRANSLATED; 564 mmFormatInfo.ulFlags|=MMIO_CANWRITETRANSLATED; 569 565 ulReturnCode = mmioQueryFormatCount ( &mmFormatInfo, 570 566 &lNumIOProcs, 571 567 0, 572 568 0 ); 573 569 574 570 if( ulReturnCode != MMIO_SUCCESS ) 575 571 { … … 592 588 return FALSE; 593 589 } 594 590 595 591 /* 596 592 * call mmioGetFormats to get info on the formats supported. … … 610 606 return FALSE; 611 607 } 612 608 613 609 if( lFormatsRead != lNumIOProcs ) 614 610 { … … 627 623 char szName[CCHMAXPATH]; 628 624 629 mmioGetFormatName(pmmFormatInfoArray, szName, &lBytesRead, 0L, 0L); 625 mmioGetFormatName(pmmFormatInfoArray, szName, &lBytesRead, 0L, 0L); 630 626 /* Insert NULL string terminator */ 631 *( szName + lBytesRead ) = (CHAR)NULL;627 *( szName + lBytesRead ) = 0; 632 628 633 629 … … 643 639 644 640 #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, 646 642 pmmFormatInfoArray->szDefaultFormatExt, 647 643 szName); 648 644 #endif 649 645 650 646 iPrivIOProc[sIdx]=index; 651 647 … … 669 665 /* 670 666 * advance to next entry in mmFormatInfo array 671 */ 667 */ 672 668 pmmFormatInfoArray++; 673 669 } … … 700 696 ULONG iIndex, iCount, iCount2; 701 697 702 MMFORMATINFO mmFormatInfo; 698 MMFORMATINFO mmFormatInfo; 703 699 FOURCC fccSourceIOProc; 704 700 FOURCC fccStorageSystem; … … 728 724 mmioinfoSource.fccIOProc = fccSourceIOProc; 729 725 mmioinfoSource.ulTranslate = MMIO_TRANSLATEHEADER | MMIO_TRANSLATEDATA; 730 726 731 727 hmmioSource = mmioOpen ((PSZ)pszSource, &mmioinfoSource, 732 728 MMIO_READ | MMIO_DENYWRITE 733 729 | MMIO_NOIDENTIFY); 734 730 735 731 if (!hmmioSource) 736 732 return (FALSE); 737 733 738 734 /*******************************/ 739 735 /* Set up/open the TARGET file */ … … 743 739 mmioinfoTarget.fccIOProc = fccTargetIOProc; 744 740 mmioinfoTarget.ulTranslate = MMIO_TRANSLATEHEADER | MMIO_TRANSLATEDATA; 745 741 746 742 hmmioTarget = mmioOpen ((PSZ)pszTarget, 747 743 &mmioinfoTarget, 748 744 MMIO_CREATE | MMIO_WRITE | 749 745 MMIO_DENYWRITE | MMIO_NOIDENTIFY); 750 746 751 747 if (!hmmioTarget) 752 748 { … … 762 758 rcSrcQueryCount = mmioSendMessage(hmmioSource, MMIOM_QUERYIMAGECOUNT, (LONG)&iCount, (LONG)0); 763 759 if (rcSrcQueryCount) iCount = 1; 764 760 765 761 // find out if the target has multiple image support 766 762 rcTrgQueryCount = mmioSendMessage(hmmioTarget, MMIOM_QUERYIMAGECOUNT, (LONG)&iCount2, (LONG)0); 767 763 768 764 for (iIndex=0; iIndex<iCount; iIndex++) { /* loop through known images */ 769 765 770 766 if (!rcSrcQueryCount && !rcTrgQueryCount) { /* if Both support images */ 771 767 772 768 /* Determine if the target can write arrays, and if not */ 773 769 /* then write the the default image from the source */ 774 770 775 771 if (rcTrgSetImage && iIndex > 0) break; /* Target Can't Write array */ 776 772 777 773 /* Now, determine if the target can write arrays */ 778 774 rcTrgSetImage = mmioSendMessage (hmmioTarget, MMIOM_SETIMAGE, (LONG)iIndex, (LONG)0); 779 775 780 776 if (!rcTrgSetImage) mmioSendMessage (hmmioSource, MMIOM_SETIMAGE, (LONG)iIndex, (LONG)0); 781 777 782 778 } else if (!rcSrcQueryCount) { /* Source does but target doesn't */ 783 779 /* Use the default image from source to copy to target */ … … 806 802 (LONG)sizeof (MMIMAGEHEADER), (PLONG)&ulBytesRead, 807 803 0L, 0L); 808 804 809 805 if (rc != MMIO_SUCCESS) 810 806 /* Header unavailable */ … … 814 810 return (FALSE); 815 811 } 816 812 817 813 818 814 /*************************/ … … 828 824 } 829 825 830 826 831 827 /* Use the SAME data as came from the SOURCE FILE. It must be 832 828 compatible with the OS/2 bitmaps, etc. */ … … 834 830 (LONG)sizeof (MMIMAGEHEADER), (PLONG)&ulBytesRead, 835 831 0L, 0L); 836 832 837 833 if (rc != MMIO_SUCCESS) 838 834 /* Header unavailable */ … … 846 842 HlpWriteToTrapLog("Target header set.\n"); 847 843 #endif 848 844 849 845 /* Determine the number of bytes required, per row */ 850 846 /* PLANES MUST ALWAYS BE = 1 */ … … 853 849 dwRowBits = dwWidth * mmImgHdr.mmXDIBHeader.BMPInfoHeader2.cBitCount; 854 850 dwNumRowBytes = dwRowBits >> 3; 855 851 856 852 /* Account for odd bits used in 1bpp or 4bpp images that are NOT on byte boundaries. */ 857 853 if (dwRowBits % 8) 858 854 dwNumRowBytes++; 859 855 860 856 /* Ensure the row length in bytes accounts for byte padding. All bitmap data rows 861 857 must are aligned on LONG/4-BYTE boundaries. The data FROM an IOProc … … 898 894 mmioClose (hmmioSource, 0L); 899 895 DosFreeMem(pRowBuffer); 900 896 901 897 return(TRUE); 902 898 } 903 899 904 void _OptlinkconvertThreadFunc (void *arg)900 void convertThreadFunc (void *arg) 905 901 { 906 902 HAB hab; … … 916 912 chrSourceName, 917 913 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); 922 918 DosSleep(1000); 923 919 WinDestroyMsgQueue(hmq); … … 944 940 POINTL aptl[4]; 945 941 HPS hps; 946 BOOL bReturnCode;947 942 ULONG ulHeight; 948 943 ULONG ulWidth; … … 954 949 * Get position of image frame 955 950 */ 956 bReturnCode =WinQueryWindowPos ( hwnd, &swp);951 WinQueryWindowPos ( hwnd, &swp); 957 952 958 953 /* Center image */ … … 963 958 aptl[0].x=(swp.cx-ulWidth)/2; 964 959 aptl[1].x=aptl[0].x+ulWidth; 965 960 966 961 aptl[0].y=(swp.cy-ulHeight)/2; 967 962 aptl[1].y=aptl[0].y+ulHeight; … … 977 972 aptl[0].x=(swp.cx-ulWidth*fRes)/2; 978 973 aptl[1].x=aptl[0].x+ulWidth*fRes; 979 974 980 975 aptl[0].y=(swp.cy-ulHeight*fRes)/2; 981 976 aptl[1].y=aptl[0].y+ulHeight*fRes; 982 977 } 983 978 984 979 aptl[2].x = 0; // source lower left 985 980 aptl[2].y = 0; 986 981 987 982 aptl[3].x = ulWidth; // source upper right 988 983 aptl[3].y = ulHeight; … … 1004 999 // WinDrawBitmap(hps, hBitmap, NULLHANDLE, (PPOINTL)aptl, 0, 0, DBM_NORMAL/*|DBM_STRETCH*/); 1005 1000 #endif 1006 bReturnCode =WinEndPaint (hps);1001 WinEndPaint (hps); 1007 1002 } 1008 1003 … … 1011 1006 1012 1007 switch (msg) 1013 { 1008 { 1014 1009 case WM_PAINT: 1015 1010 { … … 1036 1031 1037 1032 switch (msg) 1038 { 1033 { 1039 1034 case WM_INITDLG: 1040 1035 #if 0 … … 1047 1042 1048 1043 WinSendMsg(WinWindowFromID(hwnd,IDST_IMGCONVERTNAME),EM_SETTEXTLIMIT,MPFROMSHORT((SHORT)CCHMAXPATH),0); 1049 1044 1050 1045 /* Filename */ 1051 1046 WinSetWindowText(WinWindowFromID(hwnd,IDST_IMGCONVERTNAME), chrSourceName); 1052 1047 1053 1048 /* Set dialog font to WarpSans for Warp 4 and above */ 1054 1049 if(SysQueryOSRelease()>=40) { … … 1112 1107 iPercent=0; 1113 1108 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 %. */ 1115 1110 sprintf(text,"%d#%d%%", iPercent, iPercent); 1116 1111 WinSetWindowText(WinWindowFromID(hwnd,IDBAR_IMGCONVERTPROGRESS), text); … … 1149 1144 1150 1145 createTargetName(chrSourceName, pMemFormatInfo[iIoProc].szDefaultFormatExt); 1151 WinSetWindowText( WinWindowFromID(hwnd,IDEF_IMGCONVERTTARGETNAME), chrTargetName ); 1146 WinSetWindowText( WinWindowFromID(hwnd,IDEF_IMGCONVERTTARGETNAME), chrTargetName ); 1152 1147 } 1153 1148 } … … 1210 1205 // ULONG ulDiskNum; 1211 1206 // char cLetter; 1212 1207 1213 1208 /* Get target name */ 1214 WinQueryWindowText( WinWindowFromID(hwnd,IDEF_IMGCONVERTTARGETNAME), 1209 WinQueryWindowText( WinWindowFromID(hwnd,IDEF_IMGCONVERTTARGETNAME), 1215 1210 sizeof(chrTargetName), chrTargetName ); 1216 1211 #if 0 … … 1225 1220 if(lFreeSpace<lAudioSize) { 1226 1221 /* 1227 Text: 1228 Title: 1229 */ 1222 Text: 1223 Title: 1224 */ 1230 1225 getMessage(title, IDSTR_CONVERTNOSPACETEXT,sizeof(title), RESSOURCEHANDLE, hwnd); 1231 1226 sprintf(text,title,lAudioSize/1000000 ); … … 1237 1232 else { 1238 1233 /* Start decoding an audio file */ 1239 WinEnableWindow( WinWindowFromID(hwnd,IDPB_CONVERTOK), FALSE); 1234 WinEnableWindow( WinWindowFromID(hwnd,IDPB_CONVERTOK), FALSE); 1240 1235 WinEnableWindow( WinWindowFromID(hwnd,IDPB_CONVERTABORT), TRUE); 1241 1236 convertAudioFile(hwnd); … … 1244 1239 /* Start converting image file */ 1245 1240 WinPostMsg(hwnd, WM_APPTERMINATENOTIFY, MPFROMLONG(MSG_CONVERTPERCENT), MPFROMLONG(0)); 1246 WinEnableWindow( WinWindowFromID(hwnd,IDPB_IMGCONVERTOK), FALSE); 1241 WinEnableWindow( WinWindowFromID(hwnd,IDPB_IMGCONVERTOK), FALSE); 1247 1242 WinEnableWindow( WinWindowFromID(hwnd,IDPB_IMGCONVERTABORT), TRUE); 1248 1243 convertImageFile(hwnd); … … 1256 1251 break; 1257 1252 }/* switch */ 1258 1253 1259 1254 return WinDefDlgProc( hwnd, msg, mp1, mp2); 1260 1255 } … … 1283 1278 if(hab) { 1284 1279 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 */ 1287 1282 if(argc<NUMPARAMS-1) {/* Not the right num of params */ 1288 1283 pmUsage(); … … 1297 1292 strcpy(chrProcName, ""); 1298 1293 } 1299 /* Get our ressource dll */ 1294 /* Get our ressource dll */ 1300 1295 // RESSOURCEHANDLE=0; 1301 1296 RESSOURCEHANDLE=queryResModuleHandle(argv[0]); … … 1304 1299 /* Register the percent bar window class */ 1305 1300 percentRegisterBarClass(); 1306 1307 globalHab=WinQueryAnchorBlock(HWND_DESKTOP); 1301 1302 globalHab=WinQueryAnchorBlock(HWND_DESKTOP); 1308 1303 hBitmap=loadBitmap ( chrSourceName, &bmpInfoHeader2); 1309 1310 if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, decodeStatusDialogProc, 1304 1305 if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, decodeStatusDialogProc, 1311 1306 RESSOURCEHANDLE, IDDLG_IMGCONVERT, 0) == DID_ERROR ) 1312 1307 { … … 1314 1309 char title[CCHMAXPATH]; 1315 1310 /* 1316 Text: 1317 Title: "Installation problem" 1318 */ 1311 Text: 1312 Title: "Installation problem" 1313 */ 1319 1314 messageBox( text, IDSTR_CONVERTDIALOGERROR , sizeof(text), 1320 1315 title, IDSTR_INSTALLERRORTITLE , sizeof(title), … … 1329 1324 return( 1 ); 1330 1325 } 1331 if(pMemFormatInfo) 1326 if(pMemFormatInfo) 1332 1327 free(pMemFormatInfo); 1333 1328 if(hBitmap) -
branches/v2.9_Lars/classes/mm-progs/include/mmprogs_defaults.h
r4 r74 17 17 * If you need another license for your project/product (commercial, 18 18 * noncommercial, whatever) contact me at 19 * 19 * 20 20 * http://www.os2world.com/cdwriting 21 21 * http://www.geocities.com/SiliconValley/Sector/5785/ … … 34 34 /* Audio player */ 35 35 #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 */ 39 39 40 40 /* Image converter */ 41 #define INI_IMGCONV_APP 41 #define INI_IMGCONV_APP (PSZ)"imageconv" 42 42 43 43 /* Audio converter */ 44 #define INI_AUDIOCONV_APP 44 #define INI_AUDIOCONV_APP (PSZ)"audioconv" 45 45 46 46 /* Master volume */ 47 #define INI_VOLUME_APP "volume"47 #define INI_VOLUME_APP (PSZ)"volume" 48 48 49 49 /* Volume for classes */ 50 #define INI_CLASSVOLUME_APP 50 #define INI_CLASSVOLUME_APP (PSZ)"classvolume" 51 51 52 52 /* For setting volume */ 53 #define SETUP_MMAUDIOVOLUME 53 #define SETUP_MMAUDIOVOLUME (PSZ)"MMAUDIOVOLUME" -
branches/v2.9_Lars/classes/mm-progs/makefile
r2 r74 7 7 8 8 CC = gcc 9 LIB_DIR = $d:/emx/lib 10 #CPPFLAGS = -Ge- /Gm+ -G4 -Gl /O+ -Oc+ -Ol 11 CPPFLAGS = -O -Wall -Zomf -Zcrtdll -s 9 CPPFLAGS = -O -Wno-pointer-sign -Wall -Zomf -Zcrtdll -s 12 10 INC = ./include -I ../../classes/inc -I ../../common_functions/include 13 DEFS = 14 PROGS = 11 DEFS = 12 PROGS = 15 13 ODIR = . 16 14 CPPDIR = . … … 22 20 23 21 $(LIBDIR)/%.obj: $(COMMONSRC)/%.c 24 gcc -c -W all -o$@ -Zomf -I$(INC) $<22 gcc -c -Wno-pointer-sign -Wall -o$@ -Zomf -I$(INC) $< 25 23 26 24 all: $(LIBOBJS) … … 48 46 -cd ./mmplayer && make cleaner 49 47 -cd ./master_volume && make cleaner 50 -rm ./include/*.*~ 48 -rm ./include/*.*~ 51 49 52 50 -
branches/v2.9_Lars/classes/mm-progs/master_volume/volume.c
r2 r74 17 17 * along with this program; see the file COPYING. If not, write to 18 18 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 19 */ 19 */ 20 20 /* 21 21 * If you need another license for your project/product (commercial, 22 22 * noncommercial, whatever) contact me at 23 * 23 * 24 24 * http://www.os2world.com/cdwriting 25 25 * http://www.geocities.com/SiliconValley/Sector/5785/ … … 35 35 #define INCL_MMIOOS2 36 36 #define INCL_MCIOS2 37 #define INCL_SECONDARYWINDOW 38 #define INCL_GRAPHICBUTTON 37 #define INCL_SECONDARYWINDOW 38 #define INCL_GRAPHICBUTTON 39 39 #include <os2.h> 40 40 #include <sw.h> … … 73 73 BOOL bHaveWindowPos=FALSE; 74 74 75 BOOL bMute=FALSE; 75 BOOL bMute=FALSE; 76 76 HMODULE RESSOURCEHANDLE=0; 77 77 int bTBVisible=0; … … 134 134 135 135 /* 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) 136 MRESULT EXPENTRY volumeObjectProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 137 137 { 138 138 switch(msg) … … 153 153 ULONG mastervolume; /* Set to master volumepercentage 154 154 percentage by this example */ 155 155 156 156 USHORT usDeviceID=0; 157 157 MCI_MASTERAUDIO_PARMS masteraudioparms; … … 161 161 memset(&openParms,0, sizeof(openParms)); 162 162 openParms.pszDeviceType="Masteraudio"; 163 163 164 164 rc=mciSendCommand(0, /* Device */ 165 165 MCI_OPEN, /* Master audio message */ … … 171 171 mciGetErrorString(rc,chrCommand, sizeof(chrCommand)); 172 172 //sprintf(chrCommand, "%x", rc); 173 WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, chrCommand, "", 1234, MB_MOVEABLE); 173 WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, chrCommand, "", 1234, MB_MOVEABLE); 174 174 DosBeep(5000, 10); 175 175 usDeviceID=openParms.usDeviceID; … … 178 178 /* Get current system master 179 179 volume setting */ 180 180 181 181 mciSendCommand(usDeviceID, /* Device */ 182 182 MCI_MASTERAUDIO, /* Master audio message */ … … 188 188 /* Get current system master 189 189 volume setting */ 190 190 191 191 mciSendCommand(usDeviceID, /* Device */ 192 192 MCI_MASTERAUDIO, /* Master audio message */ … … 195 195 (PVOID) &masteraudioparms, /* Data structure */ 196 196 0); /* User parm */ 197 197 198 198 mastervolume = masteraudioparms.ulReturn; 199 199 DosBeep(500, 10); … … 228 228 } 229 229 230 void _OptlinkvolumeThreadFunc (void *arg)230 void volumeThreadFunc (void *arg) 231 231 { 232 232 HAB hab; … … 238 238 hmq=WinCreateMsgQueue(hab,0); 239 239 if(hmq) { 240 240 241 241 if((hwndThread=WinCreateWindow(HWND_OBJECT, WC_STATIC, "", 0,0,0,0,0, NULLHANDLE, 242 242 HWND_BOTTOM, 1, NULLHANDLE, NULLHANDLE))==NULLHANDLE) { … … 245 245 } 246 246 WinSubclassWindow(hwndThread,&volumeObjectProc); 247 /* Window created. */ 247 /* Window created. */ 248 248 249 249 while(WinGetMsg(hab,&qmsg,(HWND)NULL,0,0)) 250 250 WinDispatchMsg(hab,&qmsg); 251 251 WinDestroyWindow(hwndThread); 252 252 253 253 WinDestroyMsgQueue(hmq); 254 254 } … … 267 267 if((hwndTitleBar=WinWindowFromID(hwnd, FID_TITLEBAR))==NULLHANDLE) 268 268 return; 269 269 270 270 hwndPopup = WinLoadMenu(hwnd, RESSOURCEHANDLE, IDM_POPUP); 271 271 if (hwndPopup == NULLHANDLE) 272 272 return; 273 273 274 274 bVisible=WinIsWindowVisible(hwndTitleBar); 275 275 276 276 if(!bVisible) 277 WinSendMsg(hwndPopup,MM_SETITEMATTR,MPFROM2SHORT(IDM_ITEMTITLEBAR,FALSE), 277 WinSendMsg(hwndPopup,MM_SETITEMATTR,MPFROM2SHORT(IDM_ITEMTITLEBAR,FALSE), 278 278 MPFROM2SHORT(MIA_CHECKED,MIA_CHECKED)); 279 279 280 280 WinQueryPointerPos(HWND_DESKTOP, &ptl) ; 281 281 WinMapWindowPoints(HWND_DESKTOP,hwnd,&ptl,1); 282 WinPopupMenu(hwnd, hwnd, hwndPopup, 282 WinPopupMenu(hwnd, hwnd, hwndPopup, 283 283 ptl.x, ptl.y, IDM_ITEMEXIT, PU_HCONSTRAIN | PU_VCONSTRAIN | 284 284 PU_KEYBOARD | PU_MOUSEBUTTON1 | PU_MOUSEBUTTON2 | PU_NONE ); … … 296 296 if(!WinQueryWindowPos(hwndTitleBar,&swp)) 297 297 return FALSE; 298 298 299 299 if(!WinQueryWindowPos(hwnd,&swpFrame)) 300 300 return FALSE; 301 301 302 302 /* Shrink or expand the frame */ 303 303 if(!bTBVisible) { 304 WinSetWindowPos(hwnd, NULLHANDLE, swpFrame.x, swpFrame.y,//-swp.cy, 304 WinSetWindowPos(hwnd, NULLHANDLE, swpFrame.x, swpFrame.y,//-swp.cy, 305 305 swpFrame.cx, swpFrame.cy+swp.cy, SWP_SIZE|SWP_MOVE); 306 306 bTBVisible=TRUE; … … 308 308 else 309 309 { 310 WinSetWindowPos(hwnd, NULLHANDLE, swpFrame.x, swpFrame.y,//+swp.cy, 310 WinSetWindowPos(hwnd, NULLHANDLE, swpFrame.x, swpFrame.y,//+swp.cy, 311 311 swpFrame.cx, swpFrame.cy-swp.cy, SWP_SIZE|SWP_MOVE); 312 312 bTBVisible=FALSE; 313 313 } 314 314 } 315 WinSendMsg(hwnd,WM_UPDATEFRAME,0,0); 315 WinSendMsg(hwnd,WM_UPDATEFRAME,0,0); 316 316 return TRUE; 317 317 } … … 326 326 327 327 switch (msg) 328 { 328 { 329 329 case WM_INITDLG: 330 330 { … … 345 345 (MPARAM) 0L, 346 346 (MPARAM) 100L); 347 347 348 348 WinSendMsg( WinWindowFromID(hwnd, IDCS_VOLUME), 349 349 CSM_SETINCREMENT, 350 350 (MPARAM) 10L, 351 351 (MPARAM) 1L); 352 353 352 353 354 354 WinSendMsg( WinWindowFromID(hwnd, IDCS_VOLUME), 355 355 CSM_SETVALUE, 356 356 (MPARAM) queryMasterVolume(), 357 357 (MPARAM) NULL); 358 359 358 359 360 360 // getMessage(title, IDSTR_CONVERTCHANNELS, sizeof(title), RESSOURCEHANDLE, hwnd); 361 361 /* Set dialog font to WarpSans for Warp 4 and above */ … … 365 365 DEFAULT_DIALOG_FONT ); 366 366 } 367 367 368 368 hpProgramIcon = 369 369 WinLoadPointer( … … 371 371 (HMODULE) NULL, /* Resource is kept in .Exe file. */ 372 372 ID_ICONVOLUME ); /* Which icon to use. */ 373 373 374 374 WinSendMsg( 375 375 hwnd, /* Dialog window handle. */ … … 399 399 PP_BACKGROUNDCOLOR,(ULONG)sizeof(rgb), &rgb); 400 400 } 401 ulSize=sizeof(RGB); 401 ulSize=sizeof(RGB); 402 402 if(IniRestoreData(chrIniFile, INI_VOLUME_APP, INI_BTNFGCLR_KEY, &rgb, &ulSize)) 403 403 { … … 428 428 /* Remove top frame controls if titlebar is hidden */ 429 429 SHORT countSwp; 430 430 431 431 countSwp = (int) WinDefDlgProc(hwnd, msg, mp1, mp2); 432 432 if(countSwp) { 433 if(bTBVisible==0) { 434 /* Hide frame controls */ 433 if(bTBVisible==0) { 434 /* Hide frame controls */ 435 435 /* countSWP: number of standard framecontrols 436 436 pswp: Array of SWP describing the framecontrols. … … 485 485 case WM_BUTTON1MOTIONSTART: 486 486 /* Drag the window without titlebar */ 487 WinSendMsg(hwnd, WM_TRACKFRAME, 487 WinSendMsg(hwnd, WM_TRACKFRAME, 488 488 MPFROMSHORT(TF_MOVE /*| TF_SETPOINTERPOS */), NULL) ; 489 489 return (MRESULT) 0 ; … … 504 504 { 505 505 if (SHORT2FROMMP(mp1)==GBN_BUTTONDOWN) { 506 bMute=TRUE; 506 bMute=TRUE; 507 507 setMasterVolume(hwnd, 0); 508 508 } 509 509 else if (SHORT2FROMMP(mp1)==GBN_BUTTONUP) { 510 510 SHORT sValue; 511 511 512 512 bMute=FALSE; 513 513 WinSendMsg(WinWindowFromID(hwnd, IDCS_VOLUME),CSM_QUERYVALUE ,MPFROMP(&sValue) ,0); … … 524 524 memset(&masteraudioparms,0, sizeof(masteraudioparms)); 525 525 /* Save master audio level */ 526 mciSendCommand( 0, 526 mciSendCommand( 0, 527 527 MCI_MASTERAUDIO, /* Master audio message */ 528 528 MCI_WAIT | MCI_MASTERVOL | MCI_SAVESETTING, … … 594 594 bTBVisible=IniRestoreInt(chrIniFile, INI_VOLUME_APP, INI_TBVISIBLE_KEY, 1); 595 595 596 if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, 596 if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, 597 597 volumeDialogProc, RESSOURCEHANDLE, IDDLG_VOLUME, 0) == DID_ERROR ) 598 598 { 599 599 /* 600 Text: 601 Title: "Installation problem" 600 Text: 601 Title: "Installation problem" 602 602 */ 603 603 #if 0 … … 605 605 title, IDSTR_INSTALLERRORTITLE , sizeof(title), 606 606 RESSOURCEHANDLE, HWND_DESKTOP, MB_OK | MB_ICONEXCLAMATION | MB_MOVEABLE); 607 #endif 607 #endif 608 608 WinDestroyMsgQueue( hmq ); 609 609 WinTerminate( hab ); … … 637 637 (MPARAM) NULL); 638 638 while ( WinGetMsg( hab, (PQMSG) &qmsg, (HWND) NULL, 0, 0) ) 639 WinDispatchMsg( hab, (PQMSG) &qmsg ); 639 WinDispatchMsg( hab, (PQMSG) &qmsg ); 640 640 #endif 641 641 freeResHandle(); -
branches/v2.9_Lars/classes/mm-progs/mmfind/image.c
r4 r74 26 26 POINTL aptl[4]; 27 27 HPS hps; 28 BOOL bReturnCode;29 28 ULONG ulHeight; 30 29 ULONG ulWidth; … … 37 36 * Get position of image frame 38 37 */ 39 bReturnCode =WinQueryWindowPos ( hwnd, &swp);38 WinQueryWindowPos ( hwnd, &swp); 40 39 41 40 WinQueryWindowRect(hwnd, &rectl); … … 48 47 aptl[0].x=(swp.cx-ulWidth)/2; 49 48 aptl[1].x=aptl[0].x+ulWidth; 50 49 51 50 aptl[0].y=(swp.cy-ulHeight)/2; 52 51 aptl[1].y=aptl[0].y+ulHeight; … … 62 61 aptl[0].x=(swp.cx-ulWidth*fRes)/2; 63 62 aptl[1].x=aptl[0].x+ulWidth*fRes; 64 63 65 64 aptl[0].y=(swp.cy-ulHeight*fRes)/2; 66 65 aptl[1].y=aptl[0].y+ulHeight*fRes; 67 66 } 68 67 69 68 aptl[2].x = 0; // source lower left 70 69 aptl[2].y = 0; 71 70 72 71 aptl[3].x = ulWidth; // source upper right 73 72 aptl[3].y = ulHeight; … … 89 88 // WinDrawBitmap(hps, hBitmap, NULLHANDLE, (PPOINTL)aptl, 0, 0, DBM_NORMAL/*|DBM_STRETCH*/); 90 89 #endif 91 bReturnCode =WinEndPaint (hps);90 WinEndPaint (hps); 92 91 } 93 92 … … 96 95 97 96 switch (msg) 98 { 97 { 99 98 case WM_PAINT: 100 99 { … … 276 275 return(0L); 277 276 } 278 277 279 278 280 279 // *************************************************** … … 282 281 // the memory device context obtained above. 283 282 // *************************************************** 284 283 285 284 ImageSize.cx = dwWidth; 286 285 ImageSize.cy = dwHeight; … … 300 299 (ULONG) MB_OK | MB_MOVEABLE | 301 300 MB_ERROR ); 302 #endif 301 #endif 303 302 DevCloseDC(hdc); 304 303 DosFreeMem(pRowBuffer); -
branches/v2.9_Lars/classes/mm-progs/mmfind/mmfind.c
r4 r74 21 21 * If you need another license for your project/product (commercial, 22 22 * noncommercial, whatever) contact me at 23 * 23 * 24 24 * http://www.os2world.com/cdwriting 25 25 * http://www.geocities.com/SiliconValley/Sector/5785/ … … 73 73 BOOL bIsMidi=FALSE; /* No MIDI support atm */ 74 74 BOOL bIsPlaying=FALSE; /* TRUE if currently playing */ 75 BOOL bPaused=FALSE; 75 BOOL bPaused=FALSE; 76 76 ULONG ulPos; 77 77 ULONG ulTotalLength; … … 120 120 hps=WinGetPS(HWND_DESKTOP); 121 121 122 /* Play */ 122 /* Play */ 123 123 hbmPlay=GpiLoadBitmap(hps, hResource, IDBMP_PLAY, 0, 0); 124 124 … … 143 143 ulStyle|=(BS_BITMAP); 144 144 ulStyle&=~BS_TEXT; 145 145 146 146 if(WinSetWindowULong(hwndTemp, QWL_STYLE, ulStyle)) { 147 147 memset(&btCtrl, 0, sizeof(btCtrl)); … … 163 163 ulStyle|=(BS_BITMAP); 164 164 ulStyle&=~BS_TEXT; 165 165 166 166 if(WinSetWindowULong(hwndTemp, QWL_STYLE, ulStyle)) { 167 167 memset(&btCtrl, 0, sizeof(btCtrl)); … … 199 199 if(!MsgGetMessage(audioText, IDSTR_AUDIOINFOTEXT, sizeof(audioText), hResMod,HWND_DESKTOP)) 200 200 strcpy(audioText, TEXT_INFOTEXT); 201 if(!MsgGetMessage(chrMediaFileTypes[MT_AUDIO], IDSTR_TYPEAUDIO, 201 if(!MsgGetMessage(chrMediaFileTypes[MT_AUDIO], IDSTR_TYPEAUDIO, 202 202 sizeof(chrMediaFileTypes[MT_AUDIO]), hResMod, HWND_DESKTOP)) 203 203 strcpy(chrMediaFileTypes[MT_AUDIO], TEXT_TYPEAUDIO); 204 if(!MsgGetMessage(chrMediaFileTypes[MT_IMAGE], IDSTR_TYPEIMAGE, 204 if(!MsgGetMessage(chrMediaFileTypes[MT_IMAGE], IDSTR_TYPEIMAGE, 205 205 sizeof(chrMediaFileTypes[MT_IMAGE]), hResMod, HWND_DESKTOP)) 206 206 strcpy(chrMediaFileTypes[MT_AUDIO], TEXT_TYPEIMAGE); 207 if(!MsgGetMessage(chrMediaFileTypes[MT_VIDEO], IDSTR_TYPEVIDEO, 207 if(!MsgGetMessage(chrMediaFileTypes[MT_VIDEO], IDSTR_TYPEVIDEO, 208 208 sizeof(chrMediaFileTypes[MT_VIDEO]), hResMod, HWND_DESKTOP)) 209 209 strcpy(chrMediaFileTypes[MT_VIDEO], TEXT_TYPEVIDEO); … … 272 272 char chrCommand[50]; 273 273 char retMsg[100]; 274 ULONG rc;275 274 276 275 if(bIsPlaying) { 277 276 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 280 279 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 284 283 _resetDisplay(hwndFrame); 285 284 showPlayTimeDisplay( hwndFrame, TRUE); … … 287 286 #endif 288 287 bIsPlaying=FALSE; 289 bPaused=FALSE; 288 bPaused=FALSE; 290 289 } 291 290 … … 319 318 strncpy(chrDevice,"WAVEAUDIO", sizeof(chrDevice)); 320 319 321 /* Start audio file */ 320 /* Start audio file */ 322 321 sprintf(chrCommand,"open \"%s\" type %s alias wave%ld SHAREABLE wait", chrSourceName, chrDevice, hwndNotify); 323 322 … … 326 325 if((rc & 0x0000ffff)!=MCIERR_SUCCESS) 327 326 return 0; 328 327 329 328 /* Set time format */ 330 329 sprintf(chrCommand,"SET wave%ld TIME FORMAT MILLISECONDS wait", hwndNotify); … … 334 333 rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 335 334 return 0; 336 } 335 } 337 336 338 337 #if 0 … … 420 419 421 420 /* Every folder has one running play thread to handle play commands */ 422 void _OptlinkplayThreadFunc (void *arg)421 void playThreadFunc (void *arg) 423 422 { 424 423 HAB hab; … … 488 487 if(MMIO_SUCCESS!=mmioIdentifyFile(chrFile, &mmioInfo, &mmFormatInfo, &fourCC, 0,0)) 489 488 { 490 return MT_UNKNOWN; 489 return MT_UNKNOWN; 491 490 } 492 491 … … 539 538 } 540 539 /* 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), 543 542 MPFROMP(chrMediaFileTypes[a])); 544 543 WinSetWindowText(WinWindowFromID(hwnd, IDCB_TYPEOFFILE), chrMediaFileTypes[0]); … … 681 680 mmio.ulFlags=MMIO_READ; 682 681 mmio.ulTranslate=MMIO_TRANSLATEHEADER; 683 682 684 683 hmmio = mmioOpen(chrFullName, &mmio, MMIO_READ); 685 684 if(!hmmio) … … 689 688 rc = mmioGetHeader(hmmio, &mmAudioHeader,sizeof(MMAUDIOHEADER), 690 689 &lBytesRead, 0, 0); 691 690 692 691 mmioClose(hmmio, 0); 693 692 if(rc!=MMIO_SUCCESS) { … … 785 784 APIRET rc; /* return code from REXX */ 786 785 SHORT rexxrc = 0; /* return code from function */ 787 char theScript[CCHMAXPATH]; 786 char theScript[CCHMAXPATH]; 788 787 /* By setting the strlength of the output RXSTRING to zero, we */ 789 788 /* force the interpreter to allocate memory and return it to us. */ 790 789 /* We could provide a buffer for the interpreter to use instead. */ 791 790 rexxretval.strlength = 0L; /* initialize return to empty*/ 792 791 793 792 sprintf(theScript, "%s\\%s", pszBinDir, rexxFile); 794 793 … … 807 806 #if 0 808 807 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", 810 809 tPt->rexxSkript, rc*-1); 811 810 WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, text, "", 1234, MB_OK|MB_MOVEABLE|MB_ERROR); … … 822 821 } 823 822 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. */ 825 824 if(!rc) 826 825 return TRUE; … … 845 844 '\0', 846 845 sizeof(MMFORMATINFO) ); 847 846 848 847 mmFormatInfo.ulMediaType |= MMIO_MEDIATYPE_IMAGE; 849 mmFormatInfo.ulFlags|=MMIO_CANREADTRANSLATED;/* Read !!!*/ 848 mmFormatInfo.ulFlags|=MMIO_CANREADTRANSLATED;/* Read !!!*/ 850 849 ulReturnCode = mmioQueryFormatCount ( &mmFormatInfo, 851 850 &lNumIOProcs, 852 851 0, 853 852 0 ); 854 853 855 854 if( ulReturnCode != MMIO_SUCCESS ) 856 855 { … … 873 872 return FALSE; 874 873 } 875 874 876 875 /* 877 876 * call mmioGetFormats to get info on the formats supported. … … 891 890 return FALSE; 892 891 } 893 892 894 893 if( lFormatsRead != lNumIOProcs ) 895 894 { … … 919 918 } 920 919 } 921 } 920 } 922 921 /* 923 922 * advance to next entry in mmFormatInfo array 924 */ 923 */ 925 924 pmmFormatInfoArray++; 926 925 } … … 952 951 if(hab) { 953 952 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 */ 956 955 if(argc!=NUMPARAMS) {/* Not the right num of params */ 957 956 pmUsage(); 958 957 } 959 958 else { 960 HWND hwndDlg; 961 962 /* Get our ressource dll */ 959 HWND hwndDlg; 960 961 /* Get our ressource dll */ 963 962 RESSOURCEHANDLE=queryResModuleHandle(argv[0]); 964 963 /* Load NLV strings */ … … 1031 1030 { 1032 1031 if(hBitmap) 1033 GpiDeleteBitmap(hBitmap); 1032 GpiDeleteBitmap(hBitmap); 1034 1033 if( fd.lReturn == DID_OK ) 1035 1034 { -
branches/v2.9_Lars/classes/mm-progs/volume/classvol.c
r2 r74 22 22 * If you need another license for your project/product (commercial, 23 23 * noncommercial, whatever) contact me at 24 * 24 * 25 25 * http://www.os2world.com/cdwriting 26 26 * http://www.geocities.com/SiliconValley/Sector/5785/ … … 54 54 //#include "cwaudioinc.h" 55 55 56 #ifndef OPEN_DEFAULT 56 #ifndef OPEN_DEFAULT 57 57 /* Open views for the wpOpen() method */ 58 58 #define OPEN_UNKNOWN -1 … … 162 162 hResource=BMP_RESSOURCEHANDLE; //_queryResModuleHandle(); 163 163 hps=WinGetPS(HWND_DESKTOP); 164 164 165 165 /* The main BMP */ 166 166 allBMPs[MAIN_BMP_IDX].hbm=GpiLoadBitmap(hps, hResource, IDBMP_MAIN, 0, 0); … … 265 265 WinSetWindowPos(WinWindowFromID(hwnd, ci.id),HWND_TOP, ci.rclSource.xLeft,ci.rclSource.yBottom, 266 266 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); 268 268 oldPlayTimeProc=WinSubclassWindow(WinWindowFromID(hwnd, IDST_MMPLAYERPLAYTIME), playTimeTextProc); 269 269 270 270 /* Pos slider */ 271 271 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, 273 273 hwnd, HWND_TOP, ci.id, NULLHANDLE, NULLHANDLE); 274 274 WinSetWindowPos(WinWindowFromID(hwnd, ci.id),HWND_TOP, ci.rclDest.xLeft, ci.rclDest.yBottom, 275 275 ci.rclSource.xRight-ci.rclSource.xLeft, 276 276 ci.rclSource.yTop-ci.rclSource.yBottom, SWP_MOVE | SWP_SIZE); 277 277 278 278 WinSendMsg(WinWindowFromID(hwnd, ci.id),SLM_SETSLIDERINFO, 279 279 MPFROM2SHORT(SMA_SLIDERARMDIMENSIONS,0), 280 MPFROM2SHORT( 9, 9)); 280 MPFROM2SHORT( 9, 9)); 281 281 #endif 282 282 283 283 /* Vol slider */ 284 284 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, 286 286 hwnd, HWND_TOP, ci.id, NULLHANDLE, NULLHANDLE); 287 287 WinSetWindowPos(WinWindowFromID(hwnd, ci.id),HWND_TOP, ci.rclDest.xLeft, ci.rclDest.yBottom, … … 290 290 WinSendMsg(WinWindowFromID(hwnd, ci.id),SLM_SETSLIDERINFO, 291 291 MPFROM2SHORT(SMA_SLIDERARMDIMENSIONS,0), 292 MPFROM2SHORT( 9, 9)); 292 MPFROM2SHORT( 9, 9)); 293 293 294 294 } … … 328 328 MPFROM2SHORT(SC_SIZE, TRUE), 329 329 MPFROMP(NULL)); 330 330 331 331 WinSendMsg(hwndMenu, /* Delete Minimize from the system menu */ 332 332 MM_DELETEITEM, 333 333 MPFROM2SHORT(SC_MINIMIZE, TRUE), 334 334 MPFROMP(NULL)); 335 335 336 336 WinSendMsg(hwndMenu, /* Delete Maximize from the system menu */ 337 337 MM_DELETEITEM, … … 368 368 369 369 switch (msg) 370 { 370 { 371 371 case WM_INITDLG: 372 372 { … … 381 381 swctl.fbJump=SWL_JUMPABLE; 382 382 WinAddSwitchEntry(&swctl); 383 383 384 384 adjustDialogControlPos(hwnd); 385 385 386 386 /* Set volume slider*/ 387 387 WinSendMsg( WinWindowFromID(hwnd, IDSL_MMPLAYERVOLUME), … … 389 389 MPFROM2SHORT(SMA_SLIDERARMPOSITION,SMA_INCREMENTVALUE), 390 390 MPFROMLONG( ulVolume)); 391 391 392 392 FixSysMenu(hwnd); 393 393 … … 397 397 POINTL ptl; 398 398 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), 403 403 allBMPs[MAIN_BMP_IDX].bmpInfoHdr.cx, 404 404 allBMPs[MAIN_BMP_IDX].bmpInfoHdr.cy, 405 405 SWP_SIZE|SWP_MOVE); 406 406 orgBgProc=WinSubclassWindow(WinWindowFromID(hwnd, ID_CLASSVOLCLIENT), bgProc); 407 407 408 408 /* Get mouse position */ 409 409 WinQueryPointerPos(HWND_DESKTOP, &ptl); … … 459 459 default: 460 460 break; 461 } 461 } 462 462 break; 463 463 … … 468 468 { 469 469 SWP swp; 470 470 471 471 switch(SHORT2FROMMP(mp1)) 472 472 { … … 492 492 493 493 ulVolume=ulValue; 494 sprintf(command,"MMAUDIOVOLUME=% d", ulVolume);494 sprintf(command,"MMAUDIOVOLUME=%lu", ulVolume); 495 495 sendCommandToObject(chrSourceName, command); 496 496 break; … … 509 509 { 510 510 ULONG ulValue; 511 511 512 512 ulValue=LONGFROMMP(mp2); 513 513 ulVolume=ulValue; … … 529 529 break; 530 530 }/* switch */ 531 531 532 532 return WinDefDlgProc( hwnd, msg, mp1, mp2); 533 533 } … … 541 541 BOOL writeVolumeToIni(char * iniFile, ULONG ulVolume) 542 542 { 543 543 544 544 return IniSaveInt(iniFile, INI_CLASSVOLUME_APP, INI_VOLUME_KEY, ulVolume); 545 545 } … … 580 580 if(hab) { 581 581 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 */ 584 584 if(argc!=NUMPARAMS ) {/* Not the right num of params */ 585 585 pmUsage(); … … 591 591 // ++chrPtrName; 592 592 //SysWriteToTrapLog("Name: %s\n", chrSourceName); 593 /* Get our ressource dll */ 593 /* Get our ressource dll */ 594 594 RESSOURCEHANDLE=queryResModuleHandle(argv[0]); 595 595 /* Get data from INI file */ … … 604 604 _loadBmps(); 605 605 606 if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, decodeStatusDialogProc, 606 if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, decodeStatusDialogProc, 607 607 RESSOURCEHANDLE, IDDLG_CLASSVOLUME, 0) == DID_ERROR ) 608 608 { 609 609 /* 610 Text: 611 Title: "Installation problem" 612 */ 610 Text: 611 Title: "Installation problem" 612 */ 613 613 messageBox( text, IDSTR_CONVERTDIALOGERROR , sizeof(text), 614 614 title, IDSTR_INSTALLERRORTITLE , sizeof(title),
Note:
See TracChangeset
for help on using the changeset viewer.