MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / AddToFavDlgProc

Function AddToFavDlgProc

src/Dialogs.c:682–712  ·  view source on GitHub ↗

============================================================================= AddToFavDlgProc() Controls: 100 Edit

Source from the content-addressed store, hash-verified

680// Controls: 100 Edit
681//
682INT_PTR CALLBACK AddToFavDlgProc ( HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam )
683{
684 switch ( umsg ) {
685 WCHAR *pszName;
686 case WM_INITDIALOG:
687 pszName = ( LPWSTR ) lParam;
688 SetWindowLongPtr ( hwnd, DWLP_USER, ( LONG_PTR ) pszName );
689 SendDlgItemMessage ( hwnd, 100, EM_LIMITTEXT, MAX_PATH - 1, 0 );
690 SetDlgItemText ( hwnd, 100, pszName );
691 CenterDlgInParent ( hwnd );
692 return TRUE;
693 case WM_COMMAND:
694 switch ( LOWORD ( wParam ) ) {
695 case 100:
696 EnableWindow ( GetDlgItem ( hwnd, IDOK ),
697 GetWindowTextLength ( GetDlgItem ( hwnd, 100 ) ) );
698 break;
699 case IDOK:
700 pszName = ( LPWSTR ) GetWindowLongPtr ( hwnd, DWLP_USER );
701 GetDlgItemText ( hwnd, 100, pszName,
702 MAX_PATH - 1 );
703 EndDialog ( hwnd, IDOK );
704 break;
705 case IDCANCEL:
706 EndDialog ( hwnd, IDCANCEL );
707 break;
708 }
709 return TRUE;
710 }
711 return FALSE;
712}
713
714
715//=============================================================================

Callers

nothing calls this directly

Calls 3

SetWindowLongPtrFunction · 0.85
CenterDlgInParentFunction · 0.85
GetWindowLongPtrFunction · 0.85

Tested by

no test coverage detected