
Shao
Active Members-
Posts
51 -
Joined
-
Last visited
Everything posted by Shao
-
hello Cyanidemonkey, 2 errors in your script : you've forgotten #include <StaticConstants.au3> you've written _GUICtrlTabSetCurSel instead of _GUICtrlTab_SetCurSel
-
ok, problem identified and fixed. I had forgotten to delete Case $b_close_edit Edit_Cleaner() ContinueLoop ... in Switch $mainMsg ... EndSwitch. This created a constant loop. ---------------- Now playing: Bob Sinclar - Love Generation via FoxyTunes
-
I added this line CODEGUICtrlCreateTabItem(""); end tabitem definitionbut it doesn't work ; still the same problem. ----------------
-
hello Excuseme but I didn't forget to use GUICtrlCreateTabItem. I based the creation of the tab on the helpfile of AutoIt, so I don't really understand what's wrong. CODE $Editor = GUICtrlCreateTab ($Left+2, $TabTop, $EditWidth, $EditHeight+40) $EditorLexique = GUICtrlCreateTabItem(" " & $m_Lexique) $g_page = GUICtrlCreateEdit("", $Left, $Top, $EditWidth, $EditHeight, BitOR($ES_AUTOVSCROLL, $WS_VSCROLL, $ES_READONLY)) GUICtrlSetBkColor(-1, 0xa09bb8) ---------------- Now playing: Various Artists - Doin' It - Nathan's Theme via FoxyTunes ---------------- Now playing: Various Artists - Doin' It - Nathan's Theme via FoxyTunes
-
Hello, I try to display an edit in a tab's page but it looks to be refreshing for ever. Can you tell me what's wrong with my script, please ? Thank you. CODEFunc main_gui() $return = "continue" $main_gui = GUICreate($Soft_Name, $DesktopWidth, $DesktopHeight, 0, 0, BitOR($WS_CLIPSIBLINGS, $WS_OVERLAPPEDWINDOW, $WS_MAXIMIZE), $WS_EX_CLIENTEDGE) ; ************* ; BARRE DE MENU ; ************* $mi_options = GUICtrlCreateMenu($m_Options) $mi_statistiques = GUICtrlCreateMenu($m_Statistics, $mi_options) $mi_stat_ouvrir = GUICtrlCreateMenuItem($m_Ouvrir, $mi_statistiques) $mi_recherches = GUICtrlCreateMenu($m_Recherches, $mi_options) $mi_rech_ouvrir = GUICtrlCreateMenuItem($m_Ouvrir, $mi_recherches) $mi_rech_enregistrer = GUICtrlCreateMenuItem($m_Enregistrer, $mi_recherches) GUICtrlCreateMenuItem("", $mi_options) $mi_exercises = GUICtrlCreateMenuItem($m_Exercises, $mi_options) GUICtrlCreateMenuItem("", $mi_options) $mi_close = GUICtrlCreateMenuItem($m_Close, $mi_options) $mi_parametres = GUICtrlCreateMenu($m_Parametres) $mi_langue = GUICtrlCreateMenu($m_Langue, $mi_parametres) $mi_francais = GUICtrlCreateMenuItem($m_Francais, $mi_langue) $mi_english = GUICtrlCreateMenuItem($m_English, $mi_langue) GUICtrlCreateMenuItem("", $mi_parametres) $mi_administration = GUICtrlCreateMenu($m_Administration, $mi_parametres) $mi_preferences = GUICtrlCreateMenuitem($m_Preferences, $mi_administration, 1) ; ******* ; BOUTONS ; ******* ; définition des variables de positionnement des boutons et contrôles $ButtonWidth = 960 $LeftButton = ($DesktopWidth-$ButtonWidth)/2 ; Exercices $b_exercises = GUICtrlCreateButton($m_Exercices, $LeftButton, 30, 120, 25, 0) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") ; Dictionnaire $g_translation = GUICtrlCreateGroup($m_Traduction, $LeftButton+120+100, 25, 740, 50) ; From $l_de = GUICtrlCreateLabel($m_De, $LeftButton+220+25, 45, 25, 20, $SS_RIGHT) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $c_lang1 = GUICtrlCreateCombo($ini_Languages[1], $LeftButton+270+15, 45, 97, 25) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetData(-1, $ini_Languages[2], $ini_Languages[1]) ; To $l_en = GUICtrlCreateLabel($m_En, $LeftButton+382+30, 45, 25, 20, $SS_RIGHT) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $c_lang2 = GUICtrlCreateCombo($ini_Languages[1], $LeftButton+437+15, 45, 97, 25) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetData(-1, $ini_Languages[2], $ini_Languages[2]) ; Mots à rechercher $l_word = GUICtrlCreateLabel($m_Mots, $LeftButton+549+50, 45, 55, 20, $SS_RIGHT) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $i_word = GUICtrlCreateInput("", $LeftButton+654+10, 45, 200, 21, BitOR($ES_AUTOHSCROLL, $ES_MULTILINE)) ; Rechercher $b_search = GUICtrlCreateButton($m_Chercher, $LeftButton+864+10, 45, 55, 20, 0) ; donner le focus à la barre de recherche ControlFocus($main_gui, "", $i_word) ; ************* ; PAGE CENTRALE ; ************* ; définition des variables de positionnement et de dimensions de l'éditeur ; l'éditeur et l'onglet se positionnent dans la fenêtre en s'ajustant à la résolution d'écran $EditWidth = $DesktopWidth *0.90 $Left = ($DesktopWidth-$EditWidth) /2 $EditHeight = ($DesktopHeight -85)*0.85 $Top = 85 +( ($DesktopHeight -85)-$EditHeight ) /2 $TabTop = $Top-20 $Editor = GUICtrlCreateTab ($Left+2, $TabTop, $EditWidth, $EditHeight+40) $EditorLexique = GUICtrlCreateTabItem(" " & $m_Lexique) $g_page = GUICtrlCreateEdit("", $Left, $Top, $EditWidth, $EditHeight, BitOR($ES_AUTOVSCROLL, $WS_VSCROLL, $ES_READONLY)) GUICtrlSetBkColor(-1, 0xa09bb8) GUISetState(@SW_SHOW) While 1 $mainMsg = GUIGetMsg() Switch $mainMsg ; *********************** ; CAS DE LA BARRE DE MENU ; *********************** Case $mi_close $play = 0 ExitLoop Case $mi_preferences settings_gui() ContinueLoop Case $mi_francais IniWrite($ini_Settings, "langues", "défaut", "Français") $play = 1 ExitLoop Case $mi_english IniWrite($ini_Settings, "langues", "défaut", "English") $play = 1 ExitLoop Case $mi_exercises Edit_Cleaner() Exercices("continue") ContinueLoop Case $mi_stat_ouvrir Local $c_Number, $TotalReponses, $BonnesReponses, $TR_Taux, $BR_Taux, $epreuves_lignes, $erreurs_lignes stat_read($c_Number, $TotalReponses, $BonnesReponses, $TR_Taux, $BR_Taux, $epreuves_lignes, $erreurs_lignes) StatDisplay($c_Number, $TotalReponses, $BonnesReponses, $TR_Taux, $BR_Taux, 1, $epreuves_lignes, $erreurs_lignes) ContinueLoop Case $mi_rech_ouvrir rech_read() ContinueLoop Case $mi_rech_enregistrer rech_record() ContinueLoop ; ************************ ; CAS DES CONTROLES DU GUI ; ************************ Case $GUI_EVENT_CLOSE $play = 0 ExitLoop Case $b_exercises Edit_Cleaner() Exercices("continue") ContinueLoop Case $b_search Entree() ContinueLoop Case $b_close_edit Edit_Cleaner() ContinueLoop EndSwitch WEnd GUIDelete($main_gui) EndFunc ---------------- Now playing: Orchestral Manoeuvres in the Dark - Was It Something I Said via FoxyTunes
-
Thank you very much, it 's nicely working !
-
Hi, what I made : create a simple gui with a button named $B_ForeGround what I 'd like to do : when $B_ForeGround clicked : the gui is set to foreground and locked in when clicked once again : the gui isn't locked in anymore what I tried : case $msg = $B_ForeGround guisetstate($DS_SETFOREGROUND, $Gui) oÝ÷ Ù«¢+Ø)ÍÀÌØíµÍôÀÌØí }½Éɽչ(Õ¥ÍÑÍÑÑ ÀÌØí]M}a}Q=A5=MP°ÀÌØíÕ¤¤ What occurred : none of those options worked. So, how can I do to have my gui locked-unlocked in foreground by clicking on a button ? Thanks
-
SUPPRESSION OF AN ELEMENT IN A BIDIMENSIONAL ARRAY
Shao replied to Shao's topic in AutoIt Example Scripts
It's right that wasn't needed to use a number-of-columns parameter, so I modified the code : ;=============================================================================== ; ; Function Name : BiDim_ArrayDelete() ; Description : Deletes the specified element from the given 2D_array ; Parameters : 1st param. = the 2D_array passed via ByRef ; 2nd param. = the element to delete ; Control of Errors : @Error = 1 if the 1st param. isn't an array ; = 2 if the array is only 1 element in size ; = 3 if the array isn't a 2D_array ; = 4 if the 2nd param. is <0 or > array size ; Return Value : the adjusted 2D_array ; Author(s) : Shao <dragonban@yahoo.fr> ; ;=============================================================================== Func BiDim_ArrayDelete(ByRef $avArray, $pos) Local $ArraySize = UBound($avArray)-1 ; size of the original array Local $ArrayCol = UBound($avArray, 2) Local $i = 1, $j = 1 Local $avNewArray[$ArraySize][$ArrayCol] ; TREATMENT OF ERRORS ; if the variable isn't an array If Not(IsArray($avArray)) Then SetError(1) Return "" EndIf ; if the array is only 1 element in size If $ArraySize = 1 Then SetError(2) Return "" EndIf ; if the array isn't bidimensional If Not($ArrayCol=2) Then SetError(3) Return "" EndIf ; if the element that must be deleted is higher or lower If $pos > $ArraySize Or $pos < 0 Then SetError(4) Return "" EndIf ; execution For $j = 1 To $ArraySize If $j=$pos Then $j=$j+1 Local $col=0 For $col = 0 To $ArrayCol-1 $avNewArray[$i][$col]=$avArray[$j][$col] Next $i = $i+1 Next $avArray = $avNewArray SetError(0) Return 1 EndFunc Return Value : Success : return the adjusted 2D_array Failure : @Error = 1 if the 1st param. isn't an array 2 if the array is only 1 element in size 3 if the array isn't a 2D_array 4 if the 2nd param. is <0 or > array size -
Thank you very much for your help, Iznogoud. It works (but unhappily, the cpl window can't be hidden !)
-
SUPPRESSION OF AN ELEMENT IN A BIDIMENSIONAL ARRAY
Shao replied to Shao's topic in AutoIt Example Scripts
This code above is useful to suppress an element from a bidimensional array a _ArrayDelete() do it with unidimensional array. How to use it : just type where : $My_BiDimensional_Array is the name of your bidimensional array with no quote -as in _ArrayDelete()- $My_BiDimensional_Array[$i][$j] when used in your code $Col is the number of columns of your bidimensional array $Element is the number of row to delete from your bidimensional array for example, if your bidimensional array was a result of IniReadSection(), so it contains 2 columns and as many rows as there are in the ini file read. in the above example, $MDP is a bidimensional array that contains all the passwords (15) contained in the section "PASSWORD" of an ini file. So, $MDP[0][0] = 15 $MDP[1][0] = key of the first row and $MDP[1][1] = value of the first row etc. till 15 this variable has got 2 columns (first for key and second for value) We declare name of array and number of columns as parameters of BiDim_ArrayDelete($MDP, 2, 5) 5 means that we want to delete the 5th row of the array $MDP[5][0] and $MDP[5][1] In case of errors in parameters (array isn't modified) it returns "" as result and : 1 means the first parameter isn't an array 2 means the array's got only 1 element (so no necessary to delete it by using this function) 3 means the element to delete is <0 or higher than the last element of the array -
SUPPRESSION OF AN ELEMENT IN A BIDIMENSIONAL ARRAY
Shao replied to Shao's topic in AutoIt Example Scripts
Hi everybody, I put a code above but I didn't take time to check it and anymore it's wrong and with no security in case of errors. I was working all evening long to make it better and it works ! The good code just below : -
; ####################################### ; ; SUPPRESSION OF AN ELEMENT IN A BIDIMENSIONAL ARRAY ; ; ####################################### Func BiDim_ArrayDelete(ByRef $array, $col2, $pos) Local $i = 1, $j = 1 For $i = 1 To $array[0][0] If Not($i=$pos) Then Local $col=1 For $col = 1 To $col2 $array[$j][$col]=$array[$i][$col] Next $j = $j+1 EndIf Next ReDim $array[$array[0][0]][$col2+1] EndFunc
-
I tried netdom.exe and it fails because my computer isn't in a domain. My computer and others are in the same Network and none of them have a domain name. If I try to give them a domain Name, so I have an error. How can I do to use netdom with no domain name ?
-
Yes, I already used Netsh, it's great ! I saw a plentiful other utilities in system32.
-
Hi, Yes I began with Regedit, but it doesn't work even after a computer reboot.
-
thank you very much. I try it.
-
Thank you very much for help About "Network Name of a computer" I meant the name of a computer as visible on a network, so your answer about this question is not that I was searching for.
-
Hello, I'm developping a programm that changes in an automatic way the @IP and Network Name of a computer. I know how to do with a mouse, but I don't know how to automate it ! Some help is welcome. Thank you.
-
Hi Smoke_N Yes, title and class names are the same ones in both of the Printer Windows : Title : Imprimer Class : #32770 In your comment I don't understand how can I do to get all the informations I need considering that ctrlID aren't the same in an AutoIt Printing Window or in an Acrobat Reader Printing Window (examples).
-
Thank you very much, it works. Now , another problem : I notice that windows aren't the same ones when you print from Acrobat Reader or From Word or any other programs. How can I do to be sure to get the good informations from any printing windows ? Informations that I need : printer name number of copies how many pages are printed ;[from x to y : y+1-x = number of pages ; value of x and y ?] etc.
-
Thank you Mega but I can't find any ControlGetText in help and ControlCommand is used to send a command to a control, not to get any information from a control.
-
Hi, In a multiusers environment I'd like to know how many pages are sent to printer from any application To resolve, I use WinWaitActive("Imprimer") ; r [=Print in french ]) And I use then Guictrlread (ctrlID in the window) But it doesn't work ! How can I do ?
-
Help with AD/remote computer information
Shao replied to mcgill's topic in AutoIt General Help and Support
HI, I have the same request : "How can I get a remote computername on NetWork and under OS by using @IP ?" -
Hi, I wrote a programm that is installed on all the computers of a LAN (P2P Network) in a cyberclub. In this programm I'd like that 2 users on remote computer on the same LAN be able to chat together (there are many rooms in the cyberspace and it would be pleasant for several reasons that the chat programm can be used even though Internet connexion has broken). How can I do to create this chat programm or is there already some existing chat programm created by developpers in AutoIt ? If not possible, how can I send a text on a remote computer ? (displayed in notepad or in a gui, for example) Thank you for answering. Regards.
-
Hello I'd like to know how to display a webcam picture in a gui. Thanks.