當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetMainWindow函數代碼示例

本文整理匯總了C++中GetMainWindow函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetMainWindow函數的具體用法?C++ GetMainWindow怎麽用?C++ GetMainWindow使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetMainWindow函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: if

void CViewCommander::Command_TAB_CLOSERIGHT( void )
{
	if( GetDllShareData().m_Common.m_sTabBar.m_bDispTabWnd ){
		int nGroup = 0;

		// ウィンドウ一覧を取得する
		EditNode* pEditNode;
		int nCount = CAppNodeManager::getInstance()->GetOpenedWindowArr( &pEditNode, TRUE );
		BOOL bSelfFound = FALSE;
		if( 0 >= nCount )return;

		for( int i = 0; i < nCount; i++ ){
			if( pEditNode[i].m_hWnd == GetMainWindow() ){
				pEditNode[i].m_hWnd = NULL;		//自分自身は閉じない
				nGroup = pEditNode[i].m_nGroup;
				bSelfFound = TRUE;
			}else if( !bSelfFound ){
				pEditNode[i].m_hWnd = NULL;		//左は閉じない
			}
		}

		//終了要求を出す
		CAppNodeGroupHandle(nGroup).RequestCloseEditor( pEditNode, nCount, FALSE, TRUE, GetMainWindow() );
		delete []pEditNode;
	}
	return;
}
開發者ID:daisukekoba,項目名稱:sakura-editor-trunk2,代碼行數:27,代碼來源:CViewCommander_Window.cpp

示例2: GetMainWindow

/* ウィンドウを閉じる */
void CViewCommander::Command_WINCLOSE( void )
{
	/* 閉じる */
	::PostMessage( GetMainWindow(), MYWM_CLOSE, 0, 								// 2007.02.13 ryoji WM_CLOSE→MYWM_CLOSEに変更
		(LPARAM)CAppNodeManager::getInstance()->GetNextTab( GetMainWindow() ) );	// タブまとめ時、次のタブに移動	2013/4/10 Uchi
	return;
}
開發者ID:daisukekoba,項目名稱:sakura-editor-trunk2,代碼行數:8,代碼來源:CViewCommander_Window.cpp

示例3: GetMainWindow

bool VirtualKeyboard::loadKeyboardPack(const std::string &packName)
{
  _kbdGUI->initSize(GetMainWindow().GetWidth(), GetMainWindow().GetHeight());

  _loaded = false;

  bool opened = false;
  opened = openPack(packName, Config::GetConstInstance()->GetDataDir() + "/vkeyb");

  // fallback to the current dir
  if (!opened)
    opened = openPack(packName, ".");

  if (opened) {
    _parser->setParseMode(VirtualKeyboardParser::kParseFull);
    _loaded = _parser->parse();

    if (_loaded) {
      printf("Keyboard pack '%s' loaded successfully\n", packName.c_str());
    } else {
      printf("Error parsing the keyboard pack '%s\n'", packName.c_str());
    }
  } else {
    printf("Keyboard pack not found\n");
  }

  return _loaded;
}
開發者ID:fluxer,項目名稱:warmux,代碼行數:28,代碼來源:virtual-keyboard.cpp

示例4: HasScrollBar

bool ScrollBox::Update(const Point2i &mousePosition,
                       const Point2i &lastMousePosition)
{
  // Force redrawing if we are scrolling and the mouse has moved
  if (start_drag_offset!=NO_DRAG && mousePosition!=lastMousePosition) {
    //NeedRedrawing();
  }

  bool redraw = need_redrawing;
  bool updated = Widget::Update(mousePosition, lastMousePosition);
  need_redrawing = redraw;

  bool has_scrollbar = HasScrollBar();
  m_up->SetVisible(has_scrollbar);
  m_down->SetVisible(has_scrollbar);

  updated |= WidgetList::Update(mousePosition, lastMousePosition);

  if (has_scrollbar) {
    GetMainWindow().BoxColor(GetScrollTrack(), dark_gray_color);

    const Rectanglei& thumb = GetScrollThumb();
    bool over = scroll_mode==SCROLL_MODE_THUMB || thumb.Contains(mousePosition);
    GetMainWindow().BoxColor(thumb, over ? white_color : gray_color);
  }
  return updated;
}
開發者ID:Arnaud474,項目名稱:Warmux,代碼行數:27,代碼來源:scroll_box.cpp

示例5: Save

bool TDocument::AllowClose()
{
	if (IsModified())
	{
		bool save;

		if (!TCommonDialogs::SaveChanges(fTitle, GetMainWindow(), save))
			return false;

		if (save)
		{	
	 		// save the file
	 		if (fFile.IsSpecified())
				Save();
			else
			{
				TFile* file = TCommonDialogs::SaveFile(NULL, GetMainWindow());
				
				if (file)
				{
					SetFile(file);
					Save();
					delete file;
				}
				else
					return false;
			}
		}
	}

	return true;
}
開發者ID:mikevoydanoff,項目名稱:zoinks,代碼行數:32,代碼來源:TDocument.cpp

示例6: SoftwareTabView_OnSelectionChanged

static void SoftwareTabView_OnSelectionChanged(void)
{
	int nTab = 0;
	HWND hwndSoftwarePicker;
	HWND hwndSoftwareDevView;
	HWND hwndSoftwareList;

	hwndSoftwarePicker = GetDlgItem(GetMainWindow(), IDC_SWLIST);
	hwndSoftwareDevView = GetDlgItem(GetMainWindow(), IDC_SWDEVVIEW);
	hwndSoftwareList = GetDlgItem(GetMainWindow(), IDC_SOFTLIST);

	nTab = TabView_GetCurrentTab(GetDlgItem(GetMainWindow(), IDC_SWTAB));

	switch(nTab)
	{
		case 0:
			ShowWindow(hwndSoftwarePicker, SW_SHOW);
			ShowWindow(hwndSoftwareDevView, SW_HIDE);
			ShowWindow(hwndSoftwareList, SW_HIDE);
			break;

		case 1:
			ShowWindow(hwndSoftwarePicker, SW_HIDE);
			ShowWindow(hwndSoftwareDevView, SW_SHOW);
			ShowWindow(hwndSoftwareList, SW_HIDE);
			break;
		case 2:
			ShowWindow(hwndSoftwarePicker, SW_HIDE);
			ShowWindow(hwndSoftwareDevView, SW_HIDE);
			ShowWindow(hwndSoftwareList, SW_SHOW);
			break;
	}
}
開發者ID:crazii,項目名稱:mameui,代碼行數:33,代碼來源:messui.cpp

示例7: SoftwareList_GetItemImage

static int SoftwareList_GetItemImage(HWND hwndPicker, int nItem)
{
	iodevice_t nType;
	int nIcon = 0;
	int drvindex = 0;
	const char *icon_name;
	HWND hwndGamePicker = GetDlgItem(GetMainWindow(), IDC_LIST);
	HWND hwndSoftwareList = GetDlgItem(GetMainWindow(), IDC_SOFTLIST);
	drvindex = Picker_GetSelectedItem(hwndGamePicker);
	nType = SoftwareList_GetImageType(hwndSoftwareList, nItem);
	nIcon = GetMessIcon(drvindex, nType);
	if (!nIcon)
	{
		switch(nType)
		{
			case IO_UNKNOWN:
				nIcon = FindIconIndex(IDI_WIN_REDX);
				break;

			default:
				icon_name = lookupdevice(nType)->icon_name;
				if (!icon_name)
					icon_name = device_image_interface::device_typename(nType);
				nIcon = FindIconIndexByName(icon_name);
				if (nIcon < 0)
					nIcon = FindIconIndex(IDI_WIN_UNKNOWN);
				break;
		}
	}
	return nIcon;
}
開發者ID:crazii,項目名稱:mameui,代碼行數:31,代碼來源:messui.cpp

示例8: WinQueryWindowULong

// For frame windows, 'Show' is equivalent to 'Show & Activate'
nsresult nsFrameWindow::Show( PRBool bState)
{
   if( mWnd)
   {
      ULONG ulFlags;
      if( bState) {
         ULONG ulStyle = WinQueryWindowULong( GetMainWindow(), QWL_STYLE);
         ulFlags = SWP_SHOW;
         /* Don't activate the window unless the parent is visible */
         if (WinIsWindowVisible(WinQueryWindow(GetMainWindow(), QW_PARENT)))
           ulFlags |= SWP_ACTIVATE;
         if (!( ulStyle & WS_VISIBLE)) {
            PRInt32 sizeMode;
            GetSizeMode( &sizeMode);
            if ( sizeMode == nsSizeMode_Maximized) {
               ulFlags |= SWP_MAXIMIZE;
            } else if ( sizeMode == nsSizeMode_Minimized) {
               ulFlags |= SWP_MINIMIZE;
            } else {
               ulFlags |= SWP_RESTORE;
            }
         }
         if( ulStyle & WS_MINIMIZED)
            ulFlags |= (SWP_RESTORE | SWP_MAXIMIZE);
      }
      else
         ulFlags = SWP_HIDE | SWP_DEACTIVATE;
      WinSetWindowPos( GetMainWindow(), NULLHANDLE, 0L, 0L, 0L, 0L, ulFlags);
      SetWindowListVisibility( bState);
   }

   return NS_OK;
}
開發者ID:MozillaOnline,項目名稱:gecko-dev,代碼行數:34,代碼來源:nsFrameWindow.cpp

示例9: DrawBackground

void Menu::DrawBackground()
{
  if (!background) {
    return;
  }
  background->ScaleSize(GetMainWindow().GetSize()+1);
  background->Blit(GetMainWindow(), 0, 0);
}
開發者ID:Arnaud474,項目名稱:Warmux,代碼行數:8,代碼來源:menu.cpp

示例10: LoadScreenShotEx

/* Allow us to pre-load the DIB once for future draws */
#ifdef MESS
BOOL LoadScreenShotEx(int nGame, LPCSTR lpSoftwareName, int nType)
#else /* !MESS */
BOOL LoadScreenShot(int nGame, int nType)
#endif /* MESS */
{
	BOOL loaded = FALSE;
	/* No need to reload the same one again */
#ifndef MESS
	if (nGame == current_image_game && nType == current_image_type)
		return TRUE;
#endif

	/* Delete the last ones */
	FreeScreenShot();

	/* Load the DIB */
#ifdef MESS
	if (lpSoftwareName)
	{
		int nParentIndex = -1;
		loaded = LoadSoftwareScreenShot(drivers[nGame], lpSoftwareName, nType);
		if (!loaded && DriverIsClone(nGame) == TRUE)
		{
			nParentIndex = GetParentIndex(drivers[nGame]);
			loaded = LoadSoftwareScreenShot(drivers[nParentIndex], lpSoftwareName, nType);
		}
	}
	if (!loaded)
#endif /* MESS */
	{
		loaded = LoadDIB(drivers[nGame]->name, &m_hDIB, &m_hPal, nType);
	}

	/* If not loaded, see if there is a clone and try that */
	if (!loaded)
	{
		int nParentIndex = GetParentIndex(drivers[nGame]);
		if( nParentIndex >= 0)
		{
			loaded = LoadDIB(drivers[nParentIndex]->name, &m_hDIB, &m_hPal, nType);
			nParentIndex = GetParentIndex(drivers[nParentIndex]);
			if (!loaded && nParentIndex >= 0)
				loaded = LoadDIB(drivers[nParentIndex]->name, &m_hDIB, &m_hPal, nType);
		}
	}

	if (loaded)
	{
		HDC hdc = GetDC(GetMainWindow());
		m_hDDB = DIBToDDB(hdc, m_hDIB, NULL);
		ReleaseDC(GetMainWindow(),hdc);
		
		current_image_game = nGame;
		current_image_type = nType;

	}

	return (loaded) ? TRUE : FALSE;
}
開發者ID:broftkd,項目名稱:mess-cvs,代碼行數:61,代碼來源:screenshot.c

示例11: if

void CUISkin::SetWheelChannelChanging(bool fChanging,DWORD Delay)
{
	if (fChanging) {
		if (Delay>0)
			::SetTimer(GetMainWindow(),TIMER_ID_WHEELCHANNELCHANGE,Delay,NULL);
		m_fWheelChannelChanging=true;
	} else if (m_fWheelChannelChanging) {
		::KillTimer(GetMainWindow(),TIMER_ID_WHEELCHANNELCHANGE);
		m_fWheelChannelChanging=false;
	}
}
開發者ID:DBCTRADO,項目名稱:TVTest,代碼行數:11,代碼來源:UISkin.cpp

示例12: LoadScreenShotEx

/* Allow us to pre-load the DIB once for future draws */
#ifdef MESS
BOOL LoadScreenShotEx(int nGame, LPCSTR lpSoftwareName, int nType)
#else /* !MESS */
BOOL LoadScreenShot(int nGame, int nType)
#endif /* MESS */
{
	BOOL loaded = FALSE;

	/* No need to reload the same one again */
#ifndef MESS
	if (nGame == current_image_game && nType == current_image_type)
		return TRUE;
#endif

	/* Delete the last ones */
	FreeScreenShot();

	/* Load the DIB */
#ifdef MESS
	if (lpSoftwareName)
	{
		loaded = LoadSoftwareScreenShot(drivers[nGame], lpSoftwareName, nType);
		if (!loaded && (drivers[nGame]->clone_of && !(drivers[nGame]->clone_of->flags & NOT_A_DRIVER)))
			loaded = LoadSoftwareScreenShot(drivers[nGame]->clone_of, lpSoftwareName, nType);
	}
	if (!loaded)
#endif /* MESS */
	{
		loaded = LoadDIB(drivers[nGame]->name, &m_hDIB, &m_hPal, nType);
	}

	/* If not loaded, see if there is a clone and try that */
	if (!loaded
	&&	 (drivers[nGame]->clone_of != NULL)
	&&	!(drivers[nGame]->clone_of->flags & NOT_A_DRIVER))
	{
		loaded = LoadDIB(drivers[nGame]->clone_of->name, &m_hDIB, &m_hPal, nType);
		if (!loaded && drivers[nGame]->clone_of->clone_of)
			loaded = LoadDIB(drivers[nGame]->clone_of->clone_of->name, &m_hDIB, &m_hPal, nType);
	}

	if (loaded)
	{
		HDC hdc = GetDC(GetMainWindow());
		m_hDDB = DIBToDDB(hdc, m_hDIB, NULL);
		ReleaseDC(GetMainWindow(),hdc);
		
		current_image_game = nGame;
		current_image_type = nType;

	}

	return (loaded) ? TRUE : FALSE;
}
開發者ID:Sunoo,項目名稱:nonamemame,代碼行數:55,代碼來源:screenshot.c

示例13: GetCurrentDirectory

afx_msg void
CMapPropertiesDialog::OnBrowseBackgroundMusic()
{
  char old_directory[MAX_PATH] = {0};
  GetCurrentDirectory(MAX_PATH, old_directory);
  std::string directory = GetMainWindow()->GetDefaultFolder(WA_SOUND);
  SetCurrentDirectory(directory.c_str());
  CSoundFileDialog dialog(FDM_OPEN);

  if (dialog.DoModal() == IDOK)
  {
    std::string full_path = LPCTSTR(dialog.GetPathName());
    std::string term("sounds");
    size_t pos = full_path.rfind(term);

    if (pos != std::string::npos)
    {
      CString path = full_path.substr(pos + 7).c_str();
      path.Replace('\\', '/');
      SetDlgItemText(IDC_MUSIC, path);
    }

  }

  SetCurrentDirectory(old_directory);
}
開發者ID:FlyingJester,項目名稱:sphere,代碼行數:26,代碼來源:MapPropertiesDialog.cpp

示例14: dialog

void t4p::VersionUpdateViewClass::OnHelpCheckForUpdates(wxCommandEvent& event) {
    wxString currentVersion  = Feature.GetCurrentVersion();
    t4p::VersionUpdateDialogClass dialog(GetMainWindow(),
                                         wxID_ANY, Feature.App.RunningThreads, currentVersion, false,
                                         wxEmptyString);
    dialog.ShowModal();
}
開發者ID:62BRAINS,項目名稱:triumph4php,代碼行數:7,代碼來源:VersionUpdateViewClass.cpp

示例15: _T

/*!	入力補完
	Ctrl+Spaceでここに到著。
	CEditView::m_bHokan: 現在補完ウィンドウが表示されているかを表すフラグ。

    @date 2001/06/19 asa-o 英大文字小文字を同一視する
                     候補が1つのときはそれに確定する
	@date 2001/06/14 asa-o 參照データ変更
	                 開くプロパティシートをタイプ別に変更y
	@date 2000/09/15 JEPRO [Esc]キーと[x]ボタンでも中止できるように変更
	@date 2005/01/10 genta CEditView_Commandから移動
*/
void CViewCommander::Command_HOKAN( void )
{
#if 0
// 2011.06.24 Moca Plugin導入に従い未設定の確認をやめる
retry:;
	/* 補完候補一覧ファイルが設定されていないときは、設定するように促す。 */
	// 2003.06.22 Moca ファイル內から検索する場合には補完ファイルの設定は必須ではない
	if( m_pCommanderView->m_pTypeData->m_bUseHokanByFile == FALSE &&
		m_pCommanderView->m_pTypeData->m_bUseHokanByKeyword == false &&
		_T('\0') == m_pCommanderView->m_pTypeData->m_szHokanFile[0]
	){
		ConfirmBeep();
		if( IDYES == ::ConfirmMessage( GetMainWindow(),
			LS(STR_ERR_DLGEDITVWHOKAN1)
		) ){
			/* タイプ別設定 プロパティシート */
			if( !CEditApp::getInstance()->m_pcPropertyManager->OpenPropertySheetTypes( 2, GetDocument()->m_cDocType.GetDocumentType() ) ){
				return;
			}
			goto retry;
		}
	}
#endif
	CNativeW	cmemData;
	/* カーソル直前の単語を取得 */
	if( 0 < m_pCommanderView->GetParser().GetLeftWord( &cmemData, 100 ) ){
		m_pCommanderView->ShowHokanMgr( cmemData, TRUE );
	}else{
		InfoBeep(); //2010.04.03 Error→Info
		m_pCommanderView->SendStatusMessage(LS(STR_SUPPORT_NOT_COMPLITE)); // 2010.05.29 ステータスで表示
	}
	return;
}
開發者ID:daisukekoba,項目名稱:sakura-editor-trunk2,代碼行數:44,代碼來源:CViewCommander_Support.cpp


注:本文中的GetMainWindow函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。