Leaderboard
Popular Content
Showing content with the highest reputation on 06/22/2017 in all areas
-
One more work-around for the old problem :). Update procedure must be quite different for these two control types under the hood. #include <WindowsConstants.au3> #include <EditConstants.au3> HotKeySet("{ESC}", "_Exit") GUICreate("My GUI") GUISetBkColor(0x00ff00) $c_Label = GUICtrlCreateLabel(0, 10, 10, 200, 20) $c_Input = GUICtrlCreateInput(0, 10, 60, 200, 20, $ES_READONLY, $WS_EX_TRANSPARENT) GUICtrlSetBkColor(-1, 0x00ff00) GUICtrlSetCursor(-1, 2) ; Arrow GUISetState(@SW_SHOW) While 1 GUICtrlSetData($c_Label, TimerInit()) GUICtrlSetData($c_Input, TimerInit()) WEnd Func _Exit() Exit EndFunc ;==>_Exit1 point
-
my text to audio converter
Xandy reacted to nacerbaaziz for a topic
Hello my friends I am a totally blind young man for easier to read books and articles Among the blind i has programmed a tool This tool converts text to audio with the possibility to save it into a wav or mp3 file It is also compatible with all persons, whether blind or ordinary I have completed the work of this tool and want to take your opinion i Especially published here for anyone looking about how to convert text to speech, I will put this tool open source for you I want to know what your think about it and if it need any other additions? Note : This tool converts texts to audio using sapi 5 voices so i was also puted a hot keys to control the tool Now I put this project to you for public benefit and I am ready to answer any question. Apology : I am an Arab youth from Algeria I do not mastered English very well So I apologize to you if there are written mistakes With my greetings and best wishes My texts to audio converter.zip1 point -
Yeah; I should have said "explicit return value".1 point
-
You can try this (untested) $s_SRE = StringRegExpReplace($s_Source, '(?s).*?(' & $s_Pattern & ').*', "$1")1 point
-
Well try this. I have commented a lot of things but if there's anything you don't know then just post. The AutoIt Wiki is a good place to pick up info and there's a thread on Best Practices here that's worth a read. I picked up a lot from both. I changed the top input for a combo box, I kept your other inputs for the info but they would be better as labels. I have included one as an example but commented it out. The inputs text can be deleted. It has no effect on the program but a bit more professional #Region #### Includes ################################ #include <Array.au3> #include <GuiComboBox.au3> #include <ComboConstants.au3> #include <Excel.au3> #include <GUIConstantsEx.au3> #include <GuiListBox.au3> #include <MsgBoxConstants.au3> ;~ #include <StaticConstants.au3> ; only needed for label example #include <WindowsConstants.au3> #EndRegion #### Includes ################################ #Region #### Globals ################################# ; these relate to the columns that contain the information, ; they relate to the ARRAY columns layout NOT the EXCEL sheet columns. Enum will ; assign them a value starting at 0 and incrementing by one. If you add or change the column ; layout in the excel sheet, these will need to be altered Global Enum _ $STAFFNUMBER_COL, _ ; 0 $NAME_COL, _ ; 1 $DEPT_COL, _ ; 2 $JOINING_COL, _ ; 3 $ID_COL, _ ; 4 $MAX_COLS ; 5, or 1 above the last column ; these relate to the controls on the GUI. Only the ones ; we need to update that would be Global are in here ; ### THESE MUST HAVE THE SAME VALUE AS THEIR COLUMN COUNTERPARTS ### Global Enum _ $STAFFNUMBER_CBO, _ ; 0 $NAME_INP, _ ; 1 $DEPT_INP, _ ; 2 $JOINING_INP, _ ; 3 $ID_INP, _ ; 4 $MAX_IDS ; 5, or 1 above the last control ; create an array to hold the id's for the controls ; scope is global so it can be accessed by all. We ; loop through this array later when updating the inputs ; with the array values Global $g_aiControlIDs[$MAX_IDS] ; declare a variable to hold the RangeRead return ; scope is global so it can be accessed by all Global $g_asStaffInfo = '' #EndRegion #### Globals ################################# ; read the full sheet to the array ReadSheetToArray($g_asStaffInfo) ;~ _ArrayDisplay($g_asStaffInfo) ; draw the GUI GUI_Draw() Func GUI_Draw() GUICreate("Rimo System", 270, 500, -1, -1) ; no need to assign the controlID to a variable as ; it's text is constant GUICtrlCreateLabel("Rimo System", 80, 16, 150, 25) GUICtrlSetFont(-1, 14, 800, 0, "MS Serif") ; $STAFFNUMBER_CBO $g_aiControlIDs[$STAFFNUMBER_CBO] = GUICtrlCreateCombo("", 50, 48, 169, 21, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL, $WS_VSCROLL)) GUICtrlSetData(-1, LoadStaffNumberCombo()) ; declare as Local because it's not used outside of this function Local $id_GetInfo_btn = GUICtrlCreateButton("Get Info", 85, 88, 89, 33) ; $NAME_INP - Gets the text from the array and corresponding column GUICtrlCreateLabel($g_asStaffInfo[0][$NAME_COL], 16, 147, 36, 17) $g_aiControlIDs[$NAME_INP] = GUICtrlCreateInput("", 72, 144, 161, 21) ; label example ;~ $g_aiControlIDs[$NAME_INP] = GUICtrlCreateLabel("", 72, 144, 161, 21, $SS_CENTERIMAGE, $WS_EX_STATICEDGE) ;~ GUICtrlSetBkColor(-1, 0xFFFFFF) ; $DEPT_INP - Gets the text from the array and corresponding column GUICtrlCreateLabel($g_asStaffInfo[0][$DEPT_COL], 16, 177, 36, 17) $g_aiControlIDs[$DEPT_INP] = GUICtrlCreateInput("", 72, 176, 161, 21) ; $JOINING_INP - Gets the text from the array and corresponding column GUICtrlCreateLabel($g_asStaffInfo[0][$JOINING_COL], 16, 211, 36, 17) $g_aiControlIDs[$JOINING_INP] = GUICtrlCreateInput("", 72, 208, 161, 21) ; $ID_INP - Gets the text from the array and corresponding column GUICtrlCreateLabel($g_asStaffInfo[0][$ID_COL], 16, 243, 36, 17) $g_aiControlIDs[$ID_INP] = GUICtrlCreateInput("", 72, 240, 161, 21) ; unknown1 - These two will need to be added when you expand the spreadsheet ; you will need to create them in the same way as the others above ;~ GUICtrlCreateLabel("", 16, 272, 36, 17) ;~ Global $id_unknown2_inp = GUICtrlCreateInput("", 72, 272, 161, 21) ; unknown2 ;~ GUICtrlCreateLabel("", 16, 304, 36, 17) ;~ Global $id_unknown2_inp = GUICtrlCreateInput("", 72, 304, 161, 21) ; declare as Local because it's not used outside of this function Local $id_Cancel_btn = GUICtrlCreateButton("Cancel", 75, 416, 121, 25) ; show the gui GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $id_Cancel_btn ExitLoop Case $id_GetInfo_btn LoadStaffInfoInputs() ; retreive the info from the array EndSwitch WEnd GUIDelete() EndFunc ;==>GUI_Draw Func LoadStaffNumberCombo() ; set a starting string Local $s_Input = '|' ; loop through the Staff# column of the array For $i = 1 To UBound($g_asStaffInfo) - 1 ; add the values from the rows ($i) $s_Input &= '|' & $g_asStaffInfo[$i][$STAFFNUMBER_COL] Next ; trim the first pipe symbol Return StringTrimLeft($s_Input, 1) EndFunc ;==>LoadStaffNumberCombo Func LoadStaffInfoInputs() ; get the index of the currently selected item in the combo Local $i_ComboIndex = _GUICtrlComboBox_GetCurSel($g_aiControlIDs[$STAFFNUMBER_CBO]) If $i_ComboIndex = -1 Then Return ; nothing selected ; _GUICtrlComboBox_GetCurSel returns a zero based index so ; we need to increase by one to tally with $g_asStaffInfo rows $i_ComboIndex += 1 ; loop through the inputs and add the values. If the number of columns in the excel ; sheet increases and the number of inputs increases, as long as they are added to the global ; enums at the top of the script in the correct order, this should not need adjusting For $i = $NAME_COL To $MAX_COLS - 1 GUICtrlSetData($g_aiControlIDs[$i], $g_asStaffInfo[$i_ComboIndex][$i]) Next EndFunc ;==>LoadStaffInfoInputs Func ReadSheetToArray(ByRef $as_RangeRead) Local $s_ErrorMsg = "Error creating the Excel application object" ; create an instance of excel. Declare as local scope ; as it is only needed in this function Local $o_Excel = _Excel_Open(False) If Not @error Then $s_ErrorMsg = "Error opening workbook" ; open the workbook. Scope as above Local $o_WorkBook = _Excel_BookOpen($o_Excel, 'D:\info.xlsx', False, False) If Not @error Then $s_ErrorMsg = "Error reading excel range" $as_RangeRead = _Excel_RangeRead($o_WorkBook) EndIf EndIf If @error Then Exit MsgBox($MB_SYSTEMMODAL, _ "Excel Error", _ $s_ErrorMsg & $o_WorkBook & @CRLF & _ "@error = " & @error & ", @extended = " & @extended) ; we're are finished with excel now as all the info ; is in the array so it can be closed _Excel_Close($o_Excel) EndFunc ;==>ReadSheetToArray1 point
-
easy audio player progect
yutijang reacted to nacerbaaziz for a topic
hellow guys I am a blind young man I started a project to make an audio player with recorder I ended the player and i did not know how to recorder This player is Compatible with the blind and visually impaired and ordinary users Unfortunately I do not see so I could not merge images and icons So I hope you will be able to help me in this matter I will bring you the open source project and please help me to add images, icons and recorder, the project is requires easy access in order to be compatible with the screen readers, Please take this into account. the software is organized so the recorder is In a special menu that Contains stop and start and pause and save. The same is true for player Please help And greetings to all easy player.zip1 point -
Automatic Reassignment of COMM Port
larksp reacted to antonioj84 for a topic
you should do #RequireAdmin RegWrite("HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM", "\Device\Serial1", "REG_SZ", "COM2") RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\ACPI\PNP0501\1\Device Parameters", "\PortName", "REG_SZ", "COM2") RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\ACPI\PNP0501\1\", "FriendlyName", "REG_SZ","Communications Port(COM2)") You can do it that way instead, this show how to port assignment serial1 (com1) to com2, . The only problem unless you have full admin rights on regedit you can not modify the friendlyName . however you can use tool like regini.exe1 point -
This takes as many .ico files as you give it and compiles them into a resource-only .dll. Firstly it removes all 256 x 256 elements from each individual .ico file using icon sushi; then adds them into RDG; then finally compiles the .dll There are many guides on how to do this but they all assume various levels of knowledge. This script allows someone with minimal knowledge to compile a resource-only .dll.1 point