mirror of
https://github.com/yuanyuanxiang/SimpleRemoter.git
synced 2026-01-21 23:13:08 +08:00
Fix AudioManager bug and remove struct dlgInfo
This commit is contained in:
@@ -2091,10 +2091,10 @@ BOOL CALLBACK CMy2015RemoteDlg::NotifyProc(CONTEXT_OBJECT* ContextObject)
|
||||
int cmd = ContextObject->GetBYTE(0);
|
||||
AUTO_TICK(50, std::to_string(cmd));
|
||||
|
||||
if (ContextObject->hWnd) {
|
||||
if (!IsWindow(ContextObject->hWnd))
|
||||
DialogBase* Dlg = (DialogBase*)ContextObject->hDlg;
|
||||
if (Dlg) {
|
||||
if (!IsWindow(Dlg->GetSafeHwnd()))
|
||||
return FALSE;
|
||||
DialogBase* Dlg = (DialogBase*)ContextObject->hDlg;
|
||||
Dlg->MarkReceiving(true);
|
||||
Dlg->OnReceiveComplete();
|
||||
Dlg->MarkReceiving(false);
|
||||
@@ -2121,24 +2121,17 @@ BOOL CALLBACK CMy2015RemoteDlg::NotifyProc(CONTEXT_OBJECT* ContextObject)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// 对话框指针及对话框句柄
|
||||
struct dlgInfo {
|
||||
HANDLE hDlg; // 对话框指针
|
||||
HWND hWnd; // 窗口句柄
|
||||
dlgInfo(HANDLE h, HWND type) : hDlg(h), hWnd(type) { }
|
||||
};
|
||||
|
||||
BOOL CALLBACK CMy2015RemoteDlg::OfflineProc(CONTEXT_OBJECT* ContextObject)
|
||||
{
|
||||
if (!g_2015RemoteDlg || g_2015RemoteDlg->isClosed)
|
||||
return FALSE;
|
||||
dlgInfo* dlg = ContextObject->hWnd ? new dlgInfo(ContextObject->hDlg, ContextObject->hWnd) : NULL;
|
||||
|
||||
SOCKET nSocket = ContextObject->sClientSocket;
|
||||
|
||||
g_2015RemoteDlg->PostMessage(WM_USEROFFLINEMSG, (WPARAM)dlg, (LPARAM)nSocket);
|
||||
g_2015RemoteDlg->PostMessage(WM_USEROFFLINEMSG, (WPARAM)ContextObject->hDlg, (LPARAM)nSocket);
|
||||
|
||||
ContextObject->hWnd = NULL;
|
||||
ContextObject->hDlg = NULL;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -2534,13 +2527,9 @@ LRESULT CMy2015RemoteDlg::OnUserOfflineMsg(WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
LeaveCriticalSection(&m_cs);
|
||||
|
||||
dlgInfo *p = (dlgInfo *)wParam;
|
||||
if (p) {
|
||||
if (::IsWindow(p->hWnd)) {
|
||||
::PostMessageA(p->hWnd, WM_CLOSE, 0, 0);
|
||||
}
|
||||
delete p;
|
||||
p = NULL;
|
||||
DialogBase *p = (DialogBase*)wParam;
|
||||
if (p && ::IsWindow(p->GetSafeHwnd())) {
|
||||
::PostMessageA(p->GetSafeHwnd(), WM_CLOSE, 0, 0);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
@@ -194,7 +194,6 @@ public:
|
||||
m_gridDlg->ShowWindow(isGrid ? SW_SHOWMAXIMIZED : SW_HIDE);
|
||||
}
|
||||
|
||||
ContextObject->hWnd = Dlg->GetSafeHwnd();
|
||||
ContextObject->hDlg = Dlg;
|
||||
if(id == IDD_DIALOG_SCREEN_SPY)
|
||||
m_RemoteWnds[Dlg->GetSafeHwnd()]=(CDialogBase*)Dlg;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<LocalDebuggerCommand>$(SolutionDir)Bin\$(TargetName)_x64d$(TargetExt)</LocalDebuggerCommand>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
<LocalDebuggerCommandArguments>-agent</LocalDebuggerCommandArguments>
|
||||
<LocalDebuggerCommandArgumentsHistory>-agent|</LocalDebuggerCommandArgumentsHistory>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<RESOURCE_FILE>2015Remote.rc</RESOURCE_FILE>
|
||||
|
||||
@@ -277,8 +277,6 @@ BOOL IOCPServer::InitializeIOCP(VOID)
|
||||
|
||||
DWORD IOCPServer::WorkThreadProc(LPVOID lParam)
|
||||
{
|
||||
Mprintf("======> IOCPServer WorkThreadProc begin \n");
|
||||
|
||||
ZSTD_DCtx* m_Dctx = ZSTD_createDCtx(); // 解压上下文
|
||||
|
||||
IOCPServer* This = (IOCPServer*)(lParam);
|
||||
@@ -371,8 +369,6 @@ DWORD IOCPServer::WorkThreadProc(LPVOID lParam)
|
||||
|
||||
ZSTD_freeDCtx(m_Dctx);
|
||||
|
||||
Mprintf("======> IOCPServer WorkThreadProc end \n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -367,8 +367,7 @@ public:
|
||||
CBuffer InCompressedBuffer; // 接收到的压缩的数据
|
||||
CBuffer InDeCompressedBuffer; // 解压后的数据
|
||||
CBuffer OutCompressedBuffer;
|
||||
HWND hWnd;
|
||||
HANDLE hDlg;
|
||||
HANDLE hDlg; // 对话框指针
|
||||
OVERLAPPEDPLUS* olps; // OVERLAPPEDPLUS
|
||||
int CompressMethod; // 压缩算法
|
||||
HeaderParser Parser; // 解析数据协议
|
||||
@@ -464,7 +463,6 @@ public:
|
||||
VOID InitMember(SOCKET s, Server *svr)
|
||||
{
|
||||
memset(szBuffer, 0, sizeof(char) * PACKET_LENGTH);
|
||||
hWnd = NULL;
|
||||
hDlg = NULL;
|
||||
sClientSocket = s;
|
||||
PeerName = ::GetPeerName(sClientSocket);
|
||||
|
||||
Reference in New Issue
Block a user