![]() ![]() ![]() Expand collapse popup #include #include #include #include Global $dropFile_1, $dropFile_2 GuiCreate ( 'Drag and Drop', 530, 120, / 2 - 192, _ / 2 - 235, - 1, $WS_EX_ACCEPTFILES ) GUICtrlCreateGroup ( "Dict Files", 5, 5, 510, 90 ) GUICtrlCreateLabel ( 'File 1:', 20, 30 ) $dropFile_1 = GUICtrlCreateInput ( "", 80, 30, 400, 20, - 1, $WS_EX_STATICEDGE ) GUICtrlSetState ( - 1, $GUI_DROPACCEPTED ) GUICtrlSetTip ( - 1, 'You can drag & drop files here.' ) GUICtrlCreateLabel ( 'File 2:', 20, 60 ) $dropFile_2 = GUICtrlCreateInput ( "", 80, 60, 400, 20, - 1, $WS_EX_STATICEDGE ) GUICtrlSetState ( - 1, $GUI_DROPACCEPTED ) GUICtrlSetTip ( - 1, 'You can drag & drop files here.' ) GuiSetState ( ) Loop GUI While 1 $msg = GuiGetMsg ( ) Select Case $msg = $GUI_EVENT_CLOSE GUIDelete ( ) ExitLoop Case $msg = $GUI_EVENT_DROPPED If = $dropFile_1 Then GUICtrlSetData ( $dropFile_1, ) ElseIf = $dropFile_2 Then GUICtrlSetData ( $dropFile_2, ) EndIf EndSelect WEnd ExitÄ®xpand collapse popup #include #include #include #include Global $dropFile_1, $dropFile_2, $label GuiCreate ( 'Drag and Drop', 530, 120, / 2 - 192, _ / 2 - 235, - 1, $WS_EX_ACCEPTFILES + $WS_EX_TOPMOST ) GUICtrlCreateGroup ( "Dict Files", 5, 5, 510, 90 ) GUICtrlCreateLabel ( 'File 1:', 20, 30 ) $dropFile_1 = GUICtrlCreateInput ( "", 80, 30, 400, 20, - 1 ) GUICtrlSetState ( $dropFile_1, $GUI_DROPACCEPTED ) GUICtrlSetTip ( $dropFile_1, 'You can drag & drop files here.' ) GUICtrlCreateLabel ( 'File 2:', 20, 60 ) $dropFile_2 = GUICtrlCreateInput ( "", 80, 60, 400, 20, - 1 ) GUICtrlSetState ( $dropFile_2, $GUI_DROPACCEPTED ) GUICtrlSetTip ( $dropFile_2, 'You can drag & drop files here.' ) $label = GUICtrlCreateLabel ( '', 0, 0, 530, 120 ) GUICtrlSetBkColor ( $label, $GUI_BKCOLOR_TRANSPARENT ) GUICtrlSetState ( $label, $GUI_DROPACCEPTED ) GuiSetState ( ) Loop GUI While 1 $msg = GuiGetMsg ( ) Select Case $msg = $GUI_EVENT_CLOSE GUIDelete ( ) ExitLoop Case $msg = $GUI_EVENT_DROPPED If = $dropFile_1 Then GUICtrlSetData ( $dropFile_1, ) ElseIf = $dropFile_2 Then GUICtrlSetData ( $dropFile_2, ) Else If = $label Then MsgBox ( 262144, "Drop Result", ) EndIf EndSelect WEnd ExitÄrag to anywhere but the two Inputs and the MsgBox will popup with file path. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |