add last backwards-compatible version

This commit is contained in:
2021-12-14 00:33:46 -07:00
parent 68b10d413b
commit b0dd3f07f3
335 changed files with 4746 additions and 19627 deletions

View File

@@ -19,11 +19,6 @@ namespace pfc {
private:
const DWORD m_val;
};
string8 getWindowText(HWND wnd);
void setWindowText(HWND wnd, const char * txt);
string8 getWindowClassName( HWND wnd );
HWND findOwningPopup(HWND wnd);
}
@@ -50,8 +45,7 @@ private:
pfc::string_formatter m_buffer;
};
class exception_win32 : public std::exception {
public:
struct exception_win32 : public std::exception {
exception_win32(DWORD p_code) : std::exception(format_win32_error(p_code)), m_code(p_code) {}
DWORD get_code() const {return m_code;}
private:
@@ -271,10 +265,10 @@ template<typename TBase> class ImplementCOMRefCounter : public TBase {
public:
template<typename ... arg_t> ImplementCOMRefCounter(arg_t && ... arg) : TBase(std::forward<arg_t>(arg) ...) {}
ULONG STDMETHODCALLTYPE AddRef() override {
ULONG STDMETHODCALLTYPE AddRef() {
return ++m_refcounter;
}
ULONG STDMETHODCALLTYPE Release() override {
ULONG STDMETHODCALLTYPE Release() {
long val = --m_refcounter;
if (val == 0) delete this;
return val;
@@ -306,6 +300,7 @@ namespace pfc {
bool isCtrlKeyPressed();
bool isAltKeyPressed();
class winHandle {
public:
winHandle(HANDLE h_ = INVALID_HANDLE_VALUE) : h(h_) {}
@@ -329,13 +324,5 @@ namespace pfc {
void winSleep( double seconds );
void sleepSeconds(double seconds);
void yield();
#ifdef PFC_WINDOWS_DESKTOP_APP
void winSetThreadDescription(HANDLE hThread, const wchar_t * desc);
#if PFC_DEBUG
#define PFC_SET_THREAD_DESCRIPTION(msg) ::pfc::winSetThreadDescription(GetCurrentThread(), L##msg);
#define PFC_SET_THREAD_DESCRIPTION_SUPPORTED
#endif // PFC_DEBUG
#endif // PFC_WINDOWS_DESKTOP_APP
}