Beispiel #1
0
void UpdateRcvBufferStatusDlg(HWND hwnd)
  {
  BUFCNT stCounts;
  ULONG ulQueueLength;
  ULONG ulTemp;
  char szSize[20];

  if (GetReceiveQueueCounts(&stIOctl,hCom,&stCounts) != NO_ERROR)
    {
    WinPostMsg(hwndStatAll,UM_KILL_MONITOR,(MPARAM)0L,(MPARAM)0L);
    WinPostMsg(hwndStatDev,UM_KILL_MONITOR,(MPARAM)0L,(MPARAM)0L);
    }
  else
    {
    if (stCounts.wQueueLen == 0)
      ulQueueLength = 0x10000;
    else
      ulQueueLength = (ULONG)stCounts.wQueueLen;
    ulTemp = (ULONG)stCounts.wByteCount * 100;
    ulTemp /= ulQueueLength;
    ltoa(ulTemp,szSize,10);
    WinSetDlgItemText(hwnd,HWS_BUFLEV,szSize);
    ltoa((LONG)stCounts.wByteCount,szSize,10);
    WinSetDlgItemText(hwnd,HWS_BUFLEN,szSize);
    ltoa((LONG)stCounts.dwQueueHigh,szSize,10);
    WinSetDlgItemText(hwnd,HWS_BUFHIGH,szSize);
    }
  }
VOID DisplayDriveInfo (HWND hWnd, ULONG ulInx)
{
    CHAR  szVolumeLabel[12];
    ULONG ulTotalSpace,
          ulAllocated,
          ulAvailable;

    WinSetDlgItemText (hWnd, IDC_LOCATION, DriveInfo[ulInx].szLocation);
    WinSetDlgItemText (hWnd, IDC_REMOVABLE, DriveInfo[ulInx].szRemovable);
    WinSetDlgItemText (hWnd, IDC_FILESYSTEM, DriveInfo[ulInx].szFileSystem);
    WinSetDlgItemText (hWnd, IDC_DESCRIPTION, 
        szDriveDescription[DriveInfo[ulInx].ulDescriptionIndex]);

    WinSetPointer (HWND_DESKTOP, 
        WinQuerySysPointer (HWND_DESKTOP,SPTR_WAIT,FALSE));

    QueryVolumeLabel (DriveInfo[ulInx].szDrive[0] - 'A' + 1, szVolumeLabel);
    WinSetDlgItemText (hWnd, IDC_VOLUMELABEL, szVolumeLabel);

    QueryDiskSpace (DriveInfo[ulInx].szDrive[0] - 'A' + 1, &ulTotalSpace,
        &ulAllocated, &ulAvailable);

    FormatNumberField (hWnd, IDC_TOTALSPACE, ulTotalSpace);
    FormatNumberField (hWnd, IDC_ALLOCATED,  ulAllocated);
    FormatNumberField (hWnd, IDC_AVAILABLE,  ulAvailable);

    WinSetPointer (HWND_DESKTOP, 
        WinQuerySysPointer (HWND_DESKTOP,SPTR_ARROW,FALSE));

    return;
}
/*---------------------------------------------------------------------------
                                AboutWndProc
---------------------------------------------------------------------------*/
MRESULT EXPENTRY AboutWndProc( HWND wnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
{
 WNDATTR *wndattr;
 MRESULT  MRes;
 HWND     frame, client;
 char     number[10];

   switch (msg) {
     case WM_INITDLG:
           PositionDialog( wnd );

           frame = WinQueryWindow( wnd, QW_OWNER );
           client = WinWindowFromID( frame, FID_CLIENT );
           wndattr = (WNDATTR*)WinQueryWindowPtr( client, QWL_USER );

           ltoa( LPListLines( wndattr->list ), number, 10 );
           WinSetDlgItemText( wnd, ID_LINES, number );
           ltoa( LPListMarkedLines( wndattr->list ), number, 10 );
           WinSetDlgItemText( wnd, ID_MARKED, number );
           ltoa( LPListMaxLines( wndattr->list ), number, 10 );
           WinSetDlgItemText( wnd, ID_MAXLINES, number );
           ltoa( LPListMaxLen( wndattr->list ), number, 10 );
           WinSetDlgItemText( wnd, ID_MAXLENGTH, number );

           break;
     default:
        MRes = WinDefDlgProc( wnd, msg, mp1, mp2 );
        break;
   }

  return MRes;
}
Beispiel #4
0
VOID FillHdwFilterDlg(HWND hwnd,DCB *pstComDCB)
  {
  char szReplaceChar[5];

  sprintf(szReplaceChar,"%02X",pstComDCB->ErrChar);
  WinSetDlgItemText(hwnd,HWR_ERRCHAR,szReplaceChar);

  sprintf(szReplaceChar,"%02X",pstComDCB->BrkChar);
  WinSetDlgItemText(hwnd,HWR_BRKCHAR,szReplaceChar);

  if (pstComDCB->Flags2 & F2_ENABLE_ERROR_REPL)
    CheckButton(hwnd,HWR_ENABERR,TRUE);
  else
    {
    ControlEnable(hwnd,HWR_ERRTTT,FALSE);
    ControlEnable(hwnd,HWR_ERRTT,FALSE);
    ControlEnable(hwnd,HWR_ERRT,FALSE);
    ControlEnable(hwnd,HWR_ERRCHAR,FALSE);
    }
  if (pstComDCB->Flags2 & F2_ENABLE_NULL_STRIP)
    CheckButton(hwnd,HWR_ENABNUL,TRUE);

  if (pstComDCB->Flags2 & F2_ENABLE_BREAK_REPL)
    CheckButton(hwnd,HWR_ENABBRK,TRUE);
  else
    {
    ControlEnable(hwnd,HWR_BRKTTT,FALSE);
    ControlEnable(hwnd,HWR_BRKTT,FALSE);
    ControlEnable(hwnd,HWR_BRKT,FALSE);
    ControlEnable(hwnd,HWR_BRKCHAR,FALSE);
    }
  }
Beispiel #5
0
MRESULT EXPENTRY fnwpLogonDlg(HWND hwnd,USHORT msg,MPARAM mp1,MPARAM mp2)
  {
  static LOGON *pstLogon;

  switch (msg)
    {
    case WM_INITDLG:
      pstLogon = (LOGON *)mp2;
      WinSendDlgItemMsg(hwnd,LOG_USERID,EM_SETTEXTLIMIT,MPFROMSHORT(40),(MPARAM)NULL);
      WinSetDlgItemText(hwnd,LOG_USERID,pstLogon->szUserName);
      WinSendDlgItemMsg(hwnd,LOG_PASSWORD,EM_SETTEXTLIMIT,MPFROMSHORT(40),(MPARAM)NULL);
      WinSetDlgItemText(hwnd,LOG_PASSWORD,pstLogon->szPassword);
      break;
    case WM_COMMAND:
      switch(SHORT1FROMMP(mp1))
        {
        case DID_OK:
          WinQueryDlgItemText(hwnd,LOG_USERID,40,pstLogon->szUserName);
          WinQueryDlgItemText(hwnd,LOG_PASSWORD,40,pstLogon->szPassword);
          WinDismissDlg(hwnd,TRUE);
          break;
        case DID_CANCEL:
          WinDismissDlg(hwnd,FALSE);
          break;
        default:
          return(WinDefDlgProc(hwnd,msg,mp1,mp2));
        }
      break;
    default:
      return(WinDefDlgProc(hwnd,msg,mp1,mp2));
    }
  return(FALSE);
  }
Beispiel #6
0
void FillHdwTimeoutDlg(HWND hwnd,DCB *pstComDCB)
  {
  char szTimeout[8];

  sprintf(szTimeout,"%u",pstComDCB->ReadTimeout);
  WinSetDlgItemText(hwnd,HWT_RTIME,szTimeout);
  WinSendDlgItemMsg(hwnd,HWT_RTIME,EM_SETTEXTLIMIT,MPFROMSHORT(5),(MPARAM)NULL);

  sprintf(szTimeout,"%u",pstComDCB->WrtTimeout);
  WinSendDlgItemMsg(hwnd,HWT_WTIME,EM_SETTEXTLIMIT,MPFROMSHORT(5),(MPARAM)NULL);
  WinSetDlgItemText(hwnd,HWT_WTIME,szTimeout);

  if (pstComDCB->Flags3 & F3_INFINITE_WRT_TIMEOUT)
    {
    ControlEnable(hwnd,HWT_WTIMET,FALSE);
    ControlEnable(hwnd,HWT_WTIME,FALSE);
    CheckButton(hwnd,HWT_WINF,TRUE);
    }
  else
    CheckButton(hwnd,HWT_WNORM,TRUE);

  if ((pstComDCB->Flags3 & F3_RTO_MASK) == F3_WAIT_NONE) // first mask significant bits
    {
    ControlEnable(hwnd,HWT_RTIMET,FALSE);
    ControlEnable(hwnd,HWT_RTIME,FALSE);
    CheckButton(hwnd,HWT_RNOWAIT,TRUE);
    }
  else
    {
    if ((pstComDCB->Flags3  & F3_RTO_MASK) == F3_WAIT_SOMETHING)
      CheckButton(hwnd,HWT_RWAITSOME,TRUE);
    else
      CheckButton(hwnd,HWT_RNORM,TRUE);
    }
  }
static void internal_SetPwdProtWindowText(HWND hwnd)
{
  char *pchTemp;

  // Set new window texts!
  if (DosRequestMutexSem(hmtxUseNLSTextArray, SEM_INDEFINITE_WAIT)==NO_ERROR)
  {
    pchTemp = apchNLSText[SSMODULE_NLSTEXT_PWDPROT_ASK_TITLE];
    if (pchTemp)
      WinSetWindowText(hwnd, pchTemp);

    pchTemp = apchNLSText[SSMODULE_NLSTEXT_PWDPROT_ASK_TEXT];
    if (pchTemp)
      WinSetDlgItemText(hwnd, ST_PLEASEENTERTHEPASSWORD, pchTemp);

    pchTemp = apchNLSText[SSMODULE_NLSTEXT_PWDPROT_ASK_OKBUTTON];
    if (pchTemp)
      WinSetDlgItemText(hwnd, PB_OK, pchTemp);

    pchTemp = apchNLSText[SSMODULE_NLSTEXT_PWDPROT_ASK_CANCELBUTTON];
    if (pchTemp)
      WinSetDlgItemText(hwnd, PB_CANCEL, pchTemp);

    DosReleaseMutexSem(hmtxUseNLSTextArray);
  }
}
Beispiel #8
0
void UpdateModemOutputStatusDlg(HWND hwnd)
  {
  char szState[4];
  BYTE byOutputSignals;

  if (GetModemOutputSignals(&stIOctl,hCom,&byOutputSignals) != NO_ERROR)
    {
    WinPostMsg(hwndStatAll,UM_KILL_MONITOR,(MPARAM)0L,(MPARAM)0L);
    WinPostMsg(hwndStatDev,UM_KILL_MONITOR,(MPARAM)0L,(MPARAM)0L);
    }
  else
    {
    if (byOutputSignals & 0x01)
      strcpy(szState,szOn);
    else
      strcpy(szState,szOff);
    WinSetDlgItemText(hwnd,HWS_DTR,szState);

    if (byOutputSignals & 0x02)
      strcpy(szState,szOn);
    else
      strcpy(szState,szOff);
    WinSetDlgItemText(hwnd,HWS_RTS,szState);
    }
  }
Beispiel #9
0
static MRESULT APIENTRY OK ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ) {

 /***************************************************************************
  * Find the instance data.                                                 *
  ***************************************************************************/

  PPROFILE_PARMS Parms = PPROFILE_PARMS ( WinQueryWindowPtr ( hwnd, QWL_USER ) ) ;

 /***************************************************************************
  * Verify the entered path.                                                *
  ***************************************************************************/

  BYTE Name [256] ;
  WinQueryDlgItemText ( hwnd, Parms->id+ENTRY, sizeof(Name), Name ) ;

  BYTE FullPath [256] ;
  if ( DosQueryPathInfo ( Name, FIL_QUERYFULLNAME, FullPath, sizeof(FullPath) ) ) {
    PSZ Message = PSZ ( "ERROR: Not a valid path." ) ;
    WinSetDlgItemText ( hwnd, Parms->id+ERR, Message ) ;
    WinAlarm ( HWND_DESKTOP, WA_ERROR ) ;
    WinSetFocus ( HWND_DESKTOP, WinWindowFromID ( hwnd, Parms->id+ENTRY ) ) ;
    return ( 0 ) ;
  }

  FILESTATUS3 Status ;
  if ( DosQueryPathInfo ( FullPath, FIL_STANDARD, &Status, sizeof(Status) ) ) {
    PSZ Message = PSZ ( "ERROR: Path does not exist." ) ;
    WinSetDlgItemText ( hwnd, Parms->id+ERR, Message ) ;
    WinAlarm ( HWND_DESKTOP, WA_ERROR ) ;
    WinSetFocus ( HWND_DESKTOP, WinWindowFromID ( hwnd, Parms->id+ENTRY ) ) ;
    return ( 0 ) ;
  }

  if ( ! ( Status.attrFile & FILE_DIRECTORY ) ) {
    PSZ Message = PSZ ( "ERROR: Specified path is not a directory." ) ;
    WinSetDlgItemText ( hwnd, Parms->id+ERR, Message ) ;
    WinAlarm ( HWND_DESKTOP, WA_ERROR ) ;
    WinSetFocus ( HWND_DESKTOP, WinWindowFromID ( hwnd, Parms->id+ENTRY ) ) ;
    return ( 0 ) ;
  }

 /***************************************************************************
  * Return the full path to the caller.                                     *
  ***************************************************************************/

  strncpy ( PCHAR(Parms->Path), PCHAR(FullPath), Parms->PathSize ) ;

 /***************************************************************************
  * Dismiss the dialog with a TRUE status.                                  *
  ***************************************************************************/

  WinDismissDlg ( hwnd, TRUE ) ;

  return ( 0 ) ;
}
Beispiel #10
0
void UpdateDeviceStatusDlg(HWND hwnd)
  {
  BYTE szStatus[10];
  WORD wEvent;
  WORD wStatus;
  BYTE byStatus;
  APIRET rc;

  if (GetCOMstatus(&stIOctl,hCom,&byStatus) != NO_ERROR)
    {
    WinPostMsg(hwndStatAll,UM_KILL_MONITOR,(MPARAM)0L,(MPARAM)0L);
    WinPostMsg(hwndStatDev,UM_KILL_MONITOR,(MPARAM)0L,(MPARAM)0L);
    }
  else
    {
    sprintf(szStatus,"%02X",byStatus);
    WinSetDlgItemText(hwnd,HWS_COMST,szStatus);
    }

  if ((rc = GetNoClearComEvent_ComError(hCom,&wEvent,&wStatus)) != NO_ERROR)
    {
    if ((rc = GetCOMevent(&stIOctl,hCom,&wEvent)) != NO_ERROR)
      rc = GetCOMerror(&stIOctl,hCom,&wStatus);
    }
  if (rc != NO_ERROR)
    {
    WinPostMsg(hwndStatAll,UM_KILL_MONITOR,(MPARAM)0L,(MPARAM)0L);
    WinPostMsg(hwndStatDev,UM_KILL_MONITOR,(MPARAM)0L,(MPARAM)0L);
    }
  else
    {
    sprintf(szStatus,"%04X",wStatus);
    WinSetDlgItemText(hwnd,HWS_COMERROR,szStatus);

    sprintf(szStatus,"%04X",wEvent);
    WinSetDlgItemText(hwnd,HWS_COMEVENT,szStatus);
    }

  if (GetXmitStatus(&stIOctl,hCom,&byStatus) != NO_ERROR)
    {
    WinPostMsg(hwndStatAll,UM_KILL_MONITOR,(MPARAM)0L,(MPARAM)0L);
    WinPostMsg(hwndStatDev,UM_KILL_MONITOR,(MPARAM)0L,(MPARAM)0L);
    }
  else
    {
    sprintf(szStatus,"%02X",byStatus);
    WinSetDlgItemText(hwnd,HWS_XMITST,szStatus);
    }
  }
Beispiel #11
0
static MRESULT APIENTRY InitDlg ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ) {

 /***************************************************************************
  * Get parameters from initialization message.                             *
  ***************************************************************************/

  PPROFILE_PARMS Parms = (PPROFILE_PARMS) ( PVOIDFROMMP ( mp2 ) ) ;

  WinSetWindowPtr ( hwnd, QWL_USER, Parms ) ;

 /***************************************************************************
  * Set the dialog help instance.                                           *
  ***************************************************************************/

  WinSetWindowUShort ( hwnd, QWS_ID, Parms->id ) ;
  if ( Parms->hwndHelp ) {
    WinAssociateHelpInstance ( Parms->hwndHelp, hwnd ) ;
  }

 /***************************************************************************
  * Set the entry field contents.                                           *
  ***************************************************************************/

  WinSetDlgItemText ( hwnd, Parms->id+ENTRY, Parms->Path ) ;

 /***************************************************************************
  * Return no error.                                                        *
  ***************************************************************************/

  return ( MRFROMSHORT ( FALSE ) ) ;
}
Beispiel #12
0
MRESULT EXPENTRY ShowHighDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
{
	CHAR i;
	switch( msg ){
		case WM_INITDLG:
			for( i = 0; i < 10; i++){
				WinSetDlgItemText( hwnd, ULONG(321 + i) , InfoData.GetHighName(i) );
				// item IDR_HIGHNAME1 ... IDR_HIGHNAME10
				WinSetDlgItemShort( hwnd, ULONG(331 + i), (USHORT)InfoData.GetHighScore(i),
										  FALSE);
				// item IDR_HIGHSCORE1 ... IDR_HIGHSCORE10
			}
			break;
		case WM_COMMAND:
			switch( SHORT1FROMMP( mp1 ) ){
				case DID_OK:
					WinDismissDlg( hwnd, TRUE );
					return (MRESULT)0; 
				case IDR_HIGHCLEAR:
					WinDismissDlg( hwnd, FALSE );
					return (MRESULT)0;
			}
	}
	return WinDefDlgProc( hwnd, msg, mp1, mp2 );
}
// *******************************************************************************
// FUNCTION:     SetEntryField
//
// FUNCTION USE: Set entry field text to field value.
//
// DESCRIPTION:  Convert value to a string, moving decimal point for
//               .01 inch to inch conversion, and set the text of the
//               entry field
//
// PARAMETERS:   HWND     dialog window handle
//               MPARAM   first message parameter
//               MPARAM   second message parameter
//
// RETURNS:      MRESULT  Reserved value of zero
//
// INTERNALS:    NONE
//
// *******************************************************************************
static void SetEntryField( HWND hwnd, ULONG cid, ULONG ulValue, ULONG ulUnits )
{
   char     szText[ 34 ];
   char     *pszTemp;

// --------------------------------------------------------------------------
// Convert the numeric value to a string
// --------------------------------------------------------------------------
   _ltoa( ulValue, szText, 10 );

   if (ulUnits == (ULONG)VSI_INCHES) {

// --------------------------------------------------------------------------
// inches units are actually hundredths - so put in the decimal point
// --------------------------------------------------------------------------
      pszTemp = &szText[ strlen(szText) + 1];
      *pszTemp = *(pszTemp-1);
      pszTemp--;
      *pszTemp = *(pszTemp-1);
      pszTemp--;
      *pszTemp = *(pszTemp-1);
      pszTemp--;
      *pszTemp = '.';
   } /* endif */

// --------------------------------------------------------------------------
// Set the entry field text
// --------------------------------------------------------------------------
   WinSetDlgItemText( hwnd, cid, szText );
}
/*---------------------------------------------------------------------------
                                FindWndProc
---------------------------------------------------------------------------*/
MRESULT EXPENTRY FindWndProc( HWND wnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
{
 MRESULT  MRes;
 HWND     entryfield;

   switch (msg) {
     case WM_INITDLG:
           PositionDialog( wnd );
           entryfield = WinWindowFromID( wnd, ID_FINDENTRY );
           WinSendMsg( entryfield, EM_SETTEXTLIMIT,
                       MPFROMSHORT( sizeof FindDat.text - 1 ), 0 );
           WinSetDlgItemText( wnd, ID_FINDENTRY, FindDat.text );
           WinSendMsg( entryfield, EM_SETSEL,
                       MPFROM2SHORT( 0, sizeof FindDat.text ), 0 );
           MRes = MRFROMSHORT( FALSE );
           break;
     case WM_CHAR:
        if (SHORT2FROMMP( mp2 ) == VK_NEWLINE) {
           WinQueryDlgItemText( wnd,
                                ID_FINDENTRY,
                                sizeof FindDat.text - 1,
                                FindDat.text );
           FindDat.sense = WinQueryButtonCheckstate( wnd, ID_FINDCHECK );
           WinDismissDlg( wnd, 0 );
        }
     default:
        MRes = WinDefDlgProc( wnd, msg, mp1, mp2 );
        break;
   }

  return MRes;
}
Beispiel #15
0
VOID CDialog::SetDlgItemText (int id, PSZ text)
{
#if defined(__OS2__)
   WinSetDlgItemText (m_hWnd, id, text);
#elif defined(__NT__)
   ::SetDlgItemText (m_hWnd, id, text);
#endif
}
void NextBarDlg::install2Dialog(PSZ FileName, BOOL bObject)
{
 CHAR    Buffer[260];
 PSZ     pszTemp;
 BOOL    Batch=FALSE;
 ULONG   AppType;

 Icon.setText("");
 Parms.setText("");

 if(bObject) {
   event->session = SSF_TYPE_WPSOBJECT;
   WinSetDlgItemText(hwnd, NHX_TITLE, FileName);
   WinSetDlgItemText(hwnd, NHX_PROG, FileName); }
 else {
   DosQueryAppType(FileName, &AppType);
   event->session = SSF_TYPE_DEFAULT;
   if ((AppType & 0x7) == FAPPTYP_WINDOWAPI)
      event->session = SSF_TYPE_PM;
   else if ((AppType & 0x7) == FAPPTYP_WINDOWCOMPAT)
      event->session = SSF_TYPE_WINDOWABLEVIO;
   else if (AppType & FAPPTYP_DOS)
      event->session = SSF_TYPE_WINDOWEDVDM;
   else if (AppType & FAPPTYP_WINDOWSREAL)
      event->session = PROG_WINDOW_REAL;
   else if (AppType & FAPPTYP_WINDOWSPROT)
      event->session = PROG_WINDOW_PROT;
   else if (AppType & FAPPTYP_WINDOWSPROT31)
      event->session = PROG_31_ENH; }

 if(!bObject) {
   if(strstr(FileName, ".CMD")) {
     Batch = TRUE;
     event->session = SSF_TYPE_WINDOWABLEVIO;
     if(strchr(FileName, ' ')) {
       strcpy(Buffer, "/c \"\"");
       strcat(Buffer, FileName);
       strcat(Buffer, "\"\""); }
     else {
       strcpy(Buffer, "/c ");
       strcat(Buffer, FileName); }}
   else if(strstr(FileName, ".BAT")) {
     Batch = TRUE;
     event->session = SSF_TYPE_WINDOWEDVDM;
     strcpy(Buffer, "/c ");
     strcat(Buffer, FileName); }
   if (Batch) {
     WinSetDlgItemText(hwnd, NHX_PARMS, Buffer);
     WinSetDlgItemText(hwnd, NHX_PROG, ""); }
   else
     WinSetDlgItemText(hwnd, NHX_PROG, FileName);
   strcpy(Buffer, FileName);
   pszTemp = FileName+strlen(FileName);
   for( ; (*pszTemp!='\\') && (pszTemp>=FileName); pszTemp--);
   WinSetDlgItemText(hwnd, NHX_TITLE, (pszTemp+1));
   *pszTemp='\0';
   WinSetDlgItemText(hwnd, NHX_WORKDIR, FileName); }

 setButtons();
}
VOID FormatNumberField (HWND hWnd, USHORT usCtlID, ULONG ulNumber)
{
    CHAR  szNumber[13];

    sprintf (szNumber, "%12lu", ulNumber);

    WinSetDlgItemText (hWnd, usCtlID, szNumber);

    return;
}
static INT DisplayTimedMsg (HAB hab,
    HWND hwndDlg, PSZ pszMsg, LONG lSeconds)
{
    WinSetDlgItemText (hwndDlg, IDST_STATUSMESSAGES, pszMsg);

    // Start a timer for message
    WinStartTimer (hab, hwndDlg, IDTIMER_DISPLAYTIMEDMSG, lSeconds * 1000);

    return 0;
}
VOID SetGeneralDefault(HWND hwnd, PPREF_GEN pgen) {
   WinCheckButton(hwnd, CBOX_NOLOGO, FALSE);
   WinCheckButton(hwnd, CBOX_BUBBLE, TRUE);
   WinCheckButton(hwnd, CBOX_DEF_LEN, TRUE);
   DlgSpinSetValue(hwnd, SPIN_SUBJ_LEN, 40);
   WinEnableControl(hwnd, SPIN_SUBJ_LEN, FALSE);
   WinCheckButton(hwnd, CBOX_READ_ONLY, FALSE);
   WinCheckButton(hwnd, CBOX_SV_LASTPATH, FALSE);
   WinSetDlgItemText(hwnd, TXT_FONT, "5.System VIO");
}
void NextBarDlg::handleButtons(MPARAM mp1)
{
 if(SHORT2FROMMP(mp1) == BN_CLICKED)
   switch(SHORT1FROMMP(mp1))
    {
     case NHX_DOS_FULL:
     case NHX_DOS_WIN:
       OCL::enableControls(hwnd, WPSOControls, sizeof(WPSOControls));
       OCL::enableControls(hwnd, usChild2DOS, sizeof(usChild2DOS));
       OCL::disableControls(hwnd, usChild2WINOS2,sizeof(usChild2WINOS2));
       WinCheckButton(hwnd, NHX_WINSTD, FALSE);
       WinCheckButton(hwnd, NHX_WINENH, FALSE);
       break;

     case NHX_OS2_FULL:
     case NHX_OS2_WIN:
     case NHX_PM:
       OCL::enableControls(hwnd, WPSOControls, sizeof(WPSOControls));
       OCL::hideControls(hwnd, usChild2DOS, sizeof(usChild2DOS));
       OCL::disableControls(hwnd, usChild2WINOS2, sizeof(usChild2WINOS2));
       WinCheckButton(hwnd, NHX_WINSTD, FALSE);
       WinCheckButton(hwnd, NHX_WINENH, FALSE);
       break;

    case NHX_WPSO:
       OCL::hideControls(hwnd, WPSOControls, sizeof(WPSOControls));
       OCL::hideControls(hwnd, usChild2DOS, sizeof(usChild2DOS));
       OCL::disableControls(hwnd, usChild2WINOS2, sizeof(usChild2WINOS2));
       WinSetDlgItemText(hwnd, NHX_WORKDIR, "");
       WinSetDlgItemText(hwnd, NHX_PARMS, "");
       WinCheckButton(hwnd, NHX_WINSTD, FALSE);
       WinCheckButton(hwnd, NHX_WINENH, FALSE);
       break;

    case NHX_SEAMLESS:
       OCL::enableControls(hwnd, usChild2DOS, sizeof(usChild2DOS));
       OCL::enableControls(hwnd, WPSOControls, sizeof(WPSOControls));
       OCL::enableControls(hwnd, usChild2WINOS2, sizeof(usChild2WINOS2));
       break;
    }
 return;
}
Beispiel #21
0
void UpdateBufferStatusDlg(HWND hwnd)
  {
  WORD wByteCount;
  WORD wQueueLength;
  ULONG ulQueueLength;
  ULONG ulTemp;
  char szSize[10];

  if (GetTransmitQueueLen(&stIOctl,hCom,&wQueueLength,&wByteCount) != NO_ERROR)
    {
    WinPostMsg(hwndStatAll,UM_KILL_MONITOR,(MPARAM)0L,(MPARAM)0L);
    WinPostMsg(hwndStatDev,UM_KILL_MONITOR,(MPARAM)0L,(MPARAM)0L);
    }
  else
    {
    ulTemp = (ULONG)wByteCount * 100;
    ulTemp /= (ULONG)wQueueLength;
    ltoa(ulTemp,szSize,10);
    WinSetDlgItemText(hwnd,HWS_XMITBUFLEV,szSize);
    ltoa((LONG)wByteCount,szSize,10);
    WinSetDlgItemText(hwnd,HWS_XMITBUFLEN,szSize);
    }
  if (GetReceiveQueueLen(&stIOctl,hCom,&wQueueLength,&wByteCount) != NO_ERROR)
    {
    WinPostMsg(hwndStatAll,UM_KILL_MONITOR,(MPARAM)0L,(MPARAM)0L);
    WinPostMsg(hwndStatDev,UM_KILL_MONITOR,(MPARAM)0L,(MPARAM)0L);
    }
  else
    {
    if (wQueueLength == 0)
      ulQueueLength = 0x10000;
    else
      ulQueueLength = (ULONG)wQueueLength;
    ulTemp = (ULONG)wByteCount * 100;
    ulTemp /= ulQueueLength;
    ltoa(ulTemp,szSize,10);
    WinSetDlgItemText(hwnd,HWS_RCVBUFLEV,szSize);
    ltoa((LONG)wByteCount,szSize,10);
    WinSetDlgItemText(hwnd,HWS_RCVBUFLEN,szSize);
    }
  }
Beispiel #22
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;
}
static void internal_SetConfigDialogText(HWND hwnd, char *pchHomeDirectory) {
	FILE *hfNLSFile;
	char achTemp[128];

	if (!pchHomeDirectory) return;
	hfNLSFile = internal_OpenNLSFile(pchHomeDirectory);
	if (hfNLSFile) {
		// Window title
		if (sprintmsg(achTemp, hfNLSFile, "CFG_0001")) WinSetWindowText(hwnd, achTemp);

		// Label for the moving text label
		if (sprintmsg(achTemp, hfNLSFile, "CFG_0002")) WinSetDlgItemText(hwnd, ST_TEXT, achTemp);

		// OK button
		if (sprintmsg(achTemp, hfNLSFile, "CFG_0003")) WinSetDlgItemText(hwnd, PB_CONFOK, achTemp);
		// Cancel button
		if (sprintmsg(achTemp, hfNLSFile, "CFG_0004")) WinSetDlgItemText(hwnd, PB_CONFCANCEL, achTemp);

		internal_CloseNLSFile(hfNLSFile);
	}
}
Beispiel #24
0
void cbXPIProgress(const char* msg, PRInt32 val, PRInt32 max)
{
  char szBuf[MAX_BUF];

  if(sgProduct.ulMode != SILENT)
  {
    TruncateString(WinWindowFromID(dlgInfo.hWndDlg, IDC_STATUS3), msg, szBuf, sizeof(szBuf));
    WinSetDlgItemText(dlgInfo.hWndDlg, IDC_STATUS3, szBuf);
  }

  ProcessWindowsMessages();
}
static void internal_SetWrongPwdWindowText(HWND hwnd)
{
  char *pchTemp;

  // Set new window texts!
  if (DosRequestMutexSem(hmtxUseNLSTextArray, SEM_INDEFINITE_WAIT)==NO_ERROR)
  {
    pchTemp = apchNLSText[SSMODULE_NLSTEXT_PWDPROT_WRONG_TITLE];
    if (pchTemp)
      WinSetWindowText(hwnd, pchTemp);

    pchTemp = apchNLSText[SSMODULE_NLSTEXT_PWDPROT_WRONG_TEXT];
    if (pchTemp)
      WinSetDlgItemText(hwnd, ST_INVALIDPASSWORDTEXT, pchTemp);

    pchTemp = apchNLSText[SSMODULE_NLSTEXT_PWDPROT_WRONG_OKBUTTON];
    if (pchTemp)
      WinSetDlgItemText(hwnd, DID_OK, pchTemp);

    DosReleaseMutexSem(hmtxUseNLSTextArray);
  }
}
Beispiel #26
0
/**************************************************************************
*
* FUNCTION NAME: ProcessProdInfoDialog
*
* DESCRIPTION:
*
*
* INPUT PARAMETERS:
*     None.
*
* OUTPUT PARAMETERS:
*     None.
*
**************************************************************************/
MRESULT EXPENTRY ProcessProdInfoDialog (HWND hwnd, 
                                        ULONG msg,
                                        MPARAM mp1, 
                                        MPARAM mp2)
{
   switch (msg)
   {
		case WM_INITDLG:
			CenterDialog (hwnd);
			if (gfRegistered)
			{
				WinSetDlgItemText (hwnd, PROD_REG_NAME_ID, gszRegName);
			}
			else
			{
				WinSetDlgItemText (hwnd, PROD_REG_TO_ID, "Unregistered");
				WinSetDlgItemText (hwnd, PROD_REG_NAME_ID, "Please register the game.");
			}
         return (0);

      case WM_COMMAND :
         switch (SHORT1FROMMP (mp1))
         {
            case DID_OK:
               WinDismissDlg (hwnd, DID_OK);
               return (0);

            default:
               break;
         }
			break;

      default:
		   break;
   }

   return (WinDefDlgProc (hwnd, msg, mp1, mp2));
}
Beispiel #27
0
static VOID _ShowTextField(HWND hDlg)

{
    CHAR HlpStr[CCHMAXPATH], ShowStr[81], *pStr;

    strcpy(HlpStr, TfText);
    strupr(HlpStr);
    if ((pStr = strrchr(HlpStr, '\\')) != NULL)
	pStr[0] = '\0';

    if (strlen(HlpStr) == 2)
	strcat(HlpStr, "\\");

    if (strlen(HlpStr) > 35)
    {
	CompressFilePath(HlpStr, ShowStr);
	WinSetDlgItemText(hDlg, TID_CD_PATH, ShowStr);
    }
    else
	WinSetDlgItemText(hDlg, TID_CD_PATH, HlpStr);

    return;
}
/****************************************************************\
 *
 *--------------------------------------------------------------
 *
 *  Name:     SetAlarmField
 *
 *  Purpose:
 *
 *
 *
 *  Usage:
 *
 *  Method:
 *          -
 *
 *          -
 *          -
 *
 *          -
 *          -
 *
 *  Returns:
 *          1 - if successful execution completed
 *          0 - if error
\****************************************************************/
VOID SetAlarmField(HWND hwnd,UCHAR uchHours,UCHAR uchMinutes)
{
   UCHAR achHourMinutes[6];

   if (bTwelveHourFormat)
   {
      if (uchHours >= 12)
      {
         uchHours -= 12;
         WinSendDlgItemMsg(hwnd,
                           RB_PM,
                           BM_SETCHECK,
                           MPFROMLONG(1),
                           MPVOID);
        if (uchHours == 0)
           uchHours = 12;
      }
      else
      {
         if (uchHours == 0)
            uchHours = 12;
         WinSendDlgItemMsg(hwnd,
                           RB_AM,
                           BM_SETCHECK,
                           MPFROMLONG(1),
                           MPVOID);
      }
   }
   else
   {
       WinShowWindow(WinWindowFromID(hwnd,RB_PM),FALSE);
       WinShowWindow(WinWindowFromID(hwnd,RB_AM),FALSE);
   }
   _itoa(uchHours, achHourMinutes,10);
   _itoa(uchMinutes, &achHourMinutes[3],10);
   achHourMinutes[2] = szTimeSep[0];
   if (achHourMinutes[1] == 0)
   {
      achHourMinutes[1] = achHourMinutes[0];
      achHourMinutes[0] = ' ';
   }
   if (achHourMinutes[4] == 0)
   {
      achHourMinutes[4] = achHourMinutes[3];
      achHourMinutes[3] = '0';
   }
   WinSetDlgItemText(hwnd, IDC_HOURMINUTES, achHourMinutes);
}
Beispiel #29
0
static VOID initDlg(HWND hwnd) {
   CHAR buf[1024];
   PSZ pszText, p;
   INT i, j, k;
   for (i = 0; i < 1022; ++i) {
      buf[i] = i % 64 + '!';
      if (i && !(i % 7)) buf[++i] = ' ';
   } /* endfor */
   buf[i] = 0;
   WinSetDlgItemText(hwnd, RI_DTMLE, buf);
   hwnd = WinWindowFromID(hwnd, RI_DTLBOX);
   for (i = 0; i < 64; ++i) {
      sprintf(buf, "listbox item % 4d", i + 1);
      WinInsertLboxItem(hwnd, i, buf);
   } /* endfor */
}
VOID FillDirListBox (HWND hwnd, CHAR *pcCurrentPath)
     {
     static CHAR  szDrive [] = "  :" ;
     FILEFINDBUF3 findbuf ;
     HDIR         hDir = HDIR_CREATE ;
     SHORT        sDrive ;
     ULONG        ulDriveNum, ulDriveMap, ulCurPathLen,
                  ulReturn, ulSearchCount = 1 ;

     DosQueryCurrentDisk (&ulDriveNum, &ulDriveMap) ;
     pcCurrentPath [0] = (CHAR) ulDriveNum + '@' ;
     pcCurrentPath [1] = ':' ;
     pcCurrentPath [2] = '\\' ;

     ulCurPathLen = CCHMAXPATH ;
     DosQueryCurrentDir (0, pcCurrentPath + 3, &ulCurPathLen) ;

     WinSetDlgItemText (hwnd, IDD_PATH, pcCurrentPath) ;
     WinSendDlgItemMsg (hwnd, IDD_DIRLIST, LM_DELETEALL, NULL, NULL) ;

     for (sDrive = 0 ; sDrive < 26 ; sDrive++)
          if (ulDriveMap & 1L << sDrive)
               {
               szDrive [1] = (CHAR) sDrive + 'A' ;

               WinSendDlgItemMsg (hwnd, IDD_DIRLIST, LM_INSERTITEM,
                                  MPFROM2SHORT (LIT_END, 0),
                                  MPFROMP (szDrive)) ;
               }

     ulReturn = DosFindFirst ("*.*", &hDir, FILE_DIRECTORY, &findbuf,
                              sizeof findbuf, &ulSearchCount, FIL_STANDARD) ;
     while (!ulReturn)
          {
          if (findbuf.attrFile & 0x0010 &&
                    (findbuf.achName [0] != '.' || findbuf.achName [1]))
               
               WinSendDlgItemMsg (hwnd, IDD_DIRLIST, LM_INSERTITEM,
                                  MPFROM2SHORT (LIT_SORTASCENDING, 0),
                                  MPFROMP (findbuf.achName)) ;

          ulReturn = DosFindNext (hDir, &findbuf, sizeof findbuf,
                                  &ulSearchCount) ;
          }

     DosFindClose (hDir) ;
     }