MCPcopy Create free account
hub / github.com/DiscordMessenger/dm / WndProc

Method WndProc

src/windows/MessageList.cpp:3329–3873  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3327}
3328
3329LRESULT CALLBACK MessageList::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
3330{
3331 MessageList* pThis = (MessageList*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
3332 if (!pThis && uMsg != WM_NCCREATE)
3333 return DefWindowProc(hWnd, uMsg, wParam, lParam);
3334
3335 SCROLLINFO si{};
3336 switch (uMsg)
3337 {
3338 case WM_NCCREATE:
3339 {
3340 CREATESTRUCT* strct = (CREATESTRUCT*)lParam;
3341
3342 SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)strct->lpCreateParams);
3343
3344 break;
3345 }
3346 case WM_DESTROY:
3347 {
3348 SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) NULL);
3349 break;
3350 }
3351 case WM_TIMER:
3352 {
3353 // Flash timer
3354 Snowflake flashedMsg = pThis->m_emphasizedMessage;
3355 if (!flashedMsg)
3356 break;
3357
3358 pThis->m_flash_counter--;
3359 if (pThis->m_flash_counter <= 0) {
3360 pThis->m_emphasizedMessage = 0;
3361 KillTimer(hWnd, pThis->m_flash_timer);
3362 pThis->m_flash_timer = 0;
3363 }
3364
3365 auto itMsg = pThis->FindMessage(flashedMsg);
3366 if (itMsg == pThis->m_messages.end())
3367 break;
3368
3369 InvalidateRect(hWnd, &itMsg->m_rect, pThis->MayErase());
3370 break;
3371 }
3372 case WM_DROPFILES:
3373 {
3374 TCHAR chr[4096];
3375 HDROP hDrop = (HDROP)wParam;
3376
3377 int amount = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0);
3378
3379 if (amount != 1)
3380 {
3381 MessageBox(g_Hwnd, TmGetTString(IDS_CANT_UPLOAD_SEVERAL), TmGetTString(IDS_PROGRAM_NAME), MB_ICONWARNING | MB_OK);
3382 DragFinish(hDrop);
3383 return 0;
3384 }
3385
3386 DragQueryFile(hDrop, 0, chr, _countof(chr));

Callers

nothing calls this directly

Calls 15

DbgPrintWFunction · 0.85
HandleGestureMessageFunction · 0.85
GetDiscordInstanceFunction · 0.85
RectToNativeFunction · 0.85
GetLocalSettingsFunction · 0.85
FindMessageMethod · 0.80
MayEraseMethod · 0.80
RecalcMessageSizesMethod · 0.80
ScrollMethod · 0.80
GetProfileMethod · 0.80
HasPermissionMethod · 0.80

Tested by

no test coverage detected