Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/19/2020 in all areas

  1. Start by studying the one that’s already written
    2 points
  2. InetRead reads correctly the source code of the page The mentioned links are relative, for example this link : ../date/2020/html/index_include.en.html is in fact : https://www.ecb.europa.eu/press/pr/date/2020/html/index_include.en.html
    1 point
  3. Use GUISwitch($hGui, $hTab0) to select a tab which will get the items, then add as many items to the tab, as needed, then use the GUICtrlCreateTabItem("") to stop adding items. #include <GUIConstantsEx.au3> Example() Func Example() Global $hTab, $hTabActive $hGui = GUICreate("My GUI Tab") GUISetBkColor(0x00E0FFFF) GUISetFont(9, 300) $hTab = GUICtrlCreateTab(10, 10, 380, 256) $hTab0 = GUICtrlCreateTabItem("tab----0") GUICtrlCreateLabel("label0", 30, 80, 50, 20) GUICtrlCreateButton("OK0", 20, 50, 50, 20) GUICtrlCreateInput("default", 80, 50, 70, 20) $hTab1 = GUICtrlCreateTabItem("tab----1") GUICtrlCreateLabel("label1", 30, 80, 50, 20) GUICtrlCreateCombo("", 20, 50, 60, 120) GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo|guinness", "Jon") GUICtrlCreateButton("OK1", 80, 50, 50, 20) $hTab2 = GUICtrlCreateTabItem("tab----2") GUICtrlSetState(-1, $GUI_SHOW) GUICtrlCreateLabel("label2", 30, 80, 50, 20) GUICtrlCreateButton("OK2", 140, 50, 50) GUICtrlCreateTabItem("") Local $idButtonAdd = GUICtrlCreateButton("Add", 20, 296, 75, 35) GUISetState(@SW_SHOW) Local $idMsg While 1 $idMsg = GUIGetMsg() If $idMsg = $GUI_EVENT_CLOSE Then ExitLoop If $idMsg = $idButtonAdd Then ;$hTabActive = GUICtrlRead($hTab) GUISwitch($hGui, $hTab2) Local $idDate_Tab2 = GUICtrlCreateMonthCal("2048/03/25", 20, 175, 160, 35, -1, -1) ;want to create a MonthCal Control within TabItem 'tab----2' GUICtrlCreateTabItem("") GUISwitch($hGui, $hTab1) Local $idLabl_Tab1 = GUICtrlCreateEdit("Test", 35, 120, 240, 30) ;want to create a Label Control within TabItem 'tab----1' GUICtrlCreateTabItem("") GUISwitch($hGui, $hTab0) Local $idLabl_Tab0 = GUICtrlCreateIcon("shell32.dll", 310, 285, 225) ;want to create an Icon Control within TabItem 'tab----0' GUICtrlCreateTabItem("") EndIf WEnd EndFunc ;==>Example
    1 point
  4. Well the clue is in the first line of the following. $now = StringSplit($now, " ", 1) If $now[0] = 2 Then $time = $now[2] $now = $now[1] Else $time = "" $now = "" EndIf That space is the divider between DATE and TIME, probably as returned by the _Now() function. So have a try with $now = _Now() before that line ... or replace $now with _Now() $now = StringSplit(_Now(), " ", 1) Don't ask me why I am using $now instead of $date, but I imagine $date is in use as a variable elsewhere in my script.
    1 point
  5. Anything is possible in AutoIt3Wrapper, so in the past 15 years this hasn't come up as an issue but obviously it is possible to add an #directive what to do in case of resource update issues. by the way: All AutoIt3Wrapper does is add the /icon parameter to the aut2exe commandline when a file is provided that exists: If $INP_Icon <> "" Then $s_CMDLine &= ' /icon "' & $INP_Icon & '"' Jos
    1 point
  6. You can't at the moment, but doesn't it just skip the update of the ICO all together and leave as it would be when you didn't provide this directive? AutoIt3Wrapper also shows an error as you can see in the post. Jos
    1 point
  7. I got an error message using #pragma compile(Icon, wrong.ico) Saludos
    1 point
  8. You could use function _OL_RecipientFreeBusyGet to get the free/busy time information for a user (even for yourself).
    1 point
  9. The shortcut with the icon is now default. If you don't like the shortcuts, just delete them. New version is in the first post. @Borje Just send me a virtual cup of coffee or click the like/thanks at the rigth side. 😀
    1 point
  10. You can convert images into base64 strings and embed them directly into the HTML code. I do it for some HTML reports but my code is very specific to my reports. Search for Base64 html images Maybe this one:
    1 point
  11. Synthesis

    FTP.au3 (GUI)

    After I saw w0uter's ftp function, I've thought it is a good idea to create a GUI for it. #include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) opt('trayiconhide',1) Local $filemenu, $fileitem, $recentfilesmenu, $separator1, $upd, $fu, $fp, $fs Local $exititem, $helpmenu, $aboutitem, $okbutton, $cancelbutton, $open, $ff, $path2 Local $msg, $file, $file2, $fileu, $server, $username, $password, $conn, $path #forceref $separator1 GUICreate("FTP GUI Client 1.0", 300, 250) $filemenu = GUICtrlCreateMenu("File") $fileitem = GUICtrlCreateMenuItem("Add file", $filemenu) $recentfilesmenu = GUICtrlCreateMenu("Recent files", $filemenu) $separator1 = GUICtrlCreateMenuItem("", $filemenu) $exititem = GUICtrlCreateMenuItem("Exit", $filemenu) $helpmenu = GUICtrlCreateMenu("Help") $aboutitem = GUICtrlCreateMenuItem("About", $helpmenu) guictrlcreatelabel ("File: ",15,20) $fileu = guictrlcreateinput ("To add file, click on File>Add file",60,15,220,20) guictrlcreatelabel ("Server: ",15,50) $server = guictrlcreateinput ("ftp.example.com",60,45,220,20,0x1) guictrlcreatelabel ("Name: ",15,80) $username = guictrlcreateinput ("Admin",60,75,220,20,0x1) guictrlcreatelabel ("Pass: ",15,110) $password = guictrlcreateinput ("password",60,105,220,20,0x21) guictrlcreatelabel ("Ftp path:",15,140) $path = guictrlcreateinput ("/public_html/uploaded.exe",60,140,220,20,0x1) $okbutton = GUICtrlCreateButton("Upload file", 115, 180, 70, 20) $upd = guictrlcreatelabel ("Status: Idle",0,210,300,20,0x1000) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $fileitem $file = FileOpenDialog("Choose file to upload", @TempDir, "All (*.*)") If @error <> 1 Then GUICtrlCreateMenuItem($file, $recentfilesmenu) guictrlsetdata ($fileu, $file) guictrlsetdata ($upd, "Status: A new file has been added.") Case $msg = $exititem ExitLoop Case $msg = $okbutton _ftp() Case $msg = $aboutitem MsgBox(64, "About", "FTP GUI Client 1.0" & @crlf & "GUI by KaZo" & @crlf & "FTP function by w0uter") EndSelect WEnd GUIDelete() Exit func _ftp() guictrlsetdata ($upd, "Status: Reading...") $ff = guictrlread ($fileu) if $ff = "To add file, click on File>Add file" Then guictrlsetdata ($upd, "Error: Invalid file") else $fs = guictrlread ($server) $fu = guictrlread ($username) $fp = guictrlread ($password) $path2 = guictrlread ($path) $open = _FTPOpen('FTP connection') $conn = _FTPConnect($open, $fs, $fu, $fp) _FtpPutFile($conn, $ff, $path2) _FTPClose($open) endif if @error then guictrlsetdata ($upd,"Error: Failed to upload.") else guictrlsetdata ($upd, "Status: File succesfully uploaded") endif endfunc ;=============================================================================== ; ; Function Name: _FTPOpen() ; Description: Opens an FTP session. ; Parameter(s): $s_Agent - Random name. ( like "myftp" ) ; $l_AccessType - I dont got a clue what this does. ; $s_ProxyName - ProxyName. ; $s_ProxyBypass - ProxyByPasses's. ; $l_Flags - Special flags. ; Requirement(s): DllCall, wininet.dll ; Return Value(s): On Success - Returns an indentifier. ; On Failure - 0 and sets @ERROR ; Author(s): Wouter van Kesteren. ; ;=============================================================================== Func _FTPOpen($s_Agent, $l_AccessType = 1, $s_ProxyName = '', $s_ProxyBypass = '', $l_Flags = 0) Local $ai_InternetOpen = DllCall('wininet.dll', 'long', 'InternetOpen', 'str', $s_Agent, 'long', $l_AccessType, 'str', $s_ProxyName, 'str', $s_ProxyBypass, 'long', $l_Flags) If @error OR $ai_InternetOpen[0] = 0 Then SetError(-1) Return 0 EndIf Return $ai_InternetOpen[0] EndFunc ;==> _FTPOpen() ;=============================================================================== ; ; Function Name: _FTPConnect() ; Description: Connects to an FTP server. ; Parameter(s): $l_InternetSession - The Long from _FTPOpen() ; $s_ServerName - Server name/ip. ; $s_Username - Username. ; $s_Password - Password. ; $i_ServerPort - Server port ( 0 is default (21) ) ; $l_Service - I dont got a clue what this does. ; $l_Flags - Special flags. ; $l_Context - I dont got a clue what this does. ; Requirement(s): DllCall, wininet.dll ; Return Value(s): On Success - Returns an indentifier. ; On Failure - 0 and sets @ERROR ; Author(s): Wouter van Kesteren ; ;=============================================================================== Func _FTPConnect($l_InternetSession, $s_ServerName, $s_Username, $s_Password, $i_ServerPort = 0, $l_Service = 1, $l_Flags = 0, $l_Context = 0) Local $ai_InternetConnect = DllCall('wininet.dll', 'long', 'InternetConnect', 'long', $l_InternetSession, 'str', $s_ServerName, 'int', $i_ServerPort, 'str', $s_Username, 'str', $s_Password, 'long', $l_Service, 'long', $l_Flags, 'long', $l_Context) If @error OR $ai_InternetConnect[0] = 0 Then SetError(-1) Return 0 EndIf Return $ai_InternetConnect[0] EndFunc ;==> _FTPConnect() ;=============================================================================== ; ; Function Name: _FTPPutFile() ; Description: Puts an file on an FTP server. ; Parameter(s): $l_FTPSession - The Long from _FTPConnect() ; $s_LocalFile - The local file. ; $s_RemoteFile - The remote Location for the file. ; $l_Flags - Special flags. ; $l_Context - I dont got a clue what this does. ; Requirement(s): DllCall, wininet.dll ; Return Value(s): On Success - 1 ; On Failure - 0 ; Author(s): Wouter van Kesteren ; ;=============================================================================== Func _FTPPutFile($l_FTPSession, $s_LocalFile, $s_RemoteFile, $l_Flags = 0, $l_Context = 0) Local $ai_FTPPutFile = DllCall('wininet.dll', 'int', 'FtpPutFile', 'long', $l_FTPSession, 'str', $s_LocalFile, 'str', $s_RemoteFile, 'long', $l_Flags, 'long', $l_Context) If @error OR $ai_FTPPutFile[0] = 0 Then SetError(-1) Return 0 EndIf Return $ai_FTPPutFile[0] EndFunc ;==> _FTPPutFile() ;=============================================================================== ; ; Function Name: _FTPDelFile() ; Description: Delete an file from an FTP server. ; Parameter(s): $l_FTPSession - The Long from _FTPConnect() ; $s_RemoteFile - The remote Location for the file. ; Requirement(s): DllCall, wininet.dll ; Return Value(s): On Success - 1 ; On Failure - 0 ; Author(s): Wouter van Kesteren ; ;=============================================================================== Func _FTPDelFile($l_FTPSession, $s_RemoteFile) Local $ai_FTPPutFile = DllCall('wininet.dll', 'int', 'FtpDeleteFile', 'long', $l_FTPSession, 'str', $s_RemoteFile) If @error OR $ai_FTPPutFile[0] = 0 Then SetError(-1) Return 0 EndIf Return $ai_FTPPutFile[0] EndFunc ;==> _FTPDelFile() ;=============================================================================== ; ; Function Name: _FTPRenameFile() ; Description: Renames an file on an FTP server. ; Parameter(s): $l_FTPSession - The Long from _FTPConnect() ; $s_Existing - The old file name. ; $s_New - The new file name. ; Requirement(s): DllCall, wininet.dll ; Return Value(s): On Success - 1 ; On Failure - 0 ; Author(s): Wouter van Kesteren ; ;=============================================================================== Func _FTPRenameFile($l_FTPSession, $s_Existing, $s_New) Local $ai_FTPRenameFile = DllCall('wininet.dll', 'int', 'FtpRenameFile', 'long', $l_FTPSession, 'str', $s_Existing, 'str', $s_New) If @error OR $ai_FTPRenameFile[0] = 0 Then SetError(-1) Return 0 EndIf Return $ai_FTPRenameFile[0] EndFunc ;==> _FTPRenameFile() ;=============================================================================== ; ; Function Name: _FTPMakeDir() ; Description: Makes an Directory on an FTP server. ; Parameter(s): $l_FTPSession - The Long from _FTPConnect() ; $s_Remote - The file name to be deleted. ; Requirement(s): DllCall, wininet.dll ; Return Value(s): On Success - 1 ; On Failure - 0 ; Author(s): Wouter van Kesteren ; ;=============================================================================== Func _FTPMakeDir($l_FTPSession, $s_Remote) Local $ai_FTPMakeDir = DllCall('wininet.dll', 'int', 'FtpCreateDirectory', 'long', $l_FTPSession, 'str', $s_Remote) If @error OR $ai_FTPMakeDir[0] = 0 Then SetError(-1) Return 0 EndIf Return $ai_FTPMakeDir[0] EndFunc ;==> _FTPMakeDir() ;=============================================================================== ; ; Function Name: _FTPDelDir() ; Description: Delete's an Directory on an FTP server. ; Parameter(s): $l_FTPSession - The Long from _FTPConnect() ; $s_Remote - The Directory to be deleted. ; Requirement(s): DllCall, wininet.dll ; Return Value(s): On Success - 1 ; On Failure - 0 ; Author(s): Wouter van Kesteren ; ;=============================================================================== Func _FTPDelDir($l_FTPSession, $s_Remote) Local $ai_FTPDelDir = DllCall('wininet.dll', 'int', 'FtpRemoveDirectory', 'long', $l_FTPSession, 'str', $s_Remote) If @error OR $ai_FTPDelDir[0] = 0 Then SetError(-1) Return 0 EndIf Return $ai_FTPDelDir[0] EndFunc ;==> _FTPDelDir() ;=============================================================================== ; ; Function Name: _FTPClose() ; Description: Closes the _FTPOpen session. ; Parameter(s): $l_InternetSession - The Long from _FTPOpen() ; Requirement(s): DllCall, wininet.dll ; Return Value(s): On Success - 1 ; On Failure - 0 ; Author(s): Wouter van Kesteren ; ;=============================================================================== Func _FTPClose($l_InternetSession) Local $ai_InternetCloseHandle = DllCall('wininet.dll', 'int', 'InternetCloseHandle', 'long', $l_InternetSession) If @error OR $ai_InternetCloseHandle[0] = 0 Then SetError(-1) Return 0 EndIf Return $ai_InternetCloseHandle[0] EndFunc ;==> _FTPClose()
    1 point
×
×
  • Create New...