void SetRaw(UINT format,const void * data, t_size size) { HANDLE buffer = GlobalAlloc(GMEM_DDESHARE,size); if (buffer == NULL) throw std::bad_alloc(); try { CGlobalLockScope lock(buffer); PFC_ASSERT(lock.GetSize() == size); memcpy(lock.GetPtr(),data,size); } catch(...) { GlobalFree(buffer); throw; } WIN32_OP(SetClipboardData(format,buffer) != NULL); }
void registerclass_scope_delayed::toggle_on(UINT p_style,WNDPROC p_wndproc,int p_clsextra,int p_wndextra,HICON p_icon,HCURSOR p_cursor,HBRUSH p_background,const TCHAR * p_class_name,const TCHAR * p_menu_name) { toggle_off(); WNDCLASS wc = {}; wc.style = p_style; wc.lpfnWndProc = p_wndproc; wc.cbClsExtra = p_clsextra; wc.cbWndExtra = p_wndextra; wc.hInstance = core_api::get_my_instance(); wc.hIcon = p_icon; wc.hCursor = p_cursor; wc.hbrBackground = p_background; wc.lpszMenuName = p_menu_name; wc.lpszClassName = p_class_name; WIN32_OP( (m_class = RegisterClass(&wc)) != 0); }
void GetOSVersionStringAppend(pfc::string_base & out) { if (FetchWineInfoAppend(out)) return; OSVERSIONINFO ver = {}; ver.dwOSVersionInfoSize = sizeof(ver); WIN32_OP( GetVersionEx(&ver) ); SYSTEM_INFO info = {}; GetNativeSystemInfo(&info); out << "Windows " << (int)ver.dwMajorVersion << "." << (int)ver.dwMinorVersion << "." << (int)ver.dwBuildNumber; if (ver.szCSDVersion[0] != 0) out << " " << pfc::stringcvt::string_utf8_from_os(ver.szCSDVersion, PFC_TABSIZE(ver.szCSDVersion)); switch(info.wProcessorArchitecture) { case PROCESSOR_ARCHITECTURE_AMD64: out << " x64"; break; case PROCESSOR_ARCHITECTURE_IA64: out << " IA64"; break; case PROCESSOR_ARCHITECTURE_INTEL: out << " x86"; break; } }