Go to the source code of this file.
template<typename t_array >
static bool GetClipboardDataBlock |
( |
UINT |
p_format, |
|
|
t_array & |
p_array |
|
) |
| |
|
static |
Definition at line 66 of file win32_misc.h.
67 PFC_STATIC_ASSERT(
sizeof(p_array[0]) == 1 );
68 if (OpenClipboard(NULL)) {
69 HANDLE handle = GetClipboardData(p_format);
76 const t_size size = lock.GetSize();
78 p_array.set_size(size);
83 memcpy(p_array.get_ptr(),lock.GetPtr(),size);
typedef HANDLE(WINAPI *pPowerCreateRequest_t)(__in void *Context)
static WORD GetOSVersion |
( |
| ) |
|
|
static |
Definition at line 125 of file win32_misc.h.
126 const DWORD ver = GetVersion();
127 return (WORD)HIBYTE(LOWORD(ver)) | ((WORD)LOBYTE(LOWORD(ver)) << 8);
Definition at line 81 of file win32_misc.cpp.
void GetOSVersionStringAppend(pfc::string_base &out)
Definition at line 111 of file win32_misc.cpp.
115 OSVERSIONINFO ver = {}; ver.dwOSVersionInfoSize =
sizeof(ver);
116 WIN32_OP( GetVersionEx(&ver) );
117 SYSTEM_INFO
info = {};
118 GetNativeSystemInfo(&info);
120 out <<
"Windows " << (int)ver.dwMajorVersion <<
"." << (
int)ver.dwMinorVersion <<
"." << (int)ver.dwBuildNumber;
123 switch(info.wProcessorArchitecture) {
124 case PROCESSOR_ARCHITECTURE_AMD64:
125 out <<
" x64";
break;
126 case PROCESSOR_ARCHITECTURE_IA64:
127 out <<
" IA64";
break;
128 case PROCESSOR_ARCHITECTURE_INTEL:
129 out <<
" x86";
break;
void info(const char *p_message)
string_utf8_from_wide string_utf8_from_os
static bool FetchWineInfoAppend(pfc::string_base &out)
bool IsMenuNonEmpty |
( |
HMENU |
menu | ) |
|
Definition at line 43 of file win32_misc.cpp.
44 unsigned n,m=GetMenuItemCount(menu);
46 if (GetSubMenu(menu,n))
return true;
47 if (!(GetMenuState(menu,n,MF_BYPOSITION)&MF_SEPARATOR))
return true;
unsigned QueryScreenDPI |
( |
| ) |
|
Definition at line 27 of file win32_misc.cpp.
29 unsigned ret = GetDeviceCaps(dc,LOGPIXELSY);
SIZE QueryScreenDPIEx |
( |
| ) |
|
Definition at line 35 of file win32_misc.cpp.
37 SIZE ret = { GetDeviceCaps(dc,LOGPIXELSY), GetDeviceCaps(dc,LOGPIXELSY) };
bool SetClipboardDataBlock |
( |
UINT |
p_format, |
|
|
const void * |
p_block, |
|
|
t_size |
p_block_size |
|
) |
| |
Definition at line 143 of file win32_misc.cpp.
145 if (OpenClipboard(NULL)) {
147 HANDLE handle = GlobalAlloc(GMEM_MOVEABLE,p_block_size);
148 if (handle == NULL) {
150 throw std::bad_alloc();
152 {
CGlobalLock lock(handle);memcpy(lock.GetPtr(),p_block,p_block_size);}
153 if (SetClipboardData(p_format,handle) == NULL) {
typedef HANDLE(WINAPI *pPowerCreateRequest_t)(__in void *Context)
template<typename t_array >
static bool SetClipboardDataBlock |
( |
UINT |
p_format, |
|
|
const t_array & |
p_array |
|
) |
| |
|
static |
Definition at line 60 of file win32_misc.h.
61 PFC_STATIC_ASSERT(
sizeof(p_array[0]) == 1 );
bool SetClipboardDataBlock(UINT p_format, const void *p_block, t_size p_block_size)
void SetDefaultMenuItem |
( |
HMENU |
p_menu, |
|
|
unsigned |
p_id |
|
) |
| |
Definition at line 134 of file win32_misc.cpp.
136 info.fMask = MIIM_STATE;
137 GetMenuItemInfo(p_menu,p_id,FALSE,&info);
138 info.fState |= MFS_DEFAULT;
139 SetMenuItemInfo(p_menu,p_id,FALSE,&info);
void info(const char *p_message)
void WIN32_OP_D_FAIL |
( |
const wchar_t * |
_Message, |
|
|
const wchar_t * |
_File, |
|
|
unsigned |
_Line |
|
) |
| |
Definition at line 66 of file win32_misc.cpp.
67 const DWORD code = GetLastError();
69 wsprintfW(msgFormatted.
get_ptr(), L
"%s (code: %u)", _Message, code);
70 if (IsDebuggerPresent()) {
71 OutputDebugString(TEXT(
"WIN32_OP_D() failure:\n"));
72 OutputDebugString(msgFormatted.
get_ptr());
73 OutputDebugString(TEXT(
"\n"));
76 _wassert(msgFormatted.
get_ptr(),_File,_Line);
const t_item * get_ptr() const
t_size strlen_t(const t_char *p_string, t_size p_length=~0)
void set_size(t_size p_size)
PFC_NORETURN PFC_NOINLINE void WIN32_OP_FAIL |
( |
| ) |
|
Definition at line 52 of file win32_misc.cpp.
53 const DWORD code = GetLastError();
54 PFC_ASSERT( code != NO_ERROR );
PFC_NORETURN PFC_NOINLINE void WIN32_OP_FAIL_CRITICAL |
( |
const char * |
what | ) |
|
Definition at line 58 of file win32_misc.cpp.
59 const DWORD code = GetLastError();
60 PFC_ASSERT( code != NO_ERROR );
const char * get_ptr() const
PFC_NORETURN void SHARED_EXPORT uBugCheck()
static DWORD WS_EX_COMPOSITED_Safe |
( |
| ) |
|
|
static |