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

Function OpenWithDlgProc

src/Dialogs.c:409–506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407extern int cyOpenWithDlg;
408
409INT_PTR CALLBACK OpenWithDlgProc ( HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam )
410{
411 switch ( umsg ) {
412 case WM_INITDIALOG: {
413 LVCOLUMN lvc = { LVCF_FMT | LVCF_TEXT, LVCFMT_LEFT, 0, L"", -1, 0, 0, 0 };
414 ResizeDlg_Init ( hwnd, cxOpenWithDlg, cyOpenWithDlg, IDC_RESIZEGRIP3 );
415 SetWindowLongPtr ( hwnd, DWLP_USER, ( LONG_PTR ) lParam );
416 //SetExplorerTheme(GetDlgItem(hwnd,IDC_OPENWITHDIR));
417 ListView_SetExtendedListViewStyle ( GetDlgItem ( hwnd, IDC_OPENWITHDIR ),/*LVS_EX_FULLROWSELECT|*/LVS_EX_DOUBLEBUFFER | LVS_EX_LABELTIP );
418 ListView_InsertColumn ( GetDlgItem ( hwnd, IDC_OPENWITHDIR ), 0, &lvc );
419 DirList_Init ( GetDlgItem ( hwnd, IDC_OPENWITHDIR ), NULL );
420 DirList_Fill ( GetDlgItem ( hwnd, IDC_OPENWITHDIR ), tchOpenWithDir, DL_ALLOBJECTS, NULL, FALSE, flagNoFadeHidden, DS_NAME, FALSE );
421 DirList_StartIconThread ( GetDlgItem ( hwnd, IDC_OPENWITHDIR ) );
422 ListView_SetItemState ( GetDlgItem ( hwnd, IDC_OPENWITHDIR ), 0, LVIS_FOCUSED, LVIS_FOCUSED );
423 MakeBitmapButton ( hwnd, IDC_GETOPENWITHDIR, g_hInstance, IDB_OPEN );
424 CenterDlgInParent ( hwnd );
425 }
426 return TRUE;
427 case WM_DESTROY:
428 DirList_Destroy ( GetDlgItem ( hwnd, IDC_OPENWITHDIR ) );
429 DeleteBitmapButton ( hwnd, IDC_GETOPENWITHDIR );
430 ResizeDlg_Destroy ( hwnd, &cxOpenWithDlg, &cyOpenWithDlg );
431 return FALSE;
432 case WM_SIZE: {
433 int dx;
434 int dy;
435 HDWP hdwp;
436 ResizeDlg_Size ( hwnd, lParam, &dx, &dy );
437 hdwp = BeginDeferWindowPos ( 6 );
438 hdwp = DeferCtlPos ( hdwp, hwnd, IDC_RESIZEGRIP3, dx, dy, SWP_NOSIZE );
439 hdwp = DeferCtlPos ( hdwp, hwnd, IDOK, dx, dy, SWP_NOSIZE );
440 hdwp = DeferCtlPos ( hdwp, hwnd, IDCANCEL, dx, dy, SWP_NOSIZE );
441 hdwp = DeferCtlPos ( hdwp, hwnd, IDC_OPENWITHDIR, dx, dy, SWP_NOMOVE );
442 hdwp = DeferCtlPos ( hdwp, hwnd, IDC_GETOPENWITHDIR, 0, dy, SWP_NOSIZE );
443 hdwp = DeferCtlPos ( hdwp, hwnd, IDC_OPENWITHDESCR, 0, dy, SWP_NOSIZE );
444 EndDeferWindowPos ( hdwp );
445 ListView_SetColumnWidth ( GetDlgItem ( hwnd, IDC_OPENWITHDIR ), 0, LVSCW_AUTOSIZE_USEHEADER );
446 }
447 return TRUE;
448 case WM_GETMINMAXINFO:
449 ResizeDlg_GetMinMaxInfo ( hwnd, lParam );
450 return TRUE;
451 case WM_NOTIFY: {
452 LPNMHDR pnmh = ( LPNMHDR ) lParam;
453 if ( pnmh->idFrom == IDC_OPENWITHDIR ) {
454 switch ( pnmh->code ) {
455 case LVN_GETDISPINFO:
456 DirList_GetDispInfo ( GetDlgItem ( hwnd, IDC_OPENWITHDIR ), lParam, flagNoFadeHidden );
457 break;
458 case LVN_DELETEITEM:
459 DirList_DeleteItem ( GetDlgItem ( hwnd, IDC_OPENWITHDIR ), lParam );
460 break;
461 case LVN_ITEMCHANGED: {
462 NM_LISTVIEW *pnmlv = ( NM_LISTVIEW * ) lParam;
463 EnableWindow ( GetDlgItem ( hwnd, IDOK ), ( pnmlv->uNewState & LVIS_SELECTED ) );
464 }
465 break;
466 case NM_DBLCLK:

Callers

nothing calls this directly

Calls 15

ResizeDlg_InitFunction · 0.85
SetWindowLongPtrFunction · 0.85
DirList_InitFunction · 0.85
DirList_FillFunction · 0.85
DirList_StartIconThreadFunction · 0.85
MakeBitmapButtonFunction · 0.85
CenterDlgInParentFunction · 0.85
DirList_DestroyFunction · 0.85
DeleteBitmapButtonFunction · 0.85
ResizeDlg_DestroyFunction · 0.85
ResizeDlg_SizeFunction · 0.85
DeferCtlPosFunction · 0.85

Tested by

no test coverage detected