| 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 | } |
nothing calls this directly
no test coverage detected