Changeset 133 for trunk/mediafolder/c/mediafldr
- Timestamp:
- Nov 29, 2023, 5:59:34 PM (23 months ago)
- Location:
- trunk/mediafolder/c/mediafldr
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mediafolder/c/mediafldr/mediafolder.cpp
r57 r133 1 1 /* 2 2 * This file is (C) Chris Wohlgemuth 2002 3 * 3 * 4 4 * It's part of the Media-Folder distribution 5 5 */ … … 69 69 switch(ulAction) 70 70 { 71 case PLAY_FIRST: 71 case PLAY_FIRST: 72 72 /* Send a message to the object window created by the folder play thread */ 73 73 WinPostMsg(thisPtr->mfData->hwndPlayObject,WM_APPTERMINATENOTIFY, 0,MPFROMLONG(PLAY_FIRST)); … … 146 146 thisPtr->cwSeekAudioFile(LONGFROMMP(mp1)); 147 147 /* restart timer */ 148 // WinStartTimer(WinQueryAnchorBlock(hwnd), WinWindowFromID(hwndFrame), IDTIMER_PLAY, PLAYTIMER_DELAY); 148 // WinStartTimer(WinQueryAnchorBlock(hwnd), WinWindowFromID(hwndFrame), IDTIMER_PLAY, PLAYTIMER_DELAY); 149 149 thisPtr->ulPos=LONGFROMMP(mp1)/1000; 150 150 } … … 192 192 if(hwnd) { 193 193 thisPtr->mfData->hwndPlayObject=hwnd; 194 WinSetWindowULong(hwnd, QWL_USER,(ULONG)tPt); 194 195 WinSubclassWindow(hwnd,&playObjectProc); 195 WinSetWindowULong(hwnd, QWL_USER,(ULONG)tPt);196 196 /* Window created. */ 197 197 while(WinGetMsg(hab,&qmsg,(HWND)NULL,0,0)) … … 225 225 return; 226 226 227 thisPtr=(CWMediaFolder*)threadParms->thisPtr; 227 thisPtr=(CWMediaFolder*)threadParms->thisPtr; 228 228 229 229 if(!somIsObj(thisPtr)) … … 247 247 if(!((WPFileSystem*)thisPtr->wpObjM3UFile)->wpQueryRealName(chrFileName, &ulSize, TRUE)) 248 248 return; 249 249 250 250 /* Get name of folder */ 251 251 ulSize=CCHMAXPATH; … … 256 256 if(hab) { 257 257 hmq=WinCreateMsgQueue(hab,0); 258 if(hmq) { 258 if(hmq) { 259 259 RXSTRING arg[2]; /* argument string for REXX */ 260 260 RXSTRING rexxretval; /* return value from REXX */ … … 266 266 /* We could provide a buffer for the interpreter to use instead. */ 267 267 rexxretval.strlength = 0L; /* initialize return to empty*/ 268 268 269 269 MAKERXSTRING(arg[0], chrFileName, strlen(chrFileName));/* create input argument */ 270 MAKERXSTRING(arg[1], chrFolderName, strlen(chrFolderName));/* create input argument */ 271 270 MAKERXSTRING(arg[1], chrFolderName, strlen(chrFolderName));/* create input argument */ 271 272 272 TRY_LOUD(RX_START) { 273 273 /* Here we call the interpreter. We don't really need to use */ … … 285 285 (PSHORT) &rexxrc, /* Rexx program output */ 286 286 (PRXSTRING) &rexxretval ); /* Rexx program output */ 287 287 288 288 if(rc) { 289 sprintf(chrFileName,"Error in the Rexx skript %s\n\n Get more information with 'help REX%04d'.\n", 289 sprintf(chrFileName,"Error in the Rexx skript %s\n\n Get more information with 'help REX%04d'.\n", 290 290 "", rc*-1); 291 291 WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, chrFileName, "", 1234, MB_OK|MB_MOVEABLE|MB_ERROR); 292 292 } 293 DosFreeMem(rexxretval.strptr); /* Release storage given to us by REXX. */ 293 DosFreeMem(rexxretval.strptr); /* Release storage given to us by REXX. */ 294 294 } 295 295 CATCH(RX_START) 296 296 {}END_CATCH; 297 297 298 298 WinDestroyMsgQueue(hmq); 299 299 } … … 301 301 } 302 302 // thisPtr->fContentsChanged=FALSE; 303 thisPtr->wpFreeMem((PBYTE)chrFileName); 303 thisPtr->wpFreeMem((PBYTE)chrFileName); 304 304 thisPtr->wpFreeMem((PBYTE)threadParms); 305 305 } … … 372 372 373 373 WinSetWindowPos(hwndFrame, NULLHANDLE, swp2.x, swp2.y, swp2.cx,swp2.cy,SWP_SIZE|SWP_MOVE); 374 /* 374 /* 375 375 By changing the to contents view we trick the WPS to show the 'Details view' menu item in 376 376 the view menu of the folders system menu. In that sub menu the WPS always inserts all known … … 379 379 The system knows nothing about the 'compact view' and all the handling is done by us. 380 380 As a side effect the folder position information for the details 381 view isn't changed when the folder is closed in 'Compact view'. 381 view isn't changed when the folder is closed in 'Compact view'. 382 382 */ 383 383 wpMenuItemSelected(hwndFrame, 0x2cc); … … 419 419 ",", chrBuf, sizeof(chrBuf)); 420 420 chrBuf[sizeof(chrBuf)-1]=0; 421 421 422 422 if(mfData->ulTotalTime<=3600) { 423 423 getMessage( text, IDSTR_STATUSTIME1, sizeof(text), queryResModuleHandle(), HWND_DESKTOP); … … 432 432 sprintf(time, text, mfData->ulTotalTime/(3600*24), 433 433 (mfData->ulTotalTime%(3600*24))/3600, (mfData->ulTotalTime%3600)/60, mfData->ulTotalTime%60); 434 } 434 } 435 435 if(mfData->ulSize<=0xffffffff) { 436 436 getMessage( text2, IDSTR_STATUSTIME4, sizeof(text2), queryResModuleHandle(),HWND_DESKTOP); 437 sprintf(text, text2, 437 sprintf(text, text2, 438 438 mfData->ulNumTracks, mfData->ulSize/1000000 ,chrBuf, (mfData->ulSize%1000000)/1000, 439 439 chrBuf, mfData->ulSize%1000, … … 488 488 getMessage(pageName, IDSTRSETTING_TOOLBAR, sizeof(pageName), queryResModuleHandle(), hwndNotebook); 489 489 pageinfo.pszName = pageName; 490 490 491 491 //Insert the page into the settings notebook 492 492 return wpInsertSettingsPage(hwndNotebook,&pageinfo); … … 497 497 PMINIRECORDCORE mrc; 498 498 WPObject * contentObject; 499 499 500 500 /* See if we have an audio file played with doubleclick */ 501 501 mrc=(PMINIRECORDCORE)WinSendMsg(hwndContainer,CM_QUERYRECORDEMPHASIS,MPFROMLONG(CMA_FIRST), … … 551 551 /* Get new ID for wave device */ 552 552 if(cwRequestMutex(hmtxFileName, 100000)==ERROR_TIMEOUT) 553 return FALSE; 553 return FALSE; 554 554 555 555 iWaveDev++; … … 565 565 WPObject *wpObject; 566 566 PMINIRECORDCORE pmrc; 567 567 568 568 #if 0 569 569 /* There's already a file playing using doubleclick */ 570 if(mmGetOtherPlayingAudioFile( this, hwndContainer, &wpObject, &pmrc)) 570 if(mmGetOtherPlayingAudioFile( this, hwndContainer, &wpObject, &pmrc)) 571 571 return 0; 572 572 #endif … … 605 605 else 606 606 return 0;/* Error */ 607 608 if( contentObject->somIsA(cwAudioClass) || 607 608 if( contentObject->somIsA(cwAudioClass) || 609 609 /*contentObject->somIsA(mmAudioClass) ||*/ 610 610 contentObject->somIsA(mmMIDIClass)) { … … 643 643 MPFROM2SHORT(CMA_NEXT,CMA_ITEMORDER)); 644 644 645 if((int)mrc==-1) { 645 if((int)mrc==-1) { 646 646 /* Wrong parameter -> user deleted the shadow. */ 647 647 /* Stop wave, remove in use emphasis. */ … … 650 650 } 651 651 // HlpWriteToTrapLog("Next mrc is %x\n", mrc); 652 652 653 653 notFound=TRUE; 654 while(notFound && mrc && (int)mrc!=-1){ 654 while(notFound && mrc && (int)mrc!=-1){ 655 655 contentObject=(WPObject*)OBJECT_FROM_PREC(mrc);//Get object 656 656 if(somIsObj(contentObject)) { … … 664 664 else 665 665 return 0;/* Error */ 666 666 667 667 if(contentObject->somIsA(cwAudioClass) || 668 668 /* contentObject->somIsA(mmAudioClass) || */ … … 701 701 /* Select the object */ 702 702 WinSendMsg(hwndContainer,CM_SETRECORDEMPHASIS, MPFROMP(pmrc), 703 MPFROM2SHORT(TRUE, CRA_SELECTED)); 703 MPFROM2SHORT(TRUE, CRA_SELECTED)); 704 704 705 705 return cwPlayAudioFile(hwndFrame, PLAY_FIRST);/* Not yet playing, so start the first one. */ … … 709 709 return cwPlayAudioFile(hwndFrame, PLAY_FIRST);/* Not yet playing, so start the first one. */ 710 710 } 711 711 712 712 /* Check the current time. If we are at the very beginning of the track skip to the previous track 713 713 otherwise skip to the beginning of the current track. */ … … 727 727 /* Find an audio file */ 728 728 notFound=TRUE; 729 while(notFound && mrc && (int)mrc!=-1){ 729 while(notFound && mrc && (int)mrc!=-1){ 730 730 contentObject=(WPObject*)OBJECT_FROM_PREC(mrc);//Get object 731 731 if(somIsObj(contentObject)) { … … 741 741 742 742 /* Check if it's an audio file thus playable */ 743 if(contentObject->somIsA(cwAudioClass) || 743 if(contentObject->somIsA(cwAudioClass) || 744 744 /* contentObject->somIsA(mmAudioClass) || */ 745 745 contentObject->somIsA(mmMIDIClass)) { … … 755 755 if(!mrc) 756 756 return 0; 757 757 758 758 break; 759 759 default: … … 771 771 else /*if(contentObject->somIsA(cwAudioClass) || contentObject->somIsA(mmAudioClass))*/ 772 772 strncpy(chrDevice,"WAVEAUDIO", sizeof(chrDevice)); 773 773 774 774 chrDevice[sizeof(chrDevice)-1]=0; 775 775 776 776 hwndNotify=playControlDialogFromFrameHWND(hwndFrame);//WinWindowFromID(hwndTop, IDDLG_TOPMIDDLE); 777 777 778 /* Start audio file */ 778 /* Start audio file */ 779 779 sprintf(chrCommand,"open \"%s\" type %s alias wave%d SHAREABLE wait",name, chrDevice, iWavePriv); 780 780 rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), hwndNotify, 0); … … 789 789 rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 790 790 return 0; 791 } 791 } 792 792 793 793 sprintf(chrCommand,"SETPOSITIONADVISE wave%d ON EVERY 1000 notify", iWavePriv); … … 829 829 } 830 830 831 /* Start pos timer. SET MCIPOSITIONADVICE fails when seeking in the wave. 831 /* Start pos timer. SET MCIPOSITIONADVICE fails when seeking in the wave. 832 832 Don't know why. */ 833 833 834 //WinStartTimer(WinQueryAnchorBlock(hwndFrame), WinWindowFromID(hwndTop, IDDLG_TOPMIDDLE), IDTIMER_PLAY, PLAYTIMER_DELAY); 834 //WinStartTimer(WinQueryAnchorBlock(hwndFrame), WinWindowFromID(hwndTop, IDDLG_TOPMIDDLE), IDTIMER_PLAY, PLAYTIMER_DELAY); 835 835 WinStartTimer(WinQueryAnchorBlock(hwndFrame), playControlDialogFromFrameHWND(hwndFrame), IDTIMER_PLAY, PLAYTIMER_DELAY); 836 836 … … 849 849 /* Select the object */ 850 850 WinSendMsg(hwndContainer,CM_SETRECORDEMPHASIS, MPFROMP(mrc), 851 MPFROM2SHORT(TRUE, CRA_SELECTED)); 851 MPFROM2SHORT(TRUE, CRA_SELECTED)); 852 852 853 853 iWave=iWavePriv; … … 872 872 BOOL bFound=FALSE; 873 873 874 /** Get a random number in the appropriate range */ 874 /** Get a random number in the appropriate range */ 875 875 DosGetDateTime((PDATETIME)&DT); /* Get the time */ 876 876 seed = DT.hours*60 + DT.minutes; /* convert to hundreths */ … … 885 885 886 886 #ifdef RANDOM_DEBUG 887 HlpWriteToTrapLog("\n Zufall: %d %d\n", zufall, mfData->pRandomArray[zufall]); 887 HlpWriteToTrapLog("\n Zufall: %d %d\n", zufall, mfData->pRandomArray[zufall]); 888 888 #endif 889 889 /* Get a random number in the appropriate range */ … … 891 891 mfData->pRandomArray[zufall]=1; 892 892 #ifdef RANDOM_DEBUG 893 HlpWriteToTrapLog("2 Zufall: %d %d\n", zufall, mfData->pRandomArray[zufall]); 893 HlpWriteToTrapLog("2 Zufall: %d %d\n", zufall, mfData->pRandomArray[zufall]); 894 894 #endif 895 895 return zufall; … … 900 900 if (zufall == start && !bFound) { 901 901 #ifdef RANDOM_DEBUG 902 HlpWriteToTrapLog("Error Zufall: %d %d\n", zufall, mfData->pRandomArray[zufall]); 902 HlpWriteToTrapLog("Error Zufall: %d %d\n", zufall, mfData->pRandomArray[zufall]); 903 903 #endif 904 904 return -1; … … 944 944 /* Check if we currently play the last track. */ 945 945 if((mfData->iNumPlayed>=mfData->iNumToPlay) && mfData->pRandomArray) { 946 cwStopAudioFile(hwndFrame);/* Reset playing vars and remove in use emphasis */ 946 cwStopAudioFile(hwndFrame);/* Reset playing vars and remove in use emphasis */ 947 947 if(!(ulFlags&FLAG_REPEAT)) 948 948 return 0; … … 959 959 /* Get new ID for wave device */ 960 960 if(cwRequestMutex(hmtxFileName, 100000)==ERROR_TIMEOUT) 961 return FALSE; 961 return FALSE; 962 962 iWaveDev++; 963 963 if(iWaveDev==1000) … … 1009 1009 /* Find an audio file */ 1010 1010 notFound=TRUE; 1011 while(notFound){ 1011 while(notFound){ 1012 1012 /* Find track to play */ 1013 1013 if((iTrack=_getRandomTrack(mfData))==-1) { … … 1022 1022 HlpWriteToTrapLog("%s: _getRandomTrack returned: %d.\n", __FUNCTION__, iTrack); 1023 1023 #endif 1024 1024 1025 1025 for(a=0,mrc=(PMINIRECORDCORE)WinSendMsg(hwndContainer,CM_QUERYRECORD,NULL, 1026 1026 MPFROM2SHORT(CMA_FIRST,CMA_ITEMORDER)); … … 1039 1039 #endif 1040 1040 1041 if(!mrc) 1041 if(!mrc) 1042 1042 { 1043 1043 #ifdef RANDOM_DEBUG … … 1053 1053 1054 1054 /* Check if it's an audio file thus playable */ 1055 if(contentObject->somIsA(cwAudioClass) || 1055 if(contentObject->somIsA(cwAudioClass) || 1056 1056 /* contentObject->somIsA(mmAudioClass) ||*/ 1057 1057 contentObject->somIsA(mmMIDIClass)) { … … 1083 1083 else /*if(contentObject->somIsA(cwAudioClass) || contentObject->somIsA(mmAudioClass))*/ 1084 1084 strncpy(chrDevice,"WAVEAUDIO", sizeof(chrDevice)); 1085 1085 1086 1086 chrDevice[sizeof(chrDevice)-1]=0; 1087 1087 1088 1088 hwndNotify=playControlDialogFromFrameHWND(hwndFrame);//WinWindowFromID(hwndTop, IDDLG_TOPMIDDLE); 1089 1089 1090 /* Start audio file */ 1090 /* Start audio file */ 1091 1091 sprintf(chrCommand,"open \"%s\" type %s alias wave%d SHAREABLE wait",name, chrDevice, iWavePriv); 1092 1092 rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), hwndNotify, 0); … … 1100 1100 rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 1101 1101 return 0; 1102 } 1102 } 1103 1103 1104 1104 sprintf(chrCommand,"SETPOSITIONADVISE wave%d ON EVERY 1000 notify", iWavePriv); … … 1140 1140 return 0; 1141 1141 } 1142 /* Start pos timer. SET MCIPOSITIONADVICE fails when seeking in the wave. 1142 /* Start pos timer. SET MCIPOSITIONADVICE fails when seeking in the wave. 1143 1143 Don't know why. */ 1144 // WinStartTimer(WinQueryAnchorBlock(hwndFrame), WinWindowFromID(hwndTop, IDDLG_TOPMIDDLE), IDTIMER_PLAY, PLAYTIMER_DELAY); 1145 WinStartTimer(WinQueryAnchorBlock(hwndFrame), playControlDialogFromFrameHWND(hwndFrame), IDTIMER_PLAY, PLAYTIMER_DELAY); 1144 // WinStartTimer(WinQueryAnchorBlock(hwndFrame), WinWindowFromID(hwndTop, IDDLG_TOPMIDDLE), IDTIMER_PLAY, PLAYTIMER_DELAY); 1145 WinStartTimer(WinQueryAnchorBlock(hwndFrame), playControlDialogFromFrameHWND(hwndFrame), IDTIMER_PLAY, PLAYTIMER_DELAY); 1146 1146 1147 1147 /* Set emphasis by adding the object to the inuse list */ … … 1158 1158 /* Select the object */ 1159 1159 WinSendMsg(hwndContainer,CM_SETRECORDEMPHASIS, MPFROMP(mrc), 1160 MPFROM2SHORT(TRUE, CRA_SELECTED)); 1160 MPFROM2SHORT(TRUE, CRA_SELECTED)); 1161 1161 1162 1162 iWave=iWavePriv; … … 1187 1187 mfData->iNumPlayed=0; 1188 1188 } 1189 1189 1190 1190 sprintf(chrCommand,"stop wave%d wait", iWave); 1191 1191 rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 1192 1192 1193 1193 sprintf(chrCommand,"close wave%d wait", iWave); 1194 1194 rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0); 1195 1195 1196 1196 _resetDisplay(this); 1197 1197 //_resetDisplay(topControlFromFrameHWND(hwndFrame)); … … 1207 1207 myViewItem.bIsInUseList=FALSE; 1208 1208 }; 1209 1209 1210 1210 //HlpWriteToTrapLog("\n1 line %d.\n"); 1211 1211 1212 1212 /* Deselect the object */ 1213 1213 if(WinIsWindow(WinQueryAnchorBlock(hwndFrame), hwndContainer)) 1214 1214 WinSendMsg(hwndContainer,CM_SETRECORDEMPHASIS, MPFROMP(mrcPlaying), 1215 MPFROM2SHORT(FALSE, CRA_SELECTED)); 1216 1215 MPFROM2SHORT(FALSE, CRA_SELECTED)); 1216 1217 1217 iWave=0; 1218 1218 currentObject=NULLHANDLE; … … 1234 1234 #endif 1235 1235 WinSendMsg(hwndContainer,CM_SETRECORDEMPHASIS, MPFROMP(mrc), 1236 MPFROM2SHORT(FALSE, CRA_SELECTED)); 1236 MPFROM2SHORT(FALSE, CRA_SELECTED)); 1237 1237 } 1238 1238 #if 0 … … 1258 1258 ulPos=0; 1259 1259 WinSendMsg(hwndContainer,CM_SETRECORDEMPHASIS, MPFROMP(mrc), 1260 MPFROM2SHORT(FALSE, CRA_SELECTED)); 1260 MPFROM2SHORT(FALSE, CRA_SELECTED)); 1261 1261 1262 1262 }; … … 1273 1273 __FUNCTION__, __FILE__, __LINE__); 1274 1274 } END_CATCH; 1275 1275 1276 1276 return TRUE; 1277 1277 } … … 1323 1323 if((rc & 0x0000ffff)!=MCIERR_SUCCESS) { 1324 1324 /* Problem with MCI. Clean up. The Timer will be stopped in the method */ 1325 cwStopAudioFile(hwndFrame); 1325 cwStopAudioFile(hwndFrame); 1326 1326 } 1327 1327 else { 1328 1328 if(!stricmp(retMsg, "stopped")) { 1329 1329 /* Audio file played. Start next */ 1330 cwPlayAudioFile(hwndFrame, PLAY_NEXT); 1330 cwPlayAudioFile(hwndFrame, PLAY_NEXT); 1331 1331 } 1332 1332 showPlayTimeDisplay(this, TRUE);/* Ensure display is visible */ -
trunk/mediafolder/c/mediafldr/mediafolderoverridenwpclsmethods.cpp
r47 r133 1 1 /* 2 2 * This file is (C) Chris Wohlgemuth 1999-2003 3 * 3 * 4 4 * It's part of the Audio/Data-CD-Creator distribution 5 5 */ … … 132 132 133 133 hps=WinGetPS(HWND_DESKTOP); 134 134 135 135 /* The main BMP */ 136 136 allBMPs[MAIN_BMP_IDX].hbm=GpiLoadBitmap(hps, hResource, IDBMP_TOPMIDDLE, 0, 0); … … 352 352 if(DosQueryModuleHandle(pathname,&hmod)) { 353 353 pathname=((WPClassManager*)SOMClassMgrObject) //Query Pathname of class file 354 ->wpModuleForClass("CWAudioShadow"); 354 ->wpModuleForClass("CWAudioShadow"); 355 355 if(DosQueryModuleHandle(pathname,&hmod)) { 356 356 pathname=((WPClassManager*)SOMClassMgrObject) //Query Pathname of class file 357 ->wpModuleForClass("M_CWCDFolder"); 357 ->wpModuleForClass("M_CWCDFolder"); 358 358 if(DosQueryModuleHandle(pathname,&hmod)) { 359 359 pathname=((WPClassManager*)SOMClassMgrObject) //Query Pathname of class file 360 ->wpModuleForClass("CWCDFolder"); 360 ->wpModuleForClass("CWCDFolder"); 361 361 if(DosQueryModuleHandle(pathname,&hmod)) { 362 362 hmod=0; … … 378 378 if((found=strrchr(chrInstallDir,'\\'))!=NULLHANDLE) 379 379 *found=0; 380 380 381 381 /* Save the dir for config files. */ 382 382 //strcpy( chrConfigDir, chrInstallDir); … … 393 393 394 394 if(!hmod) { 395 char path[CCHMAXPATH]; 395 char path[CCHMAXPATH]; 396 396 char buf[CCHMAXPATH]; 397 397 char* found; 398 398 APIRET rc; 399 400 /* Get the language code of our system and load the 399 400 /* Get the language code of our system and load the 401 401 resource DLL with the right language */ 402 402 do { … … 404 404 PCSZ pszLang=chrLang; 405 405 char *chrPtr; 406 406 407 407 /* Get Language var */ 408 408 if(NO_ERROR!=DosScanEnv("LANG", &pszLang)) … … 419 419 while(*chrPtr==' ') 420 420 chrPtr++; 421 421 422 422 /* Check if value seems to be valid. The var must be something like xx_XX thus length is 5 */ 423 423 if(strlen(chrPtr)<5) 424 424 break; 425 425 426 426 if(DosQueryModuleName(queryModuleHandle("M_CWMediaFolder"),sizeof(path),path)!=NO_ERROR) 427 427 break; 428 428 429 429 found=strrchr(path,'\\'); 430 430 if(!found) 431 431 break; 432 432 *found=0; 433 434 /* Extract the first two chars */ 433 434 /* Extract the first two chars */ 435 435 sprintf(buf, RESDLLNAME, chrPtr[0], chrPtr[1]); 436 436 strcat(path,buf); … … 438 438 if(DosLoadModule(buf,sizeof(buf),path, &hmod)==NO_ERROR) 439 439 break; 440 440 441 441 /* NLS DLL not found. Try to load default */ 442 442 found=strrchr(path,'\\'); 443 443 if(!found) 444 444 break; 445 445 446 446 *found=0; 447 447 sprintf(buf, DEFRESDLLNAME); … … 534 534 ULONG ulInfoLen=0; 535 535 APIRET rc; 536 char path[CCHMAXPATH]; 536 char path[CCHMAXPATH]; 537 537 char* found; 538 538 char buf[CCHMAXPATH]; … … 574 574 /* We don't want an automatic template because we create it during 575 575 installation because we need one with an ID so we can create a shadow 576 without problems. So we return CLSSTYLE_DONTTEMPLATE. 576 without problems. So we return CLSSTYLE_DONTTEMPLATE. 577 577 Another way would be an override of wpclsCreateDefaultTemplate() 578 578 but this works, too, and we have to override this method anyway. We must … … 591 591 if(PrfQueryProfileInt(HINI_USERPROFILE, APPKEY_CWMM, MFLDR_NO_TEMPLATE_SHADOW, 0)) 592 592 return; 593 593 594 594 if(!WinQueryObject(ID_MEDIALDRTMPL_SHADOW)) 595 595 { … … 778 778 779 779 return rc; 780 #endif 781 782 } 783 784 785 786 787 788 789 790 791 792 780 #endif 781 782 } 783 784 785 786 787 788 789 790 791 792 -
trunk/mediafolder/c/mediafldr/mediafolderoverridenwpmethods.cpp
r4 r133 1 1 /* 2 2 * This file is (C) Chris Wohlgemuth 2002 3 * 3 * 4 4 * It's part of the Media-Folder distribution 5 5 */ … … 36 36 /* For calling the method in the CWAudio class. Linking to the DLL would require the 37 37 new audio classes. By dynamically querying the method the media folder works without 38 installing the audio classes. */ 38 installing the audio classes. */ 39 39 #include "cwmmquerytrackinfo.h" 40 40 … … 144 144 while(!(thisPtr->wpQueryFldrFlags() & FOI_POPULATEDWITHALL)) 145 145 DosSleep(300); 146 146 147 147 hwndContainer=WinWindowFromID(tPt->hwndFrame, FID_CLIENT); 148 148 WinSendMsg(hwndContainer,CM_QUERYCNRINFO, MPFROMP(&cnrInfo), 149 149 MPFROMLONG(sizeof(cnrInfo))); 150 150 151 151 /* Get class object of MMAudio. We need it so we can check if a file is an audio file. */ 152 152 if(somIsObj(cwAudioClass)) { … … 234 234 char time[200]; 235 235 ULONG ulSecs; 236 236 237 237 if(!methodPtr) 238 238 somhlpQueryCWAudioMethodPtr(this); 239 239 240 240 if(methodPtr){ 241 241 if((fsObject=(WPFileSystem*)cwGetFileSystemObject(Object))!=NULLHANDLE){/* Filesystem object or NULL */ … … 248 248 } 249 249 } 250 } 250 } 251 251 return CWProgFolder::wpDeleteFromContent(Object); 252 252 } … … 265 265 266 266 /* Reregister wpFolder window class on first opening */ 267 /* We need this private code to have some private 267 /* We need this private code to have some private 268 268 window words */ 269 269 if(!g_fRegisteredWindowClass) 270 270 { 271 271 CLASSINFO ci; 272 272 273 273 if(WinQueryClassInfo(WinQueryAnchorBlock(HWND_DESKTOP), 274 274 (PSZ)"wpFolder window", … … 299 299 return NULLHANDLE; 300 300 301 #if 0 301 #if 0 302 302 for(pViewItem=wpFindViewItem(VIEW_ANY, NULLHANDLE); pViewItem; pViewItem=wpFindViewItem(VIEW_ANY, pViewItem)) 303 303 iItemCount+=1; … … 318 318 } 319 319 320 /* Save this ptr */ 320 /* Save this ptr */ 321 321 WinSetWindowULong( hwnd, ulQWP_THISPTR, (ULONG)this); /* Moved from outside the if clause */ 322 322 … … 338 338 ulFlags|=FLAG_ALREADYSIZED; 339 339 } 340 340 341 341 /* Build new menu entries. */ 342 342 myFrameCtrlHWND=WinWindowFromID(hwnd,FID_MENU);//Get menu hwnd … … 388 388 iItemCount=(int)WinSendMsg(myFrameCtrlHWND,MM_QUERYITEMCOUNT,(MPARAM)0, 389 389 (MPARAM)0); 390 390 391 391 /* Fill the MENUITEM structure */ 392 392 mi.iPosition=iItemCount-1; 393 393 mi.afStyle=MIS_TEXT|MIS_SUBMENU; 394 394 mi.id=ID_MBMENUSKRIPTS; 395 mi.afAttribute=NULL; 395 mi.afAttribute=NULL; 396 396 mi.hwndSubMenu=hwndMenu; 397 397 mi.hItem=NULL; … … 400 400 getMessage(text, IDSTR_MENUSKRIPTS,sizeof(text), hResource, hwnd); 401 401 WinSendMsg(myFrameCtrlHWND,MM_INSERTITEM,MPFROMP(&mi), 402 (MPARAM)text); 402 (MPARAM)text); 403 403 }/* end of if(hwndMenu) */ 404 404 } … … 422 422 the procedure saves this pointer for later use. */ 423 423 myFrameCtrlHWND=WinLoadDlg(hwnd,hwnd,topCtrlDialogProc,hResource,IDDLG_TOPFRAME ,this); 424 /* Save the HWND in the Window words */ 424 /* Save the HWND in the Window words */ 425 425 WinSetWindowULong( hwnd, ulQWL_TOPCTRLHWND, myFrameCtrlHWND); 426 426 … … 431 431 is always the width of the folder. */ 432 432 sizel.cy=allBMPs[MAIN_BMP_IDX].bmpInfoHdr.cy; 433 /* Call a method of CWProgFolder to add the dialog as a framecontrol. 433 /* Call a method of CWProgFolder to add the dialog as a framecontrol. 434 434 FCTL_TOP means put it at the top of the folder. 435 435 After calling cwUpdateFrame(hwnd) it will be visible */ … … 442 442 the procedure saves this pointer for later use. */ 443 443 myFrameCtrlHWND=WinLoadDlg(hwnd,hwnd,leftCtrlDialogProc,hResource,IDDLG_LEFTFRAME ,this); 444 /* Save the HWND in the Window words */ 444 /* Save the HWND in the Window words */ 445 445 WinSetWindowULong( hwnd, ulQWL_LEFTCTRLHWND, myFrameCtrlHWND); 446 446 447 447 if(myFrameCtrlHWND){ 448 448 /* Query the size of the dialog */ … … 450 450 /* It's the right dialog so we need the width but not the height. */ 451 451 sizel.cx=allBMPs[CTRLIDX_TOPRIGHT].bmpInfoHdr.cx-1-7-2;//rectl.xRight-rectl.xLeft; 452 /* Call a method of CWProgFolder to add the dialog as a framecontrol. 452 /* Call a method of CWProgFolder to add the dialog as a framecontrol. 453 453 FCTL_RIGHT means put it at the RIGHT of the folder. 454 454 After calling cwUpdateFrame(hwnd) it will be visible */ … … 460 460 the procedure saves this pointer for later use. */ 461 461 myFrameCtrlHWND=WinLoadDlg(hwnd,hwnd,rightCtrlDialogProc,hResource,IDDLG_FRAMERIGHT ,this); 462 /* Save the HWND in the Window words */ 462 /* Save the HWND in the Window words */ 463 463 WinSetWindowULong( hwnd, ulQWL_RIGHTCTRLHWND, myFrameCtrlHWND); 464 464 465 465 if(myFrameCtrlHWND){ 466 466 CNRINFO cnrInfo; 467 HWND hwndContainer; 467 HWND hwndContainer; 468 468 PVIEWITEM pView; 469 469 … … 472 472 /* It's the right dialog so we need the width but not the height. */ 473 473 sizel.cx=allBMPs[CTRLIDX_TOPRIGHT].bmpInfoHdr.cx-1-7-2;// rectl.xRight-rectl.xLeft; 474 /* Call a method of CWProgFolder to add the dialog as a framecontrol. 474 /* Call a method of CWProgFolder to add the dialog as a framecontrol. 475 475 FCTL_RIGHT means put it at the RIGHT of the folder. 476 476 After calling cwUpdateFrame(hwnd) it will be visible */ 477 477 cwAddFrameCtl(hwnd, myFrameCtrlHWND, sizel, FCTL_RIGHT, FCTL_POSABOVE|FCTL_POSBELOW); 478 478 479 479 hwndContainer=WinWindowFromID(myFrameCtrlHWND, IDCNR_PLAYLIST); 480 480 WinSendMsg(hwndContainer,CM_QUERYCNRINFO, MPFROMP(&cnrInfo), … … 489 489 /* Save the HWND in the instance data */ 490 490 hwndBottom=myFrameCtrlHWND; 491 /* Save the HWND in the Window words */ 491 /* Save the HWND in the Window words */ 492 492 WinSetWindowULong( hwnd, ulQWL_BOTTOMCTRLHWND, myFrameCtrlHWND); 493 493 494 494 if(hwndBottom){ 495 495 /* Query the size of the dialog */ … … 498 498 sizel.cy=rectl.yTop-rectl.yBottom-2; 499 499 // sizel.cy=allBMPs[MAIN_BMP_IDX].bmpInfoHdr.cy; 500 /* Call a method of CWProgFolder to add the dialog as a framecontrol. 500 /* Call a method of CWProgFolder to add the dialog as a framecontrol. 501 501 FCTL_TOP means put it at the top of the folder. 502 502 After calling cwUpdateFrame(hwnd) it will be visible */ … … 526 526 SysWriteToTrapLog("\nTrap occured in %s, file: %s above line %d.\n", 527 527 __FUNCTION__, __FILE__, __LINE__); 528 528 529 529 } END_CATCH; 530 530 } … … 543 543 QMSG qmsg; 544 544 CWMediaFolder *thisPtr; 545 545 546 546 thisPtr=(CWMediaFolder*)arg; //Pointer auf CWMediaFolder-Object 547 547 hab=WinInitialize(0); … … 575 575 bufferSize=sizeof(buffer); 576 576 if(!wpScanSetupString(pSetupString, MEDIAFLDR_VOLUME, buffer,&bufferSize)) 577 { 577 { 578 578 ulVolume=70; 579 579 /* Set position of slider bar */ … … 593 593 if(!wpScanSetupString(pSetupString,"ICONVIEWPOS",buffer,&bufferSize)) 594 594 wpSetup( "ICONVIEWPOS=20,10,60,75");/* Fill in defaults */ 595 595 596 596 /* Set folder details- and sortclass to CWAudioShadow so track infos are shown */ 597 597 bufferSize=sizeof(buffer); 598 598 if(!wpScanSetupString(pSetupString,"DETAILSCLASS",buffer,&bufferSize)) 599 599 wpSetup("DETAILSCLASS=CWAudioShadow");/* Fill in defaults */ 600 600 601 601 bufferSize=sizeof(buffer); 602 602 if(!wpScanSetupString(pSetupString,"SORTCLASS",buffer,&bufferSize)) 603 603 wpSetup("SORTCLASS=CWAudioShadow");/* Fill in defaults */ 604 604 605 605 /* This works only on Warp 4 and above */ 606 606 bufferSize=sizeof(buffer); … … 608 608 /* This works only on Warp 4 and above */ 609 609 wpSetup("DETAILSTODISPLAY=0,1,4,12,13,14,15,16,17,18,19,20,21");/* Fill in defaults */ 610 610 611 611 /* This works only on Warp 4 and above */ 612 612 bufferSize=sizeof(buffer); … … 614 614 /* This works only on Warp 4 and above */ 615 615 wpSetup("SORTBYATTR=6,24,25,26,27,28,29,30,31,32,33");/* Fill in defaults */ 616 616 617 617 return rcParent; 618 618 } … … 621 621 { 622 622 PVIEWITEM pViewItem; 623 623 624 624 /* Check if we close a settings view or a folder view. */ 625 625 pViewItem=thisPtr->wpFindViewItem(VIEW_DETAILS|VIEW_CONTENTS, NULLHANDLE); … … 664 664 bufferSize=sizeof(buffer); 665 665 if(wpScanSetupString(pSetupString, MEDIAFLDR_STOP, buffer,&bufferSize)) 666 { 666 { 667 667 HWND hwndFrame=_findOpenMediaFldrViewHWND(this); 668 668 if(WinIsWindow(WinQueryAnchorBlock(HWND_DESKTOP), hwndFrame)) … … 671 671 bufferSize=sizeof(buffer); 672 672 if(wpScanSetupString(pSetupString, MEDIAFLDR_NEXT, buffer,&bufferSize)) 673 { 673 { 674 674 HWND hwndFrame=_findOpenMediaFldrViewHWND(this); 675 675 if(WinIsWindow(WinQueryAnchorBlock(HWND_DESKTOP), hwndFrame)) … … 678 678 bufferSize=sizeof(buffer); 679 679 if(wpScanSetupString(pSetupString, MEDIAFLDR_PREV, buffer,&bufferSize)) 680 { 680 { 681 681 HWND hwndFrame=_findOpenMediaFldrViewHWND(this); 682 682 if(WinIsWindow(WinQueryAnchorBlock(HWND_DESKTOP), hwndFrame)) … … 687 687 bufferSize=sizeof(buffer); 688 688 if(wpScanSetupString(pSetupString, MEDIAFLDR_VOLUME, buffer,&bufferSize)) 689 { 689 { 690 690 ulVolume=atol(buffer); 691 691 if(ulVolume<0) … … 699 699 bufferSize=sizeof(buffer); 700 700 if(wpScanSetupString(pSetupString, MEDIAFLDR_REPEAT, buffer,&bufferSize)) 701 { 701 { 702 702 switch(atol(buffer)) 703 703 { … … 779 779 ULONG CWMediaFolder::wpAddFolderView1Page(HWND hwndNotebook) 780 780 { 781 /* 781 /* 782 782 Removing this page also means removing the XWorkplace 783 783 view page. It would be possible to call the XWP method … … 836 836 } 837 837 /* 838 838 839 839 Climb up the list of parents to make sure we call the right 840 840 method if the parent was replaced. Otherwise we may skip a replacement class … … 848 848 1, 849 849 __ClassObject-> 850 somGetMethodToken(mySomId)) 851 )(this, hwndNotebook, ppageinfo); 850 somGetMethodToken(mySomId)) 851 )(this, hwndNotebook, ppageinfo); 852 852 SOMFree(mySomId); 853 853 return rc; 854 854 } 855 else 855 else 856 856 return CWProgFolder::wpInsertSettingsPage(hwndNotebook, ppageinfo); 857 857 } … … 886 886 ulPrivFlags&= ~MFLDR_VIEW_COMPACT; 887 887 return rcParent; 888 case ID_MENUVIEWCOMPACT: /* Compact view */ 888 case ID_MENUVIEWCOMPACT: /* Compact view */ 889 889 if(cwShrinkFolderToCompact(hwndFrame)) { 890 890 /* Mark that we are in compact view. May be removed later when 'Compact' … … 950 950 1, 951 951 __ClassObject-> 952 somGetMethodToken(mySomId)) 953 )(this, ulFlags, hwndCnr, fMultiSelect); 952 somGetMethodToken(mySomId)) 953 )(this, ulFlags, hwndCnr, fMultiSelect); 954 954 SOMFree(mySomId); 955 955 return rc & ~( CTXT_TREE | CTXT_ICON); 956 956 } 957 else 957 else 958 958 return CWProgFolder::wpFilterPopupMenu( ulFlags, hwndCnr, fMultiSelect) & ~( CTXT_TREE | CTXT_ICON); 959 959 } … … 970 970 1, 971 971 __ClassObject-> 972 somGetMethodToken(mySomId)) 973 )(this, ulView,pReserved); 972 somGetMethodToken(mySomId)) 973 )(this, ulView,pReserved); 974 974 SOMFree(mySomId); 975 975 } 976 else 976 else 977 977 rc=CWProgFolder::wpRefresh(ulView, pReserved); 978 978 … … 993 993 1, 994 994 __ClassObject-> 995 somGetMethodToken(mySomId)) 996 )(this,hwndNotebook); 995 somGetMethodToken(mySomId)) 996 )(this,hwndNotebook); 997 997 SOMFree(mySomId); 998 998 } 999 else 999 else 1000 1000 rc=CWProgFolder::wpAddSettingsPages(hwndNotebook); 1001 1001 1002 1002 if(!queryResModuleHandle()) { 1003 1003 errorResource(); … … 1011 1011 { 1012 1012 WPObject *wpObject; 1013 WPFileSystem *wpFSObject; 1014 ULONG ulNum; 1015 ULONG a; 1016 MRESULT mr; 1017 SOMClass *mmAudioClass=somhlpQueryMMAudioClass(); 1018 SOMClass *mmMIDIClass=somhlpGetSomClass("MMMIDI"); 1019 SOMClass *cwAudioClass=somhlpGetSomClass("CWAudioShadow"); 1020 1021 1022 mr=MRFROM2SHORT( DOR_DROP, DO_LINK); 1023 ulNum=DrgQueryDragitemCount(pDragInfo);/* Num items */ 1024 1025 if(pDragInfo->usOperation!=DO_DEFAULT && pDragInfo->usOperation!=DO_LINK) 1026 // return MRFROM2SHORT( DOR_NEVERDROP, DO_MOVE);/* It's not an audio object */ 1027 { 1028 /* Only CWAudioShadows may be copied or moved */ 1029 for(a=0;a<ulNum && SHORT1FROMMR(mr)!=DOR_NEVERDROP; a++) 1030 { 1031 /* Check every object dragged */ 1032 wpObject=(WPObject*)OBJECT_FROM_PREC(DrgQueryDragitemPtr( pDragInfo, a)->ulItemID); 1033 if(!wpObject->somIsA(cwAudioClass)) 1034 { 1035 return MRFROM2SHORT( DOR_NEVERDROP, DO_MOVE);/* It's not an audio object */ 1036 } 1037 } 1038 return MRFROM2SHORT( DOR_DROP, DO_MOVE);/* */ 1039 return MRFROM2SHORT( DOR_DROP, pDragInfo->usOperation);/* */ 1040 } 1041 1042 1043 for(a=0;a<ulNum && SHORT1FROMMR(mr)!=DOR_NEVERDROP; a++) 1044 { 1045 /* Check every object dragged */ 1046 wpObject=(WPObject*)OBJECT_FROM_PREC(DrgQueryDragitemPtr( pDragInfo, a)->ulItemID); 1047 /* Get the filesystem object in case it's a shadow */ 1048 wpFSObject=(WPFileSystem*)cwGetFileSystemObject(wpObject); 1049 if(!somIsObj(wpFSObject)) 1050 return MRFROM2SHORT( DOR_NEVERDROP, DO_MOVE);/* It's not an object */ 1051 if(!wpFSObject->somIsA(cwAudioClass) && !wpFSObject->somIsA(mmAudioClass) && !wpFSObject->somIsA(mmMIDIClass)) 1052 return MRFROM2SHORT( DOR_NEVERDROP, DO_MOVE);/* It's not an audio object */ 1053 } 1054 /* The following is necessary because for some reason hwndCnr and pDragInfo->hwndSource 1055 are equal when the dragged object resides in the same folder as the target and the target 1056 isn't opened yet. Without this check the dragged object would be moved not linked. */ 1057 if(this->wpQueryFolder()==wpObject->wpQueryFolder()) 1058 return MRFROM2SHORT(DOR_DROP,DO_LINK); 1059 /* Do not create shadows if the source is the current container */ 1060 if(hwndCnr==pDragInfo->hwndSource) 1061 return MRFROM2SHORT( DOR_DROP, DO_MOVE); 1062 1063 return mr; 1013 USHORT usIndicator=DOR_DROP,usOp=DO_LINK; 1014 SOMClass *mmAudioClass = somhlpGetSomClass("MMAudio"); 1015 SOMClass *cdTrackClass = somhlpGetSomClass("MMCDTrack"); 1016 1017 if (DrgAccessDraginfo(pDragInfo)) { 1018 ULONG ulNum=DrgQueryDragitemCount(pDragInfo);/* Num items */ 1019 ULONG a=0; 1020 1021 for(a=0;a<ulNum; a++) 1022 { 1023 PDRAGITEM pDragItem = DrgQueryDragitemPtr(pDragInfo,a); 1024 if (!DrgVerifyRMF(pDragItem,"DRM_OBJECT","DRF_OBJECT")) { 1025 usIndicator = DOR_NEVERDROP; 1026 usOp = 0; 1027 goto quit; 1028 } /* endif */ 1029 /* Check every object dragged */ 1030 wpObject=(WPObject*)OBJECT_FROM_PREC(pDragItem->ulItemID); 1031 if (!somIsObj(wpObject) || !wpObject->somIsA(mmAudioClass) || wpObject->somIsA(cdTrackClass)) { 1032 usIndicator = DOR_NEVERDROP; 1033 usOp = 0; 1034 goto quit; 1035 } /* endif */ 1036 #if 0 1037 if (somIsObj(wpObject) && this->wpQueryFolder() == wpObject->wpQueryFolder()) { 1038 usIndicator = DOR_DROP; 1039 usOp = DO_LINK; 1040 } /* endif */ 1041 #endif 1042 } 1043 /* Do not create shadows if the source is the current container */ 1044 if(hwndCnr==pDragInfo->hwndSource) { 1045 usIndicator = DOR_DROP; 1046 usOp = DO_MOVE; 1047 } 1048 1049 quit: 1050 DrgFreeDraginfo(pDragInfo); 1051 } /* endif */ 1052 1053 return MRFROM2SHORT(usIndicator,usOp); 1064 1054 } 1065 1055 … … 1078 1068 return; 1079 1069 thisPtr=(CWMediaFolder*)threadParams->thisPtr; //Pointer auf CWMediaFolder-Object 1080 1070 1081 1071 if(!somIsObj(thisPtr)) 1082 1072 return; 1083 1073 1084 1074 if(thisPtr->mfData) 1085 1075 thisPtr->mfData->bProcessing=TRUE; 1086 1076 1087 1077 hab=WinInitialize(0); 1088 1078 if(hab) { … … 1097 1087 /* Needed for specifying the drop point */ 1098 1088 POINTL ptl; 1099 PMINIRECORDCORE pmrc; 1089 PMINIRECORDCORE pmrc; 1100 1090 CNRINFO cnrInfo; 1101 1091 int ID; … … 1109 1099 hwndSource=threadParams->hwndSource; 1110 1100 ulNumObjects=threadParams->ulNumObjects; 1111 1101 1112 1102 if((mySomId=somIdFromString(SHADOW_CLASS_NAME))!=NULLHANDLE) { 1113 1103 WPFileSystem *wpFSObject; … … 1121 1111 ptl.x=threadParams->ptl.x; 1122 1112 ptl.y=threadParams->ptl.y; 1123 1113 1124 1114 /* Map to CNR */ 1125 1115 WinMapWindowPoints(HWND_DESKTOP, hwndCnr,&ptl, 1); 1126 ptl.y+=10; 1116 ptl.y+=10; 1127 1117 /* Window below the mouse ptr. We need it to check if we are over the column title area. */ 1128 1118 ID=WinQueryWindowUShort(WinWindowFromPoint(hwndCnr,&ptl, TRUE),QWS_ID); 1129 1119 ptl.y-=10; 1130 1120 1131 1121 /* Find the record near the drop point */ 1132 1122 qRecRcl.cb=sizeof(qRecRcl); … … 1138 1128 pmrc=(PMINIRECORDCORE)WinSendMsg(hwndCnr, CM_QUERYRECORDFROMRECT,MPFROMLONG(CMA_FIRST), 1139 1129 MPFROMP(&qRecRcl)); 1140 WinSendMsg(hwndCnr, CM_QUERYCNRINFO, MPFROMP(&cnrInfo), MPFROMSHORT(sizeof(cnrInfo))); 1130 WinSendMsg(hwndCnr, CM_QUERYCNRINFO, MPFROMP(&cnrInfo), MPFROMSHORT(sizeof(cnrInfo))); 1141 1131 }/*if(hwndSource!=hwndCnr)*/ 1142 1143 /* For all dropped objects */ 1132 1133 /* For all dropped objects */ 1144 1134 for(ulCount=0; ulCount<ulNumObjects; ulCount++) { 1145 1135 if(ulCount%10)/* Redraw window every 10 objects */ … … 1147 1137 else 1148 1138 WinEnableWindowUpdate(hwndCnr, TRUE); 1149 1139 1150 1140 wpObject=(WPObject*) threadParams->wpObject[ulCount]; 1151 1141 /* Get the filesystem object in case it's a shadow */ … … 1161 1151 /* Detailsview */ 1162 1152 RECORDINSERT recInsert; 1163 1153 1164 1154 recInsert.cb=sizeof(recInsert); 1165 1155 recInsert.pRecordParent=NULL; … … 1167 1157 recInsert.zOrder=CMA_TOP; 1168 1158 recInsert.cRecordsInsert=1; 1169 1159 1170 1160 // WinEnableWindowUpdate(hwndCnr, FALSE); 1171 1161 /* Create the shadow */ … … 1212 1202 __FUNCTION__, __FILE__, __LINE__); 1213 1203 } END_CATCH; 1214 1204 1215 1205 WinDestroyMsgQueue(hmq); 1216 1206 } … … 1219 1209 if(thisPtr->mfData) 1220 1210 thisPtr->mfData->bProcessing=FALSE; 1221 1211 1222 1212 thisPtr->wpFreeMem((PBYTE)threadParams); 1223 1213 } … … 1227 1217 MRESULT CWMediaFolder::wpDrop(HWND hwndCnr,PDRAGINFO pDragInfo,PDRAGITEM pDragItem) 1228 1218 { 1229 WPObject *wpObject; 1230 somId mySomId; 1231 M_WPObject *mAudioObject; 1232 SOMClass* scCWShadowClass; 1233 ULONG ulCount; 1234 ULONG ulNumObjects=DrgQueryDragitemCount(pDragInfo); 1235 1236 /* Needed for specifying the drop point */ 1237 POINTL ptl; 1238 PMINIRECORDCORE pmrc; 1239 CNRINFO cnrInfo; 1240 int ID; 1241 1242 /* The objects are already checked by the wpDragOver() method. */ 1243 TRY_LOUD(MEDIAFLDR_DROP) { 1244 PDROPTHREADPARAMS pThreadParams; 1245 ULONG ulErr; 1246 WPObject* wpObj; 1247 1248 /* DROPTHREADPARAMS already contains one WPObject var so only memory for ulNumObjects-1 must be added to the end */ 1249 pThreadParams=(PDROPTHREADPARAMS)wpAllocMem(sizeof(DROPTHREADPARAMS)+(ulNumObjects-1)*sizeof(WPObject*), &ulErr); 1250 pThreadParams->hwndCnr=hwndCnr; 1251 pThreadParams->hwndSource=pDragInfo->hwndSource; 1252 pThreadParams->ulNumObjects=DrgQueryDragitemCount(pDragInfo); 1253 pThreadParams->thisPtr=this; 1254 pThreadParams->ptl.x=pDragInfo->xDrop; 1255 pThreadParams->ptl.y=pDragInfo->yDrop; 1256 1257 /* For all dropped objects */ 1258 for(ulCount=0;ulCount<ulNumObjects ; ulCount++) { 1259 pThreadParams->wpObject[ulCount]=(WPObject*)OBJECT_FROM_PREC(DrgQueryDragitemPtr( pDragInfo, ulCount)->ulItemID); 1260 } 1261 _beginthread(dropThreadFunc,NULL,8192*16,(void*)pThreadParams); //Fehlerbehandlung fehlt 1219 if (DrgAccessDraginfo(pDragInfo)) { 1220 /* The objects are already checked by the wpDragOver() method. */ 1221 TRY_LOUD(MEDIAFLDR_DROP) { 1222 PDROPTHREADPARAMS pThreadParams; 1223 ULONG ulErr; 1224 ULONG ulCount; 1225 ULONG ulNumObjects=DrgQueryDragitemCount(pDragInfo); 1226 1227 /* DROPTHREADPARAMS already contains one WPObject var so only memory for ulNumObjects-1 must be added to the end */ 1228 pThreadParams=(PDROPTHREADPARAMS)wpAllocMem(sizeof(DROPTHREADPARAMS)+(ulNumObjects-1)*sizeof(WPObject*), &ulErr); 1229 pThreadParams->hwndCnr=hwndCnr; 1230 pThreadParams->hwndSource=pDragInfo->hwndSource; 1231 pThreadParams->ulNumObjects=ulNumObjects; 1232 pThreadParams->thisPtr=this; 1233 pThreadParams->ptl.x=pDragInfo->xDrop; 1234 pThreadParams->ptl.y=pDragInfo->yDrop; 1235 1236 /* For all dropped objects */ 1237 for(ulCount=0;ulCount<ulNumObjects ; ulCount++) { 1238 pThreadParams->wpObject[ulCount]=(WPObject*)OBJECT_FROM_PREC(DrgQueryDragitemPtr( pDragInfo, ulCount)->ulItemID); 1239 } 1240 _beginthread(dropThreadFunc,NULL,8192*16,(void*)pThreadParams); //Fehlerbehandlung fehlt 1241 } 1242 CATCH(MEDIAFLDR_DROP) 1243 { 1244 SysWriteToTrapLog("\nTrap occured in %s, file: %s, around line %d.\n", 1245 __FUNCTION__, __FILE__, __LINE__); 1246 } END_CATCH; 1247 DrgFreeDraginfo(pDragInfo); 1262 1248 } 1263 CATCH(MEDIAFLDR_DROP) 1264 { 1265 SysWriteToTrapLog("\nTrap occured in %s, file: %s, around line %d.\n", 1266 __FUNCTION__, __FILE__, __LINE__); 1267 } END_CATCH; 1268 1269 DrgFreeDraginfo(pDragInfo); 1270 return (MRESULT)RC_DROP_DROPCOMPLETE; 1249 return MRFROMLONG(RC_DROP_DROPCOMPLETE); 1271 1250 } 1272 1251 … … 1368 1347 /* Start a timer which will cause the folder to close automatically after some time even 1369 1348 if the user doesn't click any button. Get the timeout from the INI file if available. */ 1370 if((lDelay=PrfQueryProfileInt(HINI_USERPROFILE, "CWMM", MFLDR_TIMER_DELAY_KEY, MFLDR_MBOX_TIMER_DELAY)) 1349 if((lDelay=PrfQueryProfileInt(HINI_USERPROFILE, "CWMM", MFLDR_TIMER_DELAY_KEY, MFLDR_MBOX_TIMER_DELAY)) 1371 1350 < MFLDR_MBOX_MIN_TIMER_DELAY) 1372 1351 lDelay=MFLDR_MBOX_MIN_TIMER_DELAY; … … 1383 1362 } 1384 1363 } 1385 cwStopAudioFile(hwndFrame); 1364 cwStopAudioFile(hwndFrame); 1386 1365 /* Stop the playing thread */ 1387 1366 WinPostMsg(mfData->hwndPlayObject, WM_QUIT, 0, 0);
Note:
See TracChangeset
for help on using the changeset viewer.