Exemplo n.º 1
0
MRESULT hchlb_umDelete( HWND hwnd, MPARAM mp1, MPARAM mp2 )
{
    PHCHLB hchlb = WinQueryWindowPtr( hwnd, 0 );
    SHORT  index = SHORT1FROMMP( mp1 );
    LONG   rc;

    if( hchlb == NULL )
        return MRFROMLONG( HCHLIT_ERROR );

    if(( rc = HCHColDelete( hchlb->hchCol, index )) >= 0 )
    {
        if( hchlb->topIndex >= hchlb->hchCol->count )
            hchlb->topIndex = hchlb->hchCol->count - 1;

        if( hchlb->curIndex >= hchlb->hchCol->count )
        {
            notify( hwnd, HCHLN_SELECT, MPFROM2SHORT( hchlb->curIndex, FALSE ));
            hchlb->curIndex = hchlb->hchCol->count - 1;
            notify( hwnd, HCHLN_SELECT, MPFROM2SHORT( hchlb->curIndex, TRUE ));
        }

        WinSendMsg( hchlb->hwndHCHLB, HCHLM_SETTOPINDEX, MPFROMSHORT( hchlb->topIndex ), 0 );
    }

//    WinSendMsg( hwnd, HCHLM_REFRESH, MPFROMLONG( TRUE ), 0 );

    return MRFROMLONG( rc );
}
Exemplo n.º 2
0
MRESULT hia_usermConnect(HWND hwnd,MPARAM mp1,MPARAM mp2)
{
HIA *hia = WinQueryWindowPtr(hwnd,WINWORD_INSTANCE);

    if (mp1!=NULL)
        {
        int i;

        for (i=0;i<hia->notifListAllocSize;i++)
            if (hia->notifList[i].hwnd == (HWND)mp1)
                {
                HIA_NotifyToConnected(hia,HIAN_CONNECT,MPFROMLONG(FALSE));
                hia->responseTo = &(hia->notifList[i]);
                HIA_NotifyToConnected(hia,HIAN_CONNECT,MPFROMLONG(TRUE));
                return MRFROMLONG(TRUE);
                }
        return MRFROMLONG(FALSE);

        } else {

        if (hia->responseTo != &(hia->notifList[0]))
            {
            HIA_NotifyToConnected(hia,HIAN_CONNECT,MPFROMLONG(FALSE));
            hia->responseTo = &(hia->notifList[0]);
            HIA_NotifyToConnected(hia,HIAN_CONNECT,MPFROMLONG(TRUE));
            }
        }

    return MRFROMLONG(TRUE);
}
Exemplo n.º 3
0
MRESULT hchlb_umSetTopIndex( HWND hwnd, MPARAM mp1, MPARAM mp2 )
{
    PHCHLB hchlb = WinQueryWindowPtr( hwnd, 0 );
    SHORT  index = SHORT1FROMMP( mp1 );
    int    topLineN, bottomLineN;

    if( hchlb == NULL )
        return 0;

    if(( index < 0 ) || ( index >= HCHColQueryCount( hchlb->hchCol )))
        return MRFROMLONG( HCHLIT_INDEXERROR );

    index = ( index / hchlb->xChars ) * hchlb->xChars;

    if( hchlb->hchCol->count - index < hchlb->xChars * hchlb->yChars )
    {
        bottomLineN = ( hchlb->hchCol->count - 1 ) / hchlb->xChars;
        topLineN = bottomLineN - hchlb->yChars + 1;
        if( topLineN < 0 )
            topLineN = 0;

        index = topLineN * hchlb->xChars;
    }

    hchlb->topIndex = index;
    hchlb->bottomIndex = hchlb->topIndex + hchlb->xChars * hchlb->yChars - 1;
    if( hchlb->bottomIndex >= hchlb->hchCol->count )
        hchlb->bottomIndex = hchlb->hchCol->count - 1;

    WinSendMsg( hwnd, HCHLM_REFRESH, 0, 0 );

    return MRFROMLONG( TRUE );
}
Exemplo n.º 4
0
MRESULT hia_wmCreate(HWND hwnd,MPARAM mp1,MPARAM mp2)
{
HIA *hia = NULL;
HIABuf  *hiabuf = NULL;
HIANotifWnd *notifList = NULL;
ULONG notifListAllocSize = HIA_NOTIFLIST_DEFAULT_SIZE;
HWND    hwndOwner = WinQueryWindow(hwnd,QW_OWNER);
USHORT  Id      = WinQueryWindowUShort(hwnd,QWS_ID);
int i;

    if (DosAllocMem((PPVOID)&hiabuf,sizeof(HIABuf),fALLOC))
        return MRFROMLONG(TRUE);
#ifdef DEBUG
    assert(hiabuf!=NULL);
#endif
    HIABufClear(hiabuf);

    if (DosAllocMem((PPVOID)&notifList,sizeof(HIANotifWnd)*notifListAllocSize,fALLOC))
        return MRFROMLONG(TRUE);
#ifdef DEBUG
    assert(notifList!=NULL);
#endif
    for (i=0;i<notifListAllocSize;i++)
        {
        notifList[i].hwnd = NULLHANDLE;
        notifList[i].id = 0;
        }

    if (DosAllocMem((PPVOID)&hia,sizeof(HIA),fALLOC))
        return MRFROMLONG(TRUE);
#ifdef DEBUG
    assert(hia!=NULL);
#endif

    hia->hwndHIA = hwnd;
    hia->inbuf = hiabuf;
    hia->kbdtype = HAN_KBD_2;
    hia->hanmode = HCH_ENG;
    hia->insertmode = HAN_INSERT;
    hia->hcode = HCH_JSY;

    hia->isHanjaKey = hia_defaultHanjaKey;
    hia->isSpecialCharKey = hia_defaultSpecialCharKey;

    hia->notifListAllocSize = notifListAllocSize;
    hia->notifList = notifList;
    hia->notifList[0].hwnd = hwndOwner;
    hia->notifList[0].id = Id;
    hia->responseTo = &(hia->notifList[0]);
    hia->hwndHCHLB = NULLHANDLE;
    hia->fRunningHCHLB = FALSE;
    hia->scselIndex = 0;

    if (!WinSetWindowPtr(hwnd,WINWORD_INSTANCE,(PVOID)hia))
        return MRFROMLONG(TRUE);

    return 0L;
}
Exemplo n.º 5
0
MRESULT hchlb_umQueryHorzInt( HWND hwnd, MPARAM mp1, MPARAM mp2 )
{
    PHCHLB hchlb = WinQueryWindowPtr( hwnd, 0 );

    if( hchlb == NULL )
        return MRFROMLONG( HCHLIT_ERROR);

    return MRFROMLONG( hchlb->horzInt );
}
Exemplo n.º 6
0
MRESULT hchlb_umQueryHch( HWND hwnd, MPARAM mp1, MPARAM mp2 )
{
    PHCHLB hchlb = WinQueryWindowPtr( hwnd, 0 );
    SHORT  index = SHORT1FROMMP( mp1 );

    if( hchlb == NULL )
        return MRFROMLONG( HCHLIT_ERROR);

    return MRFROMLONG( HCHColQueryHch( hchlb->hchCol, index ));
}
Exemplo n.º 7
0
MRESULT hchlb_umSearchHch( HWND hwnd, MPARAM mp1, MPARAM mp2 )
{
    PHCHLB  hchlb = WinQueryWindowPtr( hwnd, 0 );
    SHORT   cmd = SHORT1FROMMP( mp1 );
    SHORT   index = SHORT2FROMMP( mp1 );
    HANCHAR hch = SHORT1FROMMP( mp2 );

    if( hchlb == NULL )
        return MRFROMLONG( HCHLIT_ERROR);

    return MRFROMLONG( HCHColSearchHch( hchlb->hchCol, cmd, index, hch ));
}
Exemplo n.º 8
0
MRESULT hchlb_umInsert( HWND hwnd, MPARAM mp1, MPARAM mp2 )
{
    PHCHLB  hchlb = WinQueryWindowPtr( hwnd, 0 );
    SHORT   index = SHORT1FROMMP( mp1 );
    HANCHAR hch = SHORT1FROMMP( mp2 );
    LONG    rc;

    if( hchlb == NULL )
        return MRFROMLONG( HCHLIT_ERROR);

    rc = HCHColInsert( hchlb->hchCol, index, hch );
    WinSendMsg( hchlb->hwndHCHLB, HCHLM_SETTOPINDEX, MPFROMSHORT( hchlb->topIndex ), 0 );

    return MRFROMLONG( rc );

}
Exemplo n.º 9
0
MRESULT mainwmControl( HWND hwnd, MPARAM mp1, MPARAM mp2 )
{
	switch (SHORT1FROMMP(mp1))
	{
	case ID_HMLE:
		switch (SHORT2FROMMP(mp1))
		{
		case HMLN_KILLFOCUS:
			break;
		case HMLN_SETFOCUS:
			break;
		case HMLN_CHANGED:
			WinInvalidateRect(hwnd,NULL,FALSE);
			break;
		case HMLN_OVERFLOW:
			printf("Overflow!\n");
			break;
		default:
			break;
		} // switch Notification
		break;
	} // switch Control

	return MRFROMLONG(0L);
}
MRESULT EXPENTRY ClientWndProc (HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2)
{
    HPS     hps;
    BOOL    bHandled = TRUE;
    MRESULT mReturn  = 0;

    switch (msg)
    {
        case WM_PAINT:
            hps = WinBeginPaint (hWnd,0,0);
            WinEndPaint (hps);
            break;

        case WM_ERASEBACKGROUND:
            mReturn = MRFROMLONG(1L);
            break;

		  case WM_COMMAND:
		      switch (LOUSHORT(mp1))
            {
                case IDM_ABOUT:
                    DisplayAbout (hWnd, szTitle);
                    break;
            }

        default:
            bHandled = FALSE;
            break;
    }

    if (!bHandled)
        mReturn = WinDefWindowProc (hWnd,msg,mp1,mp2);

    return (mReturn);
}
Exemplo n.º 11
0
/****************************************************************************
   SysMenu Dialog Procedure
*****************************************************************************/
MRESULT EXPENTRY SysMenuProc (HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    {
        BOOL    Handled = TRUE;
        MRESULT mReturn  = 0;
        RECTL   Rectl;
        POINTL  Pointl;
        ULONG   temp;
        HPS     hps;
        HBITMAP hbm;

        switch (msg)
            {
                case    WM_PAINT:
                    hps = WinBeginPaint(hWnd, 0, 0);
                    WinQueryWindowRect(hWnd,&Rectl);
                    WinFillRect(hps, &Rectl, CLR_BLACK);
                    hbm = PointerInfo.hbmMiniColor;
                    WinInflateRect(hab, &Rectl, -1L, -1L);
                    WinDrawBitmap(hps, hbm, NULL, (PPOINTL)&Rectl, 0L, 0L, DBM_NORMAL);
                    WinEndPaint(hps);
                    break;
                case WM_ERASEBACKGROUND:
                    WinFillRect((HPS)LONGFROMMP(mp1),PVOIDFROMMP(mp2),CLR_BLACK);
                    mReturn = MRFROMLONG(1L);
                    break;
                default:
                    Handled = FALSE;
                    break;
            }
        if (!Handled) mReturn =  (*SysMenuDefProc)(hWnd, msg, mp1, mp2);
        return (mReturn);
    }
Exemplo n.º 12
0
Arquivo: hin.c Projeto: komh/hanedit2
MRESULT hia_usermQueryState(HWND hwnd,MPARAM mp1,MPARAM mp2)
{
HIA *hia = WinQueryWindowPtr(hwnd,WINWORD_INSTANCE);
ULONG   flState = 0;

//  printf("HIAM_QUERYSTATE\n");

    flState = (hia->inbuf->newpos) << 16;

    if (hia->hanmode == HCH_HAN)
        flState |= HIAST_HANMODE;

    if (hia->insertmode == HAN_INSERT)
        flState |= HIAST_INSERTMODE;

    if (hia->kbdtype == HAN_KBD_390)
        flState |= HIAST_KBD390;
    else if (hia->kbdtype == HAN_KBD_3FINAL)
        flState |= HIAST_KBD3FINAL;


    if (hia->hcode == HCH_WKS)
        flState |= HIAST_KSMODE;

    return MRFROMLONG(flState);
}
Exemplo n.º 13
0
MRESULT EXPENTRY ClkWndProc (HWND hwnd, ULONG usMsg, MPARAM mp1, MPARAM mp2)
{
    switch (usMsg) {

    case WM_CREATE:
	ClkCreate (hwnd);
	return (WinDefWindowProc (hwnd, usMsg, mp1, mp2));

    case WM_DESTROY:
	ClkDestroy (hwnd);
	return (WinDefWindowProc (hwnd, usMsg, mp1, mp2));

    case WM_PAINT:
	ClkPaint (hwnd);
	break;

    case WM_SIZE:
	ClkSize (hwnd);
	return (WinDefWindowProc (hwnd, usMsg, mp1, mp2));

    default:
	/* let default window procedure handle it. */
	return (WinDefWindowProc (hwnd, usMsg, mp1, mp2));
    }

    return (MRFROMLONG(0));
}
Exemplo n.º 14
0
Arquivo: hin.c Projeto: komh/hanedit2
MRESULT hia_usermUnregisterNotify(HWND hwnd,MPARAM mp1,MPARAM mp2)
{
HIA *hia = WinQueryWindowPtr(hwnd,WINWORD_INSTANCE);
int i;

    if (mp1==NULL) return MRFROMLONG(FALSE);

    for (i=0;i<hia->notifListAllocSize;i++)
        if (hia->notifList[i].hwnd==(HWND)mp1)
            {
            hia->notifList[i].hwnd = NULLHANDLE;
            hia->notifList[i].id = 0;
            return MRFROMLONG(TRUE);
            }
    return MRFROMLONG(FALSE);
}
Exemplo n.º 15
0
MRESULT mainwmControl( HWND hwnd, MPARAM mp1, MPARAM mp2 )
{
	switch (SHORT1FROMMP(mp1))
	{
	case ID_HEF1:
		switch (SHORT2FROMMP(mp1))
		{
		case HEN_KILLFOCUS:
			break;
		case HEN_SETFOCUS:
			break;
		case HEN_CHANGE:
			WinInvalidateRect(hwnd,NULL,FALSE);
			break;
		default:
			break;
		} // switch Notification
		break;
	case ID_HEF2:
		switch (SHORT2FROMMP(mp1))
		{
		case HEN_CHANGE:
			WinInvalidateRect(hwnd,NULL,FALSE);
			break;
		}
	} // switch Control

	return MRFROMLONG(0L);
}
Exemplo n.º 16
0
Arquivo: khserver.c Projeto: 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 );
}
Exemplo n.º 17
0
MRESULT mainwmSize( HWND hwnd, MPARAM mp1, MPARAM mp2 )
{
//  printf("HMLEdit:: WM_SIZE\n");

    WinSetWindowPos( WinWindowFromID( hwnd, ID_HANMLE ), NULLHANDLE,
            0, (use_statbar?STATBAR_YSIZE:0),
            SHORT1FROMMP(mp2),
            SHORT2FROMMP(mp2)-(use_statbar?STATBAR_YSIZE:0)-(use_toolbar?TOOLBAR_YSIZE:0),
            SWP_SIZE | SWP_MOVE );
    if (use_toolbar)
        WinSetWindowPos( WinWindowFromID( hwnd, ID_TOOLBAR ), NULLHANDLE,
            0, SHORT2FROMMP(mp2)-TOOLBAR_YSIZE, SHORT1FROMMP(mp2) , TOOLBAR_YSIZE,
            SWP_SIZE | SWP_MOVE | SWP_SHOW);
        else
        WinSetWindowPos( WinWindowFromID( hwnd, ID_TOOLBAR ), NULLHANDLE,
            0, SHORT2FROMMP(mp2)-TOOLBAR_YSIZE, SHORT1FROMMP(mp2) , TOOLBAR_YSIZE,
            SWP_SIZE | SWP_MOVE | SWP_HIDE);
    if (use_statbar)
        WinSetWindowPos( WinWindowFromID( hwnd, ID_STATBAR ), NULLHANDLE,
            0, 0, SHORT1FROMMP(mp2), STATBAR_YSIZE,
            SWP_SIZE | SWP_MOVE | SWP_SHOW);
        else
        WinSetWindowPos( WinWindowFromID( hwnd, ID_STATBAR ), NULLHANDLE,
            0, 0, SHORT1FROMMP(mp2), STATBAR_YSIZE,
            SWP_SIZE | SWP_MOVE | SWP_HIDE);
    return MRFROMLONG(0L);
}
Exemplo n.º 18
0
MRESULT mainwmChar(HWND hwnd, MPARAM mp1, MPARAM mp2)
{
//USHORT  fsFlags = SHORT1FROMMP(mp1);
//UCHAR   ucVkey  = CHAR3FROMMP(mp2);
//UCHAR   ucChar  = CHAR1FROMMP(mp2);

//UCHAR ucScancode = CHAR4FROMMP(mp1);
//char str[100];
//  printf("HMLEdit:: WM_CHAR\n");

//    ucChar = toupper(ucChar);
    //if (fsFlags & KC_KEYUP) return 0L;
    //if ((ucChar == 'S')&&(fsFlags&KC_CTRL)&&!(fsFlags&KC_ALT)&&!(fsFlags&KC_SHIFT))
        //HESave(hwnd);
    //if ((ucChar == 'O')&&(fsFlags&KC_CTRL)&&!(fsFlags&KC_ALT)&&!(fsFlags&KC_SHIFT))
        //HEOpen(hwnd);
    //if ((ucChar == 'I')&&(fsFlags&KC_CTRL)&&!(fsFlags&KC_ALT)&&!(fsFlags&KC_SHIFT))
        //HEImport(hwnd);
    //if ((ucChar == 'F')&&(fsFlags&KC_CTRL)&&!(fsFlags&KC_ALT)&&!(fsFlags&KC_SHIFT))
        //HEFind(hwnd);
    //if ((ucChar == '/')&&(fsFlags&KC_CTRL)&&!(fsFlags&KC_ALT)&&!(fsFlags&KC_SHIFT))
        //HESelectAll(hwnd);
    //if ((ucChar == 'X')&&(fsFlags&KC_ALT)&&!(fsFlags&KC_CTRL)&&!(fsFlags&KC_SHIFT))
        //HEExit(hwnd);
    //if ((ucVkey == VK_F2)&&!(fsFlags&KC_ALT)&&!(fsFlags&KC_CTRL)&&!(fsFlags&KC_SHIFT))
        //WinSendMsg( hwnd, WM_COMMAND, MPFROMSHORT( IDM_RELOAD ), 0 );

    return MRFROMLONG( TRUE );
}
MRESULT MainSize(HWND hwnd,      /* handle to the main client window */
                 SHORT sTotalMsgs,
                 MPARAM mp1,     /* first parameter of WM_SIZE message */
                 MPARAM mp2)     /* second parameter of WM_SIZE message */
{

   cxClient = SHORT1FROMMP (mp2) ;
   cyClient = SHORT2FROMMP (mp2) ;

   sHscrollMax = max (0, cxTextTotal - cxClient) ;
   sHscrollPos = min (sHscrollPos, sHscrollMax) ;

   WinSendMsg (hwndHscroll, SBM_SETSCROLLBAR,
                            MPFROM2SHORT (sHscrollPos, 0),
                            MPFROM2SHORT (0, sHscrollMax)) ;

   WinEnableWindow (hwndHscroll, (BOOL)((sHscrollMax != 0) ? TRUE : FALSE)) ;

   sVscrollMax = max (0, sTotalMsgs - cyClient / cyChar) ;
   sVscrollPos = min (sVscrollPos, sVscrollMax) ;

   WinSendMsg (hwndVscroll, SBM_SETSCROLLBAR,
                            MPFROM2SHORT (sVscrollPos, 0),
                            MPFROM2SHORT (0, sVscrollMax)) ;

   WinEnableWindow (hwndVscroll, (BOOL)((sVscrollMax != 0) ? TRUE : FALSE)) ;

   return (MRFROMLONG(0));
}
Exemplo n.º 20
0
MRESULT hchlb_umSelectItem( HWND hwnd, MPARAM mp1, MPARAM mp2 )
{
    PHCHLB hchlb = WinQueryWindowPtr( hwnd, 0 );
    SHORT  index = SHORT1FROMMP( mp1 );
    BOOL   selectFlag = SHORT1FROMMP( mp2 );

    if( hchlb == NULL )
        return 0;

    if((( index < 0 ) || ( index >= HCHColQueryCount( hchlb->hchCol ))) &&
       ( index != HCHLIT_NONE ))
        return 0;

    notify( hwnd, HCHLN_SELECT, MPFROM2SHORT( hchlb->curIndex, FALSE ));

    if( index == HCHLIT_NONE )
        hchlb->curIndex = HCHLIT_NONE;
    else if( selectFlag )
    {
        hchlb->curIndex = index;
        notify( hwnd, HCHLN_SELECT, MPFROM2SHORT( hchlb->curIndex, TRUE ));
    }
    else if( hchlb->curIndex == index )
        hchlb->curIndex = HCHLIT_NONE;

    //hchlb->eraseBg = FALSE;
    //WinSendMsg( hwnd, HCHLM_REFRESH, 0, 0 );
    HCHLBRepositionPage( hchlb );

    return MRFROMLONG( TRUE );
}
MRESULT InitMainWindow(HWND hwnd,      /* handle to the main client window */
                       MPARAM mp1,     /* first parameter of WM_CREATE message */
                       MPARAM mp2)     /* second parameter of WM_CREATE message */
{
   FONTMETRICS fm;
   HPS         hps;

   hps = WinGetPS (hwnd) ;
   GpiQueryFontMetrics (hps, (LONG) sizeof fm, &fm) ;

   cxChar = fm.lAveCharWidth ;
   cxCaps = fm.lEmInc ;
   cyChar = fm.lMaxBaselineExt ;
   cyDesc = fm.lMaxDescender ;

   WinReleasePS (hps) ;

   cxTextTotal = MESSAGE_LEN * cxChar ;

   hwndHscroll = WinWindowFromID (
                       WinQueryWindow (hwnd, QW_PARENT),
                       FID_HORZSCROLL) ;

   hwndVscroll = WinWindowFromID (
                       WinQueryWindow (hwnd, QW_PARENT),
                       FID_VERTSCROLL) ;

   return (MRFROMLONG(0));
}
Exemplo n.º 22
0
Arquivo: hin.c Projeto: komh/hanedit2
MRESULT hia_usermSetKbdType(HWND hwnd,MPARAM mp1,MPARAM mp2)
{
HIA     *hia = WinQueryWindowPtr(hwnd,WINWORD_INSTANCE);

    hia->kbdtype = (ULONG)mp1;
    HIA_NotifyToList(hia,HIAN_KBDTYPECHANGED,MPFROMLONG(hia->kbdtype));
    return MRFROMLONG(TRUE);
}
Exemplo n.º 23
0
MRESULT hchlb_umQueryCount( HWND hwnd, MPARAM mp1, MPARAM mp2 )
{
    PHCHLB hchlb = WinQueryWindowPtr( hwnd, 0 );

    if( hchlb == NULL )
        return 0;

    return MRFROMLONG( HCHColQueryCount( hchlb->hchCol ));
}
Exemplo n.º 24
0
MRESULT hchlb_umQueryTopIndex( HWND hwnd, MPARAM mp1, MPARAM mp2 )
{
    PHCHLB hchlb = WinQueryWindowPtr( hwnd, 0 );

    if( hchlb == NULL )
        return MRFROMLONG( HCHLIT_ERROR);

    return MRFROMSHORT( hchlb->topIndex );
}
Exemplo n.º 25
0
MRESULT hchlb_umQuerySelection( HWND hwnd, MPARAM mp1, MPARAM mp2 )
{
    PHCHLB hchlb = WinQueryWindowPtr( hwnd, 0 );
//    SHORT  index = SHORT1FROMMP( mp1 );

    if( hchlb == NULL )
        return MRFROMLONG( HCHLIT_ERROR);

    return MRFROMSHORT( hchlb->curIndex );
}
Exemplo n.º 26
0
Arquivo: khserver.c Projeto: komh/kime
MRESULT khs_wmCreate( HWND hwnd, MPARAM mp1, MPARAM mp2 )
{
    PKHSCD  pkhscd;

    WinSetWindowPtr( hwnd, 0, 0 );

    if( DosAllocMem(( PPVOID )&pkhscd, sizeof( KHSCD ), fALLOC ) != 0 )
        return MRFROMLONG( TRUE );

    if( DosAllocSharedMem(( PPVOID )&pkhscd->pCursorPos, NULL, sizeof( RECTL ), fALLOCSHR ) != 0 )
    {
        DosFreeMem( pkhscd );

        return MRFROMLONG( TRUE );
    }

    if( DosAllocMem(( PPVOID )&pkhscd->pQTopLevel, DOSQSS_BUFSIZE, fALLOC ) != 0 )
    {
        DosFreeMem( pkhscd->pCursorPos );
        DosFreeMem( pkhscd );

        return MRFROMLONG( TRUE );
    }

    pkhscd->list = hwndlistCreate();
    if( pkhscd->list == NULL )
    {
        DosFreeMem( pkhscd->pQTopLevel );
        DosFreeMem( pkhscd->pCursorPos );
        DosFreeMem( pkhscd );

        return MRFROMLONG( TRUE );
    }

#ifdef DEBUG
    pkhscd->fp = fopen("debug.log", "wt");
#endif
    pkhscd->exceptListBuf = exceptCreateListBuf( EXCEPT_LIST_FILE );

    WinSetWindowPtr( hwnd, 0, pkhscd );

    return FALSE;
}
Exemplo n.º 27
0
Arquivo: hin.c Projeto: komh/hanedit2
MRESULT hia_usermSetInsertMode(HWND hwnd,MPARAM mp1,MPARAM mp2)
{
HIA     *hia = WinQueryWindowPtr(hwnd,WINWORD_INSTANCE);

    hia->insertmode = (ULONG)mp1;
    if ((hia->insertmode != HAN_INSERT) && (hia->insertmode != HAN_OVERWRITE))
        hia->hanmode = HAN_INSERT;
    HIA_NotifyToList(hia,HIAN_INSERTMODECHANGED,MPFROMLONG(hia->insertmode));
    return MRFROMLONG(TRUE);
}
Exemplo n.º 28
0
Arquivo: hin.c Projeto: komh/hanedit2
MRESULT hia_usermSetHanMode(HWND hwnd,MPARAM mp1,MPARAM mp2)
{
HIA     *hia = WinQueryWindowPtr(hwnd,WINWORD_INSTANCE);

    hia->hanmode = (ULONG)mp1;
    if ((hia->hanmode != HCH_HAN) && (hia->hanmode != HCH_ENG))
        hia->hanmode = HCH_ENG;
    HIA_NotifyToList(hia,HIAN_HANMODECHANGED,MPFROMLONG(hia->hanmode));
    return MRFROMLONG(TRUE);
}
Exemplo n.º 29
0
Arquivo: khserver.c Projeto: 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 );
}
Exemplo n.º 30
0
Arquivo: hin.c Projeto: komh/hanedit2
MRESULT hia_usermCancelBuf(HWND hwnd,MPARAM mp1,MPARAM mp2)
{
HIA *hia = WinQueryWindowPtr(hwnd,WINWORD_INSTANCE);
ULONG   temp;

//  printf("HIAM_CANCELBUF\n");

    temp = hia->inbuf->newpos;
    HIABufClear(hia->inbuf);
    HIA_NotifyToConnected(hia,HIAN_COMPO_CANCEL,0);
    return MRFROMLONG(temp);
}