Run code cleanup

This commit is contained in:
ema
2025-05-04 14:26:27 +08:00
parent ff4c9df9a2
commit 34a361e84a
20 changed files with 2963 additions and 2963 deletions

View File

@@ -27,9 +27,9 @@ void MultiCommander::GetSelected(PWCHAR buffer)
}
COPYDATASTRUCT cds;
cds.dwData = MULTICMD_CPF_GETCURITEMFULL | MULTICMD_CPF_SOURCE;
cds.cbData = 0;
cds.lpData = nullptr;
cds.dwData = MULTICMD_CPF_GETCURITEMFULL | MULTICMD_CPF_SOURCE;
cds.cbData = 0;
cds.lpData = nullptr;
ResetEvent(hGetResultEvent);
@@ -37,12 +37,12 @@ void MultiCommander::GetSelected(PWCHAR buffer)
FindWindow(MULTICMD_CLASS, nullptr),
WM_COPYDATA,
reinterpret_cast<WPARAM>(hMsgWnd),
reinterpret_cast<LPARAM>(&cds)
reinterpret_cast<LPARAM>(&cds)
);
if (!ret || WAIT_OBJECT_0 != WaitForSingleObject(hGetResultEvent, 2000)) {
if (!ret || WAIT_OBJECT_0 != WaitForSingleObject(hGetResultEvent, 2000)) {
return;
}
}
auto path = reinterpret_cast<PWCHAR>(pCurrentItemPath);
wcscpy_s(buffer, wcslen(path) + 1, path);
@@ -78,21 +78,21 @@ bool MultiCommander::PrepareMessageWindow()
LRESULT CALLBACK MultiCommander::msgWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_COPYDATA:
{
{
case WM_COPYDATA:
{
delete[] pCurrentItemPath;
auto cds = reinterpret_cast<PCOPYDATASTRUCT>(lParam);
auto buf = static_cast<PCHAR>(cds->lpData);
auto cds = reinterpret_cast<PCOPYDATASTRUCT>(lParam);
auto buf = static_cast<PCHAR>(cds->lpData);
pCurrentItemPath = new CHAR[cds->cbData + 1]{ '\0' };
memcpy(pCurrentItemPath, buf, cds->cbData);
pCurrentItemPath = new CHAR[cds->cbData + 1]{ '\0' };
memcpy(pCurrentItemPath, buf, cds->cbData);
SetEvent(hGetResultEvent);
return 0;
}
default:
}
default:
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
}
}