| 5439 | |
| 5440 | |
| 5441 | INT_PTR CALLBACK EditModifyLinesDlgProc ( HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam ) |
| 5442 | { |
| 5443 | static PMODLINESDATA pdata; |
| 5444 | static int id_hover; |
| 5445 | static int id_capture; |
| 5446 | static HFONT hFontNormal; |
| 5447 | static HFONT hFontHover; |
| 5448 | static HCURSOR hCursorNormal; |
| 5449 | static HCURSOR hCursorHover; |
| 5450 | switch ( umsg ) { |
| 5451 | case WM_INITDIALOG: { |
| 5452 | LOGFONT lf; |
| 5453 | id_hover = 0; |
| 5454 | id_capture = 0; |
| 5455 | if ( NULL == ( hFontNormal = ( HFONT ) SendDlgItemMessage ( hwnd, 200, WM_GETFONT, 0, 0 ) ) ) { |
| 5456 | hFontNormal = GetStockObject ( DEFAULT_GUI_FONT ); |
| 5457 | } |
| 5458 | GetObject ( hFontNormal, sizeof ( LOGFONT ), &lf ); |
| 5459 | lf.lfUnderline = TRUE; |
| 5460 | hFontHover = CreateFontIndirect ( &lf ); |
| 5461 | hCursorNormal = LoadCursor ( NULL, MAKEINTRESOURCE ( IDC_ARROW ) ); |
| 5462 | if ( ! ( hCursorHover = LoadCursor ( NULL, MAKEINTRESOURCE ( IDC_HAND ) ) ) ) { |
| 5463 | hCursorHover = LoadCursor ( g_hInstance, MAKEINTRESOURCE ( IDC_ARROW ) ); |
| 5464 | } |
| 5465 | pdata = ( PMODLINESDATA ) lParam; |
| 5466 | SetDlgItemTextW ( hwnd, 100, pdata->pwsz1 ); |
| 5467 | SendDlgItemMessage ( hwnd, 100, EM_LIMITTEXT, 255, 0 ); |
| 5468 | SetDlgItemTextW ( hwnd, 101, pdata->pwsz2 ); |
| 5469 | SendDlgItemMessage ( hwnd, 101, EM_LIMITTEXT, 255, 0 ); |
| 5470 | CenterDlgInParent ( hwnd ); |
| 5471 | } |
| 5472 | return TRUE; |
| 5473 | case WM_DESTROY: |
| 5474 | DeleteObject ( hFontHover ); |
| 5475 | return FALSE; |
| 5476 | case WM_NCACTIVATE: |
| 5477 | if ( ! ( BOOL ) wParam ) { |
| 5478 | if ( id_hover != 0 ) { |
| 5479 | int _id_hover = id_hover; |
| 5480 | id_hover = 0; |
| 5481 | id_capture = 0; |
| 5482 | //InvalidateRect(GetDlgItem(hwnd,id_hover),NULL,FALSE); |
| 5483 | } |
| 5484 | } |
| 5485 | return FALSE; |
| 5486 | case WM_CTLCOLORSTATIC: { |
| 5487 | DWORD dwId = GetWindowLong ( ( HWND ) lParam, GWL_ID ); |
| 5488 | HDC hdc = ( HDC ) wParam; |
| 5489 | if ( dwId >= 200 && dwId <= 205 ) { |
| 5490 | SetBkMode ( hdc, TRANSPARENT ); |
| 5491 | if ( GetSysColorBrush ( COLOR_HOTLIGHT ) ) { |
| 5492 | SetTextColor ( hdc, GetSysColor ( COLOR_HOTLIGHT ) ); |
| 5493 | } else { |
| 5494 | SetTextColor ( hdc, RGB ( 0, 0, 255 ) ); |
| 5495 | } |
| 5496 | SelectObject ( hdc,/*dwId == id_hover?*/hFontHover/*:hFontNormal*/ ); |
| 5497 | return ( LONG_PTR ) GetSysColorBrush ( COLOR_BTNFACE ); |
| 5498 | } |
nothing calls this directly
no test coverage detected