et autres....
Code : Tout sélectionner
#NoTrayIcon
#include <WindowsConstants.au3>
#include <GUIConstants.au3>
Opt("MustDeclareVars", 0) ;0=no, 1=require pre-declaration
Global $assets = @ScriptDir & "\Assets\"
Global $ui_width = 800 ;Universal (try change to some)
Global $ui_height = 600
Global $left_margin = 20
Global $top_margin = 20
Global $cUI = 0x318CE7, $cContent = 0xEEEEEE, $cSearch = 0x6A1B9A ;colors
Global $ui = GUICreate("PDF TO DOCX", $ui_width, $ui_height, Default, Default, $WS_POPUP, $WS_EX_CONTROLPARENT)
GUISetBkColor($cUI, $ui)
Global $Button1 = GUICtrlCreateButton("* * * * * PDF TO DOCX * * * * *", 250, 40, 315, 55)
GUICtrlSetFont(-1, 10, 800, Default, "Segoe UI", 5)
Global $Button2 = GUICtrlCreateButton("SELECTIONNER PDF", 35, 260, 215, 35)
GUICtrlSetFont(-1, 10, 800, Default, "Segoe UI", 5)
Global $Button3 = GUICtrlCreateButton("CONVERTIR", 108, 500, 70, 20)
GUISetState(@SW_SHOW)
Global $Button4 = GUICtrlCreateButton("REDUIRE", 408, 500, 70, 20)
GUICtrlSetFont(-1, 10, 800, Default, "Segoe UI", 5)
Global $Button5 = GUICtrlCreateButton("FERMER", 499, 500, 70, 20)
GUICtrlSetFont(-1, 10, 800, Default, "Segoe UI", 5)
$Input_1 = GUICtrlCreateInput("", 35, 300, 370, 20)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE Or $msg = $Button5
Exit
Case $msg = $Button2
$path = FileOpenDialog("Add File", "", "PDF Files (*.pdf)",1+2)
If @error Then
MsgBox(4096,"","PAS DE FICHIER CHOISI")
Else
GUICtrlSetData($Input_1, $path)
EndIf
Case $msg = $Button3
If GUICtrlRead($Input_1) = "" Then
MsgBox(16,"Attention", "VOUS DEVEZ CHOISIR UN FICHIER")
Else
$sFile = GUICtrlRead($Input_1)
$sPath = StringRegExp($sFile, "(.*[\\]+)",3)
MsgBox(0,"",$sPath[0]) ; pour voir à supprimer
ShellExecute (@ScriptDir & "\PDFConverter64.exe",$sFile & " " & $sPath[0] & " -c DOCX -s","TEST.DOCX")
Endif
Case $msg = $Button4
GUISetState(@SW_MINIMIZE)
EndSelect
Wend