* Callback function for the log window. **/
| 74 | * Callback function for the log window. |
| 75 | **/ |
| 76 | INT_PTR CALLBACK LogCon(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
| 77 | { |
| 78 | RECT wrect; //For remembering window position |
| 79 | switch(uMsg) |
| 80 | { |
| 81 | case WM_INITDIALOG: |
| 82 | if (MLogPosX==-32000) MLogPosX=0; //Just in case |
| 83 | if (MLogPosY==-32000) MLogPosY=0; |
| 84 | SetWindowPos(hwndDlg,0,MLogPosX,MLogPosY,0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_NOOWNERZORDER); |
| 85 | break; |
| 86 | case WM_MOVE: |
| 87 | if (!IsIconic(hwndDlg)) { |
| 88 | GetWindowRect(hwndDlg,&wrect); //Remember X,Y coordinates |
| 89 | MLogPosX = wrect.left; |
| 90 | MLogPosY = wrect.top; |
| 91 | |
| 92 | #ifdef WIN32 |
| 93 | WindowBoundsCheckNoResize(MLogPosX,MLogPosY,wrect.right); |
| 94 | #endif |
| 95 | } |
| 96 | break; |
| 97 | case WM_COMMAND: |
| 98 | { |
| 99 | if (HIWORD(wParam) == BN_CLICKED) |
| 100 | { |
| 101 | if (LOWORD(wParam) == CLEAR_LOG) |
| 102 | { |
| 103 | ClearLog(); |
| 104 | } else |
| 105 | { |
| 106 | DestroyWindow(hwndDlg); |
| 107 | // Clear the handle |
| 108 | logwin = 0; |
| 109 | } |
| 110 | } |
| 111 | break; |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | return 0; |
| 116 | } |
| 117 | |
| 118 | /** |
| 119 | * Creates the log window if it's not already open. |
nothing calls this directly
no test coverage detected