Jump to content

WoodGrain

Active Members
  • Posts

    152
  • Joined

  • Last visited

Everything posted by WoodGrain

  1. Thank you both for your very full answers! I was really just after suggestions as to what possible better alternatives to what I was considering and you both went above and beyond with full examples, thanks. @Andreik that really provided an end to end example of how to use the GDIPlus tools, thank you! @Nine interesting, by using the labels I don't even need the GDI tools, I think I will explore this further, thank you!
  2. Fantastic, thanks so much!
  3. Following on from my other post related to getting a title-less GUI with a 1px line, I'm wanting to color the line. I've attached a crude example of what i'm trying to explain/achieve. I have percentages (based on ranges in an array) I will be able to use to apply to the different colours that will define how wide they are (relative to the screen width). At this point, I'm considering creating multiple colored lines stacked horizontally next to each other using _GDIPlus_GraphicsDrawLine, but wanted to see if anyone else had a better way of achieveing this? Thanks!
  4. This is the code I've got so far to create a 1px line , however as you'll see in the attached image, it appears to be creating a 1px gray beville around the 1px line. Can anyone point me in the right direction to get this down to just a 1px (blue in this case) line? #include <GuiConstants.au3> $colourBlue = "0x4073ff" Global $hGUI = GUICreate("", @DesktopWidth, 1, 0, 10, BitOr($WS_POPUP,$WS_DLGFRAME), $WS_EX_TOOLWINDOW) GUISetBkColor($colourBlue, $hGUI) WinSetOnTop($hGUI, "", 1) GuiSetState() Thanks!
  5. Adding this line in got the menu working.
  6. Wait, I've re-read that help article and it looks like I'm missing this from my code: Opt("TrayOnEventMode", 1)
  7. I see the 3 menu items, but clicking them does nothing.
  8. These look like they loop every 50 and 100 ms, I need my program loop to be several seconds, normally between 5 seconds and 60 seconds depending on conditions ; do the rest of my app stuff in a loop every 20 seconds, this loop interval is required Sleep(20000)
  9. I have the below code I've tried but the right-click menu items do nothing, I'm guessing it's on account of TrayGetMsg()? Any help would be much appreciated! Opt("TrayMenuMode", 3) TrayIcon() Func TrayIcon() Global $trayAbout = TrayCreateItem("About") TrayItemSetOnEvent(-1, "IconAbout") Global $traySettings = TrayCreateItem("Settings") TrayItemSetOnEvent(-1, "IconSettings") TraySetOnEvent(-13, "About"); $TRAY_EVENT_PRIMARYDOUBLE Global $trayExit = TrayCreateItem("Exit") TrayItemSetOnEvent(-1, "IconExit") TraySetClick(8); $TRAY_CLICK_SECONDARYDOWN TraySetState(1); Show the icon EndFunc Func IconAbout() MsgBox(0, "About", "This is info about the app") EndFunc Func IconSettings() StartGui() EndFunc Func IconExit() Exit EndFunc ; Primary app loop to do stuff While 1 ;I've tried adding in the TrayGetMsg() here but doesn't work Switch TrayGetMsg() Case $trayAbout IconAbout() EndSwitch ; do the rest of my app stuff in a loop every 20 seconds, this loop interval is required Sleep(20000) WEnd
  10. Hi All, Trying to open windows explorer to a WebDav location and it's not working quite how I want, on the computers it is setup as a "network location" (as opposed to a "mapped drive", and this unfortunately can't be changed), the "Data" WebDav folder sits directly under "This PC" if that's an easier way to get to it. any suggestions as to what I can correct to get the 2nd example to work? ; This works, but I'm trying to avoid this as users normally see the URL style in the 2nd example below $folderToOpen = "\\mycompany.sharepoint.com@SSL\DavWWWRoot\Data" Run("Explorer.exe " & $folderToOpen) ; This does not work, it tries to open the WebDav url in the default web browser $folderToOpen = "https://mycompany.sharepoint.com/Data" Run("Explorer.exe " & $folderToOpen) ShellExecute also opens it in the default browser. Saw _WinAPI_ShellOpenFolderAndSelectItems but couldn't get the 2nd example to work. If I manually open Windows Explorer and paste in https://mycompany.sharepoint.com/Data it loads the WebDav directory without issue. If I have to use the pathing from the first example it is fine, just trying to give users a familiar experience. Thanks!
  11. Hi Team, My first GUI project, I'm 95% through to completion.. Looking for a number or code I can use instead of $GUI_BKCOLOR_TRANSPARENT to make a label transparent, if such a thing exists, all other colours I've used hex for (eg: 0xFFA500) Local $lblComplete = GUICtrlCreateLabel("Y", 260, 80, 30, 30) GUICtrlSetBkColor($lblComplete, $GUI_BKCOLOR_TRANSPARENT) Can I ask that without having to explain why? Cause I don't really have a good reason to convince you to help apart from curiosity and I can't see it in the help file...
  12. Hi All, I've found the XML information and note I could probably write a powershell script to do a search and replace on the XML file, this script will hopefully not be needed at all. Cheers
  13. Hi All, Not sure how many of you use Zoom for conferencing, I'm deploying the Zoom Outlook addin to all users in our organisation so they can schedule in a Zoom Room Calendar appointment from their calendar, however by default Zoom whack in 2 large buttons on the mail Home tab in Outlook, in the 2nd most prominent position (screenshot attached).. This is for calendaring, not sure why they need to put it there apart from arrogance, it's also available on the Calendar Home tab (which is where it should be). The MSI installer has no options for adjusting this. So, long story short I'm trying to get rid of it for the staff. I've seen you can edit the Outlook XML file, but that's a rabbit hole I'm not sure I want to go down. So I've put this script together, but I'm sure there are better ways of doing this that factor in the user.. and would welcome your feedback. I'm concerned there may be things that this script can't take into account, such as if the power users have already changed the order of the groups on the Home tab for example, pressing {DOWN 2} may not be selecting "Zoom" (screenshot attached). I can't see any usable information on the tabs screen in AutoIt Window Info that lets be identify or target the Zoom group on the email Home. Opt("WinTitleMatchMode", 2) If ProcessExists("outlook.exe") Then While Not WinActive(" - Outlook") WinActivate(" - Outlook") Sleep(500) WEnd Sleep(250) Send("!f") Sleep(250) Send("!t") While Not WinExists("Outlook Options") Sleep(200) WEnd Sleep(250) Send("c") Sleep(100) Send("c") Sleep(250) Send("{TAB 5}") Sleep(250) Send("{DOWN 2}") Sleep(250) Send("!r") Send("{ENTER}") Else MsgBox(0, "Outlook not open", "Looks like Outlook is not running, plese close this message, start Outlook, and run this app again.") EndIf Thanks!
  14. An associative array of course! Makes perfect sense to use that! I'm guessing you need to versed in c++ or .NET to be aware of these objects? Also, learned about ternary operators today 👍 thanks.
  15. Ah, interesting, the variable structure should be the most beneficial for the data it's holding, in this case having the array for the comparison with multiple related elements is the best suited for the data structure but also for iterating through it's data by means of a loop, and the string doesn't need to become an array for it's contents to be modified (assuming even up to 500 words would make little performance difference between a string and a 2nd array). Thanks Wow, ok, let me just say, that looks impressive. Bear with me as I work through this as this is my first look at ObjCreate, and the test and pattern in the StringRegExReplace make sense but I'll need to work through the replace... *opens AutoIt help file* (can I just take a moment to say how awesome the help file is with AutoIt, you guys rock!) Thanks! I love being challenged with new way of coding like this.
  16. Hi All, I'm just working through some logic, if I have a comma separated string I'm reading from a file that has say 500 unique words in it, if I want to look up and replace some of the words with another unique word if they appear in the list, what would be the best/fastest way of doing this? The replacement list might have say 250 values to swap out but would only swap them if they are in the line that is read in. I'm assuming running StringReplace or StringRegExpReplace across them all is not necessarily the best option? I was thinking about using an array? Any direction would be much appreciated! I don't have any code yet to share, and this example is a bad one cause it's easy to picture it with duplicates, but an example might be: $readFileLine = "doberman, spots, labrador, poodle, white, grey, small, pug" $readFileLine = StringReplace($readFileLine, "spots", "dalmation") $readFileLine = StringReplace($readFileLine, "grey", "wolf") ;etc The array option I had in mind was along the lines of exploding the string from the file into an array, then for each element in the array lookup against a 2nd array using _ArraySearch and replacing it with the corresponding value in the array, using the above example: $readFileLine = "doberman, spots, labrador, poodle, white, grey, small, pug" $readFileArray = _StringExplode($readFileLine, ",") $compareArray[2][2] = [["spots", "dalmation"], ["grey", "wolf]] ;Then loop through $readFileArray elements and compare each element to all the 1st elements in $compareArray and if there's a match replace $readFileArray element with the 2nd element in $compareArray ; I hope that makes sense, it's late.. Thanks!
  17. Hmm, are you on Windows 10? I wonder if it's not working correctly on Widows 10 but working on earlier versions of Windows. I had a similar issue with this same process in PowerShell, worked flawlessly on Windows 8.1, would not work on Windows 10.
  18. Hi All, I've tried to create a script to browse to a web page in IE, but it only works for some sites, I've tried to simplify the script as much as possible, hoping you can point me in the right direction - thanks. This one going to Google does work: #include <IE.au3> $oIE = _IECreate("https://www.google.com.au/", 0, 1, 1) _IELoadWait($oIE) _IEQuit($oIE) But this one going to OneDrive opens the IE page, but fails immediately returning the errors, and the IE window is not closed: --> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_ClientDisconnected (-2147023174, Browser has been deleted prior to operation.) --> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_InvalidObjectType () --> IE.au3 T3.0-2 Error from function _IEQuit, $_IESTATUS_InvalidObjectType #include <IE.au3> $oIE = _IECreate("https://abccorp-my.sharepoint.com/", 0, 1, 1) _IELoadWait($oIE) _IEQuit($oIE) Even if I put a sleep timer in for 10 seconds after the _IECreate it still doesn't work Thanks all!
  19. Hi All, I'm having issues with mapping Office 365 sharepoint to Windows Explorer (WebDav) for more than 5 days, they have a cookie that is set when you access the site that lasts for 5 days, if you visit the site again within 5 days the cookie is refreshed (https://docs.microsoft.com/en-us/office365/enterprise/session-timeouts) otherwise the cookie expires and trying to access the mapped drive it error's out until you browse to the site in IE again. I've used similar code to the below, but from what I can find the window can't run hidden with UAC enabled, so that's not going to be useful (url replaced) #include <IE.au3> $oIE = _IECreate("https://www.google.com.au/", 0, 0) $iePage = _IEDocReadHTML($oIE) _IEQuit($oIE) Anyone have any suggestions as to how I might be able to refresh the cookie in IE without showing anything to the user? Thanks!
  20. Last, hopeful bump, then I'll just have to assume not possible and move on - cheers.
  21. Sure, here you go: If WinActive("NB-ACT-12 - ConnectWiseControl") Then $hdlCurrentActive = WinGetHandle("[ACTIVE]") $winPos = WinGetPos($hdlCurrentActive) $winX = $winPos[0] $winY = $winPos[1] $winWidth = $winPos[2] $winHeight = $winPos[3] $winXandWidth = $winX + $winWidth $winYandHeight = $winY + $winHeight $currentMouse = MouseGetPos() If $currentMouse[0] > $winX And $currentMouse[0] < $winXandWidth And $currentMouse[1] > $winY And $currentMouse[1] < $winYandHeight Then MouseMove($winXandWidth +15, $winYandHeight +15) EndIf EndIf But I suspect this is more about handling the mouse when the remote access program is active, so am hoping their is another way of moving the mouse.
  22. No option for doing this?
  23. Hi guys, I've written a script that will move my mouse to a location on the screen whenever my remote access software becomes active, the problem I have is that as soon as the remote access software becomes active it appears to capture the mouse and keyboard so nothing happens when I use MouseMove(). Is there any way around this? Thanks!
  24. Cheers FD, I'll check that out, and thanks for the example code
  25. So, after thinking this through it looks like the best method will be to add in an Input Control that I can type into and then use GUIGetMsg to poll it for any changes and then from that run my function to check if the last char they typed in the control is correct compared to the current letter from my array, I've read about $SS_NOTIFY with the control to assist with this.
×
×
  • Create New...