' Add the drives
...
...then adding folders
...
.. and finaly the files...
...
...then adding folders
...
.. and finaly the files...
MCM
#Compile Exe #Include "Win32api.inc" %IDC_LABEL = 1249 %IDC_LISTBOX1 = 1250 %IDC_LISTBOX2 = 1251 Function WndProc(ByVal hWnd As Long,ByVal wMsg As Long,ByVal wParam As Long,ByVal lParam As Long) As Long Select Case wMsg Case %WM_CREATE Register i As Long Local szDir As Asciiz*128,szString As Asciiz*128 Local hListBox1,hListBox2,hLabel,hIns,dwCount As Dword hIns=GetWindowLong(hWnd,%GWL_HINSTANCE) szDir="C:\*.*" hLabel=CreateWindow("static","",%WS_CHILD Or %WS_VISIBLE,10,5,300,23,hWnd,%IDC_LABEL,hIns,ByVal 0) hListBox1=CreateWindow("listbox","",%WS_CHILD,0,0,0,0,hWnd,%IDC_LISTBOX1,hIns,ByVal 0) hListBox2=CreateWindow("listbox","",%WS_CHILD Or %WS_VISIBLE Or %WS_BORDER Or %WS_VSCROLL,10,30,250,250,hWnd,%IDC_LISTBOX2,hIns,ByVal 0) Call DlgDirList(hWnd,szDir,%IDC_LISTBOX1,%IDC_LABEL,%DDL_DRIVES) dwCount=SendMessage(hListBox1,%LB_GETCOUNT,0,0) For i=1 To dwCount Call SendMessage(hListBox1,%LB_GETTEXT,i-1,VarPtr(szString)) Call SendMessage(hListBox2,%LB_ADDSTRING,0,VarPtr(szString)) Next i Call SendMessage(hListBox1,%LB_RESETCONTENT,0,0) Call DlgDirList(hWnd,szDir,%IDC_LISTBOX1,%IDC_LABEL,%DDL_DIRECTORY) dwCount=SendMessage(hListBox1,%LB_GETCOUNT,0,0) For i=1 To dwCount Call SendMessage(hListBox1,%LB_GETTEXT,i-1,VarPtr(szString)) If InStr(szString,"[") Then Call SendMessage(hListBox2,%LB_ADDSTRING,0,VarPtr(szString)) End If Next i WndProc=0 Exit Function Case %WM_DESTROY Call PostQuitMessage(0) WndProc=0 Exit Function End Select WndProc=DefWindowProc(hWnd, wMsg, wParam, lParam) End Function Function WinMain(ByVal hIns As Long,ByVal hPrev As Long,ByVal lpCL As Asciiz Ptr,ByVal iShow As Long) As Long Local winclass As WndClassEx Local szAppName As Asciiz * 20 Local hMainWnd As Dword Local Msg As tagMsg szAppName="GetDlgDir" winclass.cbSize=SizeOf(winclass) winclass.style=%CS_HREDRAW Or %CS_VREDRAW winclass.lpfnWndProc=CodePtr(WndProc) winclass.cbClsExtra=0 winclass.cbWndExtra=0 winclass.hInstance=hIns winclass.hIcon=LoadIcon(%NULL, ByVal %IDI_APPLICATION) winclass.hCursor=LoadCursor(%NULL, ByVal %IDC_ARROW) winclass.hbrBackground=%COLOR_BTNFACE+1 winclass.lpszMenuName=%NULL winclass.lpszClassName=VarPtr(szAppName) Call RegisterClassEx(winclass) hMainWnd=CreateWindow(szAppName,szAppName,%WS_OVERLAPPEDWINDOW,200,100,320,340,0,0,hIns,ByVal 0) Call ShowWindow(hMainWnd,iShow) While GetMessage(Msg,%NULL,0,0) TranslateMessage Msg DispatchMessage Msg Wend Function=msg.wParam End Function
#Compile Exe #Include "Win32api.inc" %IDC_LABEL = 1249 %IDC_LISTBOX1 = 1250 %IDC_LISTBOX2 = 1251 Function WndProc(ByVal hWnd As Long,ByVal wMsg As Long,ByVal wParam As Long,ByVal lParam As Long) As Long Select Case wMsg Case %WM_CREATE Register i As Long Local szDir As Asciiz*128,szString As Asciiz*128 Local hListBox1,hListBox2,hLabel,hIns,dwCount As Dword hIns=GetWindowLong(hWnd,%GWL_HINSTANCE) szDir="C:\*.*" hLabel=CreateWindow("static","",%WS_CHILD Or %WS_VISIBLE,10,5,300,23,hWnd,%IDC_LABEL,hIns,ByVal 0) hListBox1=CreateWindow("listbox","",%WS_CHILD Or %WS_VISIBLE Or %WS_BORDER Or %WS_VSCROLL,10,30,250,250,hWnd,%IDC_LISTBOX1,hIns,ByVal 0) hListBox2=CreateWindow("listbox","",%WS_CHILD Or %WS_VISIBLE Or %WS_BORDER Or %WS_VSCROLL,275,30,250,250,hWnd,%IDC_LISTBOX2,hIns,ByVal 0) Call DlgDirList(hWnd,szDir,%IDC_LISTBOX1,%IDC_LABEL,%DDL_DRIVES Or %DDL_DIRECTORY) dwCount=SendMessage(hListBox1,%LB_GETCOUNT,0,0) For i=1 To dwCount Call SendMessage(hListBox1,%LB_GETTEXT,i-1,VarPtr(szString)) If InStr(szString,"[") Then Call SendMessage(hListBox2,%LB_ADDSTRING,0,VarPtr(szString)) End If Next i WndProc=0 Exit Function Case %WM_DESTROY Call PostQuitMessage(0) WndProc=0 Exit Function End Select WndProc=DefWindowProc(hWnd, wMsg, wParam, lParam) End Function Function WinMain(ByVal hIns As Long,ByVal hPrev As Long,ByVal lpCL As Asciiz Ptr,ByVal iShow As Long) As Long Local winclass As WndClassEx Local szAppName As Asciiz * 20 Local hMainWnd As Dword Local Msg As tagMsg szAppName="GetDlgDir" winclass.cbSize=SizeOf(winclass) winclass.style=%CS_HREDRAW Or %CS_VREDRAW winclass.lpfnWndProc=CodePtr(WndProc) winclass.cbClsExtra=0 winclass.cbWndExtra=0 winclass.hInstance=hIns winclass.hIcon=LoadIcon(%NULL, ByVal %IDI_APPLICATION) winclass.hCursor=LoadCursor(%NULL, ByVal %IDC_ARROW) winclass.hbrBackground=%COLOR_BTNFACE+1 winclass.lpszMenuName=%NULL winclass.lpszClassName=VarPtr(szAppName) Call RegisterClassEx(winclass) hMainWnd=CreateWindow(szAppName,szAppName,%WS_OVERLAPPEDWINDOW,200,100,545,380,0,0,hIns,ByVal 0) Call ShowWindow(hMainWnd,iShow) While GetMessage(Msg,%NULL,0,0) TranslateMessage Msg DispatchMessage Msg Wend Function=msg.wParam End Function
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: