Originally posted by DorianDarby:
The problem is that the listview cannot be the same size as the form
The problem is that the listview cannot be the same size as the form
I added some buttons/textboxes to make my idea more clear.
Drag&Drop zone is ListView' area only.
Code:
#Compile Exe #Register None #Dim All #Include "WIN32API.INC" #Include "COMMCTRL.INC" Global hDlgMain As Long, hDlg As Long CallBack Function DlgProc Static iFile As Long, nFile As Long, TmpAsciiz As Asciiz * %MAX_PATH Select Case CbMsg Case %WM_DROPFILES nFile = DragQueryFile (CbWparam, -1, ByVal 0, 0) For iFile = 0 To nFile - 1 DragQueryFile CbWparam, iFile, TmpAsciiz, SizeOf(TmpAsciiz) MsgBox TmpAsciiz Next DragFinish CbWparam Case %WM_INITDIALOG: DragAcceptFiles CbHndl, %True Case %WM_DESTROY: DragAcceptFiles CbHndl, %False End Select End Function Function PbMain()As Long InitCommonControls Dialog New 0,"Drag and drop", , , 300, 250,%WS_SYSMENU Or %WS_CAPTION Or %WS_THICKFRAME Or %DS_CENTER, To hDlgMain Control Add TextBox, hDlgMain, 102, "", 10, 5, 280, 15, , %WS_EX_CLIENTEDGE Control Add TextBox, hDlgMain, 103, "", 10, 30, 280, 15, , %WS_EX_CLIENTEDGE Control Add Button, hDlgMain, 104, "Button1", 10, 215, 120, 15 Control Add Button, hDlgMain, 105, "Button2", 170, 215, 120, 15 Dialog New hDlgMain, "", 10, 75, 280, 120, %WS_CHILD To hDlg Control Add "SysListView32", hDlg, 101, "", 0, 0, 280, 120, %WS_CHILD Or %WS_VISIBLE, %WS_EX_CLIENTEDGE Dialog Show Modeless hDlg Call DlgProc Dialog Show Modal hDlgMain End Function
Leave a comment: