Ja, ich schaue mir das noch mal an, steige da gerade nicht mehr durch.
Beiträge von Hingo
-
-
Ich habe es jetzt so gemacht, ist das so wie du es meintest mir der GUI löschen?
Spoiler anzeigen
AutoIt
Alles anzeigenFunc Impressum() Const $SC_CLOSE1 = 0xF060 Const $MF_BYCOMMAND1 = 0x0 Const $MF_GRAYED1 = 0x1 Local $hGUI1 = GUICreate ("Impressum", 250, 300) GUIRegisterMsg($WM_SYSCOMMAND, "") $hMenu1 = DllCall("user32.dll", "hwnd", "GetSystemMenu", "hwnd", $hGUI1, "int", 0) DllCall("user32.dll", "hwnd", "EnableMenuItem", "hwnd", $hMenu1[0], "int", $SC_CLOSE1, "int", BitOR($MF_BYCOMMAND1, $MF_GRAYED1)) GUICtrlCreateLabel ("Entwickler: " &@CRLF& "Maurice Maréchal" &@CRLF& "Michael Knapik", 20, 40, $widthCell) GUICtrlCreateLabel ("Icon: " &@CRLF& "www.sitech-sitztechnik.de" , 20, 130, $widthCell) GUICtrlCreateLabel ("Version: 1.0.3.0", 20, 210, $widthCell) Local $idClose1 = GUICtrlCreateButton("Schließen", 20, 250, 85, 20) GUICtrlSetColor($idClose1, 0xF79434) GUICtrlSetBkColor($idClose1, 0x494949) GUISetBkColor(0xF79434) GUISetState(@SW_SHOW, $hGUI1) While GUIGetMsg() <> -3 WEnd GUIDelete($hGUI1) EndFunc
-
Aber wenn ich das richtig sehe und verstehe hast du die GUI doch am Ende gelöscht.
GUIDelete($hGUI1)
EndFunc -
Jo, danke.
Also brauche ich OnEventMode für den Schließen Button? -
Heyho, hab wieder ein Problem.
Ich habe ein Hauptfenster und möchte mit einem Button ein Impressum öffnen, dass funktioniert auch,
doch wenn ich das Impressum mit dem X schließe dann schließt sich auch das Hauptfenster. Der Schliessen Button im Impressum funkt auch nicht kann mir da jemand helfen?Und gibt es vielleicht eine Möglichkeit das Hauptfenster zu sperren wenn das Impressum geöffnet ist?
Edit: Das X habe ich jetzt auch deaktiviert.Spoiler anzeigen
AutoIt
Alles anzeigen#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_Comment=Video Converter only .avi to .mp4. #AutoIt3Wrapper_Res_Fileversion=1.1.0.0 #AutoIt3Wrapper_Res_Language=1031 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <GUIConstantsEx.au3> #include <GUIConstants.au3> #include <File.au3> Ordner () Func Ordner () Local $VideoConverter = @TempDir&"\Video_Converter" DirCreate ($VideoConverter) EndFunc $widthCell=300 Global $sFileOpenDialog Global $sFileSelectFolder Global $iDelete ChooseButton() Func ChooseButton() Const $SC_CLOSE = 0xF060 Const $MF_BYCOMMAND = 0x0 Const $MF_GRAYED = 0x1 ; Create a GUI with various controls. Local $hGUI = GUICreate("Video Converter", 430, 200, 750, 430) GUIRegisterMsg($WM_SYSCOMMAND, "") $hMenu = DllCall("user32.dll", "hwnd", "GetSystemMenu", "hwnd", $hGUI, "int", 0) DllCall("user32.dll", "hwnd", "EnableMenuItem", "hwnd", $hMenu[0], "int", $SC_CLOSE, "int", BitOR($MF_BYCOMMAND, $MF_GRAYED)) ; Create a button control. GUICtrlCreateLabel ("Bitte Datei auswählen: ", 20, 20, $widthCell) GUICtrlCreateLabel ("Bitte Ablageort für konvertierte Datei auswählen: ", 20, 80, $widthCell) Global $impressum = GUICtrlCreateButton ("Impressum", 30, 150, 80, 20) Global $convert = GUICtrlCreateButton ("Konvertieren", 315, 150, 85, 20) Local $chooseda = GUICtrlCreateButton("Quelle", 330, 40, 60, 20) Local $chooseor = GUICtrlCreateButton("Ziel", 330, 100, 60, 20) Local $idClose = GUICtrlCreateButton("Schließen", 170, 150, 85, 20) ;Set the GUI background color GUISetBkColor(0x826D50) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) Local $iPID = 0 Local $iPID1= 0 Local $iPID2= 0 Local $iPID3= 0 ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idClose ExitLoop Case $chooseda $iPID = _openVideoFile() Global $datei = GUICtrlCreateInput ( $sFileOpenDialog, 20, 40, 300,20) Case $chooseor $iPID1 = _FileSelectFolder() Global $ort = GuiCtrlCreateInput ( $sFileSelectFolder, 20, 100, 300, 20) Case $convert $iPID2 = Convert () Case $impressum $iPID3 = Impressum () EndSwitch WEnd GUIDelete($hGUI) ; Close the Exlporer process using the PID returned by Run. If $iPID1 Then ProcessClose($iPID1) EndFunc idClose() Func idclose() FileDelete(@TempDir&"\Video_Converter") EndFunc ;openVideoFile () Func _openVideoFile() ; Create a constant variable in Local scope of the message to display in FileOpenDialog. Local Const $sMessage = "Wähle Datei" ; Display an open dialog to select a list of file(s). $sFileOpenDialog = FileOpenDialog($sMessage, @WindowsDir & "\", "Videos (*.avi)", $FD_FILEMUSTEXIST + $FD_MULTISELECT) If @error Then MsgBox(4144,"Fehlermeldung", "Keine Datei gewählt!") ; Change the working directory (@WorkingDir) back to the location of the script directory as FileOpenDialog sets it to the last accessed folder. FileChangeDir(@ScriptDir) Else ; Change the working directory (@WorkingDir) back to the location of the script directory as FileOpenDialog sets it to the last accessed folder. FileChangeDir(@ScriptDir) EndIf EndFunc ;FileSelectFolder () Func _FileSelectFolder() Global $MyDocsFolder = "::{450D8FBA-AD25-11D0-98A8-0800361B1103}" $sFileSelectFolder = FileSaveDialog("Wähle Ordner", $MyDocsFolder, "Video (*.mp4)", 2) If @error Then MsgBox(4144,"Fehlermeldung", "Kein Ziel gewählt!") EndIf EndFunc ;Convert () Func Convert () Global $msg If $sFileOpenDialog = "" Then MsgBox(4144,"Fehlermeldung","Keine Datei gewählt!") ElseIf $sFileSelectFolder = "" Then MsgBox(4144,"Fehlermeldung", "Kein Ziel gewählt!") Else Run( @TempDir&"\Video_Converter\ffmpeg.exe -i """ &$sFileOpenDialog& """ -vcodec libx264 """ &$sFileSelectFolder& """") $msg = GUIGetMsg() GUICtrlDelete($datei) GUICtrlDelete($ort) EndIf EndFunc ;Impressum () Func Impressum() Const $SC_CLOSE = 0xF060 Const $MF_BYCOMMAND = 0x0 Const $MF_GRAYED = 0x1 Local $hGUI1 = GUICreate ("Impressum", 250, 300) GUIRegisterMsg($WM_SYSCOMMAND, "") $hMenu = DllCall("user32.dll", "hwnd", "GetSystemMenu", "hwnd", $hGUI1, "int", 0) DllCall("user32.dll", "hwnd", "EnableMenuItem", "hwnd", $hMenu[0], "int", $SC_CLOSE, "int", BitOR($MF_BYCOMMAND, $MF_GRAYED)) GUICtrlCreateLabel ("Entwickler: " &@CRLF& "fg" &@CRLF& "Mfg", 20, 40, $widthCell) GUICtrlCreateLabel ("Icon: " &@CRLF& "fg" , 20, 130, $widthCell) GUICtrlCreateLabel ("Version: 1.0.3.0", 20, 210, $widthCell) Local $idClose1 = GUICtrlCreateButton("Schließen", 20, 250, 85, 20) Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idClose1 EndSwitch GUISetBkColor(0x826D50) GUISetState(@SW_SHOW, $hGUI1) EndFunc
-
Versuchs mal mit nem Minimize:
WinSetState ( "title", "text", flag ) -
Ich bin mir sicher das ich das von einem anderen Forum habe, kann sein das derjenige, das dann von dir genommen hat.
Tut mir aber trotzdem leid. -
Ich habe die Beispiele von der AutoIt.de online Hilfe genommen.
-
-
Ah OK wusste ich nicht, mein Nachschlagewerk schreibe ich eig. auch nur so für mich um nicht immer online gehen zu müssen, und da hab ich mir jetzt mal gedacht dann kann ich das auch online stellen.
-
?Welches meinst du, du hast meins verlinkt?
-
Moin Leute,
ich habe mich mal an einem Nachschlagewerk für AutoIt gemacht.
Ich hoffe es gefällt euch, Kritik und Anregungen sind gerne gesehen auch wenn ihr noch Ideen habt welche wichtigen Funktionen noch unbedingt rein müssen.
Ich bastle selber noch immer weiter dran, wenn ich Zeit habe. -
Moin,
was soll denn in Konfignummer und Hauptbenutzer rein? -
Geht das wenn du #Requira Admin drin lässt, das Skript dann compilierst und du das Programm als Admin startest?
-
Moin, ich hab das Thema doch schon als erledigt markiert.
Und bei dem anderen Thema ist noch eine Frage offen (der letzte Beitrag von mir). -
Jo perfekt.
Danke an euch. -
-
Moin,
mein Problem ist Folgendes.
Mein Skript generiert eine PDF Datei, die BPCS Checkliste heißt, jetzt soll hinter dem Namen noch die MacAdresse des Computers stehen.
Die MacAdresse wird im Programm selber schon ausgewertet.AutoIt
Alles anzeigen#include <Date.au3> #include <MPDF_UDF.au3> #include <File.au3> $dir = "C:\logs\" $file1 = "C:\logs\BPCS Checkliste__.txt" $file2 = "C:\logs\BPCS Checkliste_.txt" $getmac = "C:\logs\BPCS Checkliste.txt" If Not FileExists($dir) Then DirCreate ($dir) FileOpen($file1, 2) FileWrite($file1," BPCS Checkliste"&@CRLF) FileWrite($file1," ================================================================"&@CRLF) FileWrite($file1, " Current Date: " & _NowDate()&@CRLF) FileWrite($file1, " Current Time: " & _NowTime()&@CRLF) FileWrite($file1, ""&@CRLF) FileWrite($file1, " **************************************Computer Data***************************************"&@CRLF) FileWrite($file1, " Serial number:"&@CRLF) Global $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") Global $colAdapters = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration") $str = "" For $objAdapter in $colAdapters If $objAdapter.MacAddress = Null Then Else FileWrite($file1, " Physicaladdress: " & $objAdapter.MacAddress &@CRLF) EndIf Next FileOpen($getmac, 2) FileWrite($getmac, FileRead($file1) & @CRLF & FileRead($file2)) FileClose($file2) FileClose($getmac) #cs ====================================================================================================================================================================================================== ;Einstellungen für die PDF Erstellung ====================================================================================================================================================================================================== #ce _SetTitle("BPCS Checkliste") _SetSubject("BPCS Checkliste to pdf") _SetKeywords("pdf, AutoIt") _OpenAfter(True);PDF nach Erstellung öffnen _SetUnit($PDF_UNIT_CM) _SetPaperSize("A4") _SetZoomMode($PDF_ZOOM_CUSTOM, 70) _SetOrientation($PDF_ORIENTATION_PORTRAIT) _SetLayoutMode($PDF_LAYOUT_CONTINOUS) ;initialize the pdf _InitPDF("C:\logs\BPCS Checkliste.pdf") _LoadFontTT("F1", $PDF_FONT_NORMAL) _Txt2PDF($getmac, "F1") ;write the buffer to disk _ClosePDFFile() #cs #FUNCTION# =========================================================================================================================================================================================== Name ..........: _Txt2PDF Description ...: Convert a text file to pdf ====================================================================================================================================================================================================== #ce Func _Txt2PDF($sFile, $sFontAlias) Local $hFile = FileOpen($sFile) Local $sText = FileRead($hFile) FileClose($hFile) Local $iUnit = Ceiling(_GetUnit()) Local $iX = 2 Local $iY = Ceiling(_GetPageHeight() / _GetUnit()) - 1.5 Local $iPagina = Ceiling(_GetPageWidth() / $iUnit) - $iX Local $iWidth = Ceiling($iPagina - $iX) Local $lScale Local $iRanduri = StringSplit($sText & @CRLF & @CRLF & @CRLF & @CRLF, @CRLF, 3) Local $iHR = 0.5 * Ceiling($iY / (10 * $iUnit)) Local $iPages = Ceiling((UBound($iRanduri)) * $iHR / $iY) Local $iNrRanduri = Ceiling(UBound($iRanduri) / $iPages-2) Local $nrp For $j = 0 To $iPages + 2 $nrp = _BeginPage() _DrawText(_GetPageWidth()/_GetUnit()-1, 1, $nrp, "F1", 10, $PDF_ALIGN_CENTER) For $i = 0 To $iNrRanduri - 1 Local $sLength = Round(_GetTextLength($iRanduri[$i + $j * $iNrRanduri], $sFontAlias, 10)) Local $iH = $iY - $iHR * ($i + 1) Select Case $iH < 1 _EndPage() Case $i + $j * $iNrRanduri = UBound($iRanduri) - 1 _EndPage() Return Case $sLength > $iWidth - 1 $lScale = Ceiling($iWidth * 100 / $sLength) _SetTextHorizontalScaling($lScale) _DrawText($iX, $iH, $iRanduri[$i + $j * $iNrRanduri], $sFontAlias, 10, $PDF_ALIGN_LEFT, 0) _SetTextHorizontalScaling(100) Case Else _DrawText($iX, $iH, $iRanduri[$i + $j * $iNrRanduri], $sFontAlias, 10, $PDF_ALIGN_LEFT, 0) EndSelect Next _EndPage() Next EndFunc ;==>_Txt2PDF FileDelete($file1) FileDelete($file2) FileDelete($getmac)
Vielleicht könnt ihr mir helfen.
-
Ich muss euch noch mal nerven.
Wenn er mir die PDF erstellt habe ich immer 2 Seiten, gibt es da ne Möglichkeit, das er nur eine Seite erstellt?Edit: Kann es sein das es in der UDF festgelegt ist wie viele Seiten erstellt werden?
-
werde ich mir angucken, habe jetzt Feierabend, aber auf den ersten Blick sieht es gut aus.