MCPcopy Create free account
hub / github.com/davisking/dlib / CALLBACK

Function CALLBACK

dlib/gui_core/gui_core_kernel_1.cpp:680–1422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

678 // ------------------------------------------------------------------------------------
679
680 LRESULT CALLBACK WndProc (
681 HWND hwnd,
682 UINT message,
683 WPARAM wParam,
684 LPARAM lParam
685 )
686 {
687 using namespace gui_core_kernel_1_globals;
688 // Make the event processing thread have a priority slightly above normal.
689 // This makes the GUI smother if you do heavy processing in other threads.
690 HANDLE hand = OpenThread(THREAD_ALL_ACCESS,FALSE,GetCurrentThreadId());
691 SetThreadPriority(hand,THREAD_PRIORITY_ABOVE_NORMAL);
692 CloseHandle(hand);
693
694 auto globals = global_data();
695
696 window_table_type& window_table = globals->window_table;
697 HWND& helper_window = globals->helper_window;
698
699 auto_mutex M(window_table.get_mutex());
700
701 try
702 {
703 std::vector<unsigned char> bitmap_buffer;
704
705 bool is_double = false;
706 unsigned long btn = base_window::NONE;
707
708 switch (message)
709 {
710 case WM_USER+QUIT_EVENT_HANDLER_THREAD:
711 if (hwnd == helper_window)
712 {
713 globals->quit_windows_loop = true;
714 PostQuitMessage(0);
715 }
716 return 0;
717
718 case WM_USER+DESTROY_WINDOW:
719 if (hwnd == helper_window)
720 {
721 DestroyWindow((HWND)wParam);
722 }
723 return 0;
724
725 case WM_USER+CALL_MOVE_WINDOW:
726 if (hwnd == helper_window)
727 {
728 MoveWindow(
729 globals->move_window_hwnd,
730 globals->move_window_x,
731 globals->move_window_y,
732 globals->move_window_width,
733 globals->move_window_height,
734 TRUE);
735 globals->move_window_done = true;
736 globals->et_signaler.broadcast();
737 }

Callers

nothing calls this directly

Calls 15

global_dataClass · 0.85
error_boxFunction · 0.85
paintMethod · 0.80
map_keysFunction · 0.70
broadcastMethod · 0.45
lockMethod · 0.45
swapMethod · 0.45
unlockMethod · 0.45
resetMethod · 0.45
move_nextMethod · 0.45
on_user_eventMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected