示例#1
0
/*
 * CreateSpyBox - create the spy listbox
 */
void CreateSpyBox( HWND parent )
{
#ifdef __NT__
    LVCOLUMN    lvc;
    int         i;
#endif

    setCharSize( parent );

#ifdef __NT__
    if( LoadCommCtrl() ) {
        AllowVariableFonts();
        SpyListBox = CreateWindowEx( WS_EX_CLIENTEDGE, WC_LISTVIEW, NULL,
                                     WS_CHILD | WS_VISIBLE | LVS_REPORT | LVS_SINGLESEL,
                                     LISTBOX_X, LISTBOX_Y, 0, 0, parent,
                                     (HANDLE)(pointer_int)SPY_LIST_BOX, Instance, NULL );
        lvc.mask = LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
        for( i = 0; i < NUM_COLUMNS; i++ ) {
            lvc.cx = columns[i].width;
            lvc.pszText = AllocRCString( columns[i].string_id );
            lvc.iSubItem = i;
            SendMessage( SpyListBox, LVM_INSERTCOLUMN, i, (LPARAM)&lvc );
            FreeRCString( lvc.pszText );
        }
  #ifdef _WIN64
    } else
  #else
    } else if( LOBYTE( LOWORD( GetVersion() ) ) >= 4 ) {
示例#2
0
/* Function to initialize the first instance of Wde */
bool WdeInit( HINSTANCE app_inst )
{
    WNDCLASS wc;

    /* fill in the WINDOW CLASS structure for the main window */
    wc.style = CS_DBLCLKS;
    wc.lpfnWndProc = WdeMainWndProc;
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
    wc.hInstance = app_inst;
    wc.hIcon = LoadIcon( app_inst, "APPLICON" );
    wc.hCursor = LoadCursor( (HINSTANCE)NULL, IDC_ARROW );
    wc.hbrBackground = NULL;
    wc.lpszMenuName = "WdeMenu";
    wc.lpszClassName = WdeMainClass;

    /* register the main window class */
    if( !RegisterClass( &wc ) ) {
        WdeDisplayErrorMsg( WDE_NOREGISTERMAINCLASS );
        return( FALSE );
    }

    /* register the edit window class */
    if( !WdeRegisterEditClass( app_inst ) ) {
        WdeDisplayErrorMsg( WDE_NOREGISTEREDITCLASS );
        return( FALSE );
    }

    /* register the res MDI window class */
    if( !WdeRegisterResClass( app_inst ) ) {
        WdeDisplayErrorMsg( WDE_NOREGISTERRESCLASS );
        return( FALSE );
    }

    /* register the tag window class */
    if( !WdeRegisterTagClass( app_inst ) ) {
        WdeDisplayErrorMsg( WDE_NOREGISTERTAGCLASS );
        return( FALSE );
    }

    LoadCommCtrl();

    return( TRUE );
}
示例#3
0
static vi_rc doGREP( char *dirlist )
{
    DLGPROC     grep_proc;
    vi_rc       rc;

#ifdef __NT__
    if( LoadCommCtrl() ) {
        grep_proc = (DLGPROC)MakeProcInstance( (FARPROC)GrepListProc95, InstanceHandle );
        rc = DialogBoxParam( InstanceHandle, "GREPLIST95", Root, grep_proc, (LPARAM)dirlist );
    } else {
#endif
        grep_proc = (DLGPROC)MakeProcInstance( (FARPROC)GrepListProc, InstanceHandle );
        rc = DialogBoxParam( InstanceHandle, "GREPLIST", Root, grep_proc, (LPARAM)dirlist );
#ifdef __NT__
    }
#endif
    FreeProcInstance( (FARPROC)grep_proc );
    return( rc );
}
示例#4
0
/*
 * StatusWndInit - initialize for using the status window
 */
bool StatusWndInit( WPI_INST hinstance, statushook hook, int extra, HCURSOR hDefaultCursor )
{
    bool        rc;
#ifdef __OS2_PM__
    /* OS/2 PM version of the initialization */

    colorButtonFace = CLR_PALEGRAY;

    if( !hasGDIObjects ) {
        brushButtonFace = _wpi_createsolidbrush( colorButtonFace );
        penLight = _wpi_createpen( PS_SOLID, 1, CLR_WHITE );
        penShade = _wpi_createpen( PS_SOLID, 1, CLR_DARKGRAY );
        hasGDIObjects = true;
    }

    statusWndHookFunc = hook;

    rc = true;
    if( !classRegistered ) {
        memcpy( &classHandle, &hinstance, sizeof( WPI_INST ) );
        rc = WinRegisterClass( hinstance.hab, className, (PFNWP)StatusWndCallback,
                               CS_SIZEREDRAW | CS_CLIPSIBLINGS,
                               extra + sizeof( statwnd * ) );
        classWinExtra = extra;
        classRegistered = true;
    }
#else
    /* Win16 and Win32 version of the initialization */
    WNDCLASS    wc;

  #ifdef __NT__
    if( LoadCommCtrl() ) {
        rc = true;
    } else {
  #endif
        if( !hasGDIObjects ) {
            colorButtonFace = GetSysColor( COLOR_BTNFACE );
            colorTextFace = GetSysColor( COLOR_BTNTEXT );
            brushButtonFace = CreateSolidBrush( colorButtonFace );
            penLight = CreatePen( PS_SOLID, 1, GetSysColor( COLOR_BTNHIGHLIGHT ) );
            penShade = CreatePen( PS_SOLID, 1, GetSysColor( COLOR_BTNSHADOW ) );
            hasGDIObjects = true;
        }

        statusWndHookFunc = hook;

        rc = true;
        if( !GetClassInfo( hinstance, className, &wc ) ) {
            classHandle = hinstance;
            classWinExtra = extra;
            wc.style = CS_HREDRAW | CS_VREDRAW;
            wc.lpfnWndProc = GetWndProc( StatusWndCallback );
            wc.cbClsExtra = 0;
            wc.cbWndExtra = extra + sizeof( statwnd * );
            wc.hInstance = hinstance;
            wc.hIcon = LoadIcon( (HINSTANCE)NULL, IDI_APPLICATION );
            wc.hCursor = hDefaultCursor;
            if( wc.hCursor == NULL ) {
                wc.hCursor = LoadCursor( (HINSTANCE)NULL, IDC_ARROW );
            }
            wc.hbrBackground = (HBRUSH)0;
            wc.lpszMenuName = NULL;
            wc.lpszClassName = className;
            rc = ( RegisterClass( &wc ) != 0 );
            classRegistered = true;
        }
  #ifdef __NT__
    }
  #endif
#endif
    return( rc );

} /* StatusWndInit */