• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ ThumbInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ThumbInfo的典型用法代码示例。如果您正苦于以下问题:C++ ThumbInfo类的具体用法?C++ ThumbInfo怎么用?C++ ThumbInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ThumbInfo类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: OnContactDeleted

static int OnContactDeleted(WPARAM wParam, LPARAM lParam)
{
	HANDLE hContact = (HANDLE)wParam;
	ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
	if (pThumb) {
		pThumb->DeleteContactPos();
		thumbList.RemoveThumb(pThumb);
	}
	return 0;
}
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:10,代码来源:main.cpp


示例2: OnContactMenu_Remove

static INT_PTR OnContactMenu_Remove(WPARAM hContact, LPARAM)
{
	ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
	if (pThumb) {
		pThumb->DeleteContactPos();
		thumbList.RemoveThumb(pThumb);
	}

	DestroyMenu(hContactMenu);
	return 0;
}
开发者ID:truefriend-cz,项目名称:miranda-ng,代码行数:11,代码来源:main.cpp


示例3: OnContactIconChanged

static int OnContactIconChanged(WPARAM hContact, LPARAM lParam)
{
	ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
	if (pThumb) {
		pThumb->RefreshContactIcon((int)lParam);
		//pThumb->ThumbSelect( FALSE );
		//SetTimer( pThumb->hwnd, TIMERID_SELECT_T, 1000, NULL );
	}

	return 0;
}
开发者ID:truefriend-cz,项目名称:miranda-ng,代码行数:11,代码来源:main.cpp


示例4: OnContactMenu_Remove

static INT_PTR OnContactMenu_Remove(WPARAM wParam, LPARAM lParam)
{
	HANDLE hContact = (HANDLE)wParam;
	ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
	if (pThumb) {
		pThumb->DeleteContactPos();
		thumbList.RemoveThumb(pThumb);
	}

	DestroyMenu(hContactMenu);
	return 0;
}
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:12,代码来源:main.cpp


示例5: DragLeave

HRESULT STDMETHODCALLTYPE CDropTarget::DragLeave( )
{
	ThumbInfo *pThumb = thumbList.FindThumb( hwndCurDrag );

	if ( NULL != pThumb )
	{
		pThumb->ThumbDeselect( TRUE );
	}

	hwndCurDrag = NULL;
	
	return S_OK;
}
开发者ID:biddyweb,项目名称:miranda-ng,代码行数:13,代码来源:filedrop.cpp


示例6: OnContactDrop

static int OnContactDrop(WPARAM hContact, LPARAM)
{
	RECT rcMiranda;
	RECT rcThumb;

	ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);

	if (hNewContact == hContact && pThumb != NULL) {
		hNewContact = NULL;

		GetWindowRect(hwndMiranda, &rcMiranda);
		pThumb->GetThumbRect(&rcThumb);
	}

	SaveContactsPos();
	return 1;
}
开发者ID:truefriend-cz,项目名称:miranda-ng,代码行数:17,代码来源:main.cpp


示例7: LoadContact

static void LoadContact(MCONTACT hContact)
{
	ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
	if (hContact == NULL)
		return;

	DWORD	dwPos = db_get_dw(hContact, MODULE, "ThumbsPos", (DWORD)-1);
	if (dwPos != -1) {
		TCHAR	*ptName = pcli->pfnGetContactDisplayName(hContact, 0);
		if (ptName != NULL) {
			int nX = DB_POS_GETX(dwPos);
			int nY = DB_POS_GETY(dwPos);

			CreateThumbWnd(ptName, hContact, nX, nY);
			pThumb->PositionThumb(nX, nY);
		}
	}
}
开发者ID:truefriend-cz,项目名称:miranda-ng,代码行数:18,代码来源:main.cpp


示例8: LoadContact

static void LoadContact( HANDLE hContact )
{
	ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
	if (hContact == NULL)
		return;

	DWORD	dwPos = db_get_dw( hContact, MODULE, "ThumbsPos", (DWORD)-1);
	if ( dwPos != -1) {
		TCHAR	*ptName = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, (LPARAM)GCDNF_TCHAR);
		if ( ptName != NULL ) {
			int nX = DB_POS_GETX( dwPos );
			int nY = DB_POS_GETY( dwPos );

			CreateThumbWnd(ptName, hContact, nX, nY);
			pThumb->PositionThumb(nX, nY);
		}
	}
}
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:18,代码来源:main.cpp


示例9: BeginDeferWindowPos

void ThumbInfo::PositionThumb(int nX, int nY)
{
	POINT pos = { nX, nY };

	HDWP hdwp = BeginDeferWindowPos(1);

	ThumbInfo *pThumb = this;
	while (pThumb) {
		pThumb->PositionThumbWorker(pos.x, pos.y, &pos);
		if (nullptr != pThumb->hwnd) /* Wine fix. */
			hdwp = DeferWindowPos(hdwp, pThumb->hwnd, HWND_TOPMOST, pos.x, pos.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);

		pThumb->ptPos = pos;
		pos.x += pThumb->szSize.cx;

		pThumb = fcOpt.bMoveTogether ? thumbList.FindThumb(pThumb->dockOpt.hwndRight) : nullptr;
	}

	EndDeferWindowPos(hdwp);
}
开发者ID:tweimer,项目名称:miranda-ng,代码行数:20,代码来源:thumbs.cpp


示例10: CreateThumbWnd

static void CreateThumbWnd(TCHAR *ptszName, MCONTACT hContact, int nX, int nY)
{
	ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
	if (pThumb != NULL)
		return;

	// Prepare for window creation
	HWND hwnd = CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_TOPMOST, WND_CLASS, ptszName, WS_POPUP, nX, nY, 50, 20, NULL, NULL, hInst, NULL);
	if (hwnd == NULL)
		return;

	pThumb = thumbList.AddThumb(hwnd, ptszName, hContact);
	SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)pThumb);
	pThumb->ResizeThumb();

	pThumb->SetThumbOpacity(fcOpt.thumbAlpha);
	ShowWindow(hwnd, (fcOpt.bHideAll || HideOnFullScreen() || fcOpt.bHideOffline || (fcOpt.bHideWhenCListShow && bIsCListShow)) ? SW_HIDE : SW_SHOWNA);
	pThumb->PositionThumb(nX, nY);

	// force repaint
	pThumb->UpdateContent();
}
开发者ID:truefriend-cz,项目名称:miranda-ng,代码行数:22,代码来源:main.cpp


示例11: OnContactDrag

static int OnContactDrag(WPARAM hContact, LPARAM)
{
	POINT pt;
	GetCursorPos(&pt);

	ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
	if (pThumb == NULL) {
		int idStatus = GetContactStatus(hContact);

		if (!fcOpt.bHideAll && !HideOnFullScreen() && (!fcOpt.bHideOffline || IsStatusVisible(idStatus)) && (!fcOpt.bHideWhenCListShow || !bIsCListShow)) {
			CreateThumbWnd(pcli->pfnGetContactDisplayName(hContact, 0), hContact, pt.x, pt.y);
			ThumbInfo *pNewThumb = thumbList.FindThumbByContact(hContact);
			ShowWindow(pNewThumb->hwnd, SW_SHOWNA);
			hNewContact = hContact;

			OnStatusChanged();
		}
	}
	else if (hContact == hNewContact)
		pThumb->PositionThumb(pt.x - 5, pt.y - 5);

	return hNewContact != NULL;
}
开发者ID:truefriend-cz,项目名称:miranda-ng,代码行数:23,代码来源:main.cpp


示例12: WindowFromPoint

HRESULT STDMETHODCALLTYPE CDropTarget::DragEnter( IDataObject *pData, DWORD fKeyState, POINTL pt, DWORD *pdwEffect)
{
	FORMATETC	feFile	 = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
	FORMATETC	feText	 = { CF_TEXT, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };

	if ( S_OK == pData->QueryGetData( &feFile ) ||
		 S_OK == pData->QueryGetData( &feText ))
	{
		POINT shortPt;
		shortPt.x = pt.x; 
		shortPt.y = pt.y;
		
		HWND hwnd = WindowFromPoint( shortPt );
		
		ThumbInfo *pThumb = thumbList.FindThumb(hwnd);
		if (pThumb)
		{
			hwndCurDrag = hwnd;
			pThumb->ThumbSelect( TRUE );
		}
	}

	return DragOver( fKeyState, pt, pdwEffect);
}
开发者ID:biddyweb,项目名称:miranda-ng,代码行数:24,代码来源:filedrop.cpp


示例13: CommWndProc

static LRESULT __stdcall CommWndProc(HWND	hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	ThumbInfo *pThumb = thumbList.FindThumb(hwnd);

	switch (uMsg) {
	case WM_RBUTTONUP:
		{
			POINT pt;
			pt.x = LOWORD(lParam);
			pt.y = HIWORD(lParam);

			if (pThumb) pThumb->ThumbDeselect(TRUE);

			ClientToScreen(hwnd, &pt);
			ShowContactMenu(hwnd, pt);
		}
		break;

	case WM_CLOSE:
		DestroyWindow(hwnd);
		break;

	case WM_NCPAINT:
		if (pThumb) {
			HDC hdc = GetWindowDC(hwnd);
			BitBlt(hdc, 0, 0, pThumb->bmpContent.getWidth(), pThumb->bmpContent.getHeight(), pThumb->bmpContent.getDC(), 0, 0, SRCCOPY);
			//RepaintWindow( hwnd, hdc );
			ReleaseDC(hwnd, hdc);
			ValidateRect(hwnd, NULL);
			return 0;
		}

	case WM_PAINT:
		if (pThumb) {
			PAINTSTRUCT ps;
			HDC hdc = BeginPaint(hwnd, &ps);
			BitBlt(hdc, 0, 0, pThumb->bmpContent.getWidth(), pThumb->bmpContent.getHeight(), pThumb->bmpContent.getDC(), 0, 0, SRCCOPY);
			//RepaintWindow( hwnd, hdc );
			EndPaint(hwnd, &ps);
			break;
		}

	case WM_PRINT:
	case WM_PRINTCLIENT:
		if (pThumb) {
			BitBlt((HDC)wParam, 0, 0, pThumb->bmpContent.getWidth(), pThumb->bmpContent.getHeight(), pThumb->bmpContent.getDC(), 0, 0, SRCCOPY);
			//RepaintWindow(hwnd, (HDC)wParam);
			break;
		}

	case WM_MEASUREITEM:
		Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam);
		break;

	case WM_DRAWITEM:
		Menu_DrawItem((LPDRAWITEMSTRUCT)lParam);
		break;

	case WM_LBUTTONDOWN:
		if (pThumb) pThumb->OnLButtonDown();
		break;

	case WM_MOUSEMOVE:
		if (pThumb) pThumb->OnMouseMove(LOWORD(lParam), HIWORD(lParam));
		break;

	case WM_LBUTTONUP:
		if (pThumb) pThumb->OnLButtonUp();
		break;

	case WM_LBUTTONDBLCLK:
		// Popup message dialog
		if (!fcOpt.bUseSingleClick && pThumb)
			pThumb->PopupMessageDialog();
		break;

	case WM_RBUTTONDOWN:
		if (bEnableTip && fcOpt.bShowTip && pThumb)
			pThumb->KillTip();
		break;

	case WM_REFRESH_CONTACT:
		if (pThumb) {
			_tcsncpy(pThumb->ptszName, pcli->pfnGetContactDisplayName(pThumb->hContact, 0), USERNAME_LEN - 1);
			pThumb->RefreshContactStatus((int)lParam);
			pThumb->ResizeThumb();
		}
		break;

	case WM_TIMER:
		if (pThumb)
			pThumb->OnTimer(wParam);
		break;

	case WM_HOTKEY:
		pThumb = thumbList.FindThumb((HWND)wParam);
		if (pThumb)
			pThumb->PopupMessageDialog();
	}

//.........这里部分代码省略.........
开发者ID:truefriend-cz,项目名称:miranda-ng,代码行数:101,代码来源:main.cpp


示例14: Clist_GetImageList

void ThumbInfo::ResizeThumb()
{
	int index = FLT_FONTID_NOTONLIST;

	himlMiranda = Clist_GetImageList();
	if (himlMiranda == nullptr)
		return;

	SIZEL sizeIcon;
	ImageList_GetIconSize_my(himlMiranda, sizeIcon);

	HDC hdc = GetWindowDC(hwnd);
	if (!db_get_b(hContact, "CList", "NotOnList", 0)) {
		char *szProto = GetContactProto(hContact);
		if (nullptr != szProto) {
			int nStatus = Proto_GetStatus(szProto);
			int nContactStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
			int nApparentMode = db_get_w(hContact, szProto, "ApparentMode", 0);

			if ((nStatus == ID_STATUS_INVISIBLE && nApparentMode == ID_STATUS_ONLINE) ||
				(nStatus != ID_STATUS_INVISIBLE && nApparentMode == ID_STATUS_OFFLINE)) {
				if (ID_STATUS_OFFLINE == nContactStatus)
					index = FLT_FONTID_OFFINVIS;
				else
					index = FLT_FONTID_INVIS;
			}
			else if (ID_STATUS_OFFLINE == nContactStatus)
				index = FLT_FONTID_OFFLINE;
			else
				index = FLT_FONTID_CONTACTS;
		}
	}
	else index = FLT_FONTID_NOTONLIST;

	HFONT hOldFont = (HFONT)SelectObject(hdc, hFont[index]);

	// Get text and icon sizes
	SIZEL sizeText;
	GetTextExtentPoint32(hdc, ptszName, (int)mir_wstrlen(ptszName), &sizeText);

	SelectObject(hdc, hOldFont);

	// Transform text size
	POINT ptText;
	ptText.x = sizeText.cx;
	ptText.y = sizeText.cy;
	LPtoDP(hdc, &ptText, 1);

	szSize.cx = fcOpt.bFixedWidth ? fcOpt.nThumbWidth : sizeIcon.cx + ptText.x + 10;
	szSize.cy = ((sizeIcon.cy > ptText.y) ? sizeIcon.cy : ptText.y) + 4;

	SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, szSize.cx, szSize.cy, SWP_NOMOVE | SWP_NOACTIVATE);

	RefreshContactIcon(0xFFFFFFFF);

	ReleaseDC(hwnd, hdc);

	// Move the docked widnow if needed
	ThumbInfo *pNextThumb = thumbList.FindThumb(dockOpt.hwndRight);
	if (pNextThumb) {
		RECT rcThumb;
		GetThumbRect(&rcThumb);
		pNextThumb->PositionThumb(rcThumb.right, rcThumb.top);
	}
}
开发者ID:tweimer,项目名称:miranda-ng,代码行数:65,代码来源:thumbs.cpp



注:本文中的ThumbInfo类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ThumbItem类代码示例发布时间:2022-05-31
下一篇:
C++ ThriftBuffer类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap