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

C++ GetOpenFileNameA函数代码示例

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

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



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

示例1: GetOpenFileNameA_fix

/* MAKE_EXPORT GetOpenFileNameA_fix=GetOpenFileNameA */
BOOL WINAPI GetOpenFileNameA_fix(LPOPENFILENAMEA lpofn)
{
	BOOL ret = GetOpenFileNameA(lpofn);
	if (!ret && CommDlgExtendedError() == CDERR_STRUCTSIZE && lpofn 
		&& lpofn->lStructSize == sizeof(OPENFILENAME))
	{
		lpofn->lStructSize = OPENFILENAME_SIZE_VERSION_400A;
		ret = GetOpenFileNameA(lpofn);
		lpofn->lStructSize = sizeof(OPENFILENAME);
	}
	return ret;
}
开发者ID:metaxor,项目名称:KernelEx,代码行数:13,代码来源:openfilename_fix.c


示例2: GetDlgItemTextA

void ProjectConfigDialog::onSelectScriptFile(void)
{
    char buff[MAX_PATH + 1] = {0};
    char projdir[MAX_PATH + 1] = {0};
    GetDlgItemTextA(m_hwndDialog, IDC_EDIT_PROJECT_DIR, projdir, MAX_PATH);

    OPENFILENAMEA ofn = {0};
    ofn.lStructSize = sizeof(ofn);
    ofn.hwndOwner = m_hwndDialog;
    ofn.lpstrFilter = "Lua Script File (*.lua)\0*.lua\0";
    ofn.lpstrTitle = "Select Script File";
    if (DirectoryExists(projdir))
    {
        ofn.lpstrInitialDir = projdir;
    }
    ofn.Flags = OFN_DONTADDTORECENT | OFN_ENABLESIZING | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST;
    ofn.lpstrFile = buff;
    ofn.nMaxFile = MAX_PATH;

    if (GetOpenFileNameA(&ofn))
    {
        m_project.setScriptFile(buff);
        updateScriptFile();
    }
}
开发者ID:AlexYanJianhua,项目名称:quick-cocos2d-x,代码行数:25,代码来源:ProjectConfigDialog.cpp


示例3: WinMain

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR lpCmdLine, int nShowCmd)
{
	char szPathName[MAX_PATH];
	OPENFILENAMEA ofn;
	ZeroMemory(&ofn, sizeof(ofn));
	ofn.lStructSize = sizeof(ofn);
	ofn.lpstrFile = szPathName;
	ofn.lpstrFile[0] = '\0';
	ofn.nMaxFile = MAX_PATH;
	ofn.lpstrFilter = "Win32 executable files\0*.exe\0\0";
	ofn.nFilterIndex = 1;
	ofn.lpstrTitle = "Choose a file to protect";
	ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
	int key_pressed = MessageBoxA(NULL, "CProtector - protector for executables\nWould you like to choose a file to protect?",
		"CProtector", MB_OKCANCEL | MB_ICONQUESTION);
	if	(key_pressed == IDCANCEL)
	{
		ExitProcess(0);
	}
	if(!GetOpenFileNameA(&ofn)) ExitProcess(0);
	if(!ProtectFile(ofn.lpstrFile))
	{
		MessageBoxA(NULL, "Error occured : file is busy or error unknown","CProtector", MB_ICONERROR);
	} else
	{
		MessageBoxA(NULL, "Protection installed","CProtector", MB_ICONINFORMATION);
	}
	
	ExitProcess(0);

}
开发者ID:andrey429,项目名称:cprotector,代码行数:31,代码来源:cprotector.cpp


示例4: OpenFileDialog

BOOL OpenFileDialog(HWND hwndDlg, OPENFILENAMEA*ofn, char*exe) {
	//pointer zum exenamen
	char* exename = NULL;
	//buffer vom pfad
	static char szFile[260] = ""; //static damit noch nach dem aufruf lesbar bleibt
	//buffer vom filter
	char szFilter[260] = "";
	//backslash suchen
	exename = strrchr(exe, '\\') + 1;
	//kein backslash dann normal ret als exenamen verwenden
	if ((int)exename == 1) exename = exe;
	//filterstring aufbauen
	mir_snprintf(szFilter, SIZEOF(szFilter), "%s|%s|%s|*.*|", exename, exename, Translate("All Files"));
	//umbruch in 0 wandeln
	unsigned int sizeFilter = strlen(szFilter);
	for (unsigned int i = 0; i < sizeFilter; i++)
		if (szFilter[i] == '|') szFilter[i] = 0;
	//openfiledia vorbereiten
	memset(ofn, 0, sizeof(OPENFILENAMEA));
	ofn->lStructSize = sizeof(OPENFILENAMEA);
	ofn->hwndOwner = hwndDlg;
	ofn->lpstrFile = szFile;
	ofn->nMaxFile = SIZEOF(szFile);
	ofn->lpstrFilter = szFilter;
	ofn->nFilterIndex = 1;
	ofn->lpstrFileTitle = exe;
	ofn->nMaxFileTitle = 0;
	ofn->lpstrInitialDir = NULL;
	ofn->Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;

	return GetOpenFileNameA(ofn);
}
开发者ID:martok,项目名称:miranda-ng,代码行数:32,代码来源:addgamedialog.cpp


示例5: sizeof

char* Platform::OpenFileDialog()
{
    const int32 FileNameSize = MAX_PATH;
    char* FileName = (char*)malloc(FileNameSize);

    OPENFILENAME DialogParams   = {};
    DialogParams.lStructSize    = sizeof(OPENFILENAME);
    DialogParams.hwndOwner      = GetActiveWindow();
    DialogParams.lpstrFilter    = "JPEG\0*.jpg;*.jpeg\0PNG\0*.png\0";
    DialogParams.nFilterIndex   = 2;
    DialogParams.lpstrFile      = FileName;
    DialogParams.lpstrFile[0]   = '\0';
    DialogParams.nMaxFile       = FileNameSize;
    DialogParams.Flags          = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;

    BOOL Result = GetOpenFileNameA(&DialogParams); // TODO: Unicode support?

    if (Result)
    {
        return FileName;
    }
    else
    {
        free(FileName);
        return 0;
    }
}
开发者ID:Clever-Boy,项目名称:Papaya,代码行数:27,代码来源:papaya_platform_win32.cpp


示例6: ShowOpenFileDialog

bool ShowOpenFileDialog(char* FileName, int FileNameLength, char* filter)
// Open a dialog for selecting a file and returns true if succeeded with the name of the file in the preallocated buffer <FileName>
{
    OPENFILENAMEA ofn ;

    ZeroMemory(&ofn, sizeof(ofn));

    ofn.lStructSize = sizeof(ofn);
    ofn.hwndOwner = GetActiveWindow(); 
    ofn.lpstrDefExt = 0;
    FileName[0] = '\0';
	ofn.lpstrFile = FileName;
    ofn.nMaxFile = FileNameLength;
    ofn.lpstrFilter = filter; 
    ofn.nFilterIndex = 1;
    char strAux[MAX_PATH];
	GetCurrentDirectoryA(MAX_PATH, strAux);
	ofn.lpstrInitialDir = strAux;
    ofn.lpstrTitle = LPSTR("Open File");
    ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_ENABLESIZING;

    GetOpenFileNameA(&ofn);

    if (strlen(ofn.lpstrFile) == 0) return false;
    return true;
} // ShowOpenFileDialog
开发者ID:alhunor,项目名称:projects,代码行数:26,代码来源:filesystems.cpp


示例7: memset

void 
CTextureAtlasCreatorContext::Load()
{
	CHAR8 strOpenName[512] = "";
	OPENFILENAMEA FileName;
	memset(&FileName, 0, sizeof(OPENFILENAMEA));
	FileName.lStructSize = sizeof(OPENFILENAMEA);
	FileName.hwndOwner = reinterpret_cast<HWND>(Ascension::Renderer().GetWindowHandle());
	FileName.hInstance = reinterpret_cast<HINSTANCE>(GetModuleHandle(NULL));
	FileName.lpstrFilter = NULL;
	FileName.lpstrCustomFilter = NULL;
	FileName.nMaxCustFilter = NULL;
	FileName.lpstrFilter = "Ascension Atlas Files\0*.ascatl;*.ascatledt*\0\0";
	FileName.nFilterIndex = 2;
	FileName.lpstrFile = strOpenName;
	FileName.nMaxFile = 512;
	FileName.lpstrFileTitle = NULL;
	FileName.lpstrTitle = "Open Atlas";
	FileName.Flags = OFN_EXPLORER;

	if(TRUE == GetOpenFileNameA(&FileName))
	{
		LoadAtlas(strOpenName);
	}
}
开发者ID:Matt392,项目名称:Ascension,代码行数:25,代码来源:TextureAtlasCreatorContext.cpp


示例8: OnCompressOrDecompress

// TODO: fix alternate cohesion crap
void OnCompressOrDecompress(HWND sheet, bool compress)
{
	int size, ret;
	char path[_MAX_PATH];

	if (!GetOpenFileNameA(sheet, path, sizeof(path)))
		return;

	size = fsize(path);
	std::vector<unsigned char> buffer(size);

	AutoFile fIn(path, "rb");
	fread(&buffer[0], sizeof(char), size, fIn.get()); // contiguous
	fIn.close();

	path[0] = '\0';   // don't pre-fill path
	if (!GetSaveFileNameA(sheet, path, sizeof(path)))
		return;

	AutoFile fOut(path, "wb");

	if (compress)
		ret = deflate_file(&buffer[0], size, fOut.get());
	else
		ret = inflate_file(&buffer[0], size, fOut.get());

	fOut.close();

	if (ret >= 0)
		MessageBox(sheet, "Operation completed successfully.",
		"Raw Compression/Decompression", MB_OK);
	else
		MessageBox(sheet, "Operation failed.",
		"Raw Compression/Decompression", MB_ICONWARNING);
}
开发者ID:DoctorWillCU,项目名称:aokts,代码行数:36,代码来源:aokts.cpp


示例9: OpenFileDialog

// ^<見出し> '|' <拡張子パターン> ( ';' <拡張子パターン> )* '\n'
string_t OpenFileDialog(const char *title, const char *filter) {
	OPENFILENAMEA ofn;
	char szPath[MAX_PATH];
	char szFile[MAX_PATH];

	memset(&ofn, 0, sizeof(ofn));
	memset(szPath, 0, sizeof(szPath));
	memset(szFile, 0, sizeof(szFile));

	GetCurrentDirectoryA(MAX_PATH, szPath);

	char *fixuped_filter = fixup_filter(filter);
	
	ofn.lStructSize = sizeof(OPENFILENAMEA);
	ofn.hwndOwner = NULL;
	ofn.lpstrInitialDir = szPath;	// 初期フォルダを
	ofn.lpstrFile = szFile;			// 選択ファイルを入れるバッファ
	ofn.nMaxFile = MAX_PATH;
	ofn.lpstrFilter = fixuped_filter;
	ofn.lpstrTitle = title;
	ofn.Flags = OFN_EXPLORER|OFN_FILEMUSTEXIST;
	
	if (GetOpenFileNameA(&ofn)) {
		free(fixuped_filter);
		return String.Create(szFile);
	} else {
		free(fixuped_filter);
		return String.Create(NULL);
	}
}
开发者ID:Sup3rc4l1fr4g1l1571c3xp14l1d0c10u5,项目名称:NanoGL,代码行数:31,代码来源:Dialog.windows.c


示例10: GetFile

int GetFile(char *szFileName, char *szParse=0,u32 flags=0) 
{
	cfgLoadStr("config","image",szFileName,"null");
	if (strcmp(szFileName,"null")==0)
	{
	#if HOST_OS==OS_WINDOWS
		OPENFILENAME ofn;
		ZeroMemory( &ofn , sizeof( ofn));
	ofn.lStructSize = sizeof ( ofn );
	ofn.hwndOwner = NULL  ;
	ofn.lpstrFile = szFileName ;
	ofn.lpstrFile[0] = '\0';
	ofn.nMaxFile = MAX_PATH;
	ofn.lpstrFilter = "All\0*.*\0\0";
	ofn.nFilterIndex =1;
	ofn.lpstrFileTitle = NULL ;
	ofn.nMaxFileTitle = 0 ;
	ofn.lpstrInitialDir=NULL ;
	ofn.Flags = OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST ;

		if (GetOpenFileNameA(&ofn))
		{
			//already there
			//strcpy(szFileName,ofn.lpstrFile);
		}
	#endif
	}

	return 1; 
}
开发者ID:Hyell,项目名称:reicast-emulator,代码行数:30,代码来源:nullDC.cpp


示例11: GetOpenFileNameUTF8

BOOL GetOpenFileNameUTF8(LPOPENFILENAME lpofn)
{
#ifdef WDL_SUPPORT_WIN9X
  if (GetVersion()&0x80000000) return GetOpenFileNameA(lpofn);
#endif
  return GetOpenSaveFileNameUTF8(lpofn,FALSE);
}
开发者ID:Artogn,项目名称:licecap,代码行数:7,代码来源:win32_utf8.c


示例12: sizeof

bool Window::open( char* dlgTitle, char* initDir, char* filterStr, char * resultFile ) 
{
  OPENFILENAMEA ofn = { 0 };
    
  ofn.Flags = OFN_FILEMUSTEXIST |  // file user picks must exist, else dialog box won't return
              OFN_PATHMUSTEXIST;  // path must exist, else dialog box won't return

  ofn.hInstance = hInstance ;
  ofn.hwndOwner = hwnd;

  ofn.lStructSize = sizeof(OPENFILENAMEA);
  
  ofn.lpstrTitle = dlgTitle ;
  ofn.lpstrInitialDir = initDir;
  ofn.lpstrFilter = filterStr; //"md2 files (*.md2)\0*.md2\0All files (*.*)\0*.*\0\0";

  ofn.lpstrFile = resultFile;   // ptr to string that will contain 
                                // FILE USER CHOSE when call to
                                // GetOpenFileNameA( &ofn ) returns.

  ofn.nMaxFile  = MAX_PATH;     // length of the resultFile string

  return (GetOpenFileNameA( &ofn ));   // GetOpenFileName returns false
                                       // when user clicks cancel, or if err
}
开发者ID:sdp0et,项目名称:gtp,代码行数:25,代码来源:WindowClass.cpp


示例13: chooseFileName

std::string chooseFileName()
{
#ifdef _WINDOWS
	OPENFILENAMEA ofn ;
	static char szFile[_MAX_PATH] ;

    ZeroMemory( &ofn , sizeof( ofn) );
	ofn.lStructSize = sizeof ( ofn );
	ofn.hwndOwner = NULL  ;
	ofn.lpstrFile = szFile ;
	ofn.lpstrFile[0] = '\0';
	ofn.nMaxFile = sizeof( szFile );
	ofn.lpstrFilter = "All\0*.*\0Images\0*.jpg;*.png\0";
	ofn.nFilterIndex =1;
	ofn.lpstrFileTitle = NULL ;
	ofn.nMaxFileTitle = 0 ;
	ofn.lpstrInitialDir=NULL ;
	ofn.Flags = OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST ;

	GetOpenFileNameA( &ofn );

	return ofn.lpstrFile;
#else
	return "";
#endif
}
开发者ID:Chingliu,项目名称:llqtwebkit,代码行数:26,代码来源:testgl.cpp


示例14: showOpenDialog

    std::string showOpenDialog(const std::string& caption, const FileTypes& extensions, const std::string& defaultFilename)
    {
        auto windowHandle = oWindow->getHandle();
        char szFileName[MAX_PATH] = {0};
        memcpy(szFileName, defaultFilename.c_str(), std::min(defaultFilename.size(), static_cast<size_t>(MAX_PATH - 1)));

        OPENFILENAMEA ofn = {0};
        ofn.lStructSize = sizeof(OPENFILENAMEA);
        ofn.hwndOwner = windowHandle;
        ofn.lStructSize = sizeof(ofn);
        ofn.lpstrFile = szFileName;
        ofn.nMaxFile = MAX_PATH;
        ofn.Flags = OFN_EXPLORER | OFN_OVERWRITEPROMPT | OFN_NOCHANGEDIR;

        size_t totalCount = 0;
        for (auto& fileType : extensions)
        {
            totalCount += fileType.typeName.size();
            totalCount += fileType.extension.size();
        }

        char* szFilters = new char[21 + totalCount * 3 + 9 * extensions.size()];

        size_t currentOffset = 0;
        for (auto& fileType : extensions)
        {
            memcpy(szFilters + currentOffset, fileType.typeName.c_str(), fileType.typeName.size());
            currentOffset += fileType.typeName.size();
            memcpy(szFilters + currentOffset, " (*.", 4);
            currentOffset += 4;
            memcpy(szFilters + currentOffset, fileType.extension.c_str(), fileType.extension.size());
            currentOffset += fileType.extension.size();
            memcpy(szFilters + currentOffset, ")\0*.", 4);
            currentOffset += 4;
            memcpy(szFilters + currentOffset, fileType.extension.c_str(), fileType.extension.size());
            currentOffset += fileType.extension.size();
            memcpy(szFilters + currentOffset, "\0", 1);
            currentOffset += 1;
        }
        memcpy(szFilters + currentOffset, "All Files (*.*)\0*.*\0\0", 21);

        ofn.lpstrFilter = szFilters;
        std::string defaultExtension = extensions[0].extension;
        ofn.lpstrDefExt = defaultExtension.c_str();
        ofn.lpstrTitle = caption.c_str();

        // PNG Files (*.PNG)\0*.PNG\0All Files (*.*)\0*.*\0

        GetOpenFileNameA(&ofn);

        delete[] szFilters;

        return ofn.lpstrFile;
    }
开发者ID:Daivuk,项目名称:onut,代码行数:54,代码来源:Files.cpp


示例15: OnFileTrigRead

/**
 * Handles a user request to read triggers from above textual format.
 */
void OnFileTrigRead(HWND dialog)
{
	char path[MAX_PATH] = "";

	if (!GetOpenFileNameA(dialog, path, MAX_PATH))
		return;

	std::ifstream textin(path, std::ios_base::in);
	TrigXmlReader reader;
	reader.read(textin);
}
开发者ID:DoctorWillCU,项目名称:aokts,代码行数:14,代码来源:aokts.cpp


示例16: switch

/* WM_COMMAND message processing */
void window::WMCommand(HWND &hwnd, UINT &message, WPARAM &wParam, LPARAM &lParam)
{
  int
    horz_range,
    vert_range;
  char
    buf[32],         /* Status bar text buffer */
    file_name[256];

  switch (wParam)
  {
  case IDM_OPEN:
    OpenFName.hwndOwner = hwnd;
    OpenFName.lpstrFile =  file_name;
    OpenFName.lpstrFileTitle = NULL;
    OpenFName.lpstrFile[0] = '\0';
    OpenFName.Flags = OFN_HIDEREADONLY | OFN_CREATEPROMPT;
    GetOpenFileNameA(&OpenFName);
    if (file_name[0] != 0)
    {
      txt.Reset();
      max_str_len = txt.LoadFile(file_name);

      vert_range = txt.num_of_str - client_field.y;
      if (vert_range < 0)
        vert_range = 0;

      if (vert_range > MAX_RANGE)
        vert_scrlb_step = (int)(ceil(vert_range * 1.0 / MAX_RANGE));
      else
        vert_scrlb_step = 1;
      SetScrollRange(hwnd, SB_VERT, 0, vert_range /= vert_scrlb_step, TRUE);
      SetScrollPos(hwnd, SB_VERT, 0, TRUE);
      SetScrollRange(hwnd, SB_HORZ, 0, max_str_len - client_field.x, TRUE);
      SetScrollPos(hwnd, SB_HORZ, 0, TRUE);
      start_str_pos = 0;
      sprintf(buf, "NUM OF STRINGS: %i", txt.GetNumOfStr());
      SendMessage(hStatWnd, SB_SETTEXT, (WPARAM)0, (LPARAM)buf);
      start_str_pos = 0;
    }
    break;
  case IDM_ABOUT:
    MessageBox(hwnd, "Igor Pinaev 2013 33601/1", "About", MB_ICONINFORMATION);
    break;
  case IDM_EXIT:
    SendMessage(hwnd, WM_CLOSE, 0, 0L);
    break;
  }

  InvalidateRect(hwnd, NULL, TRUE);
} /* End of 'window::WMCommand' function */
开发者ID:Igopin,项目名称:TextPad,代码行数:52,代码来源:window.cpp


示例17: DlgExIm_OpenFileName

/**
 * name:		DlgExIm_OpenFileName
 * desc:		displayes a slightly modified OpenFileName DialogBox
 * params:		hWndParent		- parent window
 *				pszTitle		- title for the dialog
 *				pszFilter		- the filters to offer
 *				pszFile			- this is the buffer to store the file to (size must be MAX_PATH)
 * return:		-1 on error/abort or filter index otherwise
 **/
int DlgExIm_OpenFileName(HWND hWndParent, LPCSTR pszTitle, LPCSTR pszFilter, LPSTR pszFile)
{
	OPENFILENAMEA ofn;
	CHAR szInitialDir[MAX_PATH];

	InitOpenFileNameStruct(&ofn, hWndParent, pszTitle, pszFilter, szInitialDir, pszFile);
	ofn.Flags |= OFN_PATHMUSTEXIST;
	if (!GetOpenFileNameA(&ofn)) {
		DWORD dwError = CommDlgExtendedError();
		if (dwError) MsgErr(ofn.hwndOwner, LPGENT("The OpenFileDialog returned an error: %d!"), dwError);
		return -1;
	}
	SaveInitialDir(pszFile);
	return ofn.nFilterIndex;
}
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:24,代码来源:dlg_ExImOpenSaveFile.cpp


示例18: BrowseFileOpen

bool BrowseFileOpen(HWND owner, const char* filter, const char* defext, char* filename, int filename_size, const char* init_dir)
{
    OPENFILENAME ofstruct;
    memset(&ofstruct, 0, sizeof(ofstruct));
    ofstruct.lStructSize=sizeof(ofstruct);
    ofstruct.hwndOwner=owner;
    ofstruct.hInstance=hInst;
    ofstruct.lpstrFilter=filter;
    ofstruct.lpstrFile=filename;
    ofstruct.nMaxFile=filename_size;
    ofstruct.lpstrInitialDir=init_dir;
    ofstruct.lpstrDefExt=defext;
    ofstruct.Flags=OFN_EXTENSIONDIFFERENT|OFN_HIDEREADONLY|OFN_NONETWORKBUTTON;
    return GetOpenFileNameA(&ofstruct);
}
开发者ID:cdaze,项目名称:akt,代码行数:15,代码来源:_global.cpp


示例19: OpenXbeFile

//--------------------------------------------------------------------------------------
// Name: OpenXbeFile
// Desc: Allows the user to search for any given .xbe file to use with the emulator.
//--------------------------------------------------------------------------------------
bool OpenXbeFile( void )
{
	char filter[256] = {0};
	char filename[256] = {0};
	OPENFILENAMEA File;

	if( Xbe.m_bXbeHasBeenOpened )
		XBEUnload();

	strcat( filter, "XBox Executable Files (*.xbe)" );
	ZeroMemory( &File, sizeof( OPENFILENAME ) );

	int index = lstrlenA( filter ) + 1;
	filter[index++] = '*';
	filter[index++] = '.';
	filter[index++] = 'x';
	filter[index++] = 'b';
	filter[index++] = 'e';

	File.lStructSize = sizeof( OPENFILENAME );
	File.hwndOwner = GetActiveWindow();
	File.lpstrFilter = filter;
	File.lpstrFile = filename;
	File.nMaxFile = 256;
	File.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_NOCHANGEDIR;

	if( !GetOpenFileNameA( &File ) )
		return EmuError( "Unable to load file.\n" );

	// Back up the .exe data before executing
	EmuMMUSaveExeContents();

	// Now, actually load the .xbe into memory.
	if( !XBELoad( File.lpstrFile ) )
	{
		EmuError( "Unable to load Xbe file!\n" );
		return 0;
	}

	// Hijack kernel functions
	HookKrnlFunctions();

	// Activate other threads
	ResumeThread( g_hExecutionThread );
	ResumeThread( g_hUpdateThread );

	return true;
}
开发者ID:ArnCarveris,项目名称:xenoborg,代码行数:52,代码来源:EmuMain.cpp


示例20: test_create_view_window2

static void test_create_view_window2(void)
{
    OPENFILENAMEA ofn = {0};
    char filename[1024] = {0};
    DWORD ret;

    ofn.lStructSize = sizeof(ofn);
    ofn.lpstrFile = filename;
    ofn.nMaxFile = 1024;
    ofn.lpfnHook = create_view_window2_hook;
    ofn.Flags = OFN_ENABLEHOOK | OFN_EXPLORER;
    ret = GetOpenFileNameA(&ofn);
    ok(!ret, "GetOpenFileNameA returned %#x\n", ret);
    ret = CommDlgExtendedError();
    ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
}
开发者ID:wesgarner,项目名称:wine,代码行数:16,代码来源:filedlg.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GetOption函数代码示例发布时间:2022-05-30
下一篇:
C++ GetOpenFileName函数代码示例发布时间: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