示例#1
0
void MCStack::stop_externals()
{
	Boolean oldlock = MClockmessages;
	MClockmessages = True;
	MCPlayer *tptr = MCplayers;
	while (tptr != NULL)
	{
		if (tptr->getstack() == this)
		{
			if (tptr->playstop())
				tptr = MCplayers; // was removed, start search over
		}
		else
			tptr = tptr->getnextplayer();
	}

	if (!MCnoui && window != DNULL)
	{
		RevokeDragDrop((HWND)window->handle.window);
		CoLockObjectExternal(droptarget, FALSE, TRUE);
		droptarget->setstack(NULL);
		delete droptarget;
		droptarget = nil;
	}

	destroywindowshape();
	MClockmessages = oldlock;

	unloadexternals();
}
示例#2
0
void CDonutView::OnDestroy()
{
	RevokeDragDrop(m_hWnd);

	if (m_spBrowser) {
		HRESULT hr = m_spBrowser->Stop();
		CComQIPtr<IOleInPlaceObject>	spInPlaceObject = m_spBrowser;
		ATLASSERT(spInPlaceObject);
		hr = spInPlaceObject->InPlaceDeactivate();
		ATLASSERT(SUCCEEDED(hr));
		spInPlaceObject.Release();

		// Set Client Site
		CComPtr<IOleObject>	spOleObject;
		hr = m_spBrowser->QueryInterface(IID_IOleObject, (void**)&spOleObject);
		ATLASSERT(SUCCEEDED(hr));
		hr = spOleObject->Close(OLECLOSE_NOSAVE);

		spOleObject.Release();
		m_spBrowser.Release();
		m_spAxAmbient.Release();
		m_spHost.Release();
	}

	m_ViewOption.Uninit();

	DefWindowProc();
}
示例#3
0
bool ISimpleDropTarget::Register(HWND hwnd)
{
	if (IsWindow(m_hwnd))
	{
		Unregister();
	}
	if (!IsWindow(hwnd)) {
		throw L"Tried to register non window for Drag&Drop!";
		return false;
	}
	HRESULT result = OleInitialize(NULL);
	if (SUCCEEDED(result)) {
		result = RegisterDragDrop(hwnd, this);
		if (SUCCEEDED(result)) {
			m_hwnd = hwnd;
			return true;
		}
		else
		{
			RevokeDragDrop(hwnd);
			OleUninitialize();
			throw L"Drag&Drop already attached to window!";
		}
	}
	else
	{
		throw L"Drag&Drop already attached to window!";
		OleUninitialize();
	}
	return false;
}
示例#4
0
void tomEdit::OnDestroy() 
{
    RevokeDragDrop() ;

    if (m_rich_edit_ole != NULL)
    {
        m_rich_edit_ole->Release() ;
        m_rich_edit_ole = NULL ;
    }

    if (m_call_back != NULL)
    {
        m_call_back->Release() ;
        m_call_back = NULL ;
    }

    if (m_services != NULL)
    {
        m_services->Release() ;
        m_services = NULL ;
    }

    if (m_border != NULL)
    {
        m_border->Release() ;
        m_border = NULL ;
    }
}
示例#5
0
bool ISimpleDropTarget::Unregister()
{
	RevokeDragDrop(m_hwnd);
	OleUninitialize();
	m_hwnd = NULL;
	return true;
}
示例#6
0
void CFunctionView::OnInitialUpdate()
{
    CRichEditView::OnInitialUpdate();

    //Set Word Wrap OFF
    m_nWordWrap = WrapNone;

    //To turn on the horizontal scroll bar
    WrapChanged();

    //Try to create a Font
    BOOL bSuccess = m_omFont.CreateFont(10, 0, 0, 0, 400, FALSE, FALSE, 0,
                                        ANSI_CHARSET, OUT_DEFAULT_PRECIS,
                                        CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
                                        DEFAULT_PITCH | FF_MODERN, DEFAULT_FONT);

    //If succeeded, Set the Font
    if ( bSuccess )
    {
        SetFont(&m_omFont);
    }

    //Set the Richedit control to be Read-only
    GetRichEditCtrl().SetReadOnly();

    RevokeDragDrop(m_hWnd);
}
示例#7
0
void	CDLListWindow::OnClose()
{
	/* 設定を保存する */
	CIniFileO	pr(CDLOptions::s_DLIniFilePath, _T("DLList"));
	
	CRect rc;
	GetWindowRect(&rc);
	pr.SetValue(rc.top, _T("top"));
	pr.SetValue(rc.left, _T("left"));
	pr.SetValue(rc.right, _T("right"));
	pr.SetValue(rc.bottom, _T("bottom"));

	pr.SetValue(m_cmbParallelDL.GetCurSel(), _T("ParallelDL"));

	pr.SetValue(m_DLList.GetColumnWidth(0), _T("ColumnWidthURL"));

	CString strPath = MtlGetWindowText(m_cmbDLFolder);
	CDLOptions::_SavePathHistory(strPath, CDLOptions::s_vecImageDLFolderHistory);

	pr.SetValue(m_cmbDLOption.GetCurSel(), _T("DLOption"));

	RevokeDragDrop();

	CMessageLoop *pLoop = _Module.GetMessageLoop();
	pLoop->RemoveMessageFilter(this);

	DestroyWindow();
}
示例#8
0
void exit_drop_target (class CDropTarget *dt)
{
    if (dt)
    {
        RevokeDragDrop(dt->m_hwnd);
        dt->m_hwnd = NULL;
        dt->Release();
    }
}
示例#9
0
void QWindowsWindow::unregisterDropSite()
{
    if (m_data.hwnd && m_dropTarget) {
        m_dropTarget->Release();
        CoLockObjectExternal(m_dropTarget, false, true);
        RevokeDragDrop(m_data.hwnd);
        m_dropTarget = 0;
    }
}
示例#10
0
void DropTarget::DragRevoke()
{
	if (hwnd_ == NULL)
		return;

	// disconnect from OLE
	RevokeDragDrop(hwnd_);
	hwnd_ = NULL;
}
示例#11
0
void COpenView::OnDestroy()
{
	if (m_pDropHandler)
		RevokeDragDrop(m_hWnd);

	m_constraint.Persist(true, false);

	CFormView::OnDestroy();
}
示例#12
0
HRESULT CSimpleDropTarget::Revoke()
{
	if (m_hWndRegistered)
	{
		RevokeDragDrop(m_hWndRegistered);
		m_hWndRegistered=NULL;
	}

	return S_OK;
}
/** Native windows should implement this function by asking the OS to destroy OS-specific resource associated with the window (e.g. Win32 window handle) */
void FWindowsWindow::Destroy()
{
	if (OLEReferenceCount > 0)
	{
		RevokeDragDrop( HWnd );
		check( OLEReferenceCount == 0 );
	}

	::DestroyWindow( HWnd );
}
void LLDragDropWin32::reset()
{
	if ( mDropTarget )
	{
		RevokeDragDrop( mDropWindowHandle );
		CoLockObjectExternal( mDropTarget, FALSE, TRUE );
		mDropTarget->Release();  
	};
	
	OleUninitialize();
}
示例#15
0
//---------------------------------------------------------------------------
void __fastcall TForm1::FormDestroy(TObject *Sender)
{

//-----------------------------------
//OLEドラッグ&ドロップの後始末
//-----------------------------------
RevokeDragDrop(Form1->Handle);
DragAndDropTarget->Release();
OleUninitialize();

}
CBookmarksToolbar::~CBookmarksToolbar()
{
	ImageList_Destroy(m_himl);

	RevokeDragDrop(m_hToolbar);
	m_pbtdh->Release();

	RemoveWindowSubclass(m_hToolbar,BookmarksToolbarProcStub,SUBCLASS_ID);
	RemoveWindowSubclass(GetParent(m_hToolbar),BookmarksToolbarParentProcStub,PARENT_SUBCLASS_ID);

	CBookmarkItemNotifier::GetInstance().RemoveObserver(this);
}
	void playlist_switcher_t::notify_on_destroy()
	{
		m_selection_holder.release();

		g_windows.remove_item(this);

		RevokeDragDrop(get_wnd());

		standard_api_create_t<play_callback_manager>()->unregister_callback(this);
		m_playlist_api->unregister_callback(this);
		m_playlist_api.release();
		m_playback_api.release();
	}
示例#18
0
/***********************************************
  Enables / disables drag and drop for widget w
************************************************/
void qt_olednd_unregister( QWidget* widget, QOleDropTarget *dst )
{
#ifdef DEBUG_QDND_WIN
    qDebug("qt_olednd_unregister( %p ) winID: %08x", widget, widget ? widget->winId() : 0 );
#endif
    dst->releaseQt();
    dst->Release();
#ifndef Q_OS_TEMP

    CoLockObjectExternal( dst, false, true );
    RevokeDragDrop( widget->winId() );
#endif
}
示例#19
0
void DropHandler::RevokeHandler()
{
	// revoke 
	if (_isRegistered)
	{
		RevokeDragDrop(_dropWindow);
		_isRegistered = false;
	}

	if (_workingDirectoryDropTarget)
	{
		LOG(QString_NT("Registering Drop Target"));
		_workingDirectoryDropTarget->Release();
	}
}
Win32Window::~Win32Window()
{
    Win32Factory *pFactory = (Win32Factory*)Win32Factory::instance( getIntf() );
    pFactory->m_windowMap[m_hWnd] = NULL;

    if( m_hWnd )
    {
        if( m_dragDrop )
        {
            // Remove the window from the list of drop targets
            RevokeDragDrop( m_hWnd );
            m_pDropTarget->Release();
        }

        DestroyWindow( m_hWnd );
    }
}
示例#21
0
//-----------------------------------------------------------------------------
Win32Frame::~Win32Frame ()
{
	if (updateRegionList)
		free (updateRegionList);
	if (deviceContext)
		deviceContext->forget ();
	if (tooltipWindow)
		DestroyWindow (tooltipWindow);
	if (windowHandle)
	{
		RevokeDragDrop (windowHandle);
		SetWindowLongPtr (windowHandle, GWLP_USERDATA, (LONG_PTR)NULL);
		DestroyWindow (windowHandle);
	}
	if (backBuffer)
		backBuffer->forget ();
	destroyWindowClass ();
}
示例#22
0
GHOST_WindowWin32::~GHOST_WindowWin32()
{
	if (m_Bar)
	{
		m_Bar->SetProgressState(m_hWnd, TBPF_NOPROGRESS);
		m_Bar->Release();
	};

	if (m_wintab) {
		GHOST_WIN32_WTClose fpWTClose = (GHOST_WIN32_WTClose) ::GetProcAddress(m_wintab, "WTClose");
		if (fpWTClose) {
			if (m_tablet)
				fpWTClose(m_tablet);
			if (m_tabletData)
				delete m_tabletData;
			m_tabletData = NULL;
		}
	}
	if (m_customCursor) {
		DestroyCursor(m_customCursor);
		m_customCursor = NULL;
	}

	::wglMakeCurrent(NULL, NULL);
	m_multisampleEnabled = GHOST_kFailure;
	m_multisample = 0;
	setDrawingContextType(GHOST_kDrawingContextTypeNone);
	if (m_hDC && m_hDC != s_firstHDC) {
		::ReleaseDC(m_hWnd, m_hDC);
		m_hDC = 0;
	}
	if (m_hWnd) {
		if (m_dropTarget) {
			// Disable DragDrop
			RevokeDragDrop(m_hWnd);
			// Release our reference of the DropTarget and it will delete itself eventually.
			m_dropTarget->Release();
		}

		::DestroyWindow(m_hWnd);
		m_hWnd = 0;
	}
}
示例#23
0
void COleDropTarget::Revoke()
{
	ASSERT_VALID(this);
	ASSERT(m_lpDataObject == NULL);

	if (m_hWnd == NULL)
	{
		ASSERT(m_nTimerID == 0xffff);
		return;
	}

	// disconnect from OLE
	RevokeDragDrop(m_hWnd);
	CoLockObjectExternal((LPUNKNOWN)GetInterface(&IID_IUnknown), FALSE, TRUE);

	// disconnect internal data
	CWnd::FromHandle(m_hWnd)->m_pDropTarget = NULL;
	m_hWnd = NULL;
}
示例#24
0
文件: Win32Wnd.cpp 项目: koz4k/soccer
void Ctrl::WndFree()
{
	GuiLock __;
	if(!top) return;
	RevokeDragDrop(GetHWND());
	ReleaseUDropTarget(top->dndtgt);
	isopen = false;
	if(!top) return;
	HWND owner = GetWindow(top->hwnd, GW_OWNER);// CXL 31.10.2003 z DoRemove
	bool focus = ::GetFocus() == top->hwnd;
	LLOG("Ctrl::WndDestroy owner " << (void *)owner
	     << " focus " << focus
	     << " ::GetFocus() " << (void *)::GetFocus());
	if(owner && focus) { // CXL 7.11.2003 presun - melo by to fungovat take a neblikat...
		LLOG("Ctrl::WndFree->SetFocus " << UPP::Name(Ctrl::CtrlFromHWND(owner)));
		::SetFocus(owner);
	}
	LLOG(LOG_END << "//Ctrl::WndFree() in " <<UPP::Name(this));
	delete top;
	top = NULL;
}
示例#25
0
GHOST_WindowWin32::~GHOST_WindowWin32()
{
	if (m_Bar) {
		m_Bar->SetProgressState(m_hWnd, TBPF_NOPROGRESS);
		m_Bar->Release();
	}

	if (m_wintab) {
		GHOST_WIN32_WTClose fpWTClose = (GHOST_WIN32_WTClose) ::GetProcAddress(m_wintab, "WTClose");
		if (fpWTClose) {
			if (m_tablet)
				fpWTClose(m_tablet);
			if (m_tabletData)
				delete m_tabletData;
			m_tabletData = NULL;
		}
	}

	if (m_customCursor) {
		DestroyCursor(m_customCursor);
		m_customCursor = NULL;
	}

	if (m_hWnd != NULL && m_hDC != NULL && releaseNativeHandles()) {
		::ReleaseDC(m_hWnd, m_hDC);
	}

	if (m_hWnd) {
		if (m_dropTarget) {
			// Disable DragDrop
			RevokeDragDrop(m_hWnd);
			// Release our reference of the DropTarget and it will delete itself eventually.
			m_dropTarget->Release();
		}

		::DestroyWindow(m_hWnd);
		m_hWnd = 0;
	}
}
示例#26
0
	void Win32DropTarget::unregisterWithOS()
	{
		RevokeDragDrop(mHWnd);
		CoLockObjectExternal(this, FALSE, FALSE);
	}
示例#27
0
void UnregisterFileDropping( HWND hwnd )
{
	RevokeDragDrop( hwnd );
}
示例#28
0
// call before the bar window is destroyed
void exit_drop_targ (class TinyDropTarget *m_TinyDropTarget)
{
	RevokeDragDrop(m_TinyDropTarget->m_hwnd);
	m_TinyDropTarget->Release();
}
示例#29
0
CDragDrop::~CDragDrop()
{
	//DestroyDragImageBits();
	//DestroyDragImageWindow();

	if (mb_DragDropRegistered && ghWnd)
	{
		mb_DragDropRegistered = FALSE;
		RevokeDragDrop(ghWnd);
	}

	MSectionLockSimple CS;
	CS.Lock(mp_CrThreads);
	BOOL lbEmpty = m_OpThread.empty() && !InDragDrop();
	CS.Unlock();

	if (!lbEmpty)
	{
		if (MessageBox(ghWnd, L"Not all shell operations was finished!\r\nDo You want to terminate them (it's may be harmful)?",
		              gpConEmu->GetDefaultTitle(), MB_YESNO|MB_ICONEXCLAMATION) == IDYES)
		{
			// Terminate all shell (copying) threads
			CS.Lock(mp_CrThreads);
			//std::vector<ThInfo>::iterator iter = m_OpThread.begin();

			//while (iter != m_OpThread.end())
			while (m_OpThread.size() > 0)
			{
				INT_PTR j = m_OpThread.size()-1;
				const ThInfo* iter = &(m_OpThread[j]);

				HANDLE hThread = iter->hThread;
				TerminateThread(hThread, 100);
				CloseHandle(hThread);

				//iter = m_OpThread.erase(iter);
				m_OpThread.erase(j);
			}

			CS.Unlock();
		}
		else
		{
			// Wait until finished
			BOOL lbActive = TRUE;

			while (lbActive)
			{
				Sleep(100);
				CS.Lock(mp_CrThreads);
				lbActive = (!m_OpThread.empty()) || InDragDrop();
				CS.Unlock();
			}
		}
	}
	else
	{
		// незаконченных нитей нет
		// -- Leave Critical Section(&m_CrThreads); -- 101229 секция уже закрыта
	}

	// Завершение всех нитей драга
	TerminateDrag();


	//if (m_pfpi) free(m_pfpi); m_pfpi=NULL;

	//if (mp_DesktopID) { CoTaskMemFree(mp_DesktopID); mp_DesktopID = NULL; }
	SafeDelete(mp_CrThreads);
}
示例#30
0
static void exit_DeskDropTarget (HWND hwnd)
{
    RevokeDragDrop(hwnd);
    m_DeskDropTarget->Release();
}