4.44 beta

This commit is contained in:
Igor Pavlov
2007-01-20 00:00:00 +00:00
committed by Kornel Lesiński
parent 804edc5756
commit d9666cf046
1331 changed files with 10535 additions and 13791 deletions

37
CPP/Windows/Handle.h Executable file
View File

@@ -0,0 +1,37 @@
// Windows/Handle.h
#ifndef __WINDOWS_HANDLE_H
#define __WINDOWS_HANDLE_H
namespace NWindows {
class CHandle
{
protected:
HANDLE _handle;
public:
operator HANDLE() { return _handle; }
CHandle(): _handle(NULL) {}
~CHandle() { Close(); }
bool Close()
{
if (_handle == NULL)
return true;
if (!::CloseHandle(_handle))
return false;
_handle = NULL;
return true;
}
void Attach(HANDLE handle)
{ _handle = handle; }
HANDLE Detach()
{
HANDLE handle = _handle;
_handle = NULL;
return handle;
}
};
}
#endif