Esempio n. 1
0
LOCAL void About_OnCommand( HWND hDlg, int id, HWND hControl, UINT codeNotify )
/************************************************************************/
{
switch (id)
	{
	case IDC_ABOUTAPP:
	PopupWindow(hDlg, id, id, DlgDriversProc);
	break;

	case IDC_MGX:
	case IDC_PICTPUB:
   case IDC_PHOTOMAGIC:
   case IDC_DESIGNER:
   case IDC_CHARISMA:
   case IDC_DRAWPLUS:
   case IDC_ORGCHART:
   case IDC_ABCFLOWCHART:
   case IDC_SNAPGRAFX:
   case IDC_CLIPART:
   case IDC_TECHSUPT:
   case IDC_PHOTOCREDITS:
	if ( bTrack )
		KillTimer( hDlg, bTrack );
	bTrack = NO;
	EnableWindow(hDlg, FALSE);
	AstralDlg( NO, PictPubApp.GetResourceHandle(), hDlg, id, DlgWarningProc );
	EnableWindow(hDlg, TRUE);
	bScroll = NO;
	SetTimer( hDlg, bTrack = TRUE, 2, NULL );
	break;

	case IDOK:
	case IDCANCEL:
	if ( bTrack )
		KillTimer( hDlg, bTrack );
	bTrack = NO;
	AstralDlgEnd( hDlg, FALSE );
	break;

   default:
	break;
   }
}
Esempio n. 2
0
LRESULT CDlgPopup::OnHotKey( WPARAM wParam,LPARAM lParam )
{
	if (CConfigManager::Inst()->IsOnConfig)
	{
		return 0;
	}

	POINT ptCursor;
	if(::GetCursorPos(&ptCursor))
	{
		m_pForeWnd = GetForegroundWindow();

		DWORD activeWindowThread = ::GetWindowThreadProcessId(m_pForeWnd->GetSafeHwnd(), NULL);
		DWORD thisWindowThread = ::GetWindowThreadProcessId(GetSafeHwnd(), NULL);

		if(::AttachThreadInput(thisWindowThread, activeWindowThread, TRUE))
		{
			m_pFocusedControl = GetFocus();
			::AttachThreadInput(thisWindowThread, activeWindowThread, FALSE);
		}

		// Toggle show popup
		if (!IsWindowVisible())
		{
			CRect rcWindow;
			GetWindowRect(rcWindow);
			MoveWindow(ptCursor.x,ptCursor.y,rcWindow.Width(),rcWindow.Height());
			PopupWindow();
		}
		else
		{
			HideWindow();
		}
	}

	return 0;
}