当前位置: 首页>>代码示例>>C++>>正文


C++ IsWindowVisible函数代码示例

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


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

示例1: funcProc

    LRESULT CALLBACK funcProc(HWND hwnd, UINT iMessage, WPARAM wParam, LPARAM
        lParam)
    {
        static EDITDATA *ptr;
        static CCFUNCDATA **funcs[100];
        static int funcpos[100];
        static int nesting[100];
        static int curarg[100];
        static int index;
        static HFONT normal, bold, oldfont;
        static POINT origin[100];
        static HBITMAP leftarrow, rightarrow;
        int offset;
        int oldbk, oldfg;
        LOGFONT lf;
        PAINTSTRUCT ps;
        HPEN pen;
        HBRUSH brush;
        HDC dc;
        SIZE size1, size2;
        RECT r;
        char * fragments[4];
        switch(iMessage)
        {
            case WM_CREATE:
                leftarrow = LoadBitmap(hInstance, "ID_CCLEFTARR");
                rightarrow = LoadBitmap(hInstance, "ID_CCRIGHTARR");
                lf = systemDialogFont;
                normal = (HFONT)CreateFontIndirect(&lf);
                lf.lfWeight = FW_BOLD;
                bold = CreateFontIndirect(&lf);
                SetLayeredWindowAttributes(hwnd, TRANSPARENT_COLOR, 0xff, LWA_COLORKEY);
                break;
            case WM_USER:
                funcs[index] = (CCFUNCDATA *)lParam;
                funcpos[index] = 0;
                nesting[index]  = 0;
                curarg[index] = 0;
                index++;
                if (IsWindowVisible(hwnd))
                    SetFuncWindowSize(hwnd, normal, bold, origin[index-1], funcs[index-1], funcpos[index-1], curarg[index-1]);
                    
                break;
            case WM_USER + 1:
            {
                POINTL pt;
                ptr = (EDITDATA *)lParam;
                posfromchar((HWND)wParam, ptr, &pt,ptr->selendcharpos);
                origin[index-1].x = pt.x;
                origin[index-1].y = pt.y;
                MapWindowPoints((HWND)wParam, hwndFrame, &origin[index-1], 1);
                origin[index-1].y += ptr->cd->txtFontHeight;
            }
                break;                
            case WM_USER + 2:
                curarg[index-1] = wParam;
                SetFuncWindowSize(hwnd, normal, bold, origin[index-1], funcs[index-1], funcpos[index-1], curarg[index-1]);
                break;

            case WM_SHOWWINDOW:
            {
                if (wParam)
                {
                    SetFuncWindowSize(hwnd, normal, bold, origin[index-1], funcs[index-1], funcpos[index-1], curarg[index-1]);
                }
                else
                {
                    ccFreeFunctionList(funcs[--index]);
                    if (index)
                        ShowWindow(hwnd, SW_SHOW);
                }
            }
            case WM_USER + 3:
                if (IsWindowVisible(hwnd))
                {
                    switch(wParam)
                    {
                        case VK_DOWN:
                            if (GetFuncCount(funcs[index-1]) > 1)
                            {
                                funcpos[index-1] ++;
                                if (funcpos[index-1] >= GetFuncCount(funcs[index-1]))
                                    funcpos[index-1] = 0;
                                SetFuncWindowSize(hwnd, normal, bold, origin[index-1], funcs[index-1], funcpos[index-1], curarg[index-1]);

                                return 0;
                            }
                        case VK_UP:
                            if (GetFuncCount(funcs[index-1]) > 1)
                            {
                                funcpos[index-1] --;
                                if (funcpos[index-1] < 0)
                                    funcpos[index-1] = GetFuncCount(funcs[index-1]);
                                SetFuncWindowSize(hwnd, normal, bold, origin[index-1], funcs[index-1], funcpos[index-1], curarg[index-1]);
                                return 0;
                            }
                        case VK_HOME:
                        case VK_END:
                        case VK_PRIOR:
                        case VK_NEXT:
//.........这里部分代码省略.........
开发者ID:bencz,项目名称:OrangeC,代码行数:101,代码来源:xcodefunc.c

示例2: ProcessException

static void ProcessException( EXCEPTION_POINTERS* pExceptionPtrs )
{
    int rc;
    UINT uiMBFlags =
        0
        | MB_SYSTEMMODAL
        | MB_TOPMOST
        | MB_SETFOREGROUND
        ;

    HWND hwndMBOwner = FindConsoleHandle();

    if (!hwndMBOwner || !IsWindowVisible(hwndMBOwner))
        hwndMBOwner = GetDesktopWindow();

    if ( !g_pfnMiniDumpWriteDumpFunc )
    {
        MsgBox
        (
            hwndMBOwner,
            _T("The creation of a crash dump for analysis by the Hercules ")
            _T("development team is NOT possible\nbecause the required 'DbgHelp.dll' ")
            _T("is missing or is not installed or was otherwise not located.")
            ,_T("OOPS!  Hercules has crashed!"),
            uiMBFlags
                | MB_ICONERROR
                | MB_OK
            ,0                  // (default/neutral language)
            ,(15 * 1000)        // (timeout == 15 seconds)
        );

        return;
    }

    if ( IDYES == ( rc = MsgBox
    (
        hwndMBOwner,
        _T("The creation of a crash dump for further analysis by ")
        _T("the Hercules development team is strongly suggested.\n\n")
        _T("Would you like to create a crash dump for ")
        _T("the Hercules development team to analyze?")
        ,_T("OOPS!  Hercules has crashed!"),
        uiMBFlags
            | MB_ICONERROR
            | MB_YESNO
        ,0                      // (default/neutral language)
        ,(10 * 1000)            // (timeout == 10 seconds)
    ))
        || MB_TIMEDOUT == rc
    )
    {
        if ( CreateMiniDump( pExceptionPtrs ) && MB_TIMEDOUT != rc )
        {
            MsgBox
            (
                hwndMBOwner,
                _T("Please send the dump to the Hercules development team for analysis.")
                ,_T("Dump Complete"),
                uiMBFlags
                    | MB_ICONEXCLAMATION
                    | MB_OK
                ,0              // (default/neutral language)
                ,(5 * 1000)     // (timeout == 5 seconds)
            );
        }
    }
}
开发者ID:2kranki,项目名称:hercules-390,代码行数:67,代码来源:bootstrap.c

示例3: fnGetWindowVisibleState

int fnGetWindowVisibleState(HWND hWnd, int iStepX, int iStepY)
{
	RECT rc, rcWin, rcWorkArea;
	POINT pt;
	register int i, j, width, height, iCountedDots = 0, iNotCoveredDots = 0;
	BOOL bPartiallyCovered = FALSE;
	HWND hAux = 0;

	if (hWnd == NULL) {
		SetLastError(0x00000006);       //Wrong handle
		return -1;
	}

	//Some defaults now. The routine is designed for thin and tall windows.
	if (iStepX <= 0)
		iStepX = 4;
	if (iStepY <= 0)
		iStepY = 16;

	if (IsIconic(hWnd) || !IsWindowVisible(hWnd))
		return GWVS_HIDDEN;

	if (CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0))
		return GWVS_VISIBLE;

	GetWindowRect(hWnd, &rcWin);

	SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, FALSE);
	HMONITOR hMon = MonitorFromWindow(hWnd, MONITOR_DEFAULTTONEAREST);
	MONITORINFO mi;
	mi.cbSize = sizeof(mi);
	if (GetMonitorInfo(hMon, &mi))
		rcWorkArea = mi.rcWork;

	IntersectRect(&rc, &rcWin, &rcWorkArea);

	width = rc.right - rc.left;
	height = rc.bottom - rc.top;

	for (i = rc.top; i < rc.bottom; i += (height / iStepY)) {
		pt.y = i;
		for (j = rc.left; j < rc.right; j += (width / iStepX)) {
			pt.x = j;
			hAux = WindowFromPoint(pt);
			while (GetParent(hAux) != NULL)
				hAux = GetParent(hAux);
			if (hAux != hWnd && hAux != NULL)       //There's another window!
				bPartiallyCovered = TRUE;
			else
				iNotCoveredDots++;  //Let's count the not covered dots.
			iCountedDots++; //Let's keep track of how many dots we checked.
		}
	}

	if (iNotCoveredDots == iCountedDots)    //Every dot was not covered: the window is visible.
		return GWVS_VISIBLE;

	if (iNotCoveredDots == 0)  //They're all covered!
		return GWVS_COVERED;

	//There are dots which are visible, but they are not as many as the ones we counted: it's partially covered.
	return GWVS_PARTIALLY_COVERED;
}
开发者ID:Ganster41,项目名称:miranda-ng,代码行数:63,代码来源:clistmod.cpp

示例4: test_word_wrap


//.........这里部分代码省略.........
    lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0);
    ok(lines == 1, "Line was not expected to wrap (lines=%d).\n", lines);

    SetWindowLong(hwnd, GWL_STYLE, dwCommonStyle);
    pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point);
    ok(!pos ||
        broken(pos == lstrlen(text)), /* Win9x, WinME and NT4 */
        "pos=%d indicating word wrap when none is expected.\n", pos);
    lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0);
    ok(lines == 1, "Line was not expected to wrap (lines=%d).\n", lines);
    DestroyWindow(hwnd);

    hwnd = CreateWindow(RICHEDIT_CLASS10A, NULL,
                        dwCommonStyle|WS_HSCROLL|ES_AUTOHSCROLL,
                        0, 0, 200, 80, NULL, NULL, hmoduleRichEdit, NULL);
    ok(hwnd != NULL, "error: %d\n", (int) GetLastError());
    res = SendMessage(hwnd, WM_SETTEXT, 0, (LPARAM) text);
    ok(res, "WM_SETTEXT failed.\n");
    pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point);
    ok(!pos ||
        broken(pos == lstrlen(text)), /* Win9x, WinME and NT4 */
        "pos=%d indicating word wrap when none is expected.\n", pos);
    lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0);
    ok(lines == 1, "Line was not expected to wrap (lines=%d).\n", lines);

    SetWindowLong(hwnd, GWL_STYLE, dwCommonStyle);
    pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point);
    ok(!pos ||
        broken(pos == lstrlen(text)), /* Win9x, WinME and NT4 */
        "pos=%d indicating word wrap when none is expected.\n", pos);
    lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0);
    ok(lines == 1, "Line was not expected to wrap (lines=%d).\n", lines);

    /* Test the effect of EM_SETTARGETDEVICE on word wrap. */
    res = SendMessage(hwnd, EM_SETTARGETDEVICE, 0, 1);
    ok(res, "EM_SETTARGETDEVICE failed (returned %d).\n", res);
    pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point);
    ok(!pos ||
        broken(pos == lstrlen(text)), /* Win9x, WinME and NT4 */
        "pos=%d indicating word wrap when none is expected.\n", pos);
    lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0);
    ok(lines == 1, "Line was not expected to wrap (lines=%d).\n", lines);

    res = SendMessage(hwnd, EM_SETTARGETDEVICE, 0, 0);
    ok(res, "EM_SETTARGETDEVICE failed (returned %d).\n", res);
    pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point);
    ok(pos, "pos=%d indicating no word wrap when it is expected.\n", pos);
    DestroyWindow(hwnd);

    /* First lets see if the text would wrap normally (needed for reference) */
    hwnd = CreateWindow(RICHEDIT_CLASS10A, NULL, dwCommonStyle,
                        0, 0, 200, 80, NULL, NULL, hmoduleRichEdit, NULL);
    ok(hwnd != NULL, "error: %d\n", (int) GetLastError());
    ok(IsWindowVisible(hwnd), "Window should be visible.\n");
    res = SendMessage(hwnd, EM_REPLACESEL, FALSE, (LPARAM) text);
    ok(res, "EM_REPLACESEL failed.\n");
    /* Should have wrapped */
    reflines[0] = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0);
    ok(reflines[0] > 1, "Line was expected to wrap (%d lines).\n", reflines[0]);
    /* Resize the window to fit the line */
    MoveWindow(hwnd, 0, 0, 600, 80, TRUE);
    /* Text should not be wrapped */
    reflines[1] = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0);
    ok(reflines[1] == 1, "Line wasn't expected to wrap (%d lines).\n", reflines[1]);
    /* Resize the window again to make sure the line wraps again */
    MoveWindow(hwnd, 0, 0, 10, 80, TRUE);
    reflines[2] = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0);
    ok(reflines[2] > 1, "Line was expected to wrap (%d lines).\n", reflines[2]);
    DestroyWindow(hwnd);

    /* Same test with redraw disabled */
    hwnd = CreateWindow(RICHEDIT_CLASS10A, NULL, dwCommonStyle,
                        0, 0, 200, 80, NULL, NULL, hmoduleRichEdit, NULL);
    ok(hwnd != NULL, "error: %d\n", (int) GetLastError());
    ok(IsWindowVisible(hwnd), "Window should be visible.\n");
    /* Redraw is disabled by making the window invisible. */
    SendMessage(hwnd, WM_SETREDRAW, FALSE, 0);
    ok(!IsWindowVisible(hwnd), "Window shouldn't be visible.\n");
    res = SendMessage(hwnd, EM_REPLACESEL, FALSE, (LPARAM) text);
    ok(res, "EM_REPLACESEL failed.\n");
    /* Should have wrapped */
    prevlines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0);
    ok(prevlines == reflines[0],
        "Line was expected to wrap (%d lines).\n", prevlines);
    /* Resize the window to fit the line, no change to the number of lines */
    MoveWindow(hwnd, 0, 0, 600, 80, TRUE);
    lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0);
    todo_wine
    ok(lines == prevlines ||
        broken(lines == reflines[1]), /* Win98, WinME and NT4 */
        "Expected no change in the number of lines\n");
    /* Resize the window again to make sure the line wraps again */
    MoveWindow(hwnd, 0, 0, 10, 80, TRUE);
    lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0);
    todo_wine
    ok(lines == prevlines ||
        broken(lines == reflines[2]), /* Win98, WinME and NT4 */
        "Expected no change in the number of lines\n");
    DestroyWindow(hwnd);
}
开发者ID:r6144,项目名称:wine,代码行数:101,代码来源:editor.c

示例5: EditSettingDlgProc


//.........这里部分代码省略.........
					{
						char *setting, temp[32];
						int settingLength, tmp;
						settingLength = GetWindowTextLength(GetDlgItem(hwnd, IDC_SETTINGVALUE));
						if (settingLength)
						{
							setting = (char*)_malloca(settingLength + 1);
							if (setting)
							{
								// havta convert it with sprintf()
								GetWindowText(GetDlgItem(hwnd, IDC_SETTINGVALUE), setting, settingLength+1);
								if (LOWORD(wParam) == CHK_DECIMAL && IsDlgButtonChecked(hwnd, CHK_DECIMAL))
								{
									sscanf(setting, "%X", &tmp);
									mir_snprintf(temp, SIZEOF(temp), "%ld", tmp);
								}
								else
								{
									sscanf(setting, "%d", &tmp);
									mir_snprintf(temp, SIZEOF(temp), "%X", tmp);
								}
								SetWindowText(GetDlgItem(hwnd, IDC_SETTINGVALUE), temp);
							}
						}
					}
				break;
				case IDOK:
				{
					struct DBsetting *dbsetting = (struct DBsetting*)GetWindowLongPtr(hwnd,GWLP_USERDATA);
					char *setting, *value;
					int settingLength, valueLength, valueID = IDC_SETTINGVALUE;
					settingLength = GetWindowTextLength(GetDlgItem(hwnd, IDC_SETTINGNAME));

					if (IsWindowVisible(GetDlgItem(hwnd,IDC_STRING)))
						valueID = IDC_STRING;
					else
					if (IsWindowVisible(GetDlgItem(hwnd,IDC_SETTINGVALUE)))
						valueID = IDC_SETTINGVALUE;
					else
					if (IsWindowVisible(GetDlgItem(hwnd,IDC_BLOB)))
						valueID = IDC_BLOB;
					else
						break;

					valueLength = GetWindowTextLength(GetDlgItem(hwnd, valueID));

					if (dbsetting->dbv.type == DBVT_UTF8 && UOS)
						valueLength *= sizeof(WCHAR);

					if (settingLength)
					{
						int settingValue;
						setting = (char*)_malloca(settingLength + 1);

						if (valueLength)
							value = (char*)_malloca(valueLength + 2);
						else
							value = (char*)_malloca(2);

						if (!setting || !value)
						{
							msg(Translate("Couldnt allocate enough memory!"), modFullname);
							DestroyWindow(hwnd);
							break;
						}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:66,代码来源:addeditsettingsdlg.cpp

示例6: IsSipButtonVisible

BOOL IsSipButtonVisible()
{
	return IsWindowVisible(FindWindow(L"MS_SIPBUTTON", NULL));
};
开发者ID:ultrashot,项目名称:utask,代码行数:4,代码来源:PositionFix.cpp

示例7: WepWindowsPageProc


//.........这里部分代码省略.........

                    if (selectedNode = WeGetSelectedWindowNode(&context->TreeContext))
                    {
                        ShowWindowAsync(selectedNode->WindowHandle, SW_MINIMIZE);
                    }
                }
                break;
            case ID_WINDOW_MAXIMIZE:
                {
                    PWE_WINDOW_NODE selectedNode;

                    if (selectedNode = WeGetSelectedWindowNode(&context->TreeContext))
                    {
                        ShowWindowAsync(selectedNode->WindowHandle, SW_MAXIMIZE);
                    }
                }
                break;
            case ID_WINDOW_CLOSE:
                {
                    PWE_WINDOW_NODE selectedNode;

                    if (selectedNode = WeGetSelectedWindowNode(&context->TreeContext))
                    {
                        PostMessage(selectedNode->WindowHandle, WM_CLOSE, 0, 0);
                    }
                }
                break;
            case ID_WINDOW_VISIBLE:
                {
                    PWE_WINDOW_NODE selectedNode;

                    if (selectedNode = WeGetSelectedWindowNode(&context->TreeContext))
                    {
                        if (IsWindowVisible(selectedNode->WindowHandle))
                        {
                            selectedNode->WindowVisible = FALSE;
                            ShowWindowAsync(selectedNode->WindowHandle, SW_HIDE);
                        }
                        else
                        {
                            selectedNode->WindowVisible = TRUE;
                            ShowWindowAsync(selectedNode->WindowHandle, SW_SHOW);
                        }

                        PhInvalidateTreeNewNode(&selectedNode->Node, TN_CACHE_COLOR);
                        TreeNew_InvalidateNode(context->TreeNewHandle, &selectedNode->Node);
                    }
                }
                break;
            case ID_WINDOW_ENABLED:
                {
                    PWE_WINDOW_NODE selectedNode;

                    if (selectedNode = WeGetSelectedWindowNode(&context->TreeContext))
                    {
                        EnableWindow(selectedNode->WindowHandle, !IsWindowEnabled(selectedNode->WindowHandle));
                    }
                }
                break;
            case ID_WINDOW_ALWAYSONTOP:
                {
                    PWE_WINDOW_NODE selectedNode;

                    if (selectedNode = WeGetSelectedWindowNode(&context->TreeContext))
                    {
                        LOGICAL topMost;
开发者ID:amitamitamitamit,项目名称:processhacker2,代码行数:67,代码来源:wnddlg.c

示例8: while

bool CConEmuInside::InsideFindShellView(HWND hFrom)
{
	wchar_t szClass[128];
	wchar_t szParent[128];
	wchar_t szRoot[128];
	HWND hChild = NULL;
	// Для WinXP
	HWND hXpView = NULL, hXpPlace = NULL;

	while ((hChild = FindWindowEx(hFrom, hChild, NULL, NULL)) != NULL)
	{
		// Нас интересуют только видимые окна!
		if (!IsWindowVisible(hChild))
			continue;

		// Windows 7, Windows 8.
		GetClassName(hChild, szClass, countof(szClass));
		if (lstrcmp(szClass, L"SHELLDLL_DefView") == 0)
		{
			GetClassName(hFrom, szParent, countof(szParent));
			if (lstrcmp(szParent, L"CtrlNotifySink") == 0)
			{
				HWND hParent = GetParent(hFrom);
				if (hParent)
				{
					GetClassName(hParent, szRoot, countof(szRoot));
					_ASSERTE(lstrcmp(szRoot, L"DirectUIHWND") == 0);

					mh_InsideParentWND = hParent;
					mh_InsideParentRel = hFrom;
					m_InsideIntegration = ii_Explorer;

					return true;
				}
			}
			else if ((gnOsVer < 0x600) && (lstrcmp(szParent, L"ExploreWClass") == 0))
			{
				_ASSERTE(mh_InsideParentRoot == hFrom);
				hXpView = hChild;
			}
		}
		else if ((gnOsVer < 0x600) && (lstrcmp(szClass, L"BaseBar") == 0))
		{
			RECT rcBar = {}; GetWindowRect(hChild, &rcBar);
			MapWindowPoints(NULL, hFrom, (LPPOINT)&rcBar, 2);
			RECT rcParent = {}; GetClientRect(hFrom, &rcParent);
			if ((-10 <= (rcBar.right - rcParent.right))
				&& ((rcBar.right - rcParent.right) <= 10))
			{
				// Нас интересует область, прилепленная к правому-нижнему углу
				hXpPlace = hChild;
			}
		}
		// Путь в этом (hChild) хранится в формате "Address: D:\users\max"
		else if ((gnOsVer >= 0x600) && lstrcmp(szClass, L"ToolbarWindow32") == 0)
		{
			GetClassName(hFrom, szParent, countof(szParent));
			if (lstrcmp(szParent, L"Breadcrumb Parent") == 0)
			{
				HWND hParent = GetParent(hFrom);
				if (hParent)
				{
					GetClassName(hParent, szRoot, countof(szRoot));
					_ASSERTE(lstrcmp(szRoot, L"msctls_progress32") == 0);

					mh_InsideParentPath = hChild;

					// Остается ComboBox/Edit, в который можно запихнуть путь, чтобы заставить эксплорер по нему перейти
					// Но есть проблема. Этот контрол не создается при открытии окна!

					return true;
				}
			}
		}

		if ((hChild != hXpView) && (hChild != hXpPlace))
		{
			if (InsideFindShellView(hChild))
			{
				if (mh_InsideParentRel && mh_InsideParentPath)
					return true;
				else
					break;
			}
		}

		if (hXpView && hXpPlace)
		{
			mh_InsideParentRel = FindWindowEx(hXpPlace, NULL, L"ReBarWindow32", NULL);
			if (!mh_InsideParentRel)
			{
				_ASSERTE(mh_InsideParentRel && L"ReBar must be found on XP & 2k3");
				return true; // закончить поиск
			}
			mh_InsideParentWND = hXpPlace;
			mh_InsideParentPath = mh_InsideParentRoot;
			m_InsideIntegration = ii_Explorer;
			return true;
		}
	}
//.........这里部分代码省略.........
开发者ID:G-VAR,项目名称:ConEmu,代码行数:101,代码来源:Inside.cpp

示例9: GetCheck

void CPlayerSubresyncBar::UpdatePreview()
{
    if (m_mode == VOBSUB || m_mode == TEXTSUB) {
        if (0/*m_bUnlink*/) {
            for (int i = 0, j = (int)m_sts.GetCount(); i < j; i++) {
                bool bStartMod, bEndMod, bStartAdj, bEndAdj;
                GetCheck(i, bStartMod, bEndMod, bStartAdj, bEndAdj);
                m_sts[i].start = (bStartMod || bStartAdj) ? m_subtimes[i].newStart : m_subtimes[i].orgStart;
                m_sts[i].end = (bEndMod || bEndAdj) ? m_subtimes[i].newEnd : m_subtimes[i].orgEnd;
            }
        } else {
            CAtlArray<int> schk;

            for (int i = 0, j = (int)m_sts.GetCount(); i < j;) {
                schk.RemoveAll();

                int start = i, end;

                for (end = i; end < j; end++) {
                    int data = m_displayData[end].flags;
                    if ((data & TSEP) && end > i) {
                        break;
                    }
                    if (data & (TSMOD | TSADJ)) {
                        schk.Add(end);
                    }
                }

                if (schk.IsEmpty()) {
                    for (; start < end; start++) {
                        m_sts[start].start = m_subtimes[start].orgStart;
                        m_sts[start].end = m_subtimes[start].orgEnd;
                    }
                } else if (schk.GetCount() == 1) {
                    int k = schk[0];
                    int dt = m_subtimes[k].newStart - m_subtimes[k].orgStart;
                    for (; start < end; start++) {
                        m_sts[start].start = m_subtimes[start].orgStart + dt;
                        m_sts[start].end = (m_displayData[start].flags & TEMOD)
                                           ? m_subtimes[start].newEnd
                                           : (m_subtimes[start].orgEnd + dt);
                    }
                } else if (schk.GetCount() >= 2) {
                    int i0 = 0;
                    int i1 = 0;
                    int ti0 = 0;
                    int ds = 0;
                    double m = 0;

                    int k, l;
                    for (k = 0, l = (int)schk.GetCount() - 1; k < l; k++) {
                        i0 = schk[k];
                        i1 = schk[k + 1];

                        ti0 = m_subtimes[i0].orgStart;
                        ds = m_subtimes[i1].orgStart - ti0;

                        if (ds == 0) {
                            SetSTS0(start, i1, ti0);
                        } else {
                            m = double(m_subtimes[i1].newStart - m_subtimes[i0].newStart) / ds;
                            SetSTS1(start, i1, ti0, m, i0);
                        }

                    }

                    ASSERT(k > 0);
                    if (ds == 0) {
                        SetSTS0(start, end, ti0);
                    } else {
                        SetSTS1(start, end, ti0, m, i0);
                    }
                }

                i = end;
            }
        }

        m_sts.CreateSegments();

        for (size_t i = 0, j = m_sts.GetCount(); i < j; i++) {
            m_displayData[i].tPrevStart = m_sts[i].start;
            m_displayData[i].tPrevEnd = m_sts[i].end;
        }

        m_list.Invalidate();

        if (IsWindowVisible()) {
            SaveSubtitle();
        }
    }
}
开发者ID:Murder66,项目名称:mpc-hc-master,代码行数:92,代码来源:PlayerSubresyncBar.cpp

示例10: lua_Focus

static int lua_Focus(lua_State *L){

	if (IsWindowVisible(ASWN->TC->hwnd))
		SwitchToThisWindow(ASWN->TC->hwnd,0);
	return 0;
}
开发者ID:TerrahKitsune,项目名称:TerrahIRC,代码行数:6,代码来源:KSCLuaLib.cpp

示例11: FtMgrDlgProc

static INT_PTR CALLBACK FtMgrDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	struct TFtMgrData *dat = (struct TFtMgrData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);

	switch (msg) {
	case WM_INITDIALOG:
		{
			TCITEM tci = {0};
			HWND hwndTab = GetDlgItem(hwnd, IDC_TABS);

			TranslateDialogDefault(hwnd);
			Window_SetIcon_IcoLib(hwnd, SKINICON_EVENT_FILE);

			dat = (struct TFtMgrData *)mir_calloc(sizeof(struct TFtMgrData));

			SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)dat);

			dat->hhkPreshutdown = HookEventMessage(ME_SYSTEM_PRESHUTDOWN, hwnd, M_PRESHUTDOWN);

			dat->hwndIncoming = CreateDialog(hInst, MAKEINTRESOURCE(IDD_FTPAGE), hwnd, FtMgrPageDlgProc);
			dat->hwndOutgoing = CreateDialog(hInst, MAKEINTRESOURCE(IDD_FTPAGE), hwnd, FtMgrPageDlgProc);
			ShowWindow(dat->hwndIncoming, SW_SHOW);

			tci.mask = TCIF_PARAM|TCIF_TEXT;
			tci.pszText = TranslateT("Incoming");
			tci.lParam = (LPARAM)dat->hwndIncoming;
			TabCtrl_InsertItem(hwndTab, 0, &tci);
			tci.pszText = TranslateT("Outgoing");
			tci.lParam = (LPARAM)dat->hwndOutgoing;
			TabCtrl_InsertItem(hwndTab, 1, &tci);

			// Utils_RestoreWindowPosition(hwnd, NULL, "SRFile", "FtMgrDlg_");
			SAVEWINDOWPOS swp;
			swp.hwnd = hwnd; swp.hContact = NULL; swp.szModule = "SRFile"; swp.szNamePrefix = "FtMgrDlg_";
			CallService(MS_UTILS_RESTOREWINDOWPOSITION, RWPF_NOACTIVATE, (LPARAM)&swp);

			// Fall through to setup initial placement
		}
	case WM_SIZE:
		{
			RECT rc, rcButton;
			HDWP hdwp;
			HWND hwndTab = GetDlgItem(hwnd, IDC_TABS);

			GetWindowRect(GetDlgItem(hwnd, IDCANCEL), &rcButton);
			OffsetRect(&rcButton, -rcButton.left, -rcButton.top);

			GetClientRect(hwnd, &rc);
			InflateRect(&rc, -6, -6);

			hdwp = BeginDeferWindowPos(3);

			hdwp = DeferWindowPos(hdwp, GetDlgItem(hwnd, IDC_CLEAR), NULL, rc.left, rc.bottom-rcButton.bottom, 0, 0, SWP_NOZORDER|SWP_NOSIZE);
			hdwp = DeferWindowPos(hdwp, GetDlgItem(hwnd, IDCANCEL), NULL, rc.right-rcButton.right, rc.bottom-rcButton.bottom, 0, 0, SWP_NOZORDER|SWP_NOSIZE);

			rc.bottom -= rcButton.bottom + 5;

			hdwp = DeferWindowPos(hdwp, hwndTab, NULL, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, SWP_NOZORDER);

			EndDeferWindowPos(hdwp);

			GetWindowRect(hwndTab, &rc);
			MapWindowPoints(NULL, hwnd, (LPPOINT)&rc, 2);
			TabCtrl_AdjustRect(hwndTab, FALSE, &rc);
			InflateRect(&rc, -5, -5);

			hdwp = BeginDeferWindowPos(2);

			hdwp = DeferWindowPos(hdwp, dat->hwndIncoming, HWND_TOP, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, 0);
			hdwp = DeferWindowPos(hdwp, dat->hwndOutgoing, HWND_TOP, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, 0);

			EndDeferWindowPos(hdwp);

			break;
		}

	case WM_MOUSEWHEEL:
		if (IsWindowVisible(dat->hwndIncoming)) SendMessage(dat->hwndIncoming, msg, wParam, lParam);
		if (IsWindowVisible(dat->hwndOutgoing)) SendMessage(dat->hwndOutgoing, msg, wParam, lParam);
		break;

	case WM_FT_SELECTPAGE:
		{
			TCITEM tci = {0};
			HWND hwndTab = GetDlgItem(hwnd, IDC_TABS);

			if (TabCtrl_GetCurSel(hwndTab) == (int)wParam) break;

			tci.mask = TCIF_PARAM;

			TabCtrl_GetItem(hwndTab, TabCtrl_GetCurSel(hwndTab), &tci);
			ShowWindow((HWND)tci.lParam, SW_HIDE);

			TabCtrl_SetCurSel(hwndTab, wParam);

			TabCtrl_GetItem(hwndTab, TabCtrl_GetCurSel(hwndTab), &tci);
			ShowWindow((HWND)tci.lParam, SW_SHOW);
		}
		break;

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

示例12: lua_GetVisible

static int lua_GetVisible(lua_State *L){

	lua_pushinteger(L, IsWindowVisible(ASWN->TC->hwnd));
	return 1;
}
开发者ID:TerrahKitsune,项目名称:TerrahIRC,代码行数:5,代码来源:KSCLuaLib.cpp

示例13: showFunction

 void showFunction(HWND hwnd, EDITDATA *p, int ch)
 {
     sqlite3_int64 id, baseid;
     CCFUNCDATA *functionData = NULL;
     char name[2046], *q = name;
     int end = p->selstartcharpos;
     int pos = p->selstartcharpos - 1;
     POINT cpos;
     SIZE size;
     int curArg = 0;
     if (instring(p->cd->text, &p->cd->text[p->selstartcharpos]))
         return;
     p->cd->selecting = FALSE;
     
     if (pos <= 0 || PropGetInt(NULL, "CODE_COMPLETION") == 0)
         return ;
     if (ch == '(' || ch == ',' && !IsWindowVisible(hwndShowFunc))
     {
         char name[512], *p1;
         int pos;
         int i;
         int commaCount = 0;
         DWINFO *info = (DWINFO *)GetWindowLong(GetParent(hwnd), 0);
         int lineno = SendMessage(hwnd, EM_EXLINEFROMCHAR, 0, p->selstartcharpos)+1;
         CCFUNCDATA * functionData = NULL;
         BOOL parsed = FALSE;
         CHARRANGE range;
         if (ch == ',')
         {
             int nesting  =1 ;
             pos = p->selendcharpos-1;
             while (nesting > 0 && pos> 0 && p->cd->text[pos].ch != '{' && p->cd->text[pos].ch != '}')
             {
                 if (p->cd->text[pos].ch == ')')
                     nesting++;
                 else if (p->cd->text[pos].ch == '(')
                     nesting --;
                 else if (p->cd->text[pos].ch == ',' && nesting == 1)
                     commaCount++;
                 pos--;
             }
             if (nesting)
                 return;
             if (!pos || !isalnum(p->cd->text[pos-1].ch) && p->cd->text[pos-1].ch != '_')
                 return;
             range.cpMin = pos;
             range.cpMax = pos;
         }
         else
         {
             range.cpMin = p->selendcharpos-1;
             range.cpMax = p->selendcharpos-1;
         }
         GetWordSpan(p, &range);
         if (range.cpMin == range.cpMax)
             return;
         pos = range.cpMin;
         while (pos && isspace(p->cd->text[pos-1].ch))
         {
             pos--;
         }
         if (pos && p->cd->text[pos-1].ch == ':')
         {
             pos = CPPScanBackward(p, range.cpMax, TRUE);
         }
         else
         {
             pos = range.cpMin;
         }
         for (i=pos; i < range.cpMax; i++)
             name[i-pos] = p->cd->text[i].ch;
         name[i-pos] = 0;
         p1 = name;
         GetQualifiedName(name + i-pos + 1, &p1, FALSE, FALSE);
         strcpy(name, name +i-pos + 1);
         while (pos && isspace(p->cd->text[pos-1].ch))
         {
             pos--;
         }
         if (pos && (p->cd->text[pos-1].ch == '.' || p->cd->text[pos-1].ch == '>'))
         {
             int start = 0;
             start = CPPScanBackward(p, p->selendcharpos, TRUE);
             if (start != pos)
             {
                 char qual[2048];
                 for (i=start; i < pos; i++)
                     qual[i-start] = p->cd->text[i].ch;
                 qual[i-start] = 0;
                 parsed = TRUE;
                 sprintf(qual + strlen(qual), "@%s", name);
                 functionData = ccLookupFunctionList(lineno, info->dwName, qual);
             }
         }
         if (!parsed)
         {
             CCFUNCDATA **scan;
             char funcbase[2048], nsbase[512], abase[512];
             abase[0] = 0;
             GetContainerData(lineno, info->dwName, nsbase, funcbase);
//.........这里部分代码省略.........
开发者ID:bencz,项目名称:OrangeC,代码行数:101,代码来源:xcodefunc.c

示例14: DlgPluginOpt

INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch (msg) {
	case WM_INITDIALOG:
		TranslateDialogDefault(hwndDlg);
		timerID = 0;
		{
			HWND hwndList = GetDlgItem(hwndDlg, IDC_PLUGLIST);
			mir_subclassWindow(hwndList, PluginListWndProc);

			HIMAGELIST hIml = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 4, 0);
			ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_UNICODE);
			ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_ANSI);
			ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_LOADED);
			ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_NOTLOADED);
			ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_LOADEDGRAY);
			ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_NOTLOADEDGRAY);
			ListView_SetImageList(hwndList, hIml, LVSIL_SMALL);

			LVCOLUMN col;
			col.mask = LVCF_TEXT | LVCF_WIDTH;
			col.pszText = _T("");
			col.cx = 40;
			ListView_InsertColumn(hwndList, 0, &col);

			col.pszText = TranslateT("Plugin");
			col.cx = 180;
			ListView_InsertColumn(hwndList, 1, &col);

			col.pszText = TranslateT("Name");
			col.cx = 180;//max = 220;
			ListView_InsertColumn(hwndList, 2, &col);

			col.pszText = TranslateT("Version");
			col.cx = 75;
			ListView_InsertColumn(hwndList, 3, &col);

			ListView_SetExtendedListViewStyleEx(hwndList, 0, LVS_EX_SUBITEMIMAGES | LVS_EX_CHECKBOXES | LVS_EX_LABELTIP | LVS_EX_FULLROWSELECT);
			// scan the plugin dir for plugins, cos
			arPluginList.destroy();
			szFilter.Empty();
			enumPlugins(dialogListPlugins, (WPARAM)hwndDlg, (LPARAM)hwndList);
			// sort out the headers

			ListView_SetColumnWidth(hwndList, 1, LVSCW_AUTOSIZE); // dll name
			int w = ListView_GetColumnWidth(hwndList, 1);
			if (w > 110) {
				ListView_SetColumnWidth(hwndList, 1, w = 110);
			}
			int max = w < 110 ? 189 + 110 - w : 189;
			ListView_SetColumnWidth(hwndList, 3, LVSCW_AUTOSIZE); // short name
			w = ListView_GetColumnWidth(hwndList, 2);
			if (w > max)
				ListView_SetColumnWidth(hwndList, 2, max);

			ListView_SortItems(hwndList, SortPlugins, (LPARAM)hwndDlg);
		}
		return TRUE;

	case WM_NOTIFY:
		if (lParam) {
			NMLISTVIEW *hdr = (NMLISTVIEW *)lParam;
			if (hdr->hdr.code == LVN_ITEMCHANGED && IsWindowVisible(hdr->hdr.hwndFrom)) {
				if (hdr->uOldState != 0 && (hdr->uNewState == 0x1000 || hdr->uNewState == 0x2000)) {
					HWND hwndList = GetDlgItem(hwndDlg, IDC_PLUGLIST);

					LVITEM it;
					it.mask = LVIF_PARAM | LVIF_STATE;
					it.iItem = hdr->iItem;
					if (!ListView_GetItem(hwndList, &it))
						break;

					PluginListItemData *dat = (PluginListItemData*)it.lParam;
					if (dat->flags & STATIC_PLUGIN) {
						ListView_SetItemState(hwndList, hdr->iItem, 0x3000, LVIS_STATEIMAGEMASK);
						return FALSE;
					}
					// find all another standard plugins by mask and disable them
					if ((hdr->uNewState == 0x2000) && dat->stdPlugin != 0) {
						for (int iRow = 0; iRow != -1; iRow = ListView_GetNextItem(hwndList, iRow, LVNI_ALL)) {
							if (iRow != hdr->iItem) { // skip the plugin we're standing on
								LVITEM dt;
								dt.mask = LVIF_PARAM;
								dt.iItem = iRow;
								if (ListView_GetItem(hwndList, &dt)) {
									PluginListItemData *dat2 = (PluginListItemData*)dt.lParam;
									if (dat2->stdPlugin & dat->stdPlugin) {// mask differs
										// the lParam is unset, so when the check is unset the clist block doesnt trigger
										int iSave = dat2->stdPlugin;
										dat2->stdPlugin = 0;
										ListView_SetItemState(hwndList, iRow, 0x1000, LVIS_STATEIMAGEMASK);
										dat2->stdPlugin = iSave;
									}
								}
							}
						}
					}

					if (bOldMode)
						ShowWindow(GetDlgItem(hwndDlg, IDC_RESTART), TRUE); // this here only in "ghazan mode"
//.........这里部分代码省略.........
开发者ID:truefriend-cz,项目名称:miranda-ng,代码行数:101,代码来源:pluginopts.cpp

示例15: RebarLoadSettings


//.........这里部分代码省略.........
    if (ToolStatusConfig.SearchBoxEnabled && !SearchboxHandle)
    {
        SearchboxText = PhReferenceEmptyString();
        ProcessTreeFilterEntry = PhAddTreeNewFilter(PhGetFilterSupportProcessTreeList(), ProcessTreeFilterCallback, NULL);
        ServiceTreeFilterEntry = PhAddTreeNewFilter(PhGetFilterSupportServiceTreeList(), ServiceTreeFilterCallback, NULL);
        NetworkTreeFilterEntry = PhAddTreeNewFilter(PhGetFilterSupportNetworkTreeList(), NetworkTreeFilterCallback, NULL);

        if (SearchboxHandle = CreateWindowEx(
            WS_EX_CLIENTEDGE,
            WC_EDIT,
            NULL,
            WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | ES_LEFT | ES_AUTOHSCROLL | WS_VISIBLE,
            CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
            RebarHandle,
            NULL,
            NULL,
            NULL
            ))
        {
            PhCreateSearchControl(RebarHandle, SearchboxHandle, L"Search Processes (Ctrl+K)");
        }
    }

    if (ToolStatusConfig.StatusBarEnabled && !StatusBarHandle)
    {
        StatusBarHandle = CreateWindowEx(
            0,
            STATUSCLASSNAME,
            NULL,
            WS_CHILD | WS_VISIBLE | CCS_BOTTOM | SBARS_SIZEGRIP,
            CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
            PhMainWndHandle,
            NULL,
            NULL,
            NULL
            );

        if (StatusBarHandle && PhGetIntegerSetting(L"EnableThemeSupport"))
        {
            PhInitializeWindowThemeStatusBar(StatusBarHandle);
        }
    }

    // Hide or show controls (Note: don't unload or remove at runtime).
    if (ToolStatusConfig.ToolBarEnabled)
    {
        if (RebarHandle && !IsWindowVisible(RebarHandle))
            ShowWindow(RebarHandle, SW_SHOW);
    }
    else
    {
        if (RebarHandle && IsWindowVisible(RebarHandle))
            ShowWindow(RebarHandle, SW_HIDE);
    }

    if (ToolStatusConfig.SearchBoxEnabled && RebarHandle && SearchboxHandle)
    {
        UINT height = (UINT)SendMessage(RebarHandle, RB_GETROWHEIGHT, 0, 0);

        // Add the Searchbox band into the rebar control.
        if (!RebarBandExists(REBAR_BAND_ID_SEARCHBOX))
            RebarBandInsert(REBAR_BAND_ID_SEARCHBOX, SearchboxHandle, PH_SCALE_DPI(180), height);

        if (!IsWindowVisible(SearchboxHandle))
            ShowWindow(SearchboxHandle, SW_SHOW);

        if (SearchBoxDisplayMode == SEARCHBOX_DISPLAY_MODE_HIDEINACTIVE)
        {
            if (RebarBandExists(REBAR_BAND_ID_SEARCHBOX))
                RebarBandRemove(REBAR_BAND_ID_SEARCHBOX);
        }
    }
    else
    {
        // Remove the Searchbox band from the rebar control.
        if (RebarBandExists(REBAR_BAND_ID_SEARCHBOX))
            RebarBandRemove(REBAR_BAND_ID_SEARCHBOX);

        if (SearchboxHandle)
        {
            // Clear search text and reset search filters.
            SetFocus(SearchboxHandle);
            Static_SetText(SearchboxHandle, L"");

            if (IsWindowVisible(SearchboxHandle))
                ShowWindow(SearchboxHandle, SW_HIDE);
        }
    }

    if (ToolStatusConfig.StatusBarEnabled)
    {
        if (StatusBarHandle && !IsWindowVisible(StatusBarHandle))
            ShowWindow(StatusBarHandle, SW_SHOW);
    }
    else
    {
        if (StatusBarHandle && IsWindowVisible(StatusBarHandle))
            ShowWindow(StatusBarHandle, SW_HIDE);
    }
}
开发者ID:PKRoma,项目名称:ProcessHacker,代码行数:101,代码来源:toolbar.c


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