|
|
@@ -22,88 +22,108 @@ GUITask::~GUITask()
|
|
|
|
|
|
ErrorCodeEnum GUITask::Kickoff(CEntityBase *pEntity)
|
|
|
{
|
|
|
- if (m_hThread) {
|
|
|
- return Error_Duplication;
|
|
|
- }
|
|
|
+#if defined(RVC_OS_WIN)
|
|
|
|
|
|
- m_pEntity = pEntity;
|
|
|
+ if (m_hThread) {
|
|
|
+ return Error_Duplication;
|
|
|
+ }
|
|
|
|
|
|
- m_hThread = (HANDLE)_beginthreadex(0, 0, &__Process, this, 0, 0);
|
|
|
- if (!m_hThread) {
|
|
|
- return Error_Resource;
|
|
|
- }
|
|
|
+ m_pEntity = pEntity;
|
|
|
+
|
|
|
+ m_hThread = (HANDLE)_beginthreadex(0, 0, &__Process, this, 0, 0);
|
|
|
+ if (!m_hThread) {
|
|
|
+ return Error_Resource;
|
|
|
+ }
|
|
|
+
|
|
|
+ WaitForSingleObject(m_hEventStartReady, INFINITE);
|
|
|
+ return RegistEntityStateEvent();
|
|
|
+
|
|
|
+#else
|
|
|
+
|
|
|
+ return Error_NotSupport;
|
|
|
+
|
|
|
+#endif //RVC_OS_WIN
|
|
|
|
|
|
- WaitForSingleObject(m_hEventStartReady, INFINITE);
|
|
|
- //SubscribeLog();
|
|
|
- return RegistEntityStateEvent();
|
|
|
}
|
|
|
|
|
|
ErrorCodeEnum GUITask::Close()
|
|
|
{
|
|
|
- if (!m_hThread) {
|
|
|
- return Error_NotInit;
|
|
|
- }
|
|
|
-
|
|
|
- UnSubscribeLog();
|
|
|
- UnregistEntityStateEvent();
|
|
|
+#if defined(RVC_OS_WIN)
|
|
|
|
|
|
- if (m_hWndMainFrame)
|
|
|
- {
|
|
|
- PostMessageA(m_hWndMainFrame, WM_CLOSE, -1, -1);
|
|
|
- WaitForSingleObject(m_hEventStopReady, INFINITE);
|
|
|
- }
|
|
|
+ if (!m_hThread) {
|
|
|
+ return Error_NotInit;
|
|
|
+}
|
|
|
+
|
|
|
+ UnSubscribeLog();
|
|
|
+ UnregistEntityStateEvent();
|
|
|
+
|
|
|
+ if (m_hWndMainFrame) {
|
|
|
+ PostMessageA(m_hWndMainFrame, WM_CLOSE, -1, -1);
|
|
|
+ WaitForSingleObject(m_hEventStopReady, INFINITE);
|
|
|
+ }
|
|
|
+
|
|
|
+ WaitForSingleObject(m_hThread, INFINITE);
|
|
|
+ CloseHandle(m_hThread);
|
|
|
+ m_hThread = 0;
|
|
|
+
|
|
|
+#endif //RVC_OS_WIN
|
|
|
|
|
|
- WaitForSingleObject(m_hThread, INFINITE);
|
|
|
- CloseHandle(m_hThread);
|
|
|
- m_hThread = 0;
|
|
|
return Error_Succeed;
|
|
|
}
|
|
|
|
|
|
+#if defined(RVC_OS_WIN)
|
|
|
+
|
|
|
CAppModule _Module;
|
|
|
|
|
|
+#endif //RVC_OS_WIN
|
|
|
+
|
|
|
void GUITask::Process()
|
|
|
{
|
|
|
- ResetEvent(m_hEventStartReady);
|
|
|
- m_pEntity->GetFunction()->InitLogCurrentThread();
|
|
|
|
|
|
- HRESULT hRes = ::CoInitialize(NULL);
|
|
|
- // If you are running on NT 4.0 or higher you can use the following call instead to
|
|
|
- // make the EXE free threaded. This means that calls come in on a random RPC thread.
|
|
|
- // HRESULT hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
|
|
|
- ATLASSERT(SUCCEEDED(hRes));
|
|
|
+#if defined(RVC_OS_WIN)
|
|
|
|
|
|
- // this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used
|
|
|
- ::DefWindowProc(NULL, 0, 0, 0L);
|
|
|
+ ResetEvent(m_hEventStartReady);
|
|
|
+ m_pEntity->GetFunction()->InitLogCurrentThread();
|
|
|
|
|
|
- AtlInitCommonControls(ICC_COOL_CLASSES | ICC_BAR_CLASSES); // add flags to support other controls
|
|
|
- hRes = _Module.Init(NULL, ModuleBase::GetModuleBase()->GetInstance());
|
|
|
- ATLASSERT(SUCCEEDED(hRes));
|
|
|
+ HRESULT hRes = ::CoInitialize(NULL);
|
|
|
+ // If you are running on NT 4.0 or higher you can use the following call instead to
|
|
|
+ // make the EXE free threaded. This means that calls come in on a random RPC thread.
|
|
|
+ // HRESULT hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
|
|
|
+ ATLASSERT(SUCCEEDED(hRes));
|
|
|
|
|
|
- ATL::AtlAxWinInit();
|
|
|
+ // this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used
|
|
|
+ ::DefWindowProc(NULL, 0, 0, 0L);
|
|
|
|
|
|
- CMessageLoop theLoop;
|
|
|
- _Module.AddMessageLoop(&theLoop);
|
|
|
+ AtlInitCommonControls(ICC_COOL_CLASSES | ICC_BAR_CLASSES); // add flags to support other controls
|
|
|
+ hRes = _Module.Init(NULL, ModuleBase::GetModuleBase()->GetInstance());
|
|
|
+ ATLASSERT(SUCCEEDED(hRes));
|
|
|
|
|
|
- CMainFrame wndMain(this);
|
|
|
- if(wndMain.CreateEx() == NULL)
|
|
|
- {
|
|
|
- ATLTRACE(_T("Main window creation failed!\n"));
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- m_hWndMainFrame = wndMain.m_hWnd;
|
|
|
- SetEvent(m_hEventStartReady);
|
|
|
+ ATL::AtlAxWinInit();
|
|
|
+
|
|
|
+ CMessageLoop theLoop;
|
|
|
+ _Module.AddMessageLoop(&theLoop);
|
|
|
+
|
|
|
+ CMainFrame wndMain(this);
|
|
|
+ if (wndMain.CreateEx() == NULL) {
|
|
|
+ ATLTRACE(_T("Main window creation failed!\n"));
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- wndMain.ShowWindow(SW_SHOW);
|
|
|
- int nRet = theLoop.Run();
|
|
|
+ m_hWndMainFrame = wndMain.m_hWnd;
|
|
|
+ SetEvent(m_hEventStartReady);
|
|
|
|
|
|
- _Module.RemoveMessageLoop();
|
|
|
- _Module.Term();
|
|
|
- ::CoUninitialize();
|
|
|
+ wndMain.ShowWindow(SW_SHOW);
|
|
|
+ int nRet = theLoop.Run();
|
|
|
|
|
|
-
|
|
|
- SetEvent(m_hEventStopReady);
|
|
|
- m_hWndMainFrame = NULL;
|
|
|
+ _Module.RemoveMessageLoop();
|
|
|
+ _Module.Term();
|
|
|
+ ::CoUninitialize();
|
|
|
+
|
|
|
+
|
|
|
+ SetEvent(m_hEventStopReady);
|
|
|
+ m_hWndMainFrame = NULL;
|
|
|
+
|
|
|
+#endif //RVC_OS_WIN
|
|
|
}
|
|
|
|
|
|
ErrorCodeEnum GUITask::RegistEntityStateEvent()
|
|
|
@@ -142,12 +162,16 @@ ErrorCodeEnum GUITask::ReqFrameworkQuit(bool bRebootOS)
|
|
|
|
|
|
ErrorCodeEnum GUITask::SubscribeLog()
|
|
|
{
|
|
|
- return m_pEntity->GetFunction()->SubscribeLog(m_logSubID, this, Log_Ignore, Severity_None, Error_IgnoreAll, -1, NULL, false);
|
|
|
+#if defined(_MSC_VER)
|
|
|
+ return m_pEntity->GetFunction()->SubscribeLog(m_logSubID, this, Log_Ignore, Severity_None, Error_IgnoreAll, -1, NULL, false);
|
|
|
+#else
|
|
|
+ return Error_NotSupport;
|
|
|
+#endif //_MSC_VER
|
|
|
}
|
|
|
|
|
|
ErrorCodeEnum GUITask::UnSubscribeLog()
|
|
|
{
|
|
|
- if ((__int64)m_logSubID != 0)
|
|
|
+ if (HasSubscibeLog())
|
|
|
{
|
|
|
m_pEntity->GetFunction()->UnsubscribeLog(m_logSubID);
|
|
|
m_logSubID = 0;
|
|
|
@@ -196,8 +220,6 @@ ErrorCodeEnum GUITask::BeginInitialize()
|
|
|
auto rc = pClient->Connect();
|
|
|
if (rc == Error_Succeed)
|
|
|
{
|
|
|
- //Dbg("connect to entity [Initializer] succeed, start initialize now");
|
|
|
-
|
|
|
InitializerService_Initialize_Info info = {};
|
|
|
rc = pClient->Initialize(info);
|
|
|
pClient->GetFunction()->CloseSession();
|
|
|
@@ -219,7 +241,7 @@ ErrorCodeEnum GUITask::ShowMobileDialog()
|
|
|
MobileDial::MobileDialService_ShowDialog_Info info = {};
|
|
|
rc = pClient->ShowDialog(info);
|
|
|
if(rc != 0) {
|
|
|
- LogError(Severity_Low, rc, 0, CSimpleStringA::Format("Invoke show mobile dialog failed, rc = 0x%X", rc));
|
|
|
+ LogError(Severity_Low, rc, 0, CSimpleStringA::Format("Invoke show mobile dialog failed, rc = %s", SpStrError(rc)));
|
|
|
}
|
|
|
pClient->GetFunction()->CloseSession();
|
|
|
}
|
|
|
@@ -239,19 +261,18 @@ ErrorCodeEnum GUITask::ShowMobileDialog()
|
|
|
|
|
|
ErrorCodeEnum GUITask::DeleteKeySet()
|
|
|
{
|
|
|
- HCRYPTPROV hProv(0);
|
|
|
- if (!CryptAcquireContext(&hProv, "RVC", MS_ENHANCED_PROV, PROV_RSA_FULL, CRYPT_MACHINE_KEYSET | CRYPT_DELETEKEYSET))
|
|
|
- {
|
|
|
- Dbg("delete keyset fail: %d", GetLastError());
|
|
|
- return Error_Unexpect;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- Dbg("delete keyset succ");
|
|
|
- return Error_Succeed;
|
|
|
- }
|
|
|
- //auto pEntity = (CGUIConsoleEntity*)m_pEntity;
|
|
|
- //return pEntity->RegistSwallowedCard("6225887550008888", "4014", "20151014", "141755");
|
|
|
+#if defined(_MSC_VER)
|
|
|
+ HCRYPTPROV hProv(0);
|
|
|
+ if (!CryptAcquireContext(&hProv, "RVC", MS_ENHANCED_PROV, PROV_RSA_FULL, CRYPT_MACHINE_KEYSET | CRYPT_DELETEKEYSET)) {
|
|
|
+ Dbg("delete keyset fail: %d", GetLastError());
|
|
|
+ return Error_Unexpect;
|
|
|
+ } else {
|
|
|
+ Dbg("delete keyset succ");
|
|
|
+ return Error_Succeed;
|
|
|
+ }
|
|
|
+#else
|
|
|
+ return Error_NotImpl;
|
|
|
+#endif //_MSC_VER
|
|
|
}
|
|
|
|
|
|
ErrorCodeEnum GUITask::GetFrameworkInfo(CSimpleStringA &strInfo)
|
|
|
@@ -259,9 +280,9 @@ ErrorCodeEnum GUITask::GetFrameworkInfo(CSimpleStringA &strInfo)
|
|
|
CSystemStaticInfo info;
|
|
|
memset(&info, 0, sizeof(info));
|
|
|
auto rc = m_pEntity->GetFunction()->GetSystemStaticInfo(info);
|
|
|
- if (rc == Error_Succeed)
|
|
|
+ if (rc == Error_Succeed) {
|
|
|
strInfo = CSimpleStringA::Format("[%s] [%s]", (const char*) info.strTerminalID, (const char*)info.InstallVersion.ToString());
|
|
|
-
|
|
|
+ }
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
@@ -446,71 +467,69 @@ ErrorCodeEnum GUITask::GetCustomizeStartMenuList(CAutoArray<StartMenuEntry> &Sta
|
|
|
|
|
|
void GUITask::OnAnswer(CSmartPointer<IAsynWaitSp> pAsynWaitSp)
|
|
|
{
|
|
|
- if (m_hWndMainFrame) {
|
|
|
- CSmartPointer<ICallbackListener> spCallback;
|
|
|
- CSmartPointer<IReleasable> pData;
|
|
|
- pAsynWaitSp->GetCallback(spCallback, pData);
|
|
|
- LOG_ASSERT(pData.GetRawPointer() != NULL);
|
|
|
- callback_entry *entry = static_cast<callback_entry*>((IReleasable*)pData.GetRawPointer());
|
|
|
- entry->ErrorResult = pAsynWaitSp->AsyncGetAnswer();
|
|
|
- callback_entry *new_entry = new callback_entry();
|
|
|
- new_entry->EntityName = entry->EntityName;
|
|
|
- new_entry->ErrorResult = entry->ErrorResult;
|
|
|
- new_entry->op = entry->op;
|
|
|
- new_entry->state = entry->state;
|
|
|
- PostMessage(m_hWndMainFrame, WM_GUICONSOLE, 0, (LPARAM)new_entry);
|
|
|
- }
|
|
|
+#if defined(_MSC_VER)
|
|
|
+ if (m_hWndMainFrame) {
|
|
|
+ CSmartPointer<ICallbackListener> spCallback;
|
|
|
+ CSmartPointer<IReleasable> pData;
|
|
|
+ pAsynWaitSp->GetCallback(spCallback, pData);
|
|
|
+ LOG_ASSERT(pData.GetRawPointer() != NULL);
|
|
|
+ callback_entry* entry = static_cast<callback_entry*>((IReleasable*)pData.GetRawPointer());
|
|
|
+ entry->ErrorResult = pAsynWaitSp->AsyncGetAnswer();
|
|
|
+ callback_entry* new_entry = new callback_entry();
|
|
|
+ new_entry->EntityName = entry->EntityName;
|
|
|
+ new_entry->ErrorResult = entry->ErrorResult;
|
|
|
+ new_entry->op = entry->op;
|
|
|
+ new_entry->state = entry->state;
|
|
|
+ PostMessage(m_hWndMainFrame, WM_GUICONSOLE, 0, (LPARAM)new_entry);
|
|
|
+ }
|
|
|
+#endif //_MSC_VER
|
|
|
}
|
|
|
|
|
|
|
|
|
ErrorCodeEnum GUITask::OutputMsg(const char *pMsg)
|
|
|
{
|
|
|
- if (m_hWndMainFrame) {
|
|
|
- PostMessage(m_hWndMainFrame, WM_SHOW_MSG, 0, (LPARAM)strdup(pMsg));
|
|
|
- return Error_Succeed;
|
|
|
- }
|
|
|
- else
|
|
|
- return Error_NotExist;
|
|
|
+#if defined(_MSC_VER)
|
|
|
+ if (m_hWndMainFrame) {
|
|
|
+ PostMessage(m_hWndMainFrame, WM_SHOW_MSG, 0, (LPARAM)strdup(pMsg));
|
|
|
+ return Error_Succeed;
|
|
|
+ } else
|
|
|
+ return Error_NotExist;
|
|
|
+#else
|
|
|
+ return Error_NotSupport;
|
|
|
+#endif //_MSC_VER
|
|
|
}
|
|
|
|
|
|
void GUITask::OnEntityStateHook(const char *pszEntityName,const char *pszTriggerEntity,EntityStateEnum eState,EntityStateEnum eLastState)
|
|
|
{
|
|
|
- if (m_hWndMainFrame) {
|
|
|
- callback_entry *entry = new callback_entry();
|
|
|
- entry->EntityName = pszEntityName;
|
|
|
- entry->ErrorResult = Error_Succeed;
|
|
|
- entry->op = OP_FIRE_ENTITY_STATE;
|
|
|
- entry->state = eState;
|
|
|
-
|
|
|
- DWORD dwProcessID = 0;
|
|
|
- //if (entry->state != EntityState_Close) // 关闭状态进程号清0置后
|
|
|
- {
|
|
|
- CEntityRunInfo Info;
|
|
|
- CSmartPointer<IEntityFunction> pFunc = m_pEntity->GetFunction();
|
|
|
- pFunc->GetEntityRunInfo(entry->EntityName, Info);
|
|
|
- dwProcessID = Info.dwProcessID;
|
|
|
- }
|
|
|
+#if defined(_MSC_VER)
|
|
|
+ if (m_hWndMainFrame) {
|
|
|
+ callback_entry* entry = new callback_entry();
|
|
|
+ entry->EntityName = pszEntityName;
|
|
|
+ entry->ErrorResult = Error_Succeed;
|
|
|
+ entry->op = OP_FIRE_ENTITY_STATE;
|
|
|
+ entry->state = eState;
|
|
|
|
|
|
- PostMessage(m_hWndMainFrame, WM_GUICONSOLE, dwProcessID, (LPARAM)entry);
|
|
|
- }
|
|
|
+ DWORD dwProcessID = 0;
|
|
|
+ //if (entry->state != EntityState_Close) // 关闭状态进程号清0置后
|
|
|
+ {
|
|
|
+ CEntityRunInfo Info;
|
|
|
+ CSmartPointer<IEntityFunction> pFunc = m_pEntity->GetFunction();
|
|
|
+ pFunc->GetEntityRunInfo(entry->EntityName, Info);
|
|
|
+ dwProcessID = Info.dwProcessID;
|
|
|
+ }
|
|
|
+
|
|
|
+ PostMessage(m_hWndMainFrame, WM_GUICONSOLE, dwProcessID, (LPARAM)entry);
|
|
|
+ }
|
|
|
+#endif //_MSC_VER
|
|
|
}
|
|
|
|
|
|
void GUITask::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,const LogTypeEnum eLogType, const SeverityLevelEnum eLevel,
|
|
|
const DWORD dwSysError,const DWORD dwUserCode,const DWORD dwEntityInstanceID, const WORD wEntityDevelID,
|
|
|
const CAutoArray<DWORD> &Param, const char *pszEntityName, const char *pszModuleName,const char *pszMessage)
|
|
|
{
|
|
|
- //// 过滤非调试实体信息
|
|
|
- //if (pszEntityName !=NULL)
|
|
|
- //{
|
|
|
- // CEntityRunInfo info = {};
|
|
|
- // auto rc = m_pEntity->GetFunction()->GetEntityRunInfo(pszEntityName, info);
|
|
|
- // if (rc == Error_Succeed && info.eDebugLevel == 0)
|
|
|
- // return;
|
|
|
- //}
|
|
|
-
|
|
|
// 忽略GPIO事件
|
|
|
if (dwUserCode == 0x2090000A || dwUserCode == 0x20900009)
|
|
|
- return;
|
|
|
+ return;
|
|
|
|
|
|
if (pszMessage!=NULL && strlen(pszMessage)>2)
|
|
|
{
|
|
|
@@ -538,77 +557,78 @@ CEntityBase* GUITask::GetEntity()
|
|
|
|
|
|
ErrorCodeEnum GUITask::ShowMaintainView(bool bShow, bool bHighLevel)
|
|
|
{
|
|
|
- if (m_hWndMainFrame) {
|
|
|
- PostMessage(m_hWndMainFrame, WM_SHOW_MAINTAIN_VIEW, bShow?1:0, bHighLevel?1:0);
|
|
|
- return Error_Succeed;
|
|
|
- }
|
|
|
- else
|
|
|
- return Error_NotExist;
|
|
|
+#if defined(_MSC_VER)
|
|
|
+ if (m_hWndMainFrame) {
|
|
|
+ PostMessage(m_hWndMainFrame, WM_SHOW_MAINTAIN_VIEW, bShow ? 1 : 0, bHighLevel ? 1 : 0);
|
|
|
+ return Error_Succeed;
|
|
|
+ } else
|
|
|
+ return Error_NotExist;
|
|
|
+#else
|
|
|
+ return Error_NotSupport;
|
|
|
+#endif //_MSC_VER
|
|
|
}
|
|
|
|
|
|
ErrorCodeEnum GUITask::SetWindowPosition(bool bTop)
|
|
|
{
|
|
|
- if (m_hWndMainFrame)
|
|
|
- {
|
|
|
- if (bTop)
|
|
|
- {
|
|
|
- ShowWindow(m_hWndMainFrame, SW_NORMAL);
|
|
|
- SetWindowPos(m_hWndMainFrame, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
|
|
|
- SetWindowPos(m_hWndMainFrame, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
|
|
|
-
|
|
|
- // 启动软键盘
|
|
|
- // WinExec("osk.exe", SW_NORMAL);
|
|
|
- //ShellExecuteA(NULL, "open", "osk.exe", NULL, NULL, SW_SHOW);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- SetWindowPos(m_hWndMainFrame, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
|
|
|
- SetWindowPos(m_hWndMainFrame, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
|
|
|
- ShowWindow(m_hWndMainFrame, SW_MINIMIZE);
|
|
|
-
|
|
|
- // 关闭软键盘
|
|
|
- //CloseSoftKeyboard();
|
|
|
- }
|
|
|
-
|
|
|
- return Error_Succeed;
|
|
|
- }
|
|
|
- else
|
|
|
- return Error_NotExist;
|
|
|
+#if defined(_MSC_VER)
|
|
|
+ if (m_hWndMainFrame) {
|
|
|
+ if (bTop) {
|
|
|
+ ShowWindow(m_hWndMainFrame, SW_NORMAL);
|
|
|
+ SetWindowPos(m_hWndMainFrame, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
|
|
|
+ SetWindowPos(m_hWndMainFrame, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
|
|
|
+ } else {
|
|
|
+ SetWindowPos(m_hWndMainFrame, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
|
|
|
+ SetWindowPos(m_hWndMainFrame, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
|
|
|
+ ShowWindow(m_hWndMainFrame, SW_MINIMIZE);
|
|
|
+ }
|
|
|
+ return Error_Succeed;
|
|
|
+ } else
|
|
|
+ return Error_NotExist;
|
|
|
+#else
|
|
|
+ return Error_NotSupport;
|
|
|
+#endif //_MSC_VER
|
|
|
}
|
|
|
|
|
|
ErrorCodeEnum GUITask::ShowBeginInit(bool bShow)
|
|
|
{
|
|
|
- if (m_hWndMainFrame) {
|
|
|
- PostMessage(m_hWndMainFrame, WM_SHOW_BEGININIT_VIEW, bShow?1:0, -1);
|
|
|
- return Error_Succeed;
|
|
|
- }
|
|
|
- else
|
|
|
- return Error_NotExist;
|
|
|
+#if defined(_MSC_VER)
|
|
|
+ if (m_hWndMainFrame) {
|
|
|
+ PostMessage(m_hWndMainFrame, WM_SHOW_BEGININIT_VIEW, bShow ? 1 : 0, -1);
|
|
|
+ return Error_Succeed;
|
|
|
+ } else
|
|
|
+ return Error_NotExist;
|
|
|
+#else
|
|
|
+ return Error_NotSupport;
|
|
|
+#endif //_MSC_VER
|
|
|
}
|
|
|
|
|
|
ErrorCodeEnum GUITask::EnableMobileDialMenu(bool bEnable)
|
|
|
{
|
|
|
- if (m_hWndMainFrame) {
|
|
|
- PostMessage(m_hWndMainFrame, WM_SHOW_MOBILEDIAL_VIEW, bEnable ? 1 : 0, -1);
|
|
|
- return Error_Succeed;
|
|
|
- }
|
|
|
- else {
|
|
|
- return Error_NotExist;
|
|
|
- }
|
|
|
+#if defined(_MSC_VER)
|
|
|
+ if (m_hWndMainFrame) {
|
|
|
+ PostMessage(m_hWndMainFrame, WM_SHOW_MOBILEDIAL_VIEW, bEnable ? 1 : 0, -1);
|
|
|
+ return Error_Succeed;
|
|
|
+ } else {
|
|
|
+ return Error_NotExist;
|
|
|
+ }
|
|
|
+#else
|
|
|
+ return Error_NotSupport;
|
|
|
+#endif //_MSC_VER
|
|
|
}
|
|
|
|
|
|
void GUITask::CloseSoftKeyboard()
|
|
|
{
|
|
|
- HANDLE hProcessHandle;
|
|
|
- ULONG nProcessID;
|
|
|
- HWND kbWindow;
|
|
|
- kbWindow = ::FindWindow(NULL, _T("屏幕键盘"));
|
|
|
- if (NULL != kbWindow)
|
|
|
- {
|
|
|
- ::GetWindowThreadProcessId(kbWindow, &nProcessID);
|
|
|
- hProcessHandle = ::OpenProcess(PROCESS_TERMINATE, FALSE, nProcessID);
|
|
|
- ::TerminateProcess(hProcessHandle, 4);
|
|
|
- }
|
|
|
+#if defined(_MSC_VER)
|
|
|
+ HANDLE hProcessHandle;
|
|
|
+ ULONG nProcessID;
|
|
|
+ HWND kbWindow;
|
|
|
+ kbWindow = ::FindWindow(NULL, _T("屏幕键盘"));
|
|
|
+ if (NULL != kbWindow) {
|
|
|
+ ::GetWindowThreadProcessId(kbWindow, &nProcessID);
|
|
|
+ hProcessHandle = ::OpenProcess(PROCESS_TERMINATE, FALSE, nProcessID);
|
|
|
+ ::TerminateProcess(hProcessHandle, 4);
|
|
|
+ }
|
|
|
+#endif //_MSC_VER
|
|
|
}
|
|
|
ErrorCodeEnum GUITask::ShowBlueScreen()
|
|
|
{
|