Esempio n. 1
0
/**************************************************************************
 *
 *  Name       : InitMenu()
 *
 *  Description: Processes the WM_INITMENU message for the main window,
 *		 disabling any menus that are not active.
 *
 *  Concepts:	 Routine is called each time a menu is dropped.
 *
 *		 A switch statement branches control based upon
 *		 the id of the menu that is being displayed.
 *
 *  API's      :  [none]
 *
 *  Parameters :  mp1  = first message parameter
 *		  mp2  = second message parameter
 *************************************************************************/
VOID InitMenu(MPARAM mp1, MPARAM mp2)
{  /* define a shorthand way of denoting the menu handle */
   hwndMenu = HWNDFROMMP(mp2);

   switch(SHORT1FROMMP(mp1)) {

   case IDM_SOUND:
      MenuRedraw(bSound-7); break;

   case IDM_STYLE:
      MenuRedraw(bStyle-9); break;

   case IDM_LEVEL:
      MenuRedraw(-1);
      MenuRedraw(usLevel); break;

   case IDM_HELP:
      EnableMenuItem(hwndMenu, IDM_HELPUSINGHELP, fHelpEnabled);
      EnableMenuItem(hwndMenu, IDM_HELPGENERAL, fHelpEnabled);
      EnableMenuItem(hwndMenu, IDM_HELPKEYS, fHelpEnabled);
      EnableMenuItem(hwndMenu, IDM_HELPINDEX, fHelpEnabled); break;

    default: break; }

}   /* End of InitMenu	 */
Esempio n. 2
0
File: khserver.c Progetto: komh/kime
MRESULT khs_umFindWnd( HWND hwnd, MPARAM mp1, MPARAM mp2 )
{
    PKHSCD      pkhscd = WinQueryWindowPtr( hwnd, 0 );
    HWND        hwndInput = HWNDFROMMP( mp1 );

    return MRFROMLONG( hwndlistSearch( pkhscd->list, hwndInput ) != NULL );
}
Esempio n. 3
0
File: khserver.c Progetto: komh/kime
MRESULT khs_umIsExceptWindow( HWND hwnd, MPARAM mp1, MPARAM mp2 )
{
    PKHSCD      pkhscd = WinQueryWindowPtr( hwnd, 0 );
    HWND        hwndTarget = HWNDFROMMP( mp1 );
    PID         pid;
    PCHAR       modulePath;
    PCHAR       moduleName;
    ULONG       maxPathLen;
    APIRET      rc;
    BOOL        result;

    WinQueryWindowProcess( hwndTarget, &pid, NULL );

#ifdef DEBUG
    fprintf( pkhscd->fp, "PID = %x\n", pid );
#endif

    memset( pkhscd->pQTopLevel, 0, DOSQSS_BUFSIZE );

    rc = DosQuerySysState( 0x01, 0, pid, 1, pkhscd->pQTopLevel, DOSQSS_BUFSIZE );
    if( rc != 0 )
        return FALSE;

    DosQuerySysInfo( QSV_MAX_PATH_LENGTH, QSV_MAX_PATH_LENGTH, &maxPathLen, sizeof( ULONG ));

    modulePath = malloc( maxPathLen );
    DosQueryModuleName( pkhscd->pQTopLevel->procdata->hndmod, maxPathLen, modulePath );

#ifdef DEBUG
    fprintf( pkhscd->fp, "Module path = %s\n", modulePath );
#endif

    moduleName = strrchr( modulePath, '\\' );
    if( moduleName == NULL )
        moduleName = modulePath;
    else
        moduleName++;

#ifdef DEBUG
    fprintf( pkhscd->fp, "Module name = %s\n", moduleName );
#endif

    result = exceptFindName( pkhscd->exceptListBuf, moduleName );

    free( modulePath );

#ifdef DEBUG
    fprintf( pkhscd->fp, "exceptFindName() = %ld\n", result );

    fflush( pkhscd->fp );
#endif

    return MRFROMLONG( result );
}
Esempio n. 4
0
BOOL APIENTRY WprogressBar(HWND hParent, HWND hOwner, PPROGRESSDLG ppd) {
   QMSG  qmsg;
   HWND hwnd;
   PPRGSAPPDATA pad;
   BOOL rc = FALSE;
   
   // allocate storage for application data
   if (!(pad = (PPRGSAPPDATA)malloc(sizeof(PRGSAPPDATA)))) return FALSE;
   memset(pad, 0, sizeof(PRGSAPPDATA));
   pad->ppd = ppd;
   // ottiene tempo di inizio
   pad->start = WinGetCurrentTime(pad->hab = WinQueryAnchorBlock(hOwner))
                / 1000;
   // window handles
   if (ppd->fl & PRGSS_BITMAP) {
      SIZEL szl;
      WqueryBitmapSize(pad->ppd->hbmp, &szl);
      pad->cxbmp = szl.cx;
   } /* endif */
   if (NULLHANDLE != (hwnd = WinLoadDlg(hParent, hOwner, ProgressDlgProc,
                                     hmod, DLG_PROGRESS, pad))) {
      if (!ppd->pszPrgrss) ppd->pszPrgrss = SZ_PROGRESS;
      if (!ppd->pszTime) ppd->pszTime = SZ_ELAPSTIME;
      if (ppd->pszStop) WinSetDlgItemText(hwnd, BTN_STOP, ppd->pszStop);
      pad->hOwner = WinQueryWindow(hwnd, QW_OWNER);
      WinEnableWindow(pad->hOwner, FALSE);
      for(;;) {
         if (WinGetMsg(pad->hab, &qmsg, NULLHANDLE, 0, 0)) {    // loop standard
            if (qmsg.msg == PRGSM_END && qmsg.hwnd == hwnd) {
               if (pad->qQuit.msg)
                  WinPostMsg(pad->qQuit.hwnd, pad->qQuit.msg,
                             pad->qQuit.mp1, pad->qQuit.mp2);
               break;
            } // end if   
            WinDispatchMsg(pad->hab, &qmsg);
         } else {                   // WM_QUIT
            pad->qQuit = qmsg;
            if(qmsg.hwnd == NULLHANDLE)                       // SHUTDOWN
               WinPostMsg(hwnd, WM_CLOSE, MPFROMLONG(TRUE), NULL);
            else if(qmsg.hwnd == HWNDFROMMP(qmsg.mp2))        // TASKLIST
               WinPostMsg(hwnd, WM_CLOSE, 0L, 0L);
            else                            // chiusura regolare: termina
               break;
         } // end if
      } // end forever
      WinSetFocus(HWND_DESKTOP, hOwner);
      WinDestroyWindow(hwnd);
      WinEnableWindow(pad->hOwner, TRUE);
      rc = TRUE;
   } // end if
   free(pad);
   return rc;
}
Esempio n. 5
0
File: khserver.c Progetto: komh/kime
MRESULT khs_umDelWnd( HWND hwnd, MPARAM mp1, MPARAM mp2 )
{
    PKHSCD  pkhscd = WinQueryWindowPtr( hwnd, 0 );
    HWND    hwndInput = HWNDFROMMP( mp1 );

    if(( BOOL ) WinSendMsg( hwnd, KHSM_FINDWND, MPFROMHWND( hwndInput ), 0 ))
    {
        PHWNDLIST list;

        list = hwndlistSearch( pkhscd->list, hwndInput );
        hwndlistDelete( list );
    }

    return 0;
}
Esempio n. 6
0
File: khserver.c Progetto: komh/kime
MRESULT khs_umChangeImStatus( HWND hwnd, MPARAM mp1, MPARAM mp2 )
{
    PKHSCD  pkhscd = WinQueryWindowPtr( hwnd, 0 );
    HWND    hwndInput = HWNDFROMMP( mp1 );

    if(( BOOL )WinSendMsg( hwnd, KHSM_FINDWND, MPFROMHWND( hwndInput ), 0 ))
    {
        PHWNDLIST list;

        list = hwndlistSearch( pkhscd->list, hwndInput );
        list->line = !list->line;
    }

    return 0;
}
Esempio n. 7
0
File: khserver.c Progetto: komh/kime
MRESULT khs_umCheckDBCSSupport( HWND hwnd, MPARAM mp1, MPARAM mp2 )
{
    PKHSCD      pkhscd = WinQueryWindowPtr( hwnd, 0 );
    HWND        hwndTarget = HWNDFROMMP( mp1 );
    PID         pid;
    USHORT      qcp;


    WinQueryWindowProcess( hwndTarget, &pid, NULL );
    DosGiveSharedMem( pkhscd->pCursorPos, pid, PAG_READ | PAG_WRITE );

    qcp = SHORT1FROMMR( WinSendMsg( hwndTarget, WM_QUERYCONVERTPOS,
                                   MPFROMP( pkhscd->pCursorPos ), 0 ));

    return MRFROMLONG( qcp == QCP_CONVERT );
}
Esempio n. 8
0
/*---------------------------------------------------------------------------
                                MateWndProc
---------------------------------------------------------------------------*/
MRESULT EXPENTRY MateWndProc( HWND wnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
{
 WNDATTR *wndattr;

   switch (msg) {
     case WM_FOCUSCHANGE:
        if (SHORT1FROMMP( mp2 ) == FALSE) {
           wndattr = (WNDATTR*)WinQueryWindowPtr( wnd, QWL_USER );
           MateScrollWnd = HWNDFROMMP( mp1 );
           WinSubclassWindow( wndattr->Client, OldWndProc );
        }
        break;
     default:
        break;
   }

  return OldWndProc( wnd, msg, mp1, mp2 );
}
Esempio n. 9
0
File: khserver.c Progetto: komh/kime
MRESULT khs_umAddWnd( HWND hwnd, MPARAM mp1, MPARAM mp2 )
{
    PKHSCD  pkhscd = WinQueryWindowPtr( hwnd, 0 );
    HWND    hwndInput = HWNDFROMMP( mp1 );

    if(!( BOOL ) WinSendMsg( hwnd, KHSM_FINDWND, MPFROMHWND( hwndInput ), 0 ))
    {
        PHWNDLIST list = hwndlistCreate();

        if( list != NULL )
        {
            list->hwnd = hwndInput;
            hwndlistInsert( pkhscd->list, list );
        }
    }

    return 0;
}
Esempio n. 10
0
File: kimehook.c Progetto: komh/kime
VOID kimeSendMsgHook( PSMHSTRUCT psmh )
{
    if( psmh->msg == WM_SETFOCUS )
    {
        HWND hwnd = HWNDFROMMP( psmh->mp1 );
        BOOL focus = SHORT1FROMMP( psmh->mp2 );

        if( focus )
        {
            if( !isHCHLB( hwnd ))
            {
                WinSendMsg( hwndHIA, queryRunningHCHLB() ? HIAM_DESTROYHCHLB : HIAM_COMPLETEHCH, 0, 0 );
#ifdef FOCUS_ON
                if( hwndCurrentInput != psmh->hwnd )
                {
                    inputFocusChanged = TRUE;
                    hwndCurrentInput = psmh->hwnd;
                    initKimeStatus( hwndCurrentInput, FALSE );
                }
#endif
            }
        }
    }
}
Esempio n. 11
0
extern MRESULT APIENTRY Dde_Processor ( HWND Server, ULONG Msg, MPARAM mp1, MPARAM mp2 ) {

   switch ( Msg ) {

      case WM_CREATE: {
         DDESERVER_PARMS *Parms = (DDESERVER_PARMS*) mp1 ;
         WinSetWindowPtr ( Server, QWL_USER, Parms ) ;
         return ( 0 ) ; }

      case WM_DESTROY: {
         DDESERVER_PARMS *Parms = (DDESERVER_PARMS*) WinQueryWindowPtr ( Server, QWL_USER ) ;
         Parms->Topic->Terminate ( Server, Parms->Client, FALSE ) ;
         return ( 0 ) ; }

      case WM_DDE_REQUEST: {
         DDESERVER_PARMS *Parms = (DDESERVER_PARMS*) WinQueryWindowPtr ( Server, QWL_USER ) ;
         HWND Client = HWNDFROMMP ( mp1 ) ;
         PDDESTRUCT Request = PDDESTRUCT ( mp2 ) ;
         PCHAR Item = PCHAR ( DDES_PSZITEMNAME ( Request ) ) ;
         Parms->Topic->Request ( Server, Client, Item ) ;
         DosFreeMem ( Request ) ;
         return ( 0 ) ; }

      case WM_DDE_POKE: {
         DDESERVER_PARMS *Parms = (DDESERVER_PARMS*) WinQueryWindowPtr ( Server, QWL_USER ) ;
         HWND Client = HWNDFROMMP ( mp1 ) ;
         PDDESTRUCT Request = PDDESTRUCT ( mp2 ) ;
         PCHAR Item = PCHAR ( DDES_PSZITEMNAME ( Request ) ) ;
         int Format = int ( Request->usFormat ) ;
         PVOID Data = PVOID ( DDES_PABDATA ( Request ) ) ;
         int Size = int ( Request->cbData ) ;
         Parms->Topic->Poke ( Server, Client, Item, Format, Data, Size ) ;
         DosFreeMem ( Request ) ;
         return ( 0 ) ; }

      case WM_DDE_ADVISE: {
         DDESERVER_PARMS *Parms = (DDESERVER_PARMS*) WinQueryWindowPtr ( Server, QWL_USER ) ;
         HWND Client = HWNDFROMMP ( mp1 ) ;
         PDDESTRUCT Request = PDDESTRUCT ( mp2 ) ;
         PCHAR Item = PCHAR ( DDES_PSZITEMNAME ( Request ) ) ;
         Parms->Topic->Advise ( Server, Client, Item, ! ( Request->fsStatus & DDE_FNODATA ) ) ;
         DosFreeMem ( Request ) ;
         return ( 0 ) ; }

      case WM_DDE_UNADVISE: {
         DDESERVER_PARMS *Parms = (DDESERVER_PARMS*) WinQueryWindowPtr ( Server, QWL_USER ) ;
         HWND Client = HWNDFROMMP ( mp1 ) ;
         PDDESTRUCT Request = PDDESTRUCT ( mp2 ) ;
         PCHAR Item = PCHAR ( DDES_PSZITEMNAME ( Request ) ) ;
         Parms->Topic->Unadvise ( Server, Client, Item ) ;
         DosFreeMem ( Request ) ;
         return ( 0 ) ; }

      case WM_DDE_EXECUTE: {
         DDESERVER_PARMS *Parms = (DDESERVER_PARMS*) WinQueryWindowPtr ( Server, QWL_USER ) ;
         HWND Client = HWNDFROMMP ( mp1 ) ;
         PDDESTRUCT Request = PDDESTRUCT ( mp2 ) ;
         PCHAR Item = PCHAR ( DDES_PSZITEMNAME ( Request ) ) ;
         int Format = int ( Request->usFormat ) ;
         PVOID Data = PVOID ( DDES_PABDATA ( Request ) ) ;
         int Size = int ( Request->cbData ) ;
         Parms->Topic->Execute ( Server, Client, Item, Format, Data, Size ) ;
         DosFreeMem ( Request ) ;
         return ( 0 ) ; }

      case WM_DDE_TERMINATE: {
         DDESERVER_PARMS *Parms = (DDESERVER_PARMS*) WinQueryWindowPtr ( Server, QWL_USER ) ;
         Parms->Topic->Terminate ( Server, Parms->Client, TRUE ) ;
         return ( 0 ) ; }

   } /* endswitch */

   return ( WinDefWindowProc ( Server, Msg, mp1, mp2 ) ) ;
}
Esempio n. 12
0
MRESULT EXPENTRY wpCD(HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2)
{
	switch (msg)
	{
		case WM_INITDLG:
		{
			ULONG rc, i;
			HFILE CDDevice;
			ULONG action;
			ULONG len;
			struct
			{
				USHORT CountCD;
				USHORT FirstCD;
			} CDInfo;
			FIELDINFO *firstFieldInfo, *posFieldInfo, *splitFieldInfo;
			FIELDINFOINSERT fieldInfoInsert;
			CNRINFO cnrInfo;
			cnrInfo.cb = sizeof(cnrInfo);

			firstFieldInfo = posFieldInfo = allocaFieldInfo(hwnd, CT_TRACK, NUM_FIELDS);
			posFieldInfo->flData = CFA_BITMAPORICON | CFA_HORZSEPARATOR | CFA_SEPARATOR;
			posFieldInfo->flTitle = CFA_CENTER;
			posFieldInfo->pTitleData = "Icon";
			posFieldInfo->offStruct = FIELDOFFSET(RECORDCORE,hptrIcon);
			fieldInfo[0] = posFieldInfo;

			posFieldInfo = posFieldInfo->pNextFieldInfo;
			posFieldInfo->flData = CFA_STRING | CFA_HORZSEPARATOR | CFA_SEPARATOR;
			posFieldInfo->flTitle = CFA_CENTER;
			posFieldInfo->pTitleData = "Filename";
			posFieldInfo->offStruct = FIELDOFFSET(RECORDCORE,pszIcon);
			fieldInfo[1] = posFieldInfo;

			cnrInfo.pFieldInfoLast = posFieldInfo;

			posFieldInfo = posFieldInfo->pNextFieldInfo;
			posFieldInfo->flData = CFA_ULONG | CFA_HORZSEPARATOR | CFA_SEPARATOR;
			posFieldInfo->flTitle = CFA_CENTER;
			posFieldInfo->pTitleData = "Track #";
			posFieldInfo->offStruct = FIELDOFFSET(CDTRACKRECORD,track);
			fieldInfo[2] = posFieldInfo;

			posFieldInfo = posFieldInfo->pNextFieldInfo;
			posFieldInfo->flData = CFA_STRING | CFA_HORZSEPARATOR | CFA_SEPARATOR | CFA_FIREADONLY;
			posFieldInfo->flTitle = CFA_CENTER;
			posFieldInfo->pTitleData = "Type";
			posFieldInfo->offStruct = FIELDOFFSET(CDTRACKRECORD,typepointer);
			fieldInfo[3] = posFieldInfo;

			posFieldInfo = posFieldInfo->pNextFieldInfo;
			posFieldInfo->flData = CFA_STRING | CFA_HORZSEPARATOR | CFA_SEPARATOR | CFA_FIREADONLY;
			posFieldInfo->flTitle = CFA_CENTER;
			posFieldInfo->pTitleData = "Time";
			posFieldInfo->offStruct = FIELDOFFSET(CDTRACKRECORD,timepointer);
			fieldInfo[4] = posFieldInfo;

			posFieldInfo = posFieldInfo->pNextFieldInfo;
			posFieldInfo->flData = CFA_ULONG | CFA_HORZSEPARATOR | CFA_SEPARATOR;
			posFieldInfo->flTitle = CFA_CENTER;
			posFieldInfo->pTitleData = "Size";
			posFieldInfo->offStruct = FIELDOFFSET(CDTRACKRECORD,size);
			fieldInfo[5] = posFieldInfo;

			posFieldInfo = posFieldInfo->pNextFieldInfo;
			posFieldInfo->flData = CFA_ULONG | CFA_HORZSEPARATOR | CFA_SEPARATOR;
			posFieldInfo->flTitle = CFA_CENTER;
			posFieldInfo->pTitleData = "MP3 Size";
			posFieldInfo->offStruct = FIELDOFFSET(CDTRACKRECORD,mp3size);
			fieldInfo[6] = posFieldInfo;

			posFieldInfo = posFieldInfo->pNextFieldInfo;
			posFieldInfo->flData = CFA_STRING | CFA_HORZSEPARATOR | CFA_SEPARATOR;
			posFieldInfo->flTitle = CFA_CENTER;
			posFieldInfo->pTitleData = "Title";
			posFieldInfo->offStruct = FIELDOFFSET(CDTRACKRECORD,titleptr);
			fieldInfo[7] = posFieldInfo;

			posFieldInfo = posFieldInfo->pNextFieldInfo;
			posFieldInfo->flData = CFA_STRING | CFA_HORZSEPARATOR | CFA_SEPARATOR;
			posFieldInfo->flTitle = CFA_CENTER;
			posFieldInfo->pTitleData = "Artist";
			posFieldInfo->offStruct = FIELDOFFSET(CDTRACKRECORD,artistptr);
			fieldInfo[8] = posFieldInfo;

			posFieldInfo = posFieldInfo->pNextFieldInfo;
			posFieldInfo->flData = CFA_STRING | CFA_HORZSEPARATOR | CFA_SEPARATOR;
			posFieldInfo->flTitle = CFA_CENTER;
			posFieldInfo->pTitleData = "Album";
			posFieldInfo->offStruct = FIELDOFFSET(CDTRACKRECORD,albumptr);
			fieldInfo[9] = posFieldInfo;

			posFieldInfo = posFieldInfo->pNextFieldInfo;
			posFieldInfo->flData = CFA_STRING | CFA_HORZSEPARATOR | CFA_SEPARATOR;
			posFieldInfo->flTitle = CFA_CENTER;
			posFieldInfo->pTitleData = "Year";
			posFieldInfo->offStruct = FIELDOFFSET(CDTRACKRECORD,yearptr);
			fieldInfo[10] = posFieldInfo;

			posFieldInfo = posFieldInfo->pNextFieldInfo;
			posFieldInfo->flData = CFA_STRING | CFA_HORZSEPARATOR | CFA_SEPARATOR;
			posFieldInfo->flTitle = CFA_CENTER;
			posFieldInfo->pTitleData = "Genre";
			posFieldInfo->offStruct = FIELDOFFSET(CDTRACKRECORD,genreptr);
			fieldInfo[11] = posFieldInfo;

			posFieldInfo = posFieldInfo->pNextFieldInfo;
			posFieldInfo->flData = CFA_STRING | CFA_HORZSEPARATOR | CFA_SEPARATOR;
			posFieldInfo->flTitle = CFA_CENTER;
			posFieldInfo->pTitleData = "Comment";
			posFieldInfo->offStruct = FIELDOFFSET(CDTRACKRECORD,commentptr);
			fieldInfo[12] = posFieldInfo;

			fieldInfoInsert.cb = sizeof(fieldInfoInsert);
			fieldInfoInsert.pFieldInfoOrder = (FIELDINFO *) CMA_FIRST;
			fieldInfoInsert.fInvalidateFieldInfo = TRUE;
			fieldInfoInsert.cFieldInfoInsert = NUM_FIELDS;

			insertFieldInfo(hwnd, CT_TRACK, firstFieldInfo, &fieldInfoInsert);

			cnrInfo.xVertSplitbar = 100;
			cnrInfo.flWindowAttr = CV_DETAIL | CA_DETAILSVIEWTITLES;
			WinSendDlgItemMsg(hwnd,CT_TRACK,CM_SETCNRINFO, MPFROMP(&cnrInfo),
				MPFROMLONG(CMA_PFIELDINFOLAST | CMA_XVERTSPLITBAR | CMA_FLWINDOWATTR));


			loadConfig(CFGFILE, &grabbers, &countGrabbers);
			for(i = 0; i < countGrabbers; i++)
				insertItemText(hwnd,CB_GRABBER,LIT_END,grabbers[i].id);
			selectItem(hwnd,CB_GRABBER,0);

			setText(hwnd, EF_TITLE, "Title");

			/* wohw, this is too powerful, need cooling */

			len = sizeof(CDInfo);
			if(!DosOpen("\\DEV\\CD-ROM2$", &CDDevice, &action, 0,
							FILE_NORMAL, OPEN_ACTION_OPEN_IF_EXISTS,
							OPEN_SHARE_DENYNONE | OPEN_ACCESS_READONLY, NULL))
			{
				if(!DosDevIOCtl(CDDevice, 0x82, 0x60, NULL, 0, NULL, &CDInfo, len, &len))
				{
					for(i = 0; i < CDInfo.CountCD; i++)
					{
						char driveLetter[3] = { (char) ('A' + CDInfo.FirstCD + i), ':', 0};
						insertItemText(hwnd,CB_DRIVE,LIT_END,driveLetter);
					}
				}
				DosClose(CDDevice);
			}

			selectItem(hwnd,CB_DRIVE,0);

			wpCT = WinSubclassWindow(WinWindowFromID(hwnd,CT_TRACK),wpCTTrack);

			dataIco = WinLoadPointer(HWND_DESKTOP, NULLHANDLE, ICO_DATA);
			trackIco = WinLoadPointer(HWND_DESKTOP, NULLHANDLE, ICO_TRACK);
			loadIni(hwnd);
			return 0;
		}
		case WM_COMMAND:
			return processCommand(hwnd,mp1,mp2);
		case WM_CONTROL:
			return processControl(hwnd,mp1,mp2);
		case WM_ADJUSTFRAMEPOS:
		{
			SWP *pos = (SWP*) PVOIDFROMMP(mp1);
			static int bitRateCheck = 0;
			if(pos->fl & SWP_SIZE)
			{
				SWP ctpos;
				WinQueryWindowPos(WinWindowFromID(hwnd, CT_TRACK), &ctpos);
				WinSetWindowPos  (WinWindowFromID(hwnd, CT_TRACK), 0, 0, ctpos.y,
									  pos->cx, pos->cy - ctpos.y,
									  SWP_SIZE | SWP_SHOW | SWP_MOVE);
			}

			if((pos->fl & SWP_SHOW) && bitRateChanged != bitRateCheck)
			{
				bitRateCheck = bitRateChanged;
				refreshFieldInfo(hwnd, CT_TRACK);
			}
			break;
		}

		case WM_MENUEND:
			removeSourceEmphasis(HWNDFROMMP(mp2),&sourceEmphasisInfo);
			return 0;

		case WM_CLOSE:
		{
			WinDestroyPointer(dataIco);
			WinDestroyPointer(trackIco);
			free(grabbers);
			saveIni(hwnd);

			/* delete all current records */
			CDTRACKRECORD *record = (CDTRACKRECORD *) enumRecords(hwnd, CT_TRACK, NULL, CMA_FIRST);
			while(record && record != (CDTRACKRECORD *) -1)
			{
				free(record->record.pszIcon);
				record = (CDTRACKRECORD *) enumRecords(hwnd, CT_TRACK, (RECORDCORE *) record, CMA_NEXT);
			}

			removeRecords(hwnd, CT_TRACK, NULL, 0);

			removeFieldInfo(hwnd,CT_TRACK, NULL, 0);
			return 0;
		}

		case WM_CHAR:
			if(SHORT2FROMMP(mp2) == VK_ESC)
				return 0;
			else
				break;

		/* back from worker thread */
		case DLGCD_REFRESH:
			dlgcd_refresh2(mp1,mp2);
			return 0;

      case CDDB_FUZZYMATCH:
		{
			CDDBQUERY_DATA *matches = (CDDBQUERY_DATA *) mp1,
								*chosen	= (CDDBQUERY_DATA *) mp2;
         FUZZYMATCHCREATEPARAMS data = {matches,chosen};

			WinDlgBox(HWND_DESKTOP, hwnd, wpMatch, NULLHANDLE, DLG_MATCH, &data);
              
			return 0;
		}

	}

	return WinDefDlgProc( hwnd, msg, mp1, mp2 );
}
MRESULT EXPENTRY cdTypeOptionDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
{
  CWDataFolder* thisPtr;
  ULONG ulFlags;
  LONG lSpinValue;
  static HWND hwndStatus;
  int a;
  char chrCD[4];
  char text[CCHMAXPATH];
  char title[CCHMAXPATH];
  char text2[40];

  ULONG rc;
  THISPTR thisPtrStruct;

  switch(msg)
    {
    case WM_INITDLG :	
      WinSetWindowULong(hwnd, QWL_USER,(ULONG)PVOIDFROMMP(mp2));//Save object ptr.

      thisPtr=(CWDataFolder*)PVOIDFROMMP(mp2);
      if(somIsObj(thisPtr)) {
        ulFlags=((CWDataFolder*)PVOIDFROMMP(mp2))->cwQueryCDTypeFlags();
        // enableCDTypeCntrls(hwnd,(CWDataFolder*)PVOIDFROMMP(mp2));
        enableCDTypeCntrls(hwnd,ulFlags);

        /*        if(ulFlags&IDCDT_FIXDISK) 
          WinCheckButton(hwnd,IDCB_FIXDISK,1);*/

        getMessage(title,IDSTRD_BOOTIMAGE,sizeof(title), hDataResource,hwnd);
        getMessage(text2,IDSTRD_BOOTIMAGENAME,sizeof(text2), hDataResource,hwnd);
        sprintf(text,title,text2);
        WinSetWindowText( WinWindowFromID(hwnd,IDST_BOOTIMAGE), text );
        getMessage(title,IDSTRD_BOOTCATALOG,sizeof(title), hDataResource,hwnd);
        getMessage(text2,IDSTRD_BOOTCATALOGNAME,sizeof(text2), hDataResource,hwnd);
        sprintf(text,title,text2);
        WinSetWindowText( WinWindowFromID(hwnd,IDST_BOOTCATALOG), text );
      }

      /* Move default buttons on Warp 4 */
      cwMoveNotebookButtonsWarp4(hwnd, IDPB_CDTYPEHELP, 20);
      return (MRESULT) TRUE;
      /* This prevents switching the notebook page behind the open folder */
    case WM_WINDOWPOSCHANGED:
      {
        MRESULT mr;

        if(WinQueryFocus(HWND_DESKTOP)!=
           WinQueryWindow(WinQueryWindow(hwnd, QW_PARENT), QW_PARENT)) {
          mp2=MPFROMLONG(LONGFROMMP(mp2)|0x80000);/*AWP_ACTIVATE 0x00080000L*/
          mr=WinDefDlgProc(hwnd, msg, mp1, mp2);
          return mr;  
        }
        break;
      }
    case WM_FOCUSCHANGE:
      {
        if(!SHORT1FROMMP(mp2)) {
          if(HWNDFROMMP(mp1)==hwnd) {
            MRESULT mr;

            mr=WinDefDlgProc(hwnd, msg, mp1, mp2);
            WinSendMsg(WinQueryWindow(WinQueryWindow(hwnd, QW_PARENT), QW_PARENT), WM_SETFOCUS, MPFROMHWND(hwnd), (MPARAM)TRUE);
            return mr;
          }
        }
        break;
      }
#if 0
    case WM_WINDOWPOSCHANGED:
      {
        /* This prevents switching the notebook page behind the open folder */
        if(!(WinQueryWindowUShort(WinQueryWindow(hwnd, QW_PARENT), QWS_FLAGS) & FF_ACTIVE))
          mp2=MPFROMLONG(0x80000);
        break;
      }
#endif
    case WM_DESTROY:
      /* The notebook closes and gets destroyed */
      /* Set focus to desktop to prevent PM freeze */
      WinSetFocus(HWND_DESKTOP, HWND_DESKTOP);

      /* Let the WPS save the new instance data */
      //      thisPtr=(CWDataFolder*) WinQueryWindowULong(WinWindowFromID(hwnd,IDPB_CDTYPEUNDO),QWL_USER);
      thisPtr=(CWDataFolder*) WinQueryWindowULong(hwnd, QWL_USER);
      if(somIsObj(thisPtr)) {
        ulFlags=0;
        if(WinQueryButtonCheckstate(hwnd,IDRB_MULTISESSION)&1) {
          ulFlags|=IDCDT_MULTISESSION;
        }
        if(WinQueryButtonCheckstate(hwnd,IDRB_USERDEFINED)&1)
          ulFlags|=IDCDT_USERDEFINED;

        if(WinQueryButtonCheckstate(hwnd,IDRB_BOOTCD)&1)
          ulFlags|=IDCDT_BOOTCD;
        
        if(WinQueryButtonCheckstate(hwnd,IDRB_TRACKDATA)&1)
          ulFlags|=IDCDT_TRACKDATA;
        else
          if(WinQueryButtonCheckstate(hwnd,IDRB_TRACKMODE2)&1)
            ulFlags|=IDCDT_TRACKMODE2;
          else
            if(WinQueryButtonCheckstate(hwnd,IDRB_TRACKXA1)&1)
              ulFlags|=IDCDT_TRACKXA1;
            else
              if(WinQueryButtonCheckstate(hwnd,IDRB_TRACKXA2)&1)
                ulFlags|=IDCDT_TRACKXA2;
              else
                if(WinQueryButtonCheckstate(hwnd,IDRB_TRACKCDI)&1)
                  ulFlags|=IDCDT_TRACKCDI;
        
        if(WinQueryButtonCheckstate(hwnd,IDCB_FIXDISK)&1)
          ulFlags|=IDCDT_FIXDISK;
        thisPtr->cwSetCDTypeFlags(ulFlags,CDT_ALLFLAGS);
        thisPtr->wpSaveImmediate();
      }
      /* Setup is done */   
      bMultiSessionDone=TRUE;
      return (MRESULT) FALSE;
    case WM_CONTROL:
      //      thisPtr=(CWDataFolder*) WinQueryWindowULong(WinWindowFromID(hwnd,IDPB_CDTYPEUNDO),QWL_USER);
      thisPtr=(CWDataFolder*) WinQueryWindowULong(hwnd,QWL_USER);
      if(!somIsObj(thisPtr)) return (MRESULT) TRUE;
      ulFlags=thisPtr->cwQueryCDTypeFlags();/* Get current flags */
      ulFlags&=(IDCDT_ALLTRACKTYPES|IDCDT_FIXDISK);/* Keep the tracktype information */
      switch(SHORT1FROMMP(mp1))
        {
        case IDRB_SINGLESESSION:
          enableCDTypeCntrls(hwnd, ulFlags);
          break;
        case IDRB_MULTISESSION:
          ulFlags|=IDCDT_MULTISESSION;
          enableCDTypeCntrls(hwnd, ulFlags);
          break;
        case IDRB_BOOTCD:
          ulFlags|=IDCDT_BOOTCD;
          enableCDTypeCntrls(hwnd, ulFlags);
          break;
        case IDRB_USERDEFINED:
          ulFlags|=IDCDT_USERDEFINED;
          enableCDTypeCntrls(hwnd, ulFlags);
          break;
#if 0
        case IDRB_SINGLESESSION:
          _showMultiSessionCntrls(hwnd,FALSE);
          _showBootCDCntrls(hwnd, FALSE);
          _showTrackCntrls(hwnd, FALSE);
          _showSingleSessionCntrls(hwnd,TRUE);
          break;
        case IDRB_MULTISESSION:
          _showTrackCntrls(hwnd, FALSE);
          _showBootCDCntrls(hwnd, FALSE);
          _showMultiSessionCntrls(hwnd,TRUE);
          thisPtr->cwEnableMultiSessionCntrls(hwnd,FALSE);
          break;
        case IDRB_BOOTCD:
          _showTrackCntrls(hwnd, FALSE);
          _showMultiSessionCntrls(hwnd,FALSE);
          _showBootCDCntrls(hwnd, TRUE);
          break;
        case IDRB_USERDEFINED:
          _showMultiSessionCntrls(hwnd,FALSE);
          _showBootCDCntrls(hwnd, FALSE);
          _showTrackCntrls(hwnd, TRUE);
          break;
#endif
        default:
          break;
        }
      break;
    case WM_COMMAND:	
      switch(SHORT1FROMMP(mp1))
        {
        case IDPB_BOOTCDCONFIGURE:
          //thisPtr=(CWDataFolder*) WinQueryWindowULong(WinWindowFromID(hwnd,IDPB_CDTYPEUNDO),QWL_USER);
          thisPtr=(CWDataFolder*) WinQueryWindowULong(hwnd,QWL_USER);
          if(!somIsObj(thisPtr)) return (MRESULT) TRUE;

          thisPtrStruct.usSize=sizeof(thisPtrStruct);
          thisPtrStruct.thisPtr=thisPtr;
          if( WinDlgBox( HWND_DESKTOP, NULLHANDLE, _bootCDOptionsDialogProc, hDataResource, 
                         IDDLG_BOOTCDOPTIONS, &thisPtrStruct) == DID_OK )
            {
              getMessage(title,IDSTRD_BOOTIMAGE,sizeof(title), hDataResource,hwnd);
              sprintf(text,title,thisPtr->chrBootImage);
              WinSetWindowText( WinWindowFromID(hwnd,IDST_BOOTIMAGE), text );
              
              getMessage(title,IDSTRD_BOOTCATALOG,sizeof(title), hDataResource,hwnd);
              sprintf(text,title,thisPtr->chrBootCatalog);
              WinSetWindowText( WinWindowFromID(hwnd,IDST_BOOTCATALOG), text );
            }
          break;
        case IDPB_CDTYPEUNDO:
          // thisPtr=(CWDataFolder*) WinQueryWindowULong(WinWindowFromID(hwnd,IDPB_CDTYPEUNDO),QWL_USER);
          thisPtr=(CWDataFolder*) WinQueryWindowULong(hwnd,QWL_USER);
          /* User pressed the UNDO button */
          if(somIsObj(thisPtr)) {
            //ulFlags=thisPtr->cwQueryCDTypeFlags();
            /* Enable all multisesson controls */
            //  thisPtr->cwEnableMultiSessionCntrls(hwnd,TRUE);
            //            enableCDTypeCntrls(hwnd,thisPtr);
            enableCDTypeCntrls(hwnd, thisPtr->cwQueryCDTypeFlags());
            /*            if(ulFlags&IDCDT_FIXDISK) 
                          WinCheckButton(hwnd,IDCB_FIXDISK,1);
                          else
                          WinCheckButton(hwnd,IDCB_FIXDISK,0);*/
          }
          break;  
        default:
          break;
        }
      return (MRESULT) TRUE;
    default:
      break;
    }
  return WinDefDlgProc(hwnd, msg, mp1, mp2); 
}
/* This procedure handles the filename options page */ 
MRESULT EXPENTRY fileNameOptionDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 
{
  CWDataFolder* thisPtr;
  ULONG ulFlags;

  switch(msg)
    {
    case WM_INITDLG :	
      WinSetWindowULong(hwnd, QWL_USER,(ULONG)PVOIDFROMMP(mp2));//Save object ptr.

      thisPtr=(CWDataFolder*)PVOIDFROMMP(mp2);
      if(!somIsObj(thisPtr))
        return (MRESULT) TRUE;
      if(thisPtr->cwQueryMkisofsFlags()&IDMK_ALLOW32CHARS) {
        WinCheckButton(hwnd,IDRB_32CHARNAMES,1);
        WinCheckButton(hwnd,IDRB_DOSNAMES,0);
      }
      else {
        WinCheckButton(hwnd,IDRB_32CHARNAMES,0);
        WinCheckButton(hwnd,IDRB_DOSNAMES,1);
      }

      /* TRANS.TBL files */
      if(thisPtr->cwQueryMkisofsFlags() & IDMK_TRANSTABLE)
        WinCheckButton(hwnd,IDCB_TRANSTABLE,1);
      else
        WinCheckButton(hwnd,IDCB_TRANSTABLE,0);

      if(((CWDataFolder*)PVOIDFROMMP(mp2))->cwQueryMkisofsFlags()&IDMK_JOLIET)
        WinCheckButton(hwnd,IDCB_JOLIET,1);

      WinShowWindow(WinWindowFromID(hwnd,IDCB_DEEPDIRECTORIES),FALSE);
      
      /* Move default buttons on Warp 4 */
      cwMoveNotebookButtonsWarp4(hwnd, IDPB_FILENAMEHELP, 20);
      return (MRESULT) TRUE;
      /*    case WM_HELP:
			thisPtr=(CWAudioFolder*) WinQueryWindowULong(WinWindowFromID(hwnd,IDPB_CDRECORDBROWSE),QWL_USER);
			if(!thisPtr)
            break;
			switch(WinQueryWindowUShort(WinQueryFocus(HWND_DESKTOP),QWS_ID))
            {
            case IDEF_CDRECORDOPTIONS:
            return (MRESULT)thisPtr->wpDisplayHelp(IDEF_CDRECORDOPTIONS,AFHELPLIBRARY);
            case IDPB_WIDERRUFEN:
            return (MRESULT)thisPtr->wpDisplayHelp(IDPB_WIDERRUFEN,AFHELPLIBRARY);
            case IDPB_CDRECORDBROWSE:
            return (MRESULT)thisPtr->wpDisplayHelp(IDPB_CDRECORDBROWSE,AFHELPLIBRARY);
            case IDEF_CDRECORDPATH:
            return (MRESULT)thisPtr->wpDisplayHelp(IDEF_CDRECORDPATH,AFHELPLIBRARY);
            default:
            break;
            }
			return (MRESULT)thisPtr->wpDisplayHelp(IDDLG_CDRECORDSETUP,AFHELPLIBRARY);
			break;*/
      /* This prevents switching the notebook page behind the open folder */
    case WM_WINDOWPOSCHANGED:
      {
        MRESULT mr;

        if(WinQueryFocus(HWND_DESKTOP)!=
           WinQueryWindow(WinQueryWindow(hwnd, QW_PARENT), QW_PARENT)) {
          mp2=MPFROMLONG(LONGFROMMP(mp2)|0x80000);/*AWP_ACTIVATE 0x00080000L*/
          mr=WinDefDlgProc(hwnd, msg, mp1, mp2);
          return mr;  
        }
        break;
      }
    case WM_FOCUSCHANGE:
      {
        if(!SHORT1FROMMP(mp2)) {
          if(HWNDFROMMP(mp1)==hwnd) {
            MRESULT mr;

            mr=WinDefDlgProc(hwnd, msg, mp1, mp2);
            WinSendMsg(WinQueryWindow(WinQueryWindow(hwnd, QW_PARENT), QW_PARENT), WM_SETFOCUS, MPFROMHWND(hwnd), (MPARAM)TRUE);
            return mr;
          }
        }
        break;
      }
#if 0
    case WM_WINDOWPOSCHANGED:
      {
        /* This prevents switching the notebook page behind the open folder */
        if(!(WinQueryWindowUShort(WinQueryWindow(hwnd, QW_PARENT), QWS_FLAGS) & FF_ACTIVE))
          mp2=MPFROMLONG(0x80000);
        break;
      }
#endif
    case WM_DESTROY:
      /* The notebook closes and gets destroyed */
      /* Set focus to desktop to prevent PM freeze */
      WinSetFocus(HWND_DESKTOP, HWND_DESKTOP);

      /* Let the WPS save the new instance data */
          //      thisPtr=(CWDataFolder*) WinQueryWindowULong(WinWindowFromID(hwnd,IDPB_FILENAMEUNDO),QWL_USER);
      thisPtr=(CWDataFolder*) WinQueryWindowULong(hwnd,QWL_USER);
      if(somIsObj(thisPtr)) {
        ulFlags=0;


        if(WinQueryButtonCheckstate(hwnd,IDCB_JOLIET) &1 )
          ulFlags|=IDMK_JOLIET;
        if(WinQueryButtonCheckstate(hwnd,IDRB_32CHARNAMES) &1 )
          ulFlags|=IDMK_ALLOW32CHARS;
        /* TRANS.TBL files */
        if(WinQueryButtonCheckstate(hwnd,IDCB_TRANSTABLE) &1 )
          ulFlags|=IDMK_TRANSTABLE;

        thisPtr->cwSetMkisofsFlags(ulFlags,
                                   IDMK_ALLOW32CHARS|IDMK_JOLIET| IDMK_TRANSTABLE);
        thisPtr->wpSaveImmediate();
      }
      /* Setup is done */   
      return (MRESULT) TRUE;
    case WM_COMMAND:	
    switch(SHORT1FROMMP(mp1))
      {
      case IDPB_FILENAMEUNDO:
        /* User pressed the UNDO button */
        //thisPtr=(CWDataFolder*) WinQueryWindowULong(WinWindowFromID(hwnd,IDPB_FILENAMEUNDO),QWL_USER);
        thisPtr=(CWDataFolder*) WinQueryWindowULong(hwnd,QWL_USER);
        if(somIsObj(thisPtr)) {
          ulFlags=thisPtr->cwQueryMkisofsFlags();
          if(ulFlags&IDMK_ALLOW32CHARS) {
            WinCheckButton(hwnd,IDRB_32CHARNAMES,1);
            WinCheckButton(hwnd,IDRB_DOSNAMES,0);
          }
          else {
            WinCheckButton(hwnd,IDRB_32CHARNAMES,0);
            WinCheckButton(hwnd,IDRB_DOSNAMES,1);
          }

          if(ulFlags&IDMK_TRANSTABLE)
            WinCheckButton(hwnd,IDCB_TRANSTABLE,1);
          else
            WinCheckButton(hwnd,IDCB_TRANSTABLE,0);

          if(ulFlags&IDMK_JOLIET)
            WinCheckButton(hwnd,IDCB_JOLIET,1);
          else
            WinCheckButton(hwnd,IDCB_JOLIET,0);
        }
        break;
      default:
        break;
      }
    return (MRESULT) TRUE;
    default:
      break;
    }
  return WinDefDlgProc(hwnd, msg, mp1, mp2);
}
/* This procedure handles the author settings page */ 
MRESULT EXPENTRY authorOptionDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 
{
  CWDataFolder* thisPtr;

  switch(msg)
    {
    case WM_INITDLG :	
      WinSetWindowULong(hwnd, QWL_USER,(ULONG)PVOIDFROMMP(mp2));//Save object ptr.
      thisPtr=(CWDataFolder*)PVOIDFROMMP(mp2);
      WinSendMsg(WinWindowFromID(hwnd,IDEF_APPLICATION),EM_SETTEXTLIMIT,MPFROMSHORT((SHORT)128),0);
      WinSetWindowText(WinWindowFromID(hwnd,IDEF_APPLICATION),thisPtr->chrApplication);
      WinSendMsg(WinWindowFromID(hwnd,IDEF_PUBLISHER),EM_SETTEXTLIMIT,MPFROMSHORT((SHORT)128),0);
      WinSetWindowText(WinWindowFromID(hwnd,IDEF_PUBLISHER),thisPtr->chrPublisher);
      WinSendMsg(WinWindowFromID(hwnd,IDEF_PREPARER),EM_SETTEXTLIMIT,MPFROMSHORT((SHORT)128),0);
      WinSetWindowText(WinWindowFromID(hwnd,IDEF_PREPARER),thisPtr->chrPreparer);
      WinSendMsg(WinWindowFromID(hwnd,IDEF_VOLUMENAME),EM_SETTEXTLIMIT,MPFROMSHORT((SHORT)32),0);
      WinSetWindowText(WinWindowFromID(hwnd,IDEF_VOLUMENAME),thisPtr->chrVolumeName);

      /* Move default buttons on Warp 4 */
      cwMoveNotebookButtonsWarp4(hwnd, IDPB_AUTHORHELP, 20);
      return (MRESULT) TRUE;
      /* This prevents switching the notebook page behind the open folder */
    case WM_WINDOWPOSCHANGED:
      {
        MRESULT mr;

        if(WinQueryFocus(HWND_DESKTOP)!=
           WinQueryWindow(WinQueryWindow(hwnd, QW_PARENT), QW_PARENT)) {
          mp2=MPFROMLONG(LONGFROMMP(mp2)|0x80000);/*AWP_ACTIVATE 0x00080000L*/
          mr=WinDefDlgProc(hwnd, msg, mp1, mp2);
          return mr;  
        }
        break;
      }
    case WM_FOCUSCHANGE:
      {
        if(!SHORT1FROMMP(mp2)) {
          if(HWNDFROMMP(mp1)==hwnd) {
            MRESULT mr;

            mr=WinDefDlgProc(hwnd, msg, mp1, mp2);
            WinSendMsg(WinQueryWindow(WinQueryWindow(hwnd, QW_PARENT), QW_PARENT), WM_SETFOCUS, MPFROMHWND(hwnd), (MPARAM)TRUE);
            return mr;
          }
        }
        break;
      }
    case WM_DESTROY:
      /* The notebook closes and gets destroyed */
      /* Set focus to desktop to prevent PM freeze */
      WinSetFocus(HWND_DESKTOP, HWND_DESKTOP);

      /* Let the WPS save the new instance data */
      //      thisPtr=(CWDataFolder*) WinQueryWindowULong(WinWindowFromID(hwnd,IDPB_AUTHORUNDO),QWL_USER);
      thisPtr=(CWDataFolder*) WinQueryWindowULong(hwnd,QWL_USER);
      if(somIsObj(thisPtr)) {
        WinQueryWindowText( WinWindowFromID(hwnd,IDEF_APPLICATION),sizeof(thisPtr->chrApplication),thisPtr->chrApplication);
        WinQueryWindowText( WinWindowFromID(hwnd,IDEF_PUBLISHER),sizeof(thisPtr->chrPublisher),thisPtr->chrPublisher);
        WinQueryWindowText( WinWindowFromID(hwnd,IDEF_PREPARER),sizeof(thisPtr->chrPreparer),thisPtr->chrPreparer);
        WinQueryWindowText( WinWindowFromID(hwnd,IDEF_VOLUMENAME),sizeof(thisPtr->chrVolumeName),thisPtr->chrVolumeName);
        thisPtr->wpSaveDeferred();
      }
      /* Setup is done */
      return (MRESULT) TRUE;
    case WM_COMMAND:	
    switch(SHORT1FROMMP(mp1))
      {
      case IDPB_AUTHORUNDO:
        /* User pressed the UNDO button */
        //   thisPtr=(CWDataFolder*) WinQueryWindowULong(WinWindowFromID(hwnd,IDPB_AUTHORUNDO),QWL_USER);
        thisPtr=(CWDataFolder*) WinQueryWindowULong(hwnd,QWL_USER);
        if(somIsObj(thisPtr)) {
          WinSetWindowText(WinWindowFromID(hwnd,IDEF_APPLICATION),thisPtr->chrApplication);
          WinSetWindowText(WinWindowFromID(hwnd,IDEF_PUBLISHER),thisPtr->chrPublisher);
          WinSetWindowText(WinWindowFromID(hwnd,IDEF_PREPARER),thisPtr->chrPreparer);
          WinSetWindowText(WinWindowFromID(hwnd,IDEF_VOLUMENAME),thisPtr->chrVolumeName);
        }
        break;
      default:
        break;
      }
    return (MRESULT) TRUE;
    default:
      break;
    }
  return WinDefDlgProc(hwnd, msg, mp1, mp2);
}
MRESULT EXPENTRY specialOptionDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
{
  CWDataFolder* thisPtr;
  ULONG ulFlags;
  LONG lSpinValue;
  static HWND hwndStatus;
  int a;
  char chrCD[4];
  char text[CCHMAXPATH];
  char title[CCHMAXPATH];
  char text2[40];

  ULONG rc;
  THISPTR thisPtrStruct;

  switch(msg)
    {
    case WM_INITDLG :	
      WinSetWindowULong(hwnd, QWL_USER,(ULONG)PVOIDFROMMP(mp2));//Save object ptr.
      thisPtr=(CWDataFolder*)PVOIDFROMMP(mp2);
      if(somIsObj(thisPtr)) {
        ulFlags=((CWDataFolder*)PVOIDFROMMP(mp2))->cwQueryMkisofsFlags();
        
        if(ulFlags & IDMK_SHADOWSINROOTONLY) { 
          WinCheckButton(hwnd,IDRB_SHADOWSINROOTONLY,1);
          enableArchiveCntrls(hwnd, FALSE);
        }
        else {
          WinCheckButton(hwnd,IDRB_FOLLOWALLSHADOWS,1);
          enableArchiveCntrls(hwnd, TRUE);
        }
        /* Use archive bit */
        if(ulFlags & IDMK_USEARCHIVEBIT) 
          WinCheckButton(hwnd, IDCB_USEARCHIVEBIT, 1);
        else
          WinCheckButton(hwnd, IDCB_USEARCHIVEBIT, 0);
        /* Reset archive bit */
        if(ulFlags & IDMK_RESETARCHIVEBIT) 
          WinCheckButton(hwnd, IDCB_RESETARCHIVEBIT,1);
        else
          WinCheckButton(hwnd, IDCB_RESETARCHIVEBIT, 0);
      }
      /* Move default buttons on Warp 4 */
      cwMoveNotebookButtonsWarp4(hwnd, IDPB_SPECIALHELP, 20);
      return (MRESULT) TRUE;
      /* This prevents switching the notebook page behind the open folder */
    case WM_WINDOWPOSCHANGED:
      {
        MRESULT mr;

        if(WinQueryFocus(HWND_DESKTOP)!=
           WinQueryWindow(WinQueryWindow(hwnd, QW_PARENT), QW_PARENT)) {
          mp2=MPFROMLONG(LONGFROMMP(mp2)|0x80000);/*AWP_ACTIVATE 0x00080000L*/
          mr=WinDefDlgProc(hwnd, msg, mp1, mp2);
          return mr;  
        }
        break;
      }
    case WM_FOCUSCHANGE:
      {
        if(!SHORT1FROMMP(mp2)) {
          if(HWNDFROMMP(mp1)==hwnd) {
            MRESULT mr;

            mr=WinDefDlgProc(hwnd, msg, mp1, mp2);
            WinSendMsg(WinQueryWindow(WinQueryWindow(hwnd, QW_PARENT), QW_PARENT), WM_SETFOCUS, MPFROMHWND(hwnd), (MPARAM)TRUE);
            return mr;
          }
        }
        break;
      }
    case WM_DESTROY:
      /* The notebook closes and gets destroyed */
      /* Set focus to desktop to prevent PM freeze */
      WinSetFocus(HWND_DESKTOP, HWND_DESKTOP);

      /* Let the WPS save the new instance data */
      //      thisPtr=(CWDataFolder*) WinQueryWindowULong(WinWindowFromID(hwnd,IDPB_SPECIALUNDO),QWL_USER);
      thisPtr=(CWDataFolder*) WinQueryWindowULong(hwnd,QWL_USER);
      if(somIsObj(thisPtr)) {
        ulFlags=thisPtr->cwQueryMkisofsFlags();
        if(WinQueryButtonCheckstate(hwnd,IDRB_SHADOWSINROOTONLY) & 1) {
          ulFlags|=IDMK_SHADOWSINROOTONLY;
        }
        else
          ulFlags&=~IDMK_SHADOWSINROOTONLY;
        /* Use archive bit */
        if(WinQueryButtonCheckstate(hwnd, IDCB_USEARCHIVEBIT) & 1) {
          ulFlags|=IDMK_USEARCHIVEBIT;
        }
        else
          ulFlags&=~IDMK_USEARCHIVEBIT;
        /* Reset archive bit */
        if(WinQueryButtonCheckstate(hwnd, IDCB_RESETARCHIVEBIT) & 1) {
          ulFlags|=IDMK_RESETARCHIVEBIT;
        }
        else
          ulFlags&=~IDMK_RESETARCHIVEBIT;

        thisPtr->cwSetMkisofsFlags(ulFlags,MK_ALLFLAGS);
        thisPtr->wpSaveImmediate();
      }
      /* Setup is done */   
    
      return (MRESULT) FALSE;
    case WM_CONTROL:
      switch(SHORT1FROMMP(mp1))
        {
        case IDRB_SHADOWSINROOTONLY:
          enableArchiveCntrls(hwnd, FALSE);
          break;
        case IDRB_FOLLOWALLSHADOWS:
          enableArchiveCntrls(hwnd, TRUE);          
          break;
        default:
          break;
        }
      break;
    case WM_COMMAND:	
      //thisPtr=(CWDataFolder*) WinQueryWindowULong(WinWindowFromID(hwnd,IDPB_SPECIALUNDO),QWL_USER);
      thisPtr=(CWDataFolder*) WinQueryWindowULong(hwnd,QWL_USER);
      if(!somIsObj(thisPtr)) 
        return (MRESULT) TRUE;
      switch(SHORT1FROMMP(mp1))
        {
        case IDPB_SPECIALUNDO:
          /* User pressed the UNDO button */
          ulFlags=thisPtr->cwQueryMkisofsFlags();
          if(ulFlags & IDMK_SHADOWSINROOTONLY) 
            WinCheckButton(hwnd,IDRB_SHADOWSINROOTONLY,1);
          else
            WinCheckButton(hwnd, IDRB_FOLLOWALLSHADOWS,1);
          /* Use archive bit */
          if(ulFlags & IDMK_USEARCHIVEBIT) 
            WinCheckButton(hwnd, IDCB_USEARCHIVEBIT, 1);
          else
            WinCheckButton(hwnd, IDCB_USEARCHIVEBIT, 0);
          /* Reset archive bit */
          if(ulFlags & IDMK_RESETARCHIVEBIT) 
            WinCheckButton(hwnd, IDCB_RESETARCHIVEBIT,1);
          else
            WinCheckButton(hwnd, IDCB_RESETARCHIVEBIT, 0);          
          break;  
        case IDPB_SPECIALHELP:
          thisPtr->wpDisplayHelp(IDHLP_DATAFOLDERSPECIAL,AFHELPLIBRARY);
          break;
        case IDPB_RESETNOW:
          /* Text: ""
             Title: ""
             */
          rc=messageBox( text, IDSTRD_RESETARCHIVEBITCONFIRM , sizeof(text),
                      title, IDSTRD_RESETARCHIVEBITTITLE, sizeof(title),
                      hDataResource, HWND_DESKTOP, MB_YESNO | MB_ICONQUESTION | MB_MOVEABLE | MB_DEFBUTTON2);          
          if(rc==MBID_YES)
            DosBeep(5000,1000);
          break;
        default:
          break;
        }
      return (MRESULT) TRUE;
    default:
      break;
    }
  return WinDefDlgProc(hwnd, msg, mp1, mp2); 
}
Esempio n. 17
0
static MRESULT EXPENTRY pm_vsid(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
{
    extern int trigger_shutdown;

    switch (msg) {
        case WM_INITDLG:
            {
                HWND hmenu;
                HPOINTER hicon = WinLoadPointer(HWND_DESKTOP, NULLHANDLE, DLG_VSID);

                if (hicon) {
                    WinSendMsg(hwnd, WM_SETICON, MPFROMLONG(hicon), MPVOID);
                }

                //
                // Try to attach the menu and make it visible
                //
                hmenu = WinLoadMenu(hwnd, NULLHANDLE, IDM_VICE2);
                if (hmenu) {
                    SWP swp;
                    WinQueryWindowPos(hwnd, &swp);

                    WinDelMenuItem(hmenu, IDM_FILE);
                    WinDelMenuItem(hmenu, IDM_VIEW);
                    WinDelMenuItem(hmenu, IDM_SETUP);
                    WinDelMenuItem(hmenu, IDM_MONITOR);

                    swp.cy += WinQuerySysValue(HWND_DESKTOP, SV_CYMENU) + 1;
                    WinSetWindowPos(hwnd, 0, 0, 0, swp.cx, swp.cy, SWP_SIZE);

                    WinSendMsg(hwnd, WM_UPDATEFRAME, MPFROMLONG(FID_MENU), MPVOID);
                }

                WinSubclassDlg(hwnd, ID_TBOX, pm_vsid_dragndrop);
                WinSubclassDlg(hwnd, ID_TNAME, pm_vsid_dragndrop);
                WinSubclassDlg(hwnd, ID_TAUTHOR, pm_vsid_dragndrop);
                WinSubclassDlg(hwnd, ID_TCOPYRIGHT, pm_vsid_dragndrop);
                WinSubclassDlg(hwnd, ID_TSYNC, pm_vsid_dragndrop);
                WinSubclassDlg(hwnd, ID_TIRQ, pm_vsid_dragndrop);
                WinSubclassDlg(hwnd, ID_TSID, pm_vsid_dragndrop);
            }
            return FALSE;
        case WM_MENUSELECT:
            menu_select(HWNDFROMMP(mp2), SHORT1FROMMP(mp1));
            break;
        case WM_DESTROY:
            trigger_shutdown = 1;
            break;
        case WM_COMMAND:
            switch (LONGFROMMP(mp1)) {
                case DID_CLOSE:
                    trigger_shutdown = 1;
                    break;
                default:
                    menu_action(hwnd, SHORT1FROMMP(mp1));
                    return FALSE;
            }
            break;
        case WM_CONTROL:
            if (mp1 == MPFROM2SHORT(SPB_SETTUNE, SPBN_ENDSPIN)) {
                const ULONG val = WinGetSpinVal((HWND)mp2);

                resources_set_int("PSIDTune", (int)val);
            }
            break;
        case WM_DISPLAY:
            {
                char *txt = lib_msprintf("Vice/2 SID Player - %d%%", mp1);

                WinSetDlgItemText(hwnd, FID_TITLEBAR, txt);
                lib_free(txt);
            }
            return FALSE;
    }
    return WinDefDlgProc(hwnd, msg, mp1, mp2);
}
/*��������������������������������������������������������������������������*/
MRESULT MsgDlgProc(HWND    hwnd,
                   MSG     message,
                   MPARAM  lParam1,
                   MPARAM  lParam2 )
{
  /*������������������������������������������������������������������������Ŀ*/
  /*� Local Variables                                                        �*/
  /*��������������������������������������������������������������������������*/
  MRESULT   dpResult  = NULL;

  CHAR      szFmt [256],                          /* formatting specification */
            szText[256];                          /* formatting area          */

  USHORT    usThisItem;                           /* list item                */

  /*������������������������������������������������������������������������Ŀ*/
  /*� Locate dialog's instance data                                          �*/
  /*��������������������������������������������������������������������������*/
  PMD_DATA pData = WinQueryWindowPtr(hwnd, QWL_USER);

  /*������������������������������������������������������������������������Ŀ*/
  /*� Process the message                                                    �*/
  /*��������������������������������������������������������������������������*/
  switch (message)
  {
    /*��������������������������������������������������������������������Ŀ*/
    /*� "Done" PUSHBUTTON has been used or dialog close requested          �*/
    /*����������������������������������������������������������������������*/
    case WM_COMMAND:
    case WM_CLOSE:

         WinDismissDlg(hwnd, 0);

    break;

    /*��������������������������������������������������������������������Ŀ*/
    /*� Notification from one of the dialog controls....                   �*/
    /*����������������������������������������������������������������������*/
    case WM_CONTROL:
          /******************************************************************
          * One of our drop-down list items have new selection?
          ******************************************************************/
          if (
                 (SHORT2FROMMP(lParam1) == CBN_EFCHANGE) &&
               ( (SHORT1FROMMP(lParam1) == DLG_MD_DD_MP1) ||
                 (SHORT1FROMMP(lParam1) == DLG_MD_DD_MP2) )
             )
          {
            MP_FORMAT mpThis;                     /* current MP Format        */

            /****************************************************************
            * Determine "new" drop-down list item
            ****************************************************************/
            usThisItem = SHORT1FROMMR( WinSendMsg(HWNDFROMMP(lParam2),
                                                  LM_QUERYSELECTION,                  /* Select item    */
                                                  MPFROMSHORT(LIT_FIRST),
                                                  NULL) );

            /****************************************************************
            * Query item's "handle" to MP table item
            *****************************************************************/
            mpThis = (MP_FORMAT)
                     SHORT1FROMMR( WinSendMsg(HWNDFROMMP(lParam2),
                                              LM_QUERYITEMHANDLE,
                                              MPFROMSHORT(usThisItem),
                                              NULL) );

            /****************************************************************
            * Format MP1/MP2 using selected value
            *****************************************************************/
            if ( SHORT1FROMMP(lParam1) == DLG_MD_DD_MP1 )
            {
              WinSetWindowText( WinWindowFromID(hwnd, DLG_MD_ST_MP1),
                                MpFormat(pData->qmsgItem.mp1,
                                         pData->pMsg->fMP1 = mpThis,
                                         szText) );
            }
            else
            {
              WinSetWindowText( WinWindowFromID(hwnd, DLG_MD_ST_MP2),
                                MpFormat(pData->qmsgItem.mp2,
                                         pData->pMsg->fMP2 = mpThis,
                                         szText) );
            }
          }
    break;

     /*�������������������������������������������������������������������Ŀ*/
     /*� WM_INITDLG:                                                       �*/
     /*�                                                                   �*/
     /*� - MP2 is dialog instance's data                                   �*/
     /*���������������������������������������������������������������������*/
     case WM_INITDLG:
          /*��������������������������������������������������������������Ŀ*/
          /*� Save Dialog's instance data pointer (passed in MP2)          �*/
          /*����������������������������������������������������������������*/
          WinSetWindowPtr(hwnd, QWL_USER, pData = PVOIDFROMMP(lParam2));

          /*��������������������������������������������������������������Ŀ*/
          /*� Setup the Dialog for processing...                           �*/
          /*����������������������������������������������������������������*/
          CenterDialog(hwnd);                                /* Center DLG  */

          /*��������������������������������������������������������������Ŀ*/
          /*� Set up Dialog's title to include MSG name                    �*/
          /*����������������������������������������������������������������*/
          WinQueryWindowText(hwnd, sizeof(szFmt), szFmt);

          sprintf(szText, szFmt, pData->pMsg->pDesc);

          WinSetWindowText(hwnd, szText);

          /*��������������������������������������������������������������Ŀ*/
          /*� Display MSG's value                                          �*/
          /*����������������������������������������������������������������*/
          sprintf(szText,
                  "0x%4.4X (%d)",
                  pData->pMsg->Msg,
                  pData->pMsg->Msg);

          WinSetWindowText( WinWindowFromID(hwnd, DLG_MD_ST_MSG), szText);

          /*��������������������������������������������������������������Ŀ*/
          /*� Display MSG "seen" values                                    �*/
          /*����������������������������������������������������������������*/
          WinQueryWindowText( WinWindowFromID(hwnd, DLG_MD_ST_SEEN),
                              sizeof(szFmt), szFmt);

          sprintf( szText,
                   szFmt,
                   pData->pMsg->aulTimes[MSG_TIMES_EVER],
                   pData->pMsg->aulTimes[MSG_TIMES_SINCE]
                 );

          WinSetWindowText( WinWindowFromID(hwnd, DLG_MD_ST_SEEN), szText);

          /*��������������������������������������������������������������Ŀ*/
          /*� Set MP format values                                         �*/
          /*�                                                              �*/
          /*� Note: WM_CONTROL messages are generated by the following     �*/
          /*�       which cause formatting of MP1 / MP2 data (see above)   �*/
          /*����������������������������������������������������������������*/
          LoadMpFormats(hwnd, DLG_MD_DD_MP1, pData->pMsg->fMP1);
          LoadMpFormats(hwnd, DLG_MD_DD_MP2, pData->pMsg->fMP2);

      break;

     /*�������������������������������������������������������������������Ŀ*/
     /*� We don't need to handle any other messages...                     �*/
     /*�                                                                   �*/
     /*� If this isn't an IPF message, let PM do it's default "thing"      �*/
     /*���������������������������������������������������������������������*/
     default:
          if ( !HandleIPF(hwnd, message, lParam1, lParam2, &dpResult) )
            dpResult = WinDefDlgProc(hwnd, message, lParam1, lParam2 );
   }

   /*�����������������������������������������������������������������������Ŀ*/
   /*� Exit                                                                  �*/
   /*�������������������������������������������������������������������������*/
   return( dpResult );
}
Esempio n. 19
0
MRESULT EXPENTRY MyWindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
{
  SWP   swp;
  ULONG rc;
  HWND  hFrame, hwndMenu;

  switch (msg)
  {
  case WM_CREATE:
       hListBox = WinCreateWindow(hwnd,
                                  WC_LISTBOX,
                                  NULL,
                                  WS_VISIBLE     |
                                  LS_NOADJUSTPOS |
                                  LS_HORZSCROLL,
                                  0, 0, 0, 0,
                                  hwnd,
                                  HWND_TOP,
                                  ID_LISTBOX,
                                  0,
                                  0);

       pwpList = WinSubclassWindow(hListBox,
                    wpSubList);

       hFrame = WinQueryWindow(hwnd,
                               QW_PARENT);
       rc = WinSetWindowPos(hFrame,
                            HWND_TOP,
                            50, 250,
                            300, 200,
                            SWP_MOVE     |
                            SWP_SIZE     |
                            SWP_ACTIVATE |
                            SWP_SHOW);
       hptrDrag = WinLoadPointer( HWND_DESKTOP, NULLHANDLE, ID_DRAGPTR);
                            
       break;

  case WM_SIZE:
       WinQueryWindowPos(hwnd, &swp);
       hListBox=WinWindowFromID(hwnd,
                                ID_LISTBOX);
       WinSetWindowPos(hListBox,
                       HWND_TOP,
                       swp.x, swp.y,
                       swp.cx, swp.cy,
                       SWP_SIZE  |
                       SWP_SHOW);
       break;

  /* just record drag messages sent to client window 
  */
  case DM_DROP:
  case DM_DRAGOVER:
  case DM_DRAGLEAVE:
  case DM_DROPHELP:
  case DM_ENDCONVERSATION:
  case DM_PRINT:
  case DM_RENDER:
  case DM_RENDERCOMPLETE:
  case DM_RENDERPREPARE:
  case DM_DRAGFILECOMPLETE:
  case DM_EMPHASIZETARGET:
  case DM_DRAGERROR:
  case DM_FILERENDERED:
  case DM_RENDERFILE:
  case DM_DRAGOVERNOTIFY:
  case DM_PRINTOBJECT:
  case DM_DISCARDOBJECT:
    PutMsg( 0, msg, mp1, mp2 );
    return (MRESULT)FALSE;
    break;

  case WM_MENUSELECT:
    switch( SHORT1FROMMP(mp1) )
    {
    case ID_OPTIONS:
      WinCheckMenuItem(HWNDFROMMP(mp2), IDM_DRGDRAG, bDrgDrag);
      WinCheckMenuItem(HWNDFROMMP(mp2), IDM_DRGDRAGFILES, !bDrgDrag);
      return (MRESULT)FALSE;

    default:
      return(WinDefWindowProc(hwnd, msg, mp1, mp2));
    }
  case WM_COMMAND:
    if( SHORT1FROMMP(mp2) == CMDSRC_MENU )
    {
      hwndMenu = WinWindowFromID(hFrame, FID_MENU);
      switch( SHORT1FROMMP(mp1) )
      {
      case IDM_DRGDRAG:
        bDrgDrag = TRUE;
        WinCheckMenuItem(hwndMenu, IDM_DRGDRAG, bDrgDrag);
        WinCheckMenuItem(hwndMenu, IDM_DRGDRAGFILES, !bDrgDrag);
        return (MRESULT)FALSE;
  
      case IDM_DRGDRAGFILES:
        bDrgDrag = FALSE;
        WinCheckMenuItem(hwndMenu, IDM_DRGDRAG, bDrgDrag);
        WinCheckMenuItem(hwndMenu, IDM_DRGDRAGFILES, !bDrgDrag);
        return (MRESULT)FALSE;
  
      case IDM_CONFIGDLG:
        if( bDrgDrag == TRUE )
          WinDlgBox(HWND_DESKTOP, hwnd, wpConfDrgDrag, NULLHANDLE,
                    IDD_CONFIG1, NULL);
        else
          WinDlgBox(HWND_DESKTOP, hwnd, wpConfDrgDragFiles, NULLHANDLE,
                    IDD_CONFIG2, NULL);
        return (MRESULT)TRUE;
    
      case IDM_CLEARLIST:
        WinSendMsg( hListBox, LM_DELETEALL, (MPARAM)0, (MPARAM)0 );
        return((MRESULT)TRUE);
    
      case IDM_DOSOMETHING:
        if( WinMessageBox(HWND_DESKTOP, hwnd, "OK, so do something else!",
                       "Message", 0, MB_OKCANCEL ) == MBID_OK )
          WinPostMsg( hwnd, WM_QUIT, (MPARAM)0, (MPARAM)0 );
        return((MRESULT)TRUE);
      }
    }
    break;

  default:
       return(WinDefWindowProc(hwnd,
                               msg,
                               mp1,
                               mp2));
  }
  return((MRESULT)FALSE);
}