这篇教程C++ wxZeroMemory函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中wxZeroMemory函数的典型用法代码示例。如果您正苦于以下问题:C++ wxZeroMemory函数的具体用法?C++ wxZeroMemory怎么用?C++ wxZeroMemory使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了wxZeroMemory函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: wxGetOsVersionwxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin){ OSVERSIONINFO info; wxZeroMemory(info); info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); if ( ::GetVersionEx(&info) ) { if (verMaj) *verMaj = info.dwMajorVersion; if (verMin) *verMin = info.dwMinorVersion; }#if defined( __WXWINCE__ ) return wxOS_WINDOWS_CE;#elif defined( __WXMICROWIN__ ) return wxOS_WINDOWS_MICRO;#else switch ( info.dwPlatformId ) { case VER_PLATFORM_WIN32_NT: return wxOS_WINDOWS_NT; case VER_PLATFORM_WIN32_WINDOWS: return wxOS_WINDOWS_9X; } return wxOS_UNKNOWN;#endif}
开发者ID:252525fb,项目名称:rpcs3,代码行数:29,
示例2: wxZeroMemoryvoid wxStackFrame::OnGetName(){ if ( m_hasName ) return; m_hasName = true; // get the name of the function for this stack frame entry static const size_t MAX_NAME_LEN = 1024; BYTE symbolBuffer[sizeof(SYMBOL_INFO) + MAX_NAME_LEN]; wxZeroMemory(symbolBuffer); PSYMBOL_INFO pSymbol = (PSYMBOL_INFO)symbolBuffer; pSymbol->SizeOfStruct = sizeof(SYMBOL_INFO); pSymbol->MaxNameLen = MAX_NAME_LEN; DWORD64 symDisplacement = 0; if ( !wxDbgHelpDLL::SymFromAddr ( ::GetCurrentProcess(), GetSymAddr(), &symDisplacement, pSymbol ) ) { wxDbgHelpDLL::LogError(_T("SymFromAddr")); return; } m_name = wxString::FromAscii(pSymbol->Name); m_offset = symDisplacement;}
开发者ID:ACanadianKernel,项目名称:pcsx2,代码行数:32,
示例3: definedvoid wxTopLevelWindowMSW::Init(){ m_iconized = m_maximizeOnShow = false; // Data to save/restore when calling ShowFullScreen m_fsStyle = 0; m_fsOldWindowStyle = 0; m_fsIsMaximized = false; m_fsIsShowing = false; m_winLastFocused = NULL;#if defined(__SMARTPHONE__) && defined(__WXWINCE__) m_MenuBarHWND = 0;#endif#if defined(__SMARTPHONE__) || defined(__POCKETPC__) SHACTIVATEINFO* info = new SHACTIVATEINFO; wxZeroMemory(*info); info->cbSize = sizeof(SHACTIVATEINFO); m_activateInfo = (void*) info;#endif m_menuSystem = NULL;}
开发者ID:nwhitehead,项目名称:wxWidgets,代码行数:27,
示例4: wxT/* static */HWND wxTLWHiddenParentModule::GetHWND(){ if ( !ms_hwnd ) { if ( !ms_className ) { static const wxChar *HIDDEN_PARENT_CLASS = wxT("wxTLWHiddenParent"); WNDCLASS wndclass; wxZeroMemory(wndclass); wndclass.lpfnWndProc = DefWindowProc; wndclass.hInstance = wxGetInstance(); wndclass.lpszClassName = HIDDEN_PARENT_CLASS; if ( !::RegisterClass(&wndclass) ) { wxLogLastError(wxT("RegisterClass(/"wxTLWHiddenParent/")")); } else { ms_className = HIDDEN_PARENT_CLASS; } } ms_hwnd = ::CreateWindow(ms_className, wxEmptyString, 0, 0, 0, 0, 0, NULL, (HMENU)NULL, wxGetInstance(), NULL); if ( !ms_hwnd ) { wxLogLastError(wxT("CreateWindow(hidden TLW parent)")); } } return ms_hwnd;}
开发者ID:nwhitehead,项目名称:wxWidgets,代码行数:36,
示例5: ListView_SetItemCountint wxCheckListBox::DoInsertItems(const wxArrayStringsAdapter & items, unsigned int pos, void **clientData, wxClientDataType type){ const unsigned int count = items.GetCount(); ListView_SetItemCount( GetHwnd(), GetCount() + count ); int n = wxNOT_FOUND; for( unsigned int i = 0; i < count; i++ ) { LVITEM newItem; wxZeroMemory(newItem); newItem.iItem = pos + i; n = ListView_InsertItem( (HWND)GetHWND(), & newItem ); wxCHECK_MSG( n != -1, -1, wxT("Item not added") ); SetString( n, items[i] ); m_itemsClientData.Insert(NULL, n); AssignNewItemClientData(n, clientData, i, type); } return n;}
开发者ID:0ryuO,项目名称:dolphin-avsync,代码行数:25,
示例6: defined/* static */const wxChar *wxApp::GetRegisteredClassName(const wxChar *name, int bgBrushCol, int extraStyles){ const size_t count = gs_regClassesInfo.size();#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */# pragma ivdep# pragma swp# pragma unroll# pragma prefetch# if 0# pragma simd noassert# endif#endif /* VDM auto patch */ for ( size_t n = 0; n < count; n++ ) { if ( gs_regClassesInfo[n].regname == name ) return gs_regClassesInfo[n].regname.c_str(); } // we need to register this class WNDCLASS wndclass; wxZeroMemory(wndclass); wndclass.lpfnWndProc = (WNDPROC)wxWndProc; wndclass.hInstance = wxGetInstance(); wndclass.hCursor = ::LoadCursor(NULL, IDC_ARROW); wndclass.hbrBackground = (HBRUSH)wxUIntToPtr(bgBrushCol + 1); wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | extraStyles; ClassRegInfo regClass(name); wndclass.lpszClassName = regClass.regname.t_str(); if ( !::RegisterClass(&wndclass) ) { wxLogLastError(wxString::Format(wxT("RegisterClass(%s)"), regClass.regname)); return NULL; } wndclass.style &= ~(CS_HREDRAW | CS_VREDRAW); wndclass.lpszClassName = regClass.regnameNR.t_str(); if ( !::RegisterClass(&wndclass) ) { wxLogLastError(wxString::Format(wxT("RegisterClass(%s)"), regClass.regname)); ::UnregisterClass(regClass.regname.c_str(), wxGetInstance()); return NULL; } gs_regClassesInfo.push_back(regClass); // take care to return the pointer which will remain valid after the // function returns (it could be invalidated later if new elements are // added to the vector and it's reallocated but this shouldn't matter as // this pointer should be used right now, not stored) return gs_regClassesInfo.back().regname.t_str();}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:59,
示例7: wxASSERT_MSG/* static */size_t wxDIB::ConvertFromBitmap(BITMAPINFO *pbi, HBITMAP hbmp){ wxASSERT_MSG( hbmp, wxT("invalid bmp can't be converted to DIB") ); // prepare all the info we need BITMAP bm; if ( !::GetObject(hbmp, sizeof(bm), &bm) ) { wxLogLastError(wxT("GetObject(bitmap)")); return 0; } // we need a BITMAPINFO anyhow and if we're not given a pointer to it we // use this one BITMAPINFO bi2; const bool wantSizeOnly = pbi == NULL; if ( wantSizeOnly ) pbi = &bi2; // just for convenience const int h = bm.bmHeight; // init the header BITMAPINFOHEADER& bi = pbi->bmiHeader; wxZeroMemory(bi); bi.biSize = sizeof(BITMAPINFOHEADER); bi.biWidth = bm.bmWidth; bi.biHeight = h; bi.biPlanes = 1; bi.biBitCount = bm.bmBitsPixel; // memory we need for BITMAPINFO only DWORD dwLen = bi.biSize + GetNumberOfColours(bm.bmBitsPixel) * sizeof(RGBQUAD); // get either just the image size or the image bits if ( !::GetDIBits ( ScreenHDC(), // the DC to use hbmp, // the source DDB 0, // first scan line h, // number of lines to copy wantSizeOnly ? NULL // pointer to the buffer or : (char *)pbi + dwLen, // NULL if we don't have it pbi, // bitmap header DIB_RGB_COLORS // or DIB_PAL_COLORS ) ) { wxLogLastError(wxT("GetDIBits()")); return 0; } // return the total size return dwLen + bi.biSizeImage;}
开发者ID:BloodRedd,项目名称:gamekit,代码行数:58,
示例8: delete// save system dataHRESULTwxIDataObject::SaveSystemData(FORMATETC *pformatetc, STGMEDIUM *pmedium, BOOL fRelease){ if ( pformatetc == NULL || pmedium == NULL ) return E_INVALIDARG; // remove entry if already available for ( SystemData::iterator it = m_systemData.begin(); it != m_systemData.end(); ++it ) { if ( pformatetc->tymed & (*it)->pformatetc->tymed && pformatetc->dwAspect == (*it)->pformatetc->dwAspect && pformatetc->cfFormat == (*it)->pformatetc->cfFormat ) { delete (*it); m_systemData.erase(it); break; } } // create new format/medium FORMATETC* pnewformatEtc = new FORMATETC; STGMEDIUM* pnewmedium = new STGMEDIUM; wxZeroMemory(*pnewformatEtc); wxZeroMemory(*pnewmedium); // copy format *pnewformatEtc = *pformatetc; // copy or take ownerschip of medium if ( fRelease ) *pnewmedium = *pmedium; else wxCopyStgMedium(pmedium, pnewmedium); // save entry m_systemData.push_back(new SystemDataEntry(pnewformatEtc, pnewmedium)); return S_OK;}
开发者ID:hazeeq090576,项目名称:wxWidgets,代码行数:45,
示例9: wxZeroMemorywxToolkitInfo& wxAppTraits::GetToolkitInfo(){ // cache the version info, it's not going to change // // NB: this is MT-safe, we may use these static vars from different threads // but as they always have the same value it doesn't matter static int s_ver = -1, s_major = -1, s_minor = -1; if ( s_ver == -1 ) { OSVERSIONINFO info; wxZeroMemory(info); s_ver = wxWINDOWS; info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); if ( ::GetVersionEx(&info) ) { s_major = info.dwMajorVersion; s_minor = info.dwMinorVersion;#ifdef __SMARTPHONE__ s_ver = wxWINDOWS_SMARTPHONE;#elif defined(__POCKETPC__) s_ver = wxWINDOWS_POCKETPC;#else switch ( info.dwPlatformId ) { case VER_PLATFORM_WIN32s: s_ver = wxWIN32S; break; case VER_PLATFORM_WIN32_WINDOWS: s_ver = wxWIN95; break; case VER_PLATFORM_WIN32_NT: s_ver = wxWINDOWS_NT; break;#ifdef __WXWINCE__ case VER_PLATFORM_WIN32_CE: s_ver = wxWINDOWS_CE;#endif }#endif } } static wxToolkitInfo info; info.versionMajor = s_major; info.versionMinor = s_minor; info.os = s_ver; info.name = _T("wxBase"); return info;}
开发者ID:project-renard-survey,项目名称:chandler,代码行数:56,
示例10: GetMenuStateUINT GetMenuState(HMENU hMenu, UINT id, UINT flags){ MENUITEMINFO info; wxZeroMemory(info); info.cbSize = sizeof(info); info.fMask = MIIM_STATE; // MF_BYCOMMAND is zero so test MF_BYPOSITION if ( !::GetMenuItemInfo(hMenu, id, flags & MF_BYPOSITION ? TRUE : FALSE , & info) ) wxLogLastError(wxT("GetMenuItemInfo")); return info.fState;}
开发者ID:HackLinux,项目名称:chandler-1,代码行数:11,
示例11: wxZeroMemoryint wxCheckListBox::DoAppend(const wxString& item){ int n = (int)GetCount(); LVITEM newItem; wxZeroMemory(newItem); newItem.iItem = n; int ret = ListView_InsertItem( (HWND)GetHWND(), & newItem ); wxCHECK_MSG( n == ret , -1, _T("Item not added") ); SetString( ret , item ); m_itemsClientData.Insert(NULL, ret); return ret;}
开发者ID:EdgarTx,项目名称:wx,代码行数:12,
示例12: wxZeroMemoryint wxScrollBar::GetThumbPosition(void) const{ SCROLLINFO scrollInfo; wxZeroMemory(scrollInfo); scrollInfo.cbSize = sizeof(SCROLLINFO); scrollInfo.fMask = SIF_POS; if ( !::GetScrollInfo(GetHwnd(), SB_CTL, &scrollInfo) ) { wxLogLastError(wxT("GetScrollInfo")); } return scrollInfo.nPos;}
开发者ID:beanhome,项目名称:dev,代码行数:13,
示例13: SetDefaultMenuItem// make the given menu item defaultstatic void SetDefaultMenuItem(HMENU WXUNUSED_IN_WINCE(hmenu), UINT WXUNUSED_IN_WINCE(id)){#ifndef __WXWINCE__ MENUITEMINFO mii; wxZeroMemory(mii); mii.cbSize = sizeof(MENUITEMINFO); mii.fMask = MIIM_STATE; mii.fState = MFS_DEFAULT; if ( !::SetMenuItemInfo(hmenu, id, FALSE, &mii) ) { wxLogLastError(wxT("SetMenuItemInfo")); }#endif}
开发者ID:HackLinux,项目名称:chandler-1,代码行数:17,
示例14: wxCHECK_RETvoid wxCheckListBox::DoInsertItems(const wxArrayString& items, unsigned int pos){ wxCHECK_RET( IsValidInsert( pos ), wxT("invalid index in wxListBox::InsertItems") ); for( unsigned int i = 0; i < items.GetCount(); i++ ) { LVITEM newItem; wxZeroMemory(newItem); newItem.iItem = i+pos; int ret = ListView_InsertItem( (HWND)GetHWND(), & newItem ); wxASSERT_MSG( int(i+pos) == ret , _T("Item not added") ); SetString( ret , items[i] ); m_itemsClientData.Insert(NULL, ret); }}
开发者ID:EdgarTx,项目名称:wx,代码行数:16,
示例15: necesssary/* Creates a hidden window with supplied window proc registering the class for it if necesssary (i.e. the first time only). Caller is responsible for destroying the window and unregistering the class (note that this must be done because wxWidgets may be used as a DLL and so may be loaded/unloaded multiple times into/from the same process so we cna't rely on automatic Windows class unregistration). pclassname is a pointer to a caller stored classname, which must initially be NULL. classname is the desired wndclass classname. If function successfully registers the class, pclassname will be set to classname. */extern "C" WXDLLIMPEXP_BASE HWNDwxCreateHiddenWindow(LPCTSTR *pclassname, LPCTSTR classname, WNDPROC wndproc){ wxCHECK_MSG( classname && pclassname && wndproc, NULL, _T("NULL parameter in wxCreateHiddenWindow") ); // register the class fi we need to first if ( *pclassname == NULL ) { WNDCLASS wndclass; wxZeroMemory(wndclass); wndclass.lpfnWndProc = wndproc; wndclass.hInstance = wxGetInstance(); wndclass.lpszClassName = classname; if ( !::RegisterClass(&wndclass) ) { wxLogLastError(wxT("RegisterClass() in wxCreateHiddenWindow")); return NULL; } *pclassname = classname; } // next create the window HWND hwnd = ::CreateWindow ( *pclassname, NULL, 0, 0, 0, 0, 0, (HWND) NULL, (HMENU)NULL, wxGetInstance(), (LPVOID) NULL ); if ( !hwnd ) { wxLogLastError(wxT("CreateWindow() in wxCreateHiddenWindow")); } return hwnd;}
开发者ID:252525fb,项目名称:rpcs3,代码行数:58,
示例16: wxCheckOsVersionbool wxCheckOsVersion(int majorVsn, int minorVsn){ OSVERSIONINFOEX osvi; wxZeroMemory(osvi); osvi.dwOSVersionInfoSize = sizeof(osvi); DWORDLONG const dwlConditionMask = ::VerSetConditionMask( ::VerSetConditionMask( 0, VER_MAJORVERSION, VER_GREATER_EQUAL), VER_MINORVERSION, VER_GREATER_EQUAL); osvi.dwMajorVersion = majorVsn; osvi.dwMinorVersion = minorVsn; return ::VerifyVersionInfo(&osvi, VER_MAJORVERSION | VER_MINORVERSION, dwlConditionMask) != FALSE;}
开发者ID:hholi,项目名称:wxWidgets,代码行数:17,
示例17: wxCHECK_MSGbool wxDIB::Save(const wxString& filename){ wxCHECK_MSG( m_handle, false, wxT("wxDIB::Save(): invalid object") );#if wxUSE_FILE wxFile file(filename, wxFile::write); bool ok = file.IsOpened(); if ( ok ) { DIBSECTION ds; if ( !GetDIBSection(m_handle, &ds) ) { wxLogLastError(wxT("GetObject(hDIB)")); } else { BITMAPFILEHEADER bmpHdr; wxZeroMemory(bmpHdr); const size_t sizeHdr = ds.dsBmih.biSize; const size_t sizeImage = ds.dsBmih.biSizeImage; bmpHdr.bfType = 0x4d42; // 'BM' in little endian bmpHdr.bfOffBits = sizeof(BITMAPFILEHEADER) + ds.dsBmih.biSize; bmpHdr.bfSize = bmpHdr.bfOffBits + sizeImage; // first write the file header, then the bitmap header and finally the // bitmap data itself ok = file.Write(&bmpHdr, sizeof(bmpHdr)) == sizeof(bmpHdr) && file.Write(&ds.dsBmih, sizeHdr) == sizeHdr && file.Write(ds.dsBm.bmBits, sizeImage) == sizeImage; } }#else // !wxUSE_FILE bool ok = false;#endif // wxUSE_FILE/!wxUSE_FILE if ( !ok ) { wxLogError(_("Failed to save the bitmap image to file /"%s/"."), filename.c_str()); } return ok;}
开发者ID:BloodRedd,项目名称:gamekit,代码行数:45,
示例18: wxKillAllChildren// By John Skiffint wxKillAllChildren(long pid, wxSignal sig, wxKillError *krc){ InitToolHelp32(); if (krc) *krc = wxKILL_OK; // If not implemented for this platform (e.g. NT 4.0), silently ignore if (!lpfCreateToolhelp32Snapshot || !lpfProcess32First || !lpfProcess32Next) return 0; // Take a snapshot of all processes in the system. HANDLE hProcessSnap = lpfCreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); if (hProcessSnap == INVALID_HANDLE_VALUE) { if (krc) *krc = wxKILL_ERROR; return -1; } //Fill in the size of the structure before using it. PROCESSENTRY32 pe; wxZeroMemory(pe); pe.dwSize = sizeof(PROCESSENTRY32); // Walk the snapshot of the processes, and for each process, // kill it if its parent is pid. if (!lpfProcess32First(hProcessSnap, &pe)) { // Can't get first process. if (krc) *krc = wxKILL_ERROR; CloseHandle (hProcessSnap); return -1; } do { if (pe.th32ParentProcessID == (DWORD) pid) { if (wxKill(pe.th32ProcessID, sig, krc)) return -1; } } while (lpfProcess32Next (hProcessSnap, &pe)); return 0;}
开发者ID:252525fb,项目名称:rpcs3,代码行数:45,
示例19: wxTestFontEncodingbool wxTestFontEncoding(const wxNativeEncodingInfo& info){ // try to create such font LOGFONT lf; wxZeroMemory(lf); // all default values lf.lfCharSet = (BYTE)info.charset; wxStrlcpy(lf.lfFaceName, info.facename.c_str(), WXSIZEOF(lf.lfFaceName)); HFONT hfont = ::CreateFontIndirect(&lf); if ( !hfont ) { // no such font return false; } ::DeleteObject((HGDIOBJ)hfont); return true;}
开发者ID:Richard-Ni,项目名称:wxWidgets,代码行数:20,
示例20: wxZeroMemorybool wxCheckListBox::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, int n, const wxString choices[], long style, const wxValidator& validator, const wxString& name){ // initialize base class fields if ( !CreateControl(parent, id, pos, size, style, validator, name) ) return false; // create the native control if ( !MSWCreateControl(WC_LISTVIEW, wxEmptyString, pos, size) ) { // control creation failed return false; } ::SendMessage(GetHwnd(), LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT ); // insert single column with checkboxes and labels LV_COLUMN col; wxZeroMemory(col); ListView_InsertColumn(GetHwnd(), 0, &col ); ListView_SetItemCount( GetHwnd(), n ); // initialize the contents for ( int i = 0; i < n; i++ ) { Append(choices[i]); } m_itemsClientData.SetCount(n); // now we can compute our best size correctly, so do it if necessary SetInitialSize(size); return true;}
开发者ID:0ryuO,项目名称:dolphin-avsync,代码行数:40,
示例21: wxZeroMemorywxCrashContext::wxCrashContext(_EXCEPTION_POINTERS *ep){ wxZeroMemory(*this); if ( !ep ) { wxCHECK_RET( wxGlobalSEInformation, wxT("no exception info available") ); ep = wxGlobalSEInformation; } // TODO: we could also get the operation (read/write) and address for which // it failed for EXCEPTION_ACCESS_VIOLATION code const EXCEPTION_RECORD& rec = *ep->ExceptionRecord; code = rec.ExceptionCode; addr = rec.ExceptionAddress;#ifdef __INTEL__ const CONTEXT& ctx = *ep->ContextRecord; regs.eax = ctx.Eax; regs.ebx = ctx.Ebx; regs.ecx = ctx.Ecx; regs.edx = ctx.Edx; regs.esi = ctx.Esi; regs.edi = ctx.Edi; regs.ebp = ctx.Ebp; regs.esp = ctx.Esp; regs.eip = ctx.Eip; regs.cs = ctx.SegCs; regs.ds = ctx.SegDs; regs.es = ctx.SegEs; regs.fs = ctx.SegFs; regs.gs = ctx.SegGs; regs.ss = ctx.SegSs; regs.flags = ctx.EFlags;#endif // __INTEL__}
开发者ID:BloodRedd,项目名称:gamekit,代码行数:39,
示例22: wxZeroMemorywxPortId wxGUIAppTraits::GetToolkitVersion(int *majVer, int *minVer) const{ OSVERSIONINFO info; wxZeroMemory(info); // on Windows, the toolkit version is the same of the OS version // as Windows integrates the OS kernel with the GUI toolkit. info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); if ( ::GetVersionEx(&info) ) { if ( majVer ) *majVer = info.dwMajorVersion; if ( minVer ) *minVer = info.dwMinorVersion; }#if defined(__WXHANDHELD__) || defined(__WXWINCE__) return wxPORT_WINCE;#else return wxPORT_MSW;#endif}
开发者ID:Anonymous2,项目名称:project64,代码行数:22,
示例23: WXUNUSEDbool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam, WXWORD pos, WXHWND WXUNUSED(control)){ // current and max positions int position, maxPos, trackPos = pos; wxUnusedVar(trackPos); // when we're dragging the scrollbar we can't use pos parameter because it // is limited to 16 bits // JACS: now always using GetScrollInfo, since there's no reason // not to// if ( wParam == SB_THUMBPOSITION || wParam == SB_THUMBTRACK ) { SCROLLINFO scrollInfo; wxZeroMemory(scrollInfo); scrollInfo.cbSize = sizeof(SCROLLINFO); // also get the range if we call GetScrollInfo() anyhow -- this is less // expensive than call it once here and then call GetScrollRange() // below scrollInfo.fMask = SIF_RANGE | SIF_POS | SIF_TRACKPOS; if ( !::GetScrollInfo(GetHwnd(), SB_CTL, &scrollInfo) ) { wxLogLastError(_T("GetScrollInfo")); } trackPos = scrollInfo.nTrackPos; position = scrollInfo.nPos; maxPos = scrollInfo.nMax; }#if 0 else {
开发者ID:252525fb,项目名称:rpcs3,代码行数:36,
示例24: wxCHECK_MSGbool wxDisplayImplMultimon::ChangeMode(const wxVideoMode& mode){ // prepare ChangeDisplaySettingsEx() parameters DEVMODE dm; DEVMODE *pDevMode; int flags; if ( mode == wxDefaultVideoMode ) { // reset the video mode to default pDevMode = NULL; flags = 0; } else // change to the given mode { wxCHECK_MSG( mode.GetWidth() && mode.GetHeight(), false, wxT("at least the width and height must be specified") ); wxZeroMemory(dm); dm.dmSize = sizeof(dm); dm.dmDriverExtra = 0; dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT; dm.dmPelsWidth = mode.GetWidth(); dm.dmPelsHeight = mode.GetHeight(); if ( mode.GetDepth() ) { dm.dmFields |= DM_BITSPERPEL; dm.dmBitsPerPel = mode.GetDepth(); } if ( mode.GetRefresh() ) { dm.dmFields |= DM_DISPLAYFREQUENCY; dm.dmDisplayFrequency = mode.GetRefresh(); } pDevMode = &dm;#ifdef __WXWINCE__ flags = 0;#else // !__WXWINCE__ flags = CDS_FULLSCREEN;#endif // __WXWINCE__/!__WXWINCE__ } // get pointer to the function dynamically // // we're only called from the main thread, so it's ok to use static // variable static ChangeDisplaySettingsEx_t pfnChangeDisplaySettingsEx = NULL; if ( !pfnChangeDisplaySettingsEx ) { wxDynamicLibrary dllDisplay(displayDllName, wxDL_VERBATIM | wxDL_QUIET); if ( dllDisplay.IsLoaded() ) { wxDL_INIT_FUNC_AW(pfn, ChangeDisplaySettingsEx, dllDisplay); } //else: huh, no this DLL must always be present, what's going on??#ifndef __WXWINCE__ if ( !pfnChangeDisplaySettingsEx ) { // we must be under Win95 and so there is no multiple monitors // support anyhow pfnChangeDisplaySettingsEx = ChangeDisplaySettingsExForWin95; }#endif // !__WXWINCE__ } // do change the mode switch ( pfnChangeDisplaySettingsEx ( GetName().wx_str(), // display name pDevMode, // dev mode or NULL to reset NULL, // reserved flags, NULL // pointer to video parameters (not used) ) ) { case DISP_CHANGE_SUCCESSFUL: // ok { // If we have a top-level, full-screen frame, emulate // the DirectX behavior and resize it. This makes this // API quite a bit easier to use. wxWindow *winTop = wxTheApp->GetTopWindow(); wxFrame *frameTop = wxDynamicCast(winTop, wxFrame); if (frameTop && frameTop->IsFullScreen()) { wxVideoMode current = GetCurrentMode(); frameTop->SetClientSize(current.GetWidth(), current.GetHeight()); } } return true; case DISP_CHANGE_BADMODE: // don't complain about this, this is the only "expected" error//.........这里部分代码省略.........
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:101,
示例25: wxExecute//.........这里部分代码省略......... } else#endif // wxUSE_IPC { // no DDE command = cmd; } // the IO redirection is only supported with wxUSE_STREAMS BOOL redirect = FALSE;#if wxUSE_STREAMS wxPipe pipeIn, pipeOut, pipeErr; // open the pipes to which child process IO will be redirected if needed if ( handler && handler->IsRedirected() ) { // create pipes for redirecting stdin, stdout and stderr if ( !pipeIn.Create() || !pipeOut.Create() || !pipeErr.Create() ) { wxLogSysError(_("Failed to redirect the child process IO")); // indicate failure: we need to return different error code // depending on the sync flag return flags & wxEXEC_SYNC ? -1 : 0; } redirect = TRUE; }#endif // wxUSE_STREAMS // create the process STARTUPINFO si; wxZeroMemory(si); si.cb = sizeof(si);#if wxUSE_STREAMS if ( redirect ) { si.dwFlags = STARTF_USESTDHANDLES; si.hStdInput = pipeIn[wxPipe::Read]; si.hStdOutput = pipeOut[wxPipe::Write]; si.hStdError = pipeErr[wxPipe::Write]; // We must set the handles to those sides of std* pipes that we won't // in the child to be non-inheritable. We must do this before launching // the child process as otherwise these handles will be inherited by // the child which will never close them and so the pipe will not // return ERROR_BROKEN_PIPE if the parent or child exits unexpectedly // causing the remaining process to potentially become deadlocked in // ReadFile() or WriteFile(). if ( !::SetHandleInformation(pipeIn[wxPipe::Write], HANDLE_FLAG_INHERIT, 0) ) wxLogLastError(wxT("SetHandleInformation(pipeIn)")); if ( !::SetHandleInformation(pipeOut[wxPipe::Read], HANDLE_FLAG_INHERIT, 0) ) wxLogLastError(wxT("SetHandleInformation(pipeOut)")); if ( !::SetHandleInformation(pipeErr[wxPipe::Read], HANDLE_FLAG_INHERIT, 0) ) wxLogLastError(wxT("SetHandleInformation(pipeErr)")); }#endif // wxUSE_STREAMS
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:66,
注:本文中的wxZeroMemory函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ wxapp_install_idle_handler函数代码示例 C++ wxUpdateUIEventHandler函数代码示例 |