コード例 #1
0
ファイル: encrypt.cpp プロジェクト: Seldom/miranda-ng
static INT_PTR srvEnumProviders(WPARAM wParam, LPARAM lParam)
{
	if (wParam && lParam) {
		*(int*)wParam = arProviders.getCount();
		*(CRYPTO_PROVIDER***)lParam = arProviders.getArray();
	}
	return 0;
}
コード例 #2
0
ファイル: buttonsbar.cpp プロジェクト: 0xmono/miranda-ng
static int SaveTree(HWND hToolBarTree)
{
	bool RSide = false;
	int count = 10;
	DWORD loc_sepcout = 0;
	TCHAR strbuf[128];

	TVITEM tvi;
	tvi.mask = TVIF_TEXT | TVIF_PARAM | TVIF_HANDLE;
	tvi.hItem = TreeView_GetRoot(hToolBarTree);
	tvi.pszText = strbuf;
	tvi.cchTextMax = sizeof(strbuf);
	{
		mir_cslock lck(ToolBarCS);

		while (tvi.hItem != NULL) {
			TreeView_GetItem(hToolBarTree, &tvi);

			if (_tcscmp(tvi.pszText, MIDDLE_SEPARATOR) == 0) {
				RSide = true;
				count = TreeView_GetCount(hToolBarTree) * 10 - count;
				tvi.hItem = TreeView_GetNextSibling(hToolBarTree, tvi.hItem);
				continue;
			}
			CustomButtonData *cbd = (CustomButtonData*)tvi.lParam;
			if (cbd) {
				if (cbd->opFlags) {
					cbd->bIMButton = (cbd->opFlags & BBSF_IMBUTTON) != 0;
					cbd->bChatButton = (cbd->opFlags & BBSF_CHATBUTTON) != 0;
					cbd->bCanBeHidden = (cbd->opFlags & BBSF_CANBEHIDDEN) != 0;
				}
				if (RSide && cbd->bLSided) {
					cbd->bLSided = false;
					cbd->bRSided = true;
					cbd->opFlags |= BBSF_NTBSWAPED;
				}
				else if (!RSide && cbd->bRSided) {
					cbd->bLSided = true;
					cbd->bRSided = false;
					cbd->opFlags |= BBSF_NTBSWAPED;
				}
				if (!TreeView_GetCheckState(hToolBarTree, tvi.hItem)) {
					cbd->bIMButton = false;
					cbd->bChatButton = false;

					if (cbd->bSeparator && !strcmp(cbd->pszModuleName, "Tabsrmm_sep"))
						cbd->opFlags = BBSF_NTBDESTRUCT;
				}
				else {
					if (!cbd->bIMButton && !cbd->bChatButton)
						cbd->bIMButton = true;
					if (cbd->bSeparator && !strcmp(cbd->pszModuleName, "Tabsrmm_sep")) {
						cbd->bHidden = 0;
						cbd->opFlags &= ~BBSF_NTBDESTRUCT;
						++loc_sepcout;
					}
				}

				cbd->dwPosition = (DWORD)count;
				CB_WriteButtonSettings(NULL, cbd);

				if (!(cbd->opFlags & BBSF_NTBDESTRUCT))
					(RSide) ? (count -= 10) : (count += 10);
			}
			
			HTREEITEM hItem = TreeView_GetNextSibling(hToolBarTree, tvi.hItem);
			if (cbd->opFlags & BBSF_NTBDESTRUCT)
				TreeView_DeleteItem(hToolBarTree, tvi.hItem);
			tvi.hItem = hItem;
		}

		qsort(LButtonsList.getArray(), LButtonsList.getCount(), sizeof(void*), sstSortButtons);
		qsort(RButtonsList.getArray(), RButtonsList.getCount(), sizeof(void*), sstSortButtons);
	}
	db_set_dw(0, "TabSRMM_Toolbar", "SeparatorsCount", loc_sepcout);
	dwSepCount = loc_sepcout;
	return 1;
}
コード例 #3
0
ファイル: proto_utils.cpp プロジェクト: Seldom/miranda-ng
MIR_APP_DLL(void) Proto_EnumProtocols(int *nProtos, PROTOCOLDESCRIPTOR ***pProtos)
{
	if (nProtos) *nProtos = protos.getCount();
	if (pProtos) *pProtos = protos.getArray();
}