コード例 #1
0
void ColorStatus(
/***********************************************************************/
LPCOLORINFO lpColor,
long 	lCount,
LPSTR 	lpLabel,
BOOL 	bDoubleClick)
{
STRING szLabel, szColor;
LPSTR   lp;

if (lCount)
	{
	GetColorString(lpColor, lpColor->ColorSpace, szColor);
	MessageStatus( IDS_COLORCOUNT, lCount, (LPSTR)szColor);
	}
else
	{
	if (lpLabel && lstrlen(lpLabel) && AstralStr(IDS_COLORLABEL, &lp))
		wsprintf(szLabel, lp, lpLabel);
	else
		szLabel[0] = '\0';
	GetColorString(lpColor, lpColor->ColorSpace, szColor);
	MessageStatus(bDoubleClick ? IDS_COLOR : IDS_COLOR2 ,
				(LPSTR)szLabel, (LPSTR)szColor);
	}
}
コード例 #2
0
void StatusOfRectangle(
/***********************************************************************/
LPRECT lpRect,
LFIXED fScale)
{
STRING szUnit, szString1, szString2, szString3, szString4;
LPSTR lpUnit;
RECT rFile;
int Resolution;

OrderRect( lpRect, &rFile );
if ( fScale )
	{
	Resolution = 1000;
	ScaleRect( &rFile, fScale );
	}
else
if (lpImage)
	Resolution = FrameResolution( ImgGetBaseEditFrame(lpImage) );
if ( AstralStr( Control.Units-IDC_PREF_UNITINCHES+IDS_INCHES, &lpUnit ) )
	{
	lstrcpy( szUnit, lpUnit );
	MessageStatus( IDS_RECT_STATUS,
		Unit2String( FGET( RectWidth(&rFile), Resolution ), szString1 ),
		Unit2String( FGET( RectHeight(&rFile), Resolution ), szString2),
		(LPSTR)szUnit,
		Unit2String( FGET( rFile.left, Resolution ), szString3 ),
		Unit2String( FGET( rFile.top, Resolution ), szString4 ) );
	}
}
コード例 #3
0
int Color2Status(
/***********************************************************************/
LPCOLORINFO lpColor,
BOOL fActive)
{
STRING szColor;

GetColorString(lpColor, lpColor->ColorSpace, szColor);
MessageStatus( fActive ? IDS_ACTIVECOLOR : IDS_ALTERNATECOLOR, (LPSTR)szColor);

return( idItemHelp = IDC_ACTIVECOLOR );
}
コード例 #4
0
ファイル: Selection.cpp プロジェクト: jimmccurdy/ArchiveGit
void CSelection::EndSelection(HWND hWnd, HDC hDC, RECT* lpSelectRect, int fFlags, bool bRemove)
{
	bool fDoc = false;

	if (bRemove)
		InvertSelection(hWnd, hDC, lpSelectRect, fFlags);
	if (fDoc)
	{
//j		SetDisplayHook(hWnd, lpLastDisplayHook);
	}
	if (fDoc)
	{
//j		DisplayInfo(lpSelectRect->right, lpSelectRect->bottom, NULL);
	}
	OrderRect(lpSelectRect, lpSelectRect);
	MessageStatus(0);
}
コード例 #5
0
void ReadOutF( int idStr, int iNum, ... )
/***********************************************************************/
{
char szNum1[32], szNum2[32];
LPTR lpArguments;
LPLFIXED lpNum;

if (iNum < 1 || iNum > 2)
	return;
lpArguments = (LPTR)&iNum + sizeof(iNum);
lpNum = (LPLFIXED)lpArguments;
szNum1[0] = szNum2[0] = '\0';
FixedAscii(*lpNum, (LPSTR)szNum1, 1);
++lpNum;
if (iNum == 2)
	FixedAscii(*lpNum, (LPSTR)szNum2, 1);
MessageStatus(idStr, (LPSTR)szNum1, (LPSTR)szNum2);
}
コード例 #6
0
DWORD CALLBACK EXPORT KeyboardHookProc(
/***********************************************************************/
/*  Process the F1 key and ask for context sensitive help on the last id to receive a hint */
int 	nCode,
WPARAM 	wParam,
LPARAM 	lParam)
{
HWND hWnd;
int id;
#define STATE_MASK 0xC0000000L
#define UP_GOING_DOWN 0x00000000L
#define DOWN_GOING_UP 0xC0000000L

if ( nCode < 0 ||
     bHelpDisabled ||
     wParam != VK_F1 ||
     (lParam & STATE_MASK) != UP_GOING_DOWN )
	return( CallNextHookEx( hKBHook, nCode, wParam, lParam ) );

if ( LBUTTON )
	PostMessage ( hWndAstral, WM_KEYDOWN, VK_ESCAPE, 0L );

if ( idItemHelp <= 0 )
	{ // No help topic 
	if ( hWnd = GetLastActivePopup( hWndAstral ) )
		{ // Found a modal dialog up
		if ( !(id = GET_WINDOW_ID( hWnd )) )
			if ( !(id = AstralDlgGetID( hWnd )) );
				id = AstralDlgGetID( NULL );
		idItemHelp = MessageStatus( id, (LPSTR)"", (LPSTR)"" );
		}
	}

if ( idItemHelp > 0 )
		Help( HELP_CONTEXT, (long)idItemHelp );
else	Help( HELP_CONTEXT, (long)Tool.id );

return( TRUE );
}
コード例 #7
0
BOOL ExportImageDLL( LPSTR lpExportFile )
{
	HMODULE   hModule;
	FARPROC  lpClockCursor = NULL;
	FARPROC  lpDataPointer = NULL;
	EXPORTPROC    lpStartProc;
	EXPORTPROC    lpProcessProc;
	EXPORTPROC    lpEndProc;
	LPFRAME  lpFrame;

	EXPPARMS parms;
	BOOL     fSuccess = FALSE;
	LPIMAGE lpImage;

	lpImage = GetActiveImage();

	if (!lpImage)
		goto Exit;

	lpFrame = ImgGetBaseEditFrame(lpImage);

	if (!lpFrame)
		goto Exit;

	if (!(hModule = (HMODULE)AstralLoadLibrary(lpExportFile)))
		goto Exit;

	lpStartProc   = (EXPORTPROC)GetProcAddress(hModule, "_ExportStart");
	lpProcessProc = (EXPORTPROC)GetProcAddress(hModule, "_ExportProcess");
	lpEndProc     = (EXPORTPROC)GetProcAddress(hModule, "_ExportEnd");

	if ( !lpStartProc || !lpProcessProc || !lpEndProc )
		goto Exit;

	iExportXSize = FrameXSize( lpFrame );
	iExportYSize = FrameYSize( lpFrame );
	iExportDepth = FrameDepth( lpFrame );
	iExportResolution = FrameResolution( lpFrame );

	lpClockCursor = MakeProcInstance( (FARPROC)ExportClockCursor, PictPubApp.Get_hInstAstral() );
	lpDataPointer = MakeProcInstance( (FARPROC)ExportDataPointer, PictPubApp.Get_hInstAstral() );

	AllocLines( &lpExportBuffer, 1, iExportXSize, max(1, iExportDepth));

	parms.hInstance      = PictPubApp.Get_hInstAstral();
	parms.hWnd           = GetActiveWindow();
	parms.lpszFileName   = lpImage->CurFile;
	parms.XSize          = iExportXSize;
	parms.YSize          = iExportYSize;
	parms.Depth          = iExportDepth;
	parms.Resolution     = iExportResolution;
	parms.StatusCallback = (LPROC)lpClockCursor;
	parms.DataPointer    = (LPTRPROC)lpDataPointer;

	if (!lpClockCursor || !lpDataPointer || !lpExportBuffer)
		goto Exit;


	if ((*lpStartProc)((LPEXPPARMS)&parms))
	{
		MessageStatus( IDS_PLEASEWAIT );
		if ((*lpProcessProc)((LPEXPPARMS)&parms))
		{
			fSuccess = TRUE;
			(*lpEndProc)((LPEXPPARMS)&parms);
		}
	}

Exit:

	if (lpClockCursor)
		FreeProcInstance((FARPROC)lpClockCursor);

	if (lpDataPointer)
		FreeProcInstance((FARPROC)lpDataPointer);

	if (lpExportBuffer)
		FreeUp(lpExportBuffer);

	lpExportBuffer = NULL;

	if (hModule)
		FreeLibrary(hModule);

	MessageStatus( 0 );

	return(fSuccess);
}
コード例 #8
0
BOOL CInitializationThread::InitInstance()
{
    HWND hWnd = m_pMainWnd->GetSafeHwnd();
    FNAME szFileName;
    BOOL bRunningEmbedded = PictPubApp.RunEmbedded();
	BOOL  bRunningAutomated = PictPubApp.RunAutomated();

    lstrcpy(szFileName, Control.ProgHome);
    lstrcat(szFileName, "string.dll");

    // add and/or delete items to menus ( any one-time ( permanent ) menu changes )
    // setup IDR_PPMAIN
    m_pPictPubApp->SetupAppMainMenu( CMenu::FromHandle( GetMenu( hWnd)));
    VERIFY(SetEvent(m_hSetupAppMainMenuEvent));

    // setup IDR_PPSVRTYPE_PP
    POSITION TemplatePos = m_pPictPubApp->GetFirstDocTemplate();
    if (TemplatePos)
    {
        CPPMultiDocTemplate *pTemplate = (CPPMultiDocTemplate *)m_pPictPubApp->GetNextDocTemplate (TemplatePos);
    	m_pPictPubApp->SetupAppSharedMenu(CMenu::FromHandle(pTemplate->m_hMenuShared));
        VERIFY(SetEvent(m_hSetupAppSharedMenuEvent));
    }
                    
    lstrcpy(szFileName, Control.ProgHome);
    lstrcat(szFileName, "hint.dll");
    if( ( hInstHintLib = (HINSTANCE)AstralLoadLibrary( szFileName )))
    {
        if( Hints.fStatusHintsOn )
            MessageStatus( IDS_WELCOME, (LPSTR)szAppName );
        VERIFY(SetEvent(m_hHintsLoadEvent));
    }
    else
        //ERROR CONDITION !! 
        ;

    /* This is TWAIN Stuff */
    if (!bRunningEmbedded)
    {
        TW_IDENTITY identity;
    
        identity.Id = (TW_UINT32)hWnd;
        identity.Version.MajorNum = 3;
        identity.Version.MinorNum = 1;
        identity.Version.Language = TWLG_USA;
        identity.Version.Country  = TWCY_USA;
        lstrcpy(identity.Version.Info,  "3.1 Beta Release");
    
        identity.ProtocolMajor    = TWON_PROTOCOLMAJOR;
        identity.ProtocolMinor    = TWON_PROTOCOLMINOR;
        identity.SupportedGroups  = DG_CONTROL | DG_IMAGE;
        lstrcpy(identity.Manufacturer,  "MicroGrafX Inc.");
        lstrcpy(identity.ProductFamily, "Windows Apps");
        lstrcpy(identity.ProductName,   szAppName );
        
        DCInitialize( &identity, hWnd );
    } /* End of TWAIN Stuff */
    VERIFY(SetEvent(m_hTWAINEvent));

    // Finished Initialization !
    VERIFY(SetEvent(m_hInitThreadDoneEvent));

	// avoid entering standard message loop by returning FALSE
	return FALSE;
}
コード例 #9
0
int HintLineSpecial( int id, int idOffset )
/***********************************************************************/
{
MessageStatus( id+idOffset, (LPSTR)"", (LPSTR)"" );
return( idItemHelp = id );
}