本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例9: DrawBackground
void Menu::DrawBackground()
{
if (!background) {
return;
}
background->ScaleSize(GetMainWindow().GetSize()+1);
background->Blit(GetMainWindow(), 0, 0);
}
示例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;
}
示例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;
}
}
示例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;
}
示例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);
}
示例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();
}
示例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;
}