7 static char selected
[MAX_PATH
+ 1];
18 char dir
[MAX_PATH
+ 1];
24 switch(HIWORD(wParam
))
28 switch(LOWORD(wParam
))
32 if(DlgDirSelectEx(hwndDlg
, dir
, MAX_PATH
, IDC_DIRS
))
35 GetCurrentDirectory(MAX_PATH
, dir
);
36 DlgDirList(hwndDlg
, dir
, IDC_DIRS
, IDC_DIREDIT
, DDL_DIRECTORY
| DDL_DRIVES
);
40 SendMessage(hwndDlg
, WM_COMMAND
, MAKEWPARAM(IDC_OK
, 0), 0);
49 switch(LOWORD(wParam
))
53 char file
[MAX_PATH
+ 1];
56 if(!DlgDirSelectEx(hwndDlg
, file
, MAX_PATH
, IDC_DIRS
))
58 GetCurrentDirectory(MAX_PATH
, selected
);
59 len
= strlen(selected
);
62 if(selected
[len
- 1] != '\\')
64 lstrcat(selected
, "\\");
66 lstrcat(selected
, file
);
67 EndDialog(hwndDlg
, IDC_OK
);
74 EndDialog(hwndDlg
, IDC_CANCEL
);
85 SendDlgItemMessage(hwndDlg
, IDC_DIRS
, LB_SETCOLUMNWIDTH
, 150, 0);
86 GetCurrentDirectory(MAX_PATH
, dir
);
87 DlgDirList(hwndDlg
, dir
, IDC_DIRS
, IDC_DIREDIT
, DDL_DIRECTORY
| DDL_DRIVES
);
88 SetFocus(GetDlgItem(hwndDlg
, IDC_DIRS
));
93 EndDialog(hwndDlg
, IDC_CANCEL
);
103 HINSTANCE hPrevInstance
,
107 char str
[MAX_PATH
+ 32];
108 if(DialogBox(hInstance
, MAKEINTRESOURCE(IDD_MAIN
), 0, DlgMainProc
) == IDC_OK
)
110 sprintf(str
, "You selected \"%s\"", selected
);
111 MessageBox(0, str
, "Selected file", MB_ICONINFORMATION
);