24 const char *
get_ptr()
const {
return m_buffer.get_ptr();}
25 operator const char*()
const {
return m_buffer.get_ptr();}
35 const char *
get_ptr()
const {
return m_buffer.get_ptr();}
36 operator const char*()
const {
return m_buffer.get_ptr();}
38 void stamp_hex(HRESULT p_code);
49 #ifdef PFC_WINDOWS_DESKTOP_APP 65 bool Open(HWND p_owner);
77 void *
GetPtr()
const {
return m_ptr;}
89 TItem *
GetPtr()
const {
return reinterpret_cast<TItem*
>(m_scope.GetPtr());}
91 const t_size val = m_scope.GetSize();
92 PFC_ASSERT( val %
sizeof(TItem) == 0 );
93 return val /
sizeof(TItem);
108 void set(HMENU p_menu) {release(); m_menu = p_menu;}
110 HMENU
get()
const {
return m_menu;}
128 void create(
bool p_manualreset,
bool p_initialstate);
130 void set(
HANDLE p_handle) {release(); m_handle = p_handle;}
139 bool wait_for(
double p_timeout_seconds) {
return g_wait_for(
get(),p_timeout_seconds);}
141 static DWORD g_calculate_wait_time(
double p_seconds);
144 static bool g_wait_for(
HANDLE p_event,
double p_timeout_seconds);
146 void set_state(
bool p_state);
150 static int g_twoEventWait(
HANDLE ev1,
HANDLE ev2,
double timeout );
160 #ifdef PFC_WINDOWS_DESKTOP_APP 170 void set(HICON p_icon) {release(); m_icon = p_icon;}
171 HICON
get()
const {
return m_icon;}
187 HACCEL
get()
const {
return m_accel;}
189 void load(HINSTANCE p_inst,
const TCHAR * p_id);
198 SelectObjectScope(HDC p_dc,HGDIOBJ p_obj)
throw() : m_dc(p_dc), m_obj(SelectObject(p_dc,p_obj)) {}
209 OffsetWindowOrgEx(m_dc, m_pt.x, m_pt.y, NULL);
212 OffsetWindowOrgEx(m_dc, -m_pt.x, -m_pt.y, NULL);
222 m_state = SaveDC(m_dc);
225 RestoreDC(m_dc,m_state);
231 #endif // #ifdef PFC_WINDOWS_DESKTOP_APP 242 #ifdef PFC_WINDOWS_DESKTOP_APP 253 ULONG STDMETHODCALLTYPE AddRef() {
254 return ++m_refcounter;
257 long val = --m_refcounter;
258 if (val == 0)
delete this;
269 template<
typename TPtr>
294 if (h != INVALID_HANDLE_VALUE) { CloseHandle(h); h = INVALID_HANDLE_VALUE; }
pfc::refcounter m_refcounter
bool IsKeyPressed(unsigned vk)
BOOL winFormatSystemErrorMessage(pfc::string_base &p_out, DWORD p_code)
win32_icon(const win32_icon &)
t_type replace_null_t(t_type &p_var)
CGlobalLockScopeT(HGLOBAL handle)
typedef BOOL(WINAPI *pPowerSetRequest_t)(__in HANDLE PowerRequest
HANDLE get_handle() const
winHandle(HANDLE h_=INVALID_HANDLE_VALUE)
void uRemoveWindowStyle(HWND p_wnd, LONG p_style)
OffsetWindowOrgScope(HDC dc, const POINT &pt)
const win32_icon & operator=(const win32_icon &)
WORD GetWindowsVersionCode()
void uRemoveWindowExStyle(HWND p_wnd, LONG p_style)
bool IsWindowChildOf(HWND child, HWND parent)
t_type replace_t(t_type &p_var, const t_newval &p_newval)
void winPrefixPath(pfc::string_base &out, const char *p_path)
TEMPLATE_CONSTRUCTOR_FORWARD_FLOOD(ImplementCOMRefCounter, TBase) ULONG STDMETHODCALLTYPE AddRef()
typedef HANDLE(WINAPI *pPowerCreateRequest_t)(__in void *Context)
void uSleepSeconds(double p_time, bool p_alertable)
void winUnPrefixPath(pfc::string_base &out, const char *p_path)
string8_fastalloc string_formatter
exception_com(HRESULT p_code, const char *msg)
exception_com(HRESULT p_code)
bool IsPointInsideControl(const POINT &pt, HWND wnd)
void create(pfc::string_formatter &p_out, const t_entry_list &p_data)
Simple implementation of a COM reference counter. The initial reference count is zero, so it can be used with pfc::com_ptr_t<> with plain operator=/constructor rather than attach().
SelectObjectScope(HDC p_dc, HGDIOBJ p_obj)
exception_win32(DWORD p_code)
void uAddWindowStyle(HWND p_wnd, LONG p_style)
unsigned GetHotkeyModifierFlags()
Returns current modifier keys pressed, using win32 MOD_* flags.
win32_icon(HICON p_initval)
bool wait_for(double p_timeout_seconds)
Returns true when signaled, false on timeout.
virtual ~ImplementCOMRefCounter()
ULONG STDMETHODCALLTYPE Release()
void uAddWindowExStyle(HWND p_wnd, LONG p_style)
unsigned MapDialogWidth(HWND p_dialog, unsigned p_value)