Exemplo n.º 1
0
HBRUSH WdeCtl3dCtlColorEx( UINT msg, WPARAM wp, LPARAM lp )
{
#if !defined(WDE_USE_3D)
    _wde_touch(msg);
    _wde_touch(wp);
    _wde_touch(lp);
    return( (HBRUSH)NULL );
#else
    return( WRCtl3dCtlColorEx( msg, wp, lp ) );
#endif
}
Exemplo n.º 2
0
LONG WdeCtl3dDlgFramePaint( HWND win, UINT msg, WPARAM wp, LPARAM lp )
{
#if !defined(WDE_USE_3D)
    _wde_touch(win);
    _wde_touch(msg);
    _wde_touch(wp);
    _wde_touch(lp);
    return( 0 );
#else
    return( WRCtl3dDlgFramePaint( win, msg, wp, lp ) );
#endif
}
Exemplo n.º 3
0
void WdeCtl3dSubclassDlg ( HWND win, WORD w )
{
#if !defined(WDE_USE_3D)
    _wde_touch(win);
    _wde_touch(w);
#else
    if( CorrectVersion ) {
        WRCtl3dSubclassDlgEx( win, w );
    } else {
        WRCtl3dSubclassDlg( win, w );
    }
#endif
}
Exemplo n.º 4
0
BOOL WdeStatusHookProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
    /* touch unused vars to get rid of warning */
    _wde_touch( hWnd );
    _wde_touch( wParam );
    _wde_touch( lParam );

    if( msg == WM_DESTROY ) {
        WdeStatusWindow = NULL;
    }

    return( FALSE );
}
Exemplo n.º 5
0
Bool WdeIsBorBtnIDSupported( uint_16 id )
{
    /* touch unused vars to get rid of warning */
    _wde_touch( id );

    return( FALSE );
}
Exemplo n.º 6
0
void WdeCtl3DFini ( HINSTANCE inst )
{
#if !defined(WDE_USE_3D)
    _wde_touch(inst);
#else
    WRCtl3dUnregister ( inst );
#endif
}
Exemplo n.º 7
0
void WdeCtl3dSubclassCtl( HWND win )
{
#if !defined(WDE_USE_3D)
    _wde_touch(win);
#else
    WRCtl3dSubclassCtl( win );
#endif
}
Exemplo n.º 8
0
WINEXPORT bool CALLBACK WdeSetControlEnumProc( HWND win, LPARAM ret )
{
    /* touch unused var to get rid of warning */
    _wde_touch( ret );

    WdeSetDefaultTestControlEntries( win );

    return( TRUE );
}
Exemplo n.º 9
0
INT_PTR CALLBACK WdeOptionsDlgProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
{
    bool ret;

    /* touch unused vars to get rid of warning */
    _wde_touch( lParam );

    ret = false;

    switch( message ) {
    case WM_SYSCOLORCHANGE:
        WdeCtl3dColorChange();
        break;

    case WM_INITDIALOG:
        WdeOptWin = hDlg;
        WdeSetOptInfo( hDlg, &WdeCurrentState );
        ret = true;
        break;

    case WM_DESTROY:
        WdeOptWin = NULL;
        break;

    case WM_COMMAND:
        switch( LOWORD( wParam ) ) {
        case IDB_HELP:
            WdeHelpRoutine();
            break;

        case IDOK:
            WdeGetOptInfo( hDlg );
            EndDialog( hDlg, TRUE );
            ret = true;
            break;

        case IDCANCEL:
            EndDialog( hDlg, FALSE );
            ret = true;
            break;

#if 0
        case IDB_OPT_SETDEFS:
            WdeSetOptInfo( hDlg, &WdeDefaultState );
            break;
#endif

        }
    }

    return( ret );
}
Exemplo n.º 10
0
WINEXPORT UINT CALLBACK WdeOpenHookProc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
{
    char    *title;

    _wde_touch( wparam );
    _wde_touch( lparam );

    switch( msg ) {
    case WM_INITDIALOG:
        // We must call this to subclass the directory listbox even
        // if the app calls Ctl3dAutoSubclass (commdlg bug)
        // WdeCtl3dSubclassDlgAll( hwnd );
        title = WdeAllocRCString( WDE_GETFNCOMBOTITLE );
        if( title != NULL ) {
            SendDlgItemMessage( hwnd, stc2, WM_SETTEXT, 0, (LPARAM)title );
            WdeFreeRCString( title );
        }
        return( TRUE );
    }

    return( FALSE );
}
Exemplo n.º 11
0
BOOL WdeRibbonHook( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
    bool         ret;

    _wde_touch( hwnd );
    _wde_touch( wParam );
    _wde_touch( lParam );

    if( WdeRibbon == NULL ) {
        return( FALSE );
    }

    ret = FALSE;

    switch( msg ) {
    case WM_DESTROY:
        WdeCloseToolBar ( WdeRibbon );
        WdeRibbon = NULL;
        break;
    }

    return( ret );
}
Exemplo n.º 12
0
Bool WdeSetStatusText( const char *status1, const char *status2, int redisplay )
{
    int len;
    int pos;

    /* touch unused vars to get rid of warning */
    _wde_touch( redisplay );

    if( WdeStatusWindow == NULL ) {
        return( TRUE );
    }

    if( status1 != NULL ) {
        len = min( strlen( status1 ), MAX_STATUS_TEXT );
        if( len != 0 ) {
            memcpy( WdeStatusText, status1, len );
            pos = len;
        } else {
            WdeStatusText[0] = ' ';
            pos = 1;
        }
    } else {
        pos = 0;
    }

    if( status2 != NULL ) {
        WdeStatusText[pos++] = STATUS_ESC_CHAR;
        WdeStatusText[pos++] = STATUS_NEXT_BLOCK;
        len = min( strlen( status2 ), MAX_STATUS_TEXT );
        if( len != 0 ) {
            memcpy( WdeStatusText + pos, status2, len );
            WdeStatusText[pos + len] = '\0';
        } else {
            WdeStatusText[pos++] = ' ';
            WdeStatusText[pos] = '\0';
        }
    } else {
        WdeStatusText[pos++] = '\0';
    }

    if( status1 != NULL || status2 != NULL ) {
        return( WdeDisplayStatusText( WdeStatusText ) );
    }

    return( TRUE );
}
Exemplo n.º 13
0
static void WdeActivateResourceWindow( WdeResInfo *res_info, WPARAM wParam, LPARAM lParam )
{
    WdeResInfo  *info;
    OBJPTR      current_obj;
    bool        fActivate;
    HWND        hwndDeact;
    int         id;

    _wde_touch( wParam );

    if( res_info == NULL ) {
        return;
    }

    fActivate = GET_WM_MDIACTIVATE_FACTIVATE( res_info->res_win, wParam, lParam );

    hwndDeact = GET_WM_MDIACTIVATE_HWNDDEACTIVATE( wParam, lParam );

    res_info->active = fActivate;

    if( fActivate ) {
        WdeSetCurrentRes( res_info );
        info = WdeResInfoFromWin( hwndDeact );
        if( info != NULL ) {
            info->active = FALSE;
        }
    }

    if( res_info->editting ) {
        InitState( res_info->forms_win );
        id = WdeGetCToolID();
        WdeSetBaseObject( id );
        if( fActivate ) {
            current_obj = GetCurrObject();
            if( current_obj != NULL ) {
                Notify( current_obj, PRIMARY_OBJECT, NULL );
            }
        }
    }
}
Exemplo n.º 14
0
Bool WdeCtl3DInit ( HINSTANCE inst )
{
#if !defined(WDE_USE_3D)
    _wde_touch(inst);
    return ( TRUE );
#else
    WORD        ver;
    Bool        ok;

    ver = WRCtl3dGetVer();
    if( ver >= CTL3D_VER ) {
        CorrectVersion = TRUE;
    }

    ok = WRCtl3dRegister ( inst );
    if ( ok ) {
        ok = WRCtl3dAutoSubclass ( inst );
    }

    return ( ok );
#endif
}
Exemplo n.º 15
0
bool WdeDDEStart( HINSTANCE inst )
{
    WORD        ret;
    DWORD       flags;

    _wde_touch( inst ); /* MakeProcInstance vanishes in NT */

    if( IdInst != 0 ) {
        return( FALSE );
    }

    WdeDataClipbdFormat = RegisterClipboardFormat( WR_CLIPBD_DIALOG );
    if( WdeDataClipbdFormat == 0 ) {
        return( FALSE );
    }

    DdeProc = MakeProcInstance( (FARPROC)DdeCallBack, inst );
    if( DdeProc == (FARPROC)NULL ) {
        return( FALSE );
    }

    flags = APPCLASS_STANDARD | APPCMD_FILTERINITS |
            CBF_FAIL_ADVISES | CBF_FAIL_SELFCONNECTIONS |
            CBF_SKIP_REGISTRATIONS | CBF_SKIP_UNREGISTRATIONS;

    ret = DdeInitialize( &IdInst, (PFNCALLBACK)DdeProc, flags, 0 );
    if( ret != DMLERR_NO_ERROR ) {
        return( FALSE );
    }

    hDialogService = DdeCreateStringHandle( IdInst, WDE_SERVICE_NAME, CP_WINANSI );
    if( hDialogService == (HSZ)NULL ) {
        return( FALSE );
    }

    hDialogTopic = DdeCreateStringHandle( IdInst, WDE_DIALOG_TOPIC, CP_WINANSI );
    if( hDialogTopic == (HSZ)NULL ) {
        return( FALSE );
    }

    hFileItem = DdeCreateStringHandle( IdInst, WRE_FILE_ITEM, CP_WINANSI );
    if( hFileItem == (HSZ)NULL ) {
        return( FALSE );
    }

    hIs32BitItem = DdeCreateStringHandle( IdInst, WRE_32BIT_ITEM, CP_WINANSI );
    if( hIs32BitItem == (HSZ)NULL ) {
        return( FALSE );
    }

    hNameItem = DdeCreateStringHandle( IdInst, WRE_NAME_ITEM, CP_WINANSI );
    if( hNameItem == (HSZ)NULL ) {
        return( FALSE );
    }

    hDataItem = DdeCreateStringHandle( IdInst, WRE_DATA_ITEM, CP_WINANSI );
    if( hDataItem == (HSZ)NULL ) {
        return( FALSE );
    }

    DdeNameService( IdInst, hDialogService, (HSZ)NULL, DNS_REGISTER );

    return( TRUE );
}
Exemplo n.º 16
0
WINEXPORT BOOL CALLBACK WdeInfoWndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam )
{
    WORD    w;
    RECT    r;
    HDC     dc;

    _wde_touch( lParam );

    switch( message ) {
#if defined( __NT__ )
    case WM_INITDIALOG:
        SetWindowLong( hWnd, GWL_STYLE, WS_CHILD );
        break;
#endif
    case WM_SYSCOLORCHANGE:
#if defined( __NT__ )
        WdeInfoColor = GetSysColor( COLOR_BTNFACE );
        DeleteObject( WdeInfoBrush );
        WdeInfoBrush = CreateSolidBrush( WdeInfoColor );
#endif
        WdeCtl3dColorChange ();
        break;

#ifdef __NT__
    case WM_CTLCOLORBTN:
    case WM_CTLCOLORSTATIC:
        dc = (HDC)wParam;
        SetBkColor( dc, WdeInfoColor );
        return( WdeInfoBrush != NULL );

    case WM_CTLCOLORMSGBOX:
    case WM_CTLCOLOREDIT:
        break;
#else
    case WM_CTLCOLOR:
        w = HIWORD( lParam );
        if( w != CTLCOLOR_MSGBOX && w != CTLCOLOR_EDIT ) {
            dc = (HDC)wParam;
            SetBkColor( dc, WdeInfoColor );
            return( WdeInfoBrush != NULL );
        }
        break;
#endif

    case WM_ERASEBKGND:
#if defined( __NT__ )
        if( WdeInfoColor != GetSysColor( COLOR_BTNFACE ) ) {
            /* Fake it, this proc does not get it ... */
            SendMessage( hWnd, WM_SYSCOLORCHANGE, (WPARAM)0, (LPARAM)0 );
        }
#endif
        GetClientRect( hWnd, &r );
        UnrealizeObject( WdeInfoBrush );
        FillRect( (HDC)wParam, &r, WdeInfoBrush );
        return( TRUE );

    case WM_COMMAND:
        w = GET_WM_COMMAND_CMD( wParam, lParam );
        switch( LOWORD( wParam ) ) {
        case IDB_INFO_IDSTR:
            if( w == CBN_EDITCHANGE || w == CBN_SELCHANGE ) {
                WdeInfoLookupComboEntry( hWnd, w );
            }
            break;

        case IDB_INFO_SET:
            WdeChangeInfo();
            SetFocus( WdeGetMainWindowHandle() );
            break;

        case IDB_INFO_RESET:
            WdeResetInfo();
            break;

        case IDCANCEL:
            WdeResetInfo();
            SetFocus( WdeGetMainWindowHandle() );
            break;
        }
        break;
    }
    return( FALSE );
}
Exemplo n.º 17
0
int PASCAL WinMain( HINSTANCE hinstCurrent, HINSTANCE hinstPrevious,
                    LPSTR lpszCmdLine,  int nCmdShow )
{
    MSG         msg;
#ifndef __NT__
#if 0
    HWND        win;
    HWND        child;
#endif
#endif

    /* touch unused vars to get rid of warning */
    _wde_touch( lpszCmdLine );
    _wde_touch( nCmdShow );
#ifdef __NT__
    _wde_touch( hinstPrevious );
#endif
#if defined( __NT__ ) && !defined( __WATCOMC__ )
    _argc = __argc;
    _argv = __argv;
#endif

    WRInit();
    WdeInitDisplayError( hinstCurrent );

    /* store the handle to this instance of Wde in a static variable */
    hInstWde = hinstCurrent;

    //check we are running in DDE mode
    IsDDE = WdeIsDDEArgs( _argv, _argc );

    WdeFirstInst = (hinstPrevious == NULL);

    WdeInitEditClass();

    /* is this the first instance of the application? */
#ifndef __NT__
    if( WdeFirstInst ) {
#endif
        /* if so call the routine to initialize the application */
        if( !WdeInit( hinstCurrent ) ) {
            if( IsDDE ) {
                WdeDDEDumpConversation( hinstCurrent );
            }
            return( FALSE );
        }
#ifndef __NT__
    }
#if 0
    else if( IsDDE ) {
        WdeDisplayErrorMsg( WDE_NOMULTIPLEINSTANCES );
        WdeDDEDumpConversation( hinstCurrent );
        return( FALSE );
    } else {
        win = FindWindow( WdeMainClass, NULL );
        if( win != NULL ) {
            child = GetLastActivePopup( win );
            PostMessage( win, WM_USER, 0, 0 );
            BringWindowToTop( win );
            if( child != (HWND)NULL && child != win ) {
                BringWindowToTop( child );
            }
        } else {
            WdeDisplayErrorMsg( WDE_NOMULTIPLEINSTANCES );
        }
        return( FALSE );
    }
#endif
#endif

    if( !WdeInitInst( hinstCurrent ) ) {
        WdeDisplayErrorMsg( WDE_INITFAILED );
        if( IsDDE ) {
            WdeDDEDumpConversation( hinstCurrent );
        }
        return( FALSE );
    }

    if( IsDDE ) {
        if( WdeDDEStart( hinstCurrent ) ) {
            if( !WdeDDEStartConversation() ) {
                WdeDisplayErrorMsg( WDE_DDEINITFAILED );
                PostMessage( hWinWdeMain, WDE_FATAL_EXIT, 0, 0 );
            }
        } else {
            WdeDisplayErrorMsg( WDE_DDEINITFAILED );
            PostMessage( hWinWdeMain, WDE_FATAL_EXIT, 0, 0 );
        }
    }

    WdeEnableMenuInput( TRUE );

    if( setjmp( WdeEnv ) ) {
        PostMessage( hWinWdeMain, WDE_FATAL_EXIT, 0, 0 );
        if( setjmp( WdeEnv ) ) {
            WdeDisplayErrorMsg( WDE_EXCEPTIONDURINGABNORMALEXIT );
            exit( -1 );
        }
        WdePushEnv( &WdeEnv );
    } else {
        WdePushEnv( &WdeEnv );
        WdeProcessArgs( _argv, _argc );
    }

    if( !WdeGetNumRes() ) {
        WdeCreateNewResource( NULL );
    }

    /* create the message loop */
    while( GetMessage( &msg, (HWND)NULL, 0, 0 ) ) {
        if( !WdeIsTestMessage( &msg ) && !WdeIsInfoMessage( &msg ) &&
            !WRIsWRDialogMsg( &msg ) ) {
            if( !WdeWasAcceleratorHandled( &msg ) ) {
                TranslateMessage( &msg );
                DispatchMessage( &msg );
            }
        }
    }

    if( IsDDE ) {
        WdeDDEEndConversation();
    }

    WdePopEnv( &WdeEnv );

    if( IsDDE ) {
        WdeDDEEnd();
    }

    WRFini();

    return( msg.wParam );
}
Exemplo n.º 18
0
BOOL WdeLoadBorCustomControls ( WdeCustLib *lib )
{
    WdeListClassesProc   list_proc;
    HGLOBAL              list_global;
    uint_8              *list_locked;
    uint_16              num_classes;
    WdeBorlandClassList *class_list;
    uint_32              class_list_size;

    /* touch unused var to get rid of warning */
    _wde_touch( lib );

    list_proc = (WdeListClassesProc) GetProcAddress(lib->inst, "ListClasses");

    if ( list_proc == NULL ) {
        if ( WdeQueryAssumeMS () ) {
            lib->ms_lib = TRUE;
            return ( WdeLoadMSCustomControls ( lib ) );
        } else {
            WdeWriteTrail("WdeLoadBorCustomControls: User aborted load!");
            return ( FALSE );
        }
    }

    if ( WdeCustLOADRESInst == NULL ) {
        WdeCustLOADRESInst = MakeProcInstance ( (FARPROC) WdeCustLOADRES,
                                                WdeGetAppInstance() );
    }

    if ( WdeCustEDITRESInst == NULL ) {
        WdeCustEDITRESInst = MakeProcInstance ( (FARPROC) WdeCustEDITRES,
                                                WdeGetAppInstance() );
    }

#if 0
    list_global = (*list_proc) ( "WdeMainClass", WDE_VERSION,
                                 (LPFNLOADRES) WdeCustLOADRES,
                                 (LPFNEDITRES) WdeCustEDITRES );
#else
    list_global = (*list_proc) ( "WdeMainClass", WDE_VERSION,
                                 (LPFNLOADRES) WdeCustLOADRESInst,
                                 (LPFNEDITRES) WdeCustEDITRESInst );
#endif

    if ( list_global == NULL ) {
        WdeWriteTrail("WdeLoadBorCustomControls: ListClasses returned NULL!");
        return ( FALSE );
    }

    list_locked = (uint_8 *) GlobalLock ( list_global );
    if ( list_locked == NULL ) {
        WdeWriteTrail("WdeLoadBorCustomControls: Could lock global memory!");
        GlobalFree( list_global );
        return ( FALSE );
    }

    num_classes = *((uint_16 *) list_locked);

    class_list_size = sizeof(WdeBorlandClassList) +
                      (num_classes-1) * sizeof(WdeBorlandCtlClass);

    class_list = ( WdeBorlandClassList *) WdeMemAlloc ( class_list_size );
    if ( class_list == NULL ) {
        WdeWriteTrail("WdeLoadBorCustomControls: class list alloc failed!");
        GlobalUnlock ( list_global );
        GlobalFree( list_global );
        return ( FALSE );
    }

    memcpy ( class_list, list_locked, class_list_size );

    lib->class_list = list_global;

    if ( !WdeAddBorControlsToCustLib ( lib, class_list ) ) {
        WdeWriteTrail("WdeLoadBorCustomControls: Add to CustLib failed!");
        WdeMemFree    ( class_list );
        GlobalUnlock ( list_global );
        GlobalFree   ( list_global );
        return ( FALSE );
    }

    WdeMemFree    ( class_list );
    GlobalUnlock ( list_global );

    WdeMemValidate ( lib );

    return ( TRUE );
}
Exemplo n.º 19
0
void WdeRibbonHelpHook( HWND hwnd, WPARAM wParam, BOOL pressed )
{
    _wde_touch( hwnd );

    WdeHandleToolHint( wParam, pressed );
}
Exemplo n.º 20
0
static void wdeRibbonHelpHook( HWND hwnd, ctl_id id, bool pressed )
{
    _wde_touch( hwnd );

    WdeHandleToolHint( id, pressed );
}
Exemplo n.º 21
0
bool WdeCreateResourceWindow( WdeResInfo *res_info, int fn_offset, char *title )
{
    MDICREATESTRUCT     mdics;
    LRESULT             ret;
    HWND                win;
    bool                ok;
    bool                old;
    DWORD               style;
    RECT                r;
    HMENU               sys_menu;
    char                *win_title;
    int                 win_title_len;

    _wde_touch( fn_offset );

    WdeIncNumRes();

    style = 0;

    if( WdeGetNumRes() == 1 ) {
        WdeSetAppMenuToRes( TRUE );
        old = WdeSetStickyMode( WdeOldStickyMode );
        style = WS_MAXIMIZE;
    } else {
        if( WdeIsCurrentMDIWindowZoomed() ) {
            style = WS_MAXIMIZE;
        }
    }

    mdics.szClass = "WdeResClass";

    win_title = NULL;
    if( title == NULL ) {
        if( res_info->info->file_name ) {
            // perhaps make this an option
            //title = &res_info->info->file_name[fn_offset];
            mdics.szTitle = res_info->info->file_name;
        } else {
            WdeResCounter++;
            win_title_len = strlen( WdeResUntitled ) + 7;
            win_title = (char *)WRMemAlloc( win_title_len );
            sprintf( win_title, "%s.%d", WdeResUntitled, 0xffff & WdeResCounter );
            mdics.szTitle = win_title;
        }
    } else {
        mdics.szTitle = title;
    }

    win = WdeGetMDIWindowHandle();
    GetClientRect( win, &r );

    mdics.hOwner = WdeGetAppInstance();
    mdics.x = CW_USEDEFAULT;
    mdics.y = CW_USEDEFAULT;
    mdics.cx = CW_USEDEFAULT;
    mdics.cy = CW_USEDEFAULT;
    //mdics.cx = r.right - r.left;
    //mdics.cy = r.bottom - r.top;
    mdics.style = style;
    mdics.lParam = (LPARAM)res_info;

    ret = SendMessage( win, WM_MDICREATE, 0, (LPARAM)&mdics );

    if( win_title != NULL ) {
        WRMemFree( win_title );
    }

#ifdef __NT__
    win = (HWND)ret;
#else
    win = (HWND)LOWORD( ret );
#endif

    ok = (res_info->res_win != NULL && res_info->res_win == win);
    if( !ok ) {
        WdeWriteTrail( "WdeCreateResourceWindow: Bad window handle!" );
    }

    if( WdeIsDDE() ) {
        sys_menu = GetSystemMenu( win, FALSE );
        if( sys_menu != (HMENU)NULL ) {
            EnableMenuItem( sys_menu, SC_CLOSE, MF_GRAYED );
        }
    }

    if( ok ) {
        ok = WdeCreateEditWindows( res_info );
        if( !ok ) {
            WdeWriteTrail( "WdeCreateResourceWindow: Could not create edit windows!" );
        }
    }

    if( ok ) {
        OpenFormEdit( res_info->forms_win, WdeGetCreateTable(), MENU_NONE, SCROLL_NONE );
        WdeSetEditMode( res_info, TRUE );
        SetHorizontalInc( 1 );
        SetVerticalInc( 1 );
        InitState( res_info->forms_win );
        SetMouseRtn( res_info->forms_win, WdeMouseRtn );
        //MakeObjectCurrent( GetMainObject() );
    } else {
        if( WdeGetNumRes() == 1 ) {
            WdeSetAppMenuToRes( FALSE );
            WdeSetStickyMode( old );
        }
        WdeDecNumRes();
    }

    return( ok );
}
Exemplo n.º 22
0
WINEXPORT HDDEDATA CALLBACK DdeCallBack( UINT wType, UINT wFmt, HCONV hConv,
        HSZ hsz1, HSZ hsz2, HDDEDATA hdata,
        ULONG_PTR lData1, ULONG_PTR lData2 )
{
    HWND                hmain;
    HSZPAIR             hszpair[2];
    HDDEDATA            ret;
    WdeResDlgItem       *ditem;

    _wde_touch( wFmt );
    _wde_touch( hdata );
    _wde_touch( lData1 );
    _wde_touch( lData2 );

    ret = (HDDEDATA)NULL;

    switch( wType ) {
    case XTYP_CONNECT_CONFIRM:
        WdeServerConv = hConv;
        break;

    case XTYP_DISCONNECT:
        WdeServerConv = (HCONV)NULL;
        WdeClientConv = (HCONV)NULL;
        hmain = WdeGetMainWindowHandle();
        SendMessage( hmain, WM_CLOSE, (WPARAM)1, 0 );
        break;

    case XTYP_CONNECT:
        if( WdeServerConv == (HCONV)NULL && hsz1 == hDialogTopic ) {
            ret = (HDDEDATA)TRUE;
        }
        break;

    case XTYP_WILDCONNECT:
        if( hsz2 != hDialogService ) {
            break;
        }
        hszpair[0].hszSvc = hDialogService;
        hszpair[0].hszTopic = hDialogTopic;
        hszpair[1].hszSvc = (HSZ)NULL;
        hszpair[1].hszTopic = (HSZ)NULL;
        ret = (HDDEDATA)DdeCreateDataHandle( IdInst, (LPBYTE)&hszpair[0],
                                             sizeof( hszpair ), 0L, 0, CF_TEXT, 0 );
        break;

    case XTYP_REQUEST:
        if( wFmt == WdeDataClipbdFormat ) {
            if( hsz1 == hTopic ) {
                ditem = WdeGetDlgItem();
                if( hsz2 == hDataItem ) {
                    ret = WdeCreateResData( ditem );
                } else if( hsz2 == hNameItem ) {
                    ret = WdeCreateResNameData( ditem->dialog_name, ditem->is32bit );
                }
            }
        }
        break;

    case XTYP_POKE:
        ret = (HDDEDATA)DDE_FNOTPROCESSED;
        if( hsz1 == hDialogTopic ) {
            if( hsz2 == hDataItem ) {
                WdeHandlePokedData( hdata );
                ret = (HDDEDATA)DDE_FACK;
            }
        }
        break;
    }

    return( ret );
}