Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/22/2021 in all areas

  1. As the title implies, trying to mimic Microsoft Word (Older version) using RichEdit. Not an easy task, it's not even 1/10th of what word really is but I wanted to make a small text editor (That supported changing an individual word/letters properties). Some of the functions I wanted to use didn't have a whole lot of information/topics about them so I spent many many hours trying to figure out how to do some things... (Like getting the text from a ExComboBox or changing the color of the rich edit text without changing ALL of the rich edit text (Turns out I just needed to update my AutoIt version....)) Some of the things I struggled with was reading the Font Size from the ComboBoxEx (GUICtrlRead and ControlGetText do not work, by themselves, but if you use _GUICtrlComboBoxEx_GetEditControl to get the GUICtrlID of the ComboBoxEx you can use ControlGetText), trying to track a Popup menu for the font size (I didn't want to use a dropdown menu, trying to use the scroll wheel to increment/decrement the text in the ComboBoxEx, making sure the correct attribute buttons are Checked depending on the location of the caret (This isn't 100% perfect, I got it to pretty much work though... I originally had it checking the letter 1 left of the caret all the time, except when the caret is at the 0,0 mark, but if the caret is at the very end and the user presses one of the attribute buttons, it won't keep the button checked correctly). There are a few other things but I can't think of them. I don't know enough about the WinAPI in order to make a truly amazing wordpad but maybe this will help some others out there trying to use some of the controls I used. Also, this was actually made to be attached (_WinAPI_SetParent($frmEditor, WinGetHandle("[Class:LWJGL]")) to a game I play (PokeMMO), so there may be some remnants of the game stuff in here. I don't think so, but there might be... It still functions properly. (There is no gameplay automation, it's just supposed to be a child of the game and work as a simple text editor. I've currently submitted it to one of mods of the game so I can release it to the community) Beginnings of a Wordpad.rar
    1 point
  2. jchd

    PCRE2 has moved!

    From the PCRE mailing list:
    1 point
  3. For anyone who would like to test my UDF :
    1 point
  4. Executing excel with a parameter and running excel THEN opening a file is slightly different. When a workbook is opened directly with a parameter, it's like two windows were handled. The second window does not inhert the minimized flag that was assigned to the initial one. It's just the weird way that excel handles windows. To run a workbook "minimized", you can use this trick to run excel hidden, open a file, minimize the window, then set show flag. #include <Excel.au3> $sFilePath = "C:\test\test.xlsx" $sFileName = StringRight($sFilePath,StringLen($sFilePath)-StringInStr($sFilePath,"\",0,-1)) $oExcel = _Excel_Open(0) $oWorkbook = _Excel_BookOpen($oExcel,$sFilePath) Do Sleep(5) Until WinExists($sFileName & " - Excel") WinSetState($sFileName & " - Excel","",@SW_MINIMIZE) $oExcel.Visible = True
    1 point
  5. This line of code doesn't appear to be correct. I would suggest separating into two lines so that you could check for errors -- #include <Excel.au3> Global $bVisible = False Global $sWorkbook = "C:\test\test.xlsx" Global $oExcel = _Excel_Open($bVisible) Global $oWorkbook = _Excel_BookOpen($oExcel, $sWorkbook) I was assuming that all of the related windows are hidden if Excel is launched hidden. Is that incorrect?
    1 point
  6. Neither of these two options work for me either: ShellExecute("Excel.exe", '"C:\Users\My User\Desktop\Book1.xlsx"', "", "", @SW_MINIMIZE) ShellExecute('"C:\Users\My User\Desktop\Book1.xlsx"', "", "", "", @SW_MINIMIZE) Windows 10 latest, Excel 365. It opens the file in Excel, but Excel is not minimized. @SW_MAXIMIZE does work. The only way I can ensure that Excel is minimized is by minimizing it separately: ShellExecute ("Excel.exe", '"C:\Users\My User\Desktop\Book1.xlsx"', "", "") WinActivate ("Book1.xlsx - Excel", "") WinWaitActive ("Book1.xlsx - Excel", "") Send ("#{DOWN}") or: ShellExecute ("Excel.exe", '"C:\Users\My User\Desktop\Book1.xlsx"', "", "") WinWaitActive ("Book1.xlsx - Excel", "") WinSetState ("Book1.xlsx - Excel", "", @SW_MINIMIZE)
    1 point
  7. You could use : If $Time[0] >= '2020-09-01' Then But it is not the most robust approach, I would prefer using something like : #include <Constants.au3> #include <Date.au3> Local $String = BinaryToString(InetRead ("http://worldtimeapi.org/api/timezone/America/Toronto.txt",1)) ;MsgBox (0,"",$String) ;Local $String = BinaryToString(InetRead ( "http://worldtimeapi.org/api/timezone/Europe/Amsterdam",1)) Local $Time = StringRegExp ($String,'datetime: (.+?)T(\d+:\d+:\d+)', $STR_REGEXPARRAYMATCH) MsgBox ($MB_SYSTEMMODAL,"",$Time[0] & " " & $Time[1]) Local $iDiff = _DateDiff ('D',"2020/09/01", StringReplace($time[0],"-","/")) If @error Then Exit MsgBox ($MB_SYSTEMMODAL,"Error","Invalid date format") If $iDiff >= 0 Then Exit MsgBox ($MB_SYSTEMMODAL,"Out of Date","Please renew your license")
    1 point
×
×
  • Create New...