12345678910111213141516171819202122232425262728293031323334353637383940 |
- #include "StdAfx.h"
- #include "ShardMainWinHandle.h"
- CShardMainWinHandle::CShardMainWinHandle(void)
- {
- m_hMapFile= CreateFileMapping((HANDLE)0xFFFFFFFF,NULL,PAGE_READWRITE,0,1024,_T("smart_evaluation_main_window_handle"));
- m_pBaseMapFile=MapViewOfFile(m_hMapFile,FILE_MAP_READ|FILE_MAP_WRITE,0,0,0);
- //HANDLE m_hMapFile =OpenFileMapping(FILE_MAP_WRITE,FALSE,_T("smart_evaluation_main_window_handle"));
- }
- CShardMainWinHandle::~CShardMainWinHandle(void)
- {
- if (m_pBaseMapFile) {
- UnmapViewOfFile(m_pBaseMapFile);
- m_pBaseMapFile =NULL;
- }
- CloseHandle(m_hMapFile);
- }
- BOOL CShardMainWinHandle::SaveWndHandle( HWND hWnd )
- {
- if(m_pBaseMapFile){
- *(HWND*) m_pBaseMapFile =hWnd;
- return TRUE;
- }
- return FALSE;
- }
- BOOL CShardMainWinHandle::GetWndHandle( HWND& hWnd )
- {
- if(m_pBaseMapFile){
- hWnd = *(HWND*) m_pBaseMapFile;
- return TRUE;
- }
- return FALSE;
- }
- CShardMainWinHandle g_ShardMainWinHandle;
|