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

C++ GetWindowPlacement函数代码示例

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

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



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

示例1: GetWindowPlacement

void DX10App::Start()
{
	if(!mShowMouse)
	{
		WINDOWPLACEMENT wPos;
		GetWindowPlacement( hMainWnd, &wPos );
		SetCursorPos(wPos.rcNormalPosition.left + 100, wPos.rcNormalPosition.top + 100);
	}

	mSwapBuffers->begin();

	
	//gDevice->ClearDepthStencilView( mSwapBuffers->getRenderTargets()->DSV, D3D10_CLEAR_DEPTH|D3D10_CLEAR_STENCIL, 1.0f, 0);

	float blendFactor[] = {0.0f, 0.0f, 0.0f, 0.0f};
	gDevice->OMSetBlendState(0, blendFactor, 0xffffffff);
}
开发者ID:GustavPersson,项目名称:miniature-dubstep,代码行数:17,代码来源:DX10App.cpp


示例2: AfxGetApp

void CMainFrame::OnClose() 
{
	// TODO: Add your message handler code here and/or call default
	CMyCommApp * myApp = (CMyCommApp *)AfxGetApp();
	AfxGetApp()->WriteProfileString("Version","VER",myApp->m_AppVersion);

	WINDOWPLACEMENT   WndStatus;  
	GetWindowPlacement(&WndStatus);  
	AfxGetApp()->WriteProfileInt("Layout","FLAG",WndStatus.flags);  
	AfxGetApp()->WriteProfileInt("Layout","SHOWCMD",WndStatus.showCmd);  
	AfxGetApp()->WriteProfileInt("Layout","LEFT",WndStatus.rcNormalPosition.left);  
	AfxGetApp()->WriteProfileInt("Layout","RIGHT",WndStatus.rcNormalPosition.right);  
	AfxGetApp()->WriteProfileInt("Layout","TOP",WndStatus.rcNormalPosition.top);  
	AfxGetApp()->WriteProfileInt("Layout","BOTTOM",WndStatus.rcNormalPosition.bottom); 
	
	CFrameWnd::OnClose();
}
开发者ID:liquanhai,项目名称:LSDComm,代码行数:17,代码来源:MainFrm.cpp


示例3: SetWindowLongPtr

LRESULT CALLBACK CWindow::stWinMsgHandler(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    CWindow * pWnd = nullptr;

    if (uMsg == WM_NCCREATE)
    {
        // get the pointer to the window from lpCreateParams which was set in CreateWindow
        SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)((LPCREATESTRUCT(lParam))->lpCreateParams));
    }

    // get the pointer to the window
    pWnd = GetObjectFromWindow(hwnd);

    // if we have the pointer, go to the message handler of the window
    // else, use DefWindowProc
    if (pWnd)
    {
        switch (uMsg)
        {
        case WM_ACTIVATE:
            if ((wParam == WA_ACTIVE)&&(!pWnd->bWindowRestored)&&(!pWnd->sRegistryPath.empty()))
            {
                WINDOWPLACEMENT wpl = {0};
                DWORD size = sizeof(wpl);
                if (SHGetValue(HKEY_CURRENT_USER, pWnd->sRegistryPath.c_str(), pWnd->sRegistryValue.c_str(), REG_NONE, &wpl, &size) == ERROR_SUCCESS)
                    SetWindowPlacement(hwnd, &wpl);
                else
                    ShowWindow(hwnd, SW_SHOW);
                pWnd->bWindowRestored = true;
            }
            break;
        case WM_CLOSE:
            if (!pWnd->sRegistryPath.empty())
            {
                WINDOWPLACEMENT wpl = {0};
                wpl.length = sizeof(WINDOWPLACEMENT);
                GetWindowPlacement(hwnd, &wpl);
                SHSetValue(HKEY_CURRENT_USER, pWnd->sRegistryPath.c_str(), pWnd->sRegistryValue.c_str(), REG_NONE, &wpl, sizeof(wpl));
            }
            break;
        }
        return pWnd->WinMsgHandler(hwnd, uMsg, wParam, lParam);
    }
    else
        return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
开发者ID:hfeeki,项目名称:TortoiseGit,代码行数:46,代码来源:BaseWindow.cpp


示例4: force_normal

void force_normal(HWND hwnd)
{
    static int recurse = 0;

    WINDOWPLACEMENT wp;

    if (recurse)
	return;
    recurse = 1;

    wp.length = sizeof(wp);
    if (GetWindowPlacement(hwnd, &wp) && wp.showCmd == SW_SHOWMAXIMIZED) {
	wp.showCmd = SW_SHOWNORMAL;
	SetWindowPlacement(hwnd, &wp);
    }
    recurse = 0;
}
开发者ID:autoandshare,项目名称:putty-toolpakcloud,代码行数:17,代码来源:windlg.c


示例5: CDialogManage

/*
** Dialog procedure for the Manage dialog.
**
*/
INT_PTR CALLBACK CDialogManage::DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	if (!c_Dialog)
	{
		if (uMsg == WM_INITDIALOG)
		{
			c_Dialog = new CDialogManage(hWnd);
			return c_Dialog->OnInitDialog(wParam, lParam);
		}
	}
	else
	{
		switch (uMsg)
		{
		case WM_ACTIVATE:
			return c_Dialog->OnActivate(wParam, lParam);

		case WM_COMMAND:
			return c_Dialog->OnCommand(wParam, lParam);

		case WM_NOTIFY:
			return c_Dialog->OnNotify(wParam, lParam);

		case WM_CLOSE:
			PostMessage(hWnd, WM_DELAYED_CLOSE, 0, 0);
			return TRUE;

		case WM_DESTROY:
			delete c_Dialog;
			c_Dialog = NULL;
			return FALSE;

		case WM_DELAYED_CLOSE:
			GetWindowPlacement(hWnd, &c_WindowPlacement);
			if (c_WindowPlacement.showCmd == SW_SHOWMINIMIZED)
			{
				c_WindowPlacement.showCmd = SW_SHOWNORMAL;
			}
			DestroyWindow(hWnd);
			return TRUE;
		}
	}

	return FALSE;
}
开发者ID:JamesAC,项目名称:rainmeter,代码行数:49,代码来源:DialogManage.cpp


示例6: RedrawTitleBar

void RedrawTitleBar( HWND hWnd, bool active )
{
	if ( !pShared )
		return;

	WaitForSingleObject( CommMutex, INFINITE );
	if ( pShared->TitleBar[0] == 0 )
	{
		ReleaseMutex( CommMutex );
		return;
	}

	int len = (int)strlen( pShared->TitleBar );
	if ( len >= 1024 )
		len = 1023;

	WINDOWPLACEMENT place;
	RECT rect;
	HDC hDC = GetWindowDC( hWnd );//WINDOW dc allows us to draw on the non client area
	
	GetWindowPlacement( hWnd, &place );
	GetWindowRect( hWnd, &rect );

	// Change the coords (believe me, okay?)
	rect.top = GetSystemMetrics(SM_CYFRAME);
	rect.bottom = rect.top + GetSystemMetrics(SM_CYCAPTION);

	rect.right = ( rect.right - rect.left ) - ( 4*GetSystemMetrics(SM_CXSIZE) + GetSystemMetrics(SM_CXFRAME) );
	rect.left = GetSystemMetrics(SM_CXSIZEFRAME) + GetSystemMetrics(SM_CXSMICON) + 5;

	if ( hThemes )
	{
		HTHEME hTheme = zOpenThemeData( hWnd, L"WINDOW" );
		DrawColorTitleBar( hTheme, hWnd, hDC, active, place.showCmd == SW_MAXIMIZE, pShared->TitleBar, len, rect );
		zCloseThemeData( hTheme );
	}
	else
	{
		rect.left += GetSystemMetrics(SM_CXFRAME);
		DrawColorTitleBar( NULL, hWnd, hDC, active, place.showCmd == SW_MAXIMIZE, pShared->TitleBar, len, rect );
	}

	ReleaseDC( hWnd, hDC );
	ReleaseMutex( CommMutex );
}
开发者ID:WildGenie,项目名称:Razor,代码行数:45,代码来源:gfx.cpp


示例7: GetWindowPlacement

void Window::SaveWindowState()
{
    WINDOWPLACEMENT wp;
    wp.length=sizeof(WINDOWPLACEMENT);
    GetWindowPlacement(hWnd,&wp);

    if (Flags & W_SAVESTATE)
    {
        char *temp="Normal";
        BOOL RestToMax=wp.flags & WPF_RESTORETOMAXIMIZED;
        if (wp.showCmd==SW_SHOWMAXIMIZED ||
                ( wp.showCmd==SW_SHOWMINIMIZED && !(Flags & W_SAVEMIN) && RestToMax ) ) temp="Maximized";
        else if ( (Flags & W_SAVEMIN) && (wp.showCmd==SW_SHOWMINIMIZED)) temp= RestToMax ? "MinFromMax" : "Minimized";
        else if ( wp.showCmd==SW_HIDE) temp="Hidden";
        WriteIniString(Name,"State",temp);
    }
    WriteIniString(Name,"Window",	String()<< (int) wp.rcNormalPosition.left << ',' << (int) wp.rcNormalPosition.top << ',' << (int) wp.rcNormalPosition.right  << ',' << (int) wp.rcNormalPosition.bottom);
}
开发者ID:DavidKinder,项目名称:Level9,代码行数:18,代码来源:window.cpp


示例8: SaveWindowPosition

static INT_PTR SaveWindowPosition(WPARAM, LPARAM lParam)
{
	SAVEWINDOWPOS *swp = (SAVEWINDOWPOS*)lParam;
	WINDOWPLACEMENT wp;
	char szSettingName[64];

	wp.length = sizeof(wp);
	GetWindowPlacement(swp->hwnd, &wp);
	mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sx", swp->szNamePrefix);
	db_set_dw(swp->hContact, swp->szModule, szSettingName, wp.rcNormalPosition.left);
	mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sy", swp->szNamePrefix);
	db_set_dw(swp->hContact, swp->szModule, szSettingName, wp.rcNormalPosition.top);
	mir_snprintf(szSettingName, SIZEOF(szSettingName), "%swidth", swp->szNamePrefix);
	db_set_dw(swp->hContact, swp->szModule, szSettingName, wp.rcNormalPosition.right-wp.rcNormalPosition.left);
	mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sheight", swp->szNamePrefix);
	db_set_dw(swp->hContact, swp->szModule, szSettingName, wp.rcNormalPosition.bottom-wp.rcNormalPosition.top);
	return 0;
}
开发者ID:martok,项目名称:miranda-ng,代码行数:18,代码来源:utils.cpp


示例9: GetWindowPlacement

BOOL CDlgScraperOutput::DestroyWindow()
{
	WINDOWPLACEMENT		wp;
	CMainFrame			*pMyMainWnd  = (CMainFrame *) (theApp.m_pMainWnd);

	// Save settings to registry
	GetWindowPlacement(&wp);
	prefs.set_scraper_x(wp.rcNormalPosition.left);
	prefs.set_scraper_y(wp.rcNormalPosition.top);
	prefs.set_scraper_dx(wp.rcNormalPosition.right - wp.rcNormalPosition.left);
	prefs.set_scraper_dy(wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
	prefs.set_scraper_zoom(m_Zoom.GetCurSel());

	// Uncheck scraper output button on main toolbar
	pMyMainWnd->m_MainToolBar.GetToolBarCtrl().CheckButton(ID_MAIN_TOOLBAR_SCRAPER_OUTPUT, false);

	return CDialog::DestroyWindow();
}
开发者ID:buranela,项目名称:OpenHoldemV12,代码行数:18,代码来源:DialogScraperOutput.cpp


示例10: sizeof

void CAllToolSetupSheet::OnPaint() 
{
	WINDOWPLACEMENT wp;
	RECT rect;

	wp.length = sizeof(WINDOWPLACEMENT);  //not sure if this is still required, but what the hey 
	GetWindowPlacement(&wp);

	if (InitDialogComplete && wp.showCmd!=SW_SHOWMAXIMIZED && wp.showCmd!=SW_SHOWMINIMIZED)  // save the dialog window position
	{
        GetWindowRect(&rect);
		LastMoveX = rect.left;
		LastMoveY = rect.top;
		LastSizeX = rect.right - rect.left;
		LastSizeY = rect.bottom - rect.top;
	}
	CMySheet::OnPaint();
}
开发者ID:TomKerekes,项目名称:KMotionX,代码行数:18,代码来源:AllToolSetupSheet.cpp


示例11: MonitorFromWindow

/***********************************************************************
 *		MonitorFromWindow ([email protected])
 */
HMONITOR WINAPI MonitorFromWindow(HWND hWnd, DWORD dwFlags)
{
    RECT rect;
    WINDOWPLACEMENT wp;

    TRACE("(%p, 0x%08x)\n", hWnd, dwFlags);

    if (IsIconic(hWnd) && GetWindowPlacement(hWnd, &wp))
        return MonitorFromRect( &wp.rcNormalPosition, dwFlags );

    if (GetWindowRect( hWnd, &rect ))
        return MonitorFromRect( &rect, dwFlags );

    if (!(dwFlags & (MONITOR_DEFAULTTOPRIMARY|MONITOR_DEFAULTTONEAREST))) return 0;
    /* retrieve the primary */
    SetRect( &rect, 0, 0, 1, 1 );
    return MonitorFromRect( &rect, dwFlags );
}
开发者ID:kholia,项目名称:wine,代码行数:21,代码来源:misc.c


示例12: if

BOOL CWnd::SavePosition(HKEY hRootKey,LPCSTR lpKey,LPCSTR lpSubKey) const
{
	CRegKey RegKey;
	if (lpKey==NULL)
		RegKey.m_hKey=hRootKey;
	else if (RegKey.OpenKey(hRootKey,lpKey,CRegKey::createNew|CRegKey::samAll)!=ERROR_SUCCESS)
		return FALSE;
	
	WINDOWPLACEMENT wp;
	wp.length=sizeof(WINDOWPLACEMENT);
	GetWindowPlacement(&wp);
	
	BOOL bRet=RegKey.SetValue(lpSubKey,LPSTR(&wp),sizeof(WINDOWPLACEMENT),REG_BINARY)==ERROR_SUCCESS;

	if (lpKey==NULL)
		RegKey.m_hKey=NULL;
	return bRet;
}
开发者ID:eladkarako,项目名称:locate32,代码行数:18,代码来源:WindowClasses.cpp


示例13: ActivateExistingTab

int TSAPI ActivateExistingTab(TContainerData *pContainer, HWND hwndChild)
{
	TWindowData *dat = (TWindowData*) GetWindowLongPtr(hwndChild, GWLP_USERDATA);	// needed to obtain the hContact for the message window
	if (!dat || !pContainer)
		return FALSE;

	NMHDR nmhdr = { 0 };
	nmhdr.code = TCN_SELCHANGE;
	if (TabCtrl_GetItemCount(GetDlgItem(pContainer->hwnd, IDC_MSGTABS)) > 1 && !(pContainer->dwFlags & CNT_DEFERREDTABSELECT)) {
		TabCtrl_SetCurSel(GetDlgItem(pContainer->hwnd, IDC_MSGTABS), GetTabIndexFromHWND(GetDlgItem(pContainer->hwnd, IDC_MSGTABS), hwndChild));
		SendMessage(pContainer->hwnd, WM_NOTIFY, 0, (LPARAM)&nmhdr);	// just select the tab and let WM_NOTIFY do the rest
	}
	if (dat->bType == SESSIONTYPE_IM)
		SendMessage(pContainer->hwnd, DM_UPDATETITLE, dat->hContact, 0);
	if (IsIconic(pContainer->hwnd)) {
		SendMessage(pContainer->hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
		SetForegroundWindow(pContainer->hwnd);
	}
	//MaD - hide on close feature
	if (!IsWindowVisible(pContainer->hwnd)) {
		WINDOWPLACEMENT wp={0};
		wp.length = sizeof(wp);
		GetWindowPlacement(pContainer->hwnd, &wp);

		/*
		 * all tabs must re-check the layout on activation because adding a tab while
		 * the container was hidden can make this necessary
		 */
		BroadCastContainer(pContainer, DM_CHECKSIZE, 0, 0);
		if (wp.showCmd == SW_SHOWMAXIMIZED)
			ShowWindow(pContainer->hwnd, SW_SHOWMAXIMIZED);
		else {
			ShowWindow(pContainer->hwnd, SW_SHOWNA);
			SetForegroundWindow(pContainer->hwnd);
		}
		SendMessage(pContainer->hwndActive, WM_SIZE, 0, 0);			// make sure the active tab resizes its layout properly
	}
	//MaD_
	else if (GetForegroundWindow() != pContainer->hwnd)
		SetForegroundWindow(pContainer->hwnd);
	if (dat->bType == SESSIONTYPE_IM)
		SetFocus(GetDlgItem(hwndChild, IDC_MESSAGE));
	return TRUE;
}
开发者ID:slotwin,项目名称:miranda-ng,代码行数:44,代码来源:msgs.cpp


示例14: GetWindowPlacement

bool CTSExecutorChildFrame::GetConfigurationData(xmlNodePtr& pxmlNodePtr)
{
    WINDOWPLACEMENT wndPlacement;
    GetWindowPlacement(&wndPlacement);

    const char* omcVarChar ;
    pxmlNodePtr = xmlNewNode(nullptr, BAD_CAST DEF_TS_EXECUTOR);
    m_ouTSExecutor.GetConfigurationData(pxmlNodePtr);

    //Window position


    xmlNodePtr pNodeWndPos = xmlNewNode(nullptr, BAD_CAST DEF_WND_POS);
    xmlAddChild(pxmlNodePtr, pNodeWndPos);

    if(IsWindowVisible() == FALSE)
    {
        wndPlacement.showCmd = SW_HIDE;
    }

    xmlUtils::CreateXMLNodeFrmWindowsPlacement(pNodeWndPos,wndPlacement);

    //splitter position-------------------------
    INT nCxCur, nCxMin;
    m_omSplitterWnd.GetColumnInfo(0, nCxCur, nCxMin);

    xmlNodePtr pNodeSplitterWnd = xmlNewNode(nullptr, BAD_CAST DEF_SPLITTER_WINDOW);
    xmlAddChild(pxmlNodePtr, pNodeSplitterWnd);

    //<CxIdeal />
    CString  csCxIdeal;
    csCxIdeal.Format("%d", nCxCur );
    omcVarChar = csCxIdeal;
    xmlNodePtr pCxIdeal = xmlNewChild(pNodeSplitterWnd, nullptr, BAD_CAST DEF_CX_IDEAL, BAD_CAST omcVarChar);
    xmlAddChild(pNodeSplitterWnd, pCxIdeal);

    // <CxMin />
    CString  csCxMin;
    csCxMin.Format("%d",nCxMin );
    omcVarChar = csCxMin;
    xmlNodePtr pcsCxMin = xmlNewChild(pNodeSplitterWnd, nullptr, BAD_CAST DEF_CX_MIN, BAD_CAST omcVarChar);
    xmlAddChild(pNodeSplitterWnd, pcsCxMin);
    return true;
}
开发者ID:BlackVodka,项目名称:busmaster,代码行数:44,代码来源:TSExecutorGUI_ChildFrame.cpp


示例15: SavePreferences

//-------------------------------------------------------------------------
void SavePreferences(void)
{
    int i;
    char name[256];
    WINDOWPLACEMENT wp;
    FILE *out;
    GetUserDataPath(name);
    strcat(name, PREFFILE);
    out = fopen(name, "w");
    if (!out)
        return;
    fprintf(out, "<UIPREFS>\n");
    fprintf(out, "\t<VERSION ID=\"%d\"/>\n", PREFVERS);
    wp.length = sizeof(wp);
    GetWindowPlacement(hwndFrame, &wp);
    fprintf(out, "\t<PLACEMENT VALUE=\"%d %d %d %d %d %d %d %d %d %d\"/>\n",
        wp.flags, wp.showCmd, wp.ptMinPosition.x, wp.ptMinPosition.y,
        wp.ptMaxPosition.x, wp.ptMaxPosition.y, wp.rcNormalPosition.left,
        wp.rcNormalPosition.top, wp.rcNormalPosition.right,
        wp.rcNormalPosition.bottom);
    fprintf(out, "\t<CUSTOMCOLORS>\n\t\t");
    for (i = 0; i < 16; i++)
    {
        fprintf(out, "%d ", custColors[i]);
        if (i == 7)
            fprintf(out, "\n\t\t");
    }
    fprintf(out, "\n\t</CUSTOMCOLORS>\n");
    fprintf(out, "\t<MEMWND WORDSIZE=\"%d\"/>\n", memoryWordSize);
    fprintf(out, "\t<FIND FMODE=\"%d\" RMODE=\"%d\" FIFFINDMODE=\"%d\" FIFREPLACEMODE=\"%d\">\n", findmode, replacemode, fiffindmode, fifreplacemode);
    for (i=0; i < F_M_MAX; i++)
    {
        fprintf(out, "\t\t<MODE INDEX=\"%d\" FIND=\"%d\" REPLACE=\"%d\"/>\n", i, findflags[i], replaceflags[i]);
    }			
    fprintf(out, "\t</FIND>\n");
    fprintf(out, "\t<PROPERTIES>\n");
    SaveProps(out, generalProject.profiles->debugSettings, 2);
    fprintf(out, "\t</PROPERTIES>\n");
    fprintf(out, "\t<RULES>\n");
    SaveBuildRules(out);
    fprintf(out, "\t</RULES>\n");
    fprintf(out, "</UIPREFS>\n");
    fclose(out);
}
开发者ID:jossk,项目名称:OrangeC,代码行数:45,代码来源:slprefs.c


示例16: SetWindowPos

BOOL CSplashScreen::OnInitDialog()
{

	if (!m_image->IsValid())
		return FALSE;

#ifdef _DEBUG	//ADDED by fengwen on 2006/11/22 : 调试时不让SplashWnd永远置前,妨碍调试。
	SetWindowPos(&wndNoTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
#endif

	HDC hScrDC;						// 屏幕设备描述表
	hScrDC = CreateDC(_T("DISPLAY"), NULL, NULL, NULL);
	
	int xScrn, yScrn;				// 屏幕分辨率

	xScrn = GetDeviceCaps(hScrDC, HORZRES);
	yScrn = GetDeviceCaps(hScrDC, VERTRES);

	CDialog::OnInitDialog();
	
	//InitWindowStyles(this);

	WINDOWPLACEMENT wp;
	GetWindowPlacement(&wp);
	wp.rcNormalPosition.left = 0;
	wp.rcNormalPosition.top = 0;
	wp.rcNormalPosition.right = xScrn;
	wp.rcNormalPosition.bottom = yScrn;

	SetWindowPlacement(&wp);


	int x, y;
	x = ( xScrn - m_image->GetWidth() ) / 2;
	y = ( yScrn - m_image->GetHeight() ) / 2;

	m_rtImg.SetRect(x, y, xScrn - x, yScrn - y);
	m_rtVersion.SetRect(m_rtImg.left + 198, m_rtImg.top + 293, m_rtImg.left + 253, m_rtImg.top + 311);
	m_rtText.SetRect(m_rtImg.left + 37, m_rtImg.top + 308, m_rtImg.left + 241, m_rtImg.top + 322);


	return TRUE;
}
开发者ID:kevinzhwl,项目名称:easyMuleVeryCD,代码行数:43,代码来源:SplashScreen.cpp


示例17: GetWindowPlacement

// CDlgControl 消息处理程序
void CDlgControl::FullScreen ( )
{
	RECT			rectDesktop;
    WINDOWPLACEMENT	wpNew;

	GetWindowPlacement ( &wpNew );

	//Adjust RECT to new size of window
	::GetWindowRect ( ::GetDesktopWindow(), &rectDesktop );
	::AdjustWindowRectEx( &rectDesktop, GetStyle(), TRUE, GetExStyle() );

	// Remember this for OnGetMinMaxInfo()
	//m_FullScreenWindowRect = rectDesktop;

	wpNew.showCmd			= SW_SHOWNORMAL;
	wpNew.rcNormalPosition	= rectDesktop;

	//don't allow the toolbar to dock
	SetWindowPlacement ( &wpNew );

	//SetWindowPos ( NULL, rectDesktop.left, rectDesktop.top,  rectDesktop.right, rectDesktop.bottom, SWP_NOREPOSITION );

	// 重新排列界面元素
	m_iLeft		= 0;
	m_iTop		= 22;
	//m_iTop		= 70;
	m_iRight	= rectDesktop.right-rectDesktop.left;
	m_iBottom	= rectDesktop.bottom-rectDesktop.top-150;
	m_tabCtrl.SetWindowPos ( NULL, m_iLeft, m_iTop, m_iRight, m_iBottom, SWP_NOREPOSITION );

	if ( m_pDlgClient )
		m_pDlgClient->SetWindowPos ( NULL, m_iLeft, m_iTop, m_iRight, m_iBottom, SWP_NOREPOSITION );

	if ( m_pDlgPrePrinting )
		m_pDlgPrePrinting->SetWindowPos ( NULL, m_iLeft, m_iTop, m_iRight, m_iBottom, SWP_NOREPOSITION );

	if ( m_pDlgOperator )
		m_pDlgOperator->SetWindowPos ( NULL, m_iLeft, m_iTop, m_iRight, m_iBottom, SWP_NOREPOSITION );

	GetDlgItem ( IDOK )->SetWindowPos ( NULL, (m_iRight - m_iLeft) / 2 + m_iLeft + 100, m_iBottom + 50, 0, 0, SWP_NOSIZE );

	ActivatePage( m_iCurrentItem )	;
}
开发者ID:loyoen,项目名称:Jet,代码行数:44,代码来源:DlgControl.cpp


示例18: memset

void CMainFrame::OnDestroy() 
{
    
    WINDOWPLACEMENT wp;
	memset (&wp, 0 , sizeof(wp));
	wp.length = sizeof(wp);
	GetWindowPlacement(&wp);
	if ( wp.showCmd == SW_SHOWMINIMIZED ) 
		wp.showCmd = SW_SHOW;
    ::WritePrivateProfileBinary("View" , "WindowPlacement" ,(LPBYTE)&wp, sizeof(wp), szGLOBAL_PROFILE);

	CWinApp* pApp = AfxGetApp();
    const char* pProfSave= pApp->m_pszProfileName;
	pApp->m_pszProfileName = szGLOBAL_PROFILE;
	SaveBarState("View");
	pApp->m_pszProfileName = pProfSave;
	
    if ( m_wndSplitter.GetRowCount() > 1 ) {
        m_wndSplitter.SavePosition();
    }

    SaveBarState("JMC");
//vls-begin// multiple output
//    m_coolBar.Save();
    for (int i = 0; i < MAX_OUTPUT; i++)
        m_coolBar[i].Save();
//vls-end//

    // save history 
    CFile histFile;
//vls-begin// base dir
//    if ( histFile.Open("history.dat", CFile::modeCreate | CFile::modeWrite ) ) {
    CString strFile(szBASE_DIR);
    strFile += "\\history.dat";
    if ( histFile.Open(strFile, CFile::modeCreate | CFile::modeWrite ) ) {
//vls-end//
        CArchive ar(&histFile, CArchive::store);
        m_editBar.GetHistory().Serialize (ar);
    }

    pMainWnd = NULL;
    CFrameWnd::OnDestroy();
}
开发者ID:chenwei600,项目名称:jmc,代码行数:43,代码来源:MainFrm.cpp


示例19: PRGAPI

void CTeenSpiritDlg::SaveSettings()
{
	PrgAPI* pAPI = PRGAPI();
	AppSettings* params = pAPI->GetAppSettings();
	WINDOWPLACEMENT pl;
	GetWindowPlacement(&pl);
	params->Write(SettingsCategory, _T("CMDSHOW"), (int&) pl.showCmd);
	params->Write(SettingsCategory, _T("LEFT"), (int&) pl.rcNormalPosition.left);
	params->Write(SettingsCategory, _T("TOP"), (int&) pl.rcNormalPosition.top);
	params->Write(SettingsCategory, _T("RIGHT"), (int&) pl.rcNormalPosition.right);
	params->Write(SettingsCategory, _T("BOTTOM"), (int&) pl.rcNormalPosition.bottom);
	m_PaneController.SaveSettings();
	BOOL bIsPlayerVisible = FALSE;
	CMiniPlayerDlg* pMPDlg = pAPI->GetMiniPlayerDlg(FALSE);
	if (pMPDlg != NULL)
		bIsPlayerVisible = pMPDlg->IsWindowVisible();
	pAPI->SetOption(OPT_MINIPLR_ShowAtStartup, bIsPlayerVisible);

}
开发者ID:KurzedMetal,项目名称:Jaangle,代码行数:19,代码来源:TeenSpiritDlg.cpp


示例20: VDUIRestoreWindowPlacementW32

void VDUIRestoreWindowPlacementW32(HWND hwnd, const char *name) {
	if (!IsZoomed(hwnd) && !IsIconic(hwnd)) {
		VDRegistryAppKey key("Window Placement");
		RECT r;

		if (key.getBinaryLength(name) == sizeof(r) && key.getBinary(name, (char *)&r, sizeof r)) {
			WINDOWPLACEMENT wp = {sizeof(WINDOWPLACEMENT)};

			if (GetWindowPlacement(hwnd, &wp)) {
				wp.length			= sizeof(WINDOWPLACEMENT);
				wp.flags			= 0;
				wp.showCmd			= SW_SHOWNORMAL;
				wp.rcNormalPosition	= r;

				SetWindowPlacement(hwnd, &wp);
			}
		}
	}
}
开发者ID:KGE-INC,项目名称:modplus,代码行数:19,代码来源:gui.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GetWindowPort函数代码示例发布时间:2022-05-30
下一篇:
C++ GetWindowLongPtrW函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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