Jump to content

Drag and Drop not working


Recommended Posts

In my script the drag n drop is not working?

can anybody give me ahint on this please?? :evil:;)

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt('MustDeclareVars', 1)
#Region ### START Koda GUI section ### Form=
Dim $Form1
Dim $Button1
Global $Input2
Global $Input1
Global $Label1
Global $Label2
Global $nMsg,$exists,$malwares,$threatFolder,$readFile,$writeFile,$temp,$dirN,$getFilename,$justFile,$filePath
$Form1 = GUICreate("KAV Scan Automator", 310, 181, 192, 114)
GUISetBkColor(0xA6CAF0)
$Input1 = GUICtrlCreateInput("Drag n Drop the folder", 104, 40, 161, 21)
GUICtrlSetState($Input1, $GUI_DROPACCEPTED)
$Input2 = GUICtrlCreateInput("Drag n Drop the folder", 104, 80, 161, 21)
GUICtrlSetState($Input2, $GUI_DROPACCEPTED)
$Label1 = GUICtrlCreateLabel("Source", 16, 40, 50, 24)
GUICtrlSetFont(-1, 12, 400, 0, "Impact")
$Label2 = GUICtrlCreateLabel("Destination", 16, 80, 79, 24)
GUICtrlSetFont(-1, 12, 400, 0, "Impact")
$Button1 = GUICtrlCreateButton("Go!!!", 112, 136, 75, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

--Update:

I got it. I had to change the gui creation code to

$Form1 = GUICreate("KAV Scan Automator", 310, 181, 192, 114 , -1 , 0x00000018 ) ; 0x00000018 for accepting folders)

but i dont hv any idea why that number was added.

I have done this in one of my previous script also.

so can anybody please tell me why is this??

Edited by obscurant1st
Link to comment
Share on other sites

In my script the drag n drop is not working?

can anybody give me ahint on this please?? :evil:;)

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt('MustDeclareVars', 1)
#Region ### START Koda GUI section ### Form=
Dim $Form1
Dim $Button1
Global $Input2
Global $Input1
Global $Label1
Global $Label2
Global $nMsg,$exists,$malwares,$threatFolder,$readFile,$writeFile,$temp,$dirN,$getFilename,$justFile,$filePath
$Form1 = GUICreate("KAV Scan Automator", 310, 181, 192, 114)
GUISetBkColor(0xA6CAF0)
$Input1 = GUICtrlCreateInput("Drag n Drop the folder", 104, 40, 161, 21)
GUICtrlSetState($Input1, $GUI_DROPACCEPTED)
$Input2 = GUICtrlCreateInput("Drag n Drop the folder", 104, 80, 161, 21)
GUICtrlSetState($Input2, $GUI_DROPACCEPTED)
$Label1 = GUICtrlCreateLabel("Source", 16, 40, 50, 24)
GUICtrlSetFont(-1, 12, 400, 0, "Impact")
$Label2 = GUICtrlCreateLabel("Destination", 16, 80, 79, 24)
GUICtrlSetFont(-1, 12, 400, 0, "Impact")
$Button1 = GUICtrlCreateButton("Go!!!", 112, 136, 75, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

From Helpfile (GUICtrlCreateInput page):

If you want to drag & drop a filename onto this control just add the WS_EX_ACCEPTFILES extended style on the GUICreate() and set the state to $GUI_DROPACCEPTED.

So, edit:

$Form1 = GUICreate("KAV Scan Automator", 310, 181, 192, 114, -1, $WS_EX_ACCEPTFILES )
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...