Leaderboard
Popular Content
Showing content with the highest reputation on 01/02/2017 in all areas
-
LAST VERSION - 1.8 / 2.1b 25-Dec-13 The library allows to set hotkeys by using the low-level keyboard hook. Below are the main differences between HotKey UDF from the native HotKeySet() function: To assign a hotkeys are used integer values instead of strings as in the HotKeySet() function. This is useful, for example, to save the hotkey's values in the registry.Ability to set any hotkeys including CTRL+ALT+DEL, F12, WIN+*, etc. The only exceptions are special keys such as "Fn" which do not have their own scan code.Ability to utilize or pass on the specified hotkeys for other applications.Ability to set hotkeys that already used by other applications.Ability to set hotkeys only for the specified window(s).Ability to prevent re-activation of the hotkeys when it is held down.Ability to disable previously installed hotkeys without removing the hook from the hook chain, ie without losing priority.Ability to block call user-defined function associated with the hotkey if the previous call has not been completed. Here is what you can't do by using this library:Set hotkey only for the CTRL, ALT, SHIFT, WIN, and any combination of this keys. Any hotkey should always include one function key. For example, ALT+A, CTRL+SHIFT+F10, etc.Set hotkey for a mouse buttons.Prevent using the hotkey like CTRL+ALT+DEL, CTRL+SHIFT+ESC (Windows Vista+), and similar.Use more than one function key in the hotkey. For example, ALT+A+B, F1+F2, etc.Use "Fn" key or any other keys that do not have their own scan code. Available functions HotKey UDF Library v1.8 Previous downloads: 5027 HotKey.au3 HotKey UDF Library v2.1b (Read >here for more information) Previous downloads: 1791 HotKey_21b.au3 Virtual-Key (VK) Code Constants (Optional) Previous downloads: 1576 vkConstants.au3 Example1 #Include <HotKey.au3> Global Const $VK_ESCAPE = 0x1B Global Const $VK_F12 = 0x7B ; Assign "F12" with Message() and set extended function call _HotKey_Assign($VK_F12, 'Message', BitOR($HK_FLAG_DEFAULT, $HK_FLAG_EXTENDEDCALL)) ; Assign "CTRL-ESC" with Quit() _HotKey_Assign(BitOR($CK_CONTROL, $VK_ESCAPE), 'Quit') While 1 Sleep(10) WEnd Func Message($iKey) MsgBox(0, 'Hot key Test Message', 'F12 (0x' & Hex($iKey, 4) & ') has been pressed!') EndFunc ;==>Message Func Quit() Exit EndFunc ;==>Quit Example2 #Include <HotKey.au3> Global Const $VK_OEM_PLUS = 0xBB Global Const $VK_OEM_MINUS = 0xBD Global $Form, $Label Global $i = 0 $Form = GUICreate('MyGUI', 200, 200) $Label = GUICtrlCreateLabel($i, 20, 72, 160, 52, 0x01) GUICtrlSetFont(-1, 32, 400, 0, 'Tahoma') GUISetState() ; Assign "CTRL-(+)" with MyFunc1() and "CTRL-(-)" with MyFunc2() for created window only _HotKey_Assign(BitOR($CK_CONTROL, $VK_OEM_PLUS), 'MyFunc1', 0, $Form) _HotKey_Assign(BitOR($CK_CONTROL, $VK_OEM_MINUS), 'MyFunc2', 0, $Form) Do Until GUIGetMsg() = -3 Func MyFunc1() $i += 1 GUICtrlSetData($Label, $i) EndFunc ;==>MyFunc1 Func MyFunc2() $i -= 1 GUICtrlSetData($Label, $i) EndFunc ;==>MyFunc21 point
-
Try something like this: $iPid = run("powershell get-aduser -Filter {sn -eq '" & $USERNAME & "'} -Properties sAMAccountName,Title" , @WindowsDir , @SW_HIDE , 0x2) Or Opt('ExpandVarStrings', 1) $iPid = run("powershell get-aduser -Filter {sn -eq '$USERNAME$'} -Properties sAMAccountName,Title" , @WindowsDir , @SW_HIDE , 0x2)1 point
-
[SOLVED]Group colors
caramen reacted to InunoTaishou for a topic
I edited the code and added comments, hopefully it helps.1 point -
[SOLVED]Group colors
Skysnake reacted to InunoTaishou for a topic
Oh.. the group control, I thought it was a group of controls. Something like this maybe? #include <Misc.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <File.au3> #include <Word.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <ColorConstantS.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <ListViewConstants.au3> #include <GuiListView.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> #include <GDIPlus.au3> #include <WinAPI.au3> Global $GUI = GUICreate("Opticiens-Atol", 800, 600) $Font1 = GUICtrlCreateLabel("", 5, 5, 185, 130) $Groupe1 = GUICtrlCreateGroup("Office1", 5, 5, 190, 135) ;Groupe OFFICE $Groupe2 = GUICtrlCreateGroup("Utilisateur2", 200, 5, 200, 195) ;Groupe Utilisateur $Groupe3 = GUICtrlCreateGroup("Accés réseau3", 405, 5, 390, 120) ;Groupe RESEAU $Groupe4 = GUICtrlCreateGroup("Lecture AD4", 405, 125, 390, 75) ;Groupe RESEAU GUICtrlSetGroupBkColor($Groupe1, 0x4486FA) GUISetState(@SW_SHOW, $GUI) While (1) Switch (GUIGetMsg()) Case $GUI_EVENT_CLOSE Exit 0 EndSwitch WEnd Func GUICtrlSetGroupBkColor(Const $iCtrl, Const $iColor) Local Static $iBorder = 4 ; Border of the group control, this is the grey line around the edges Local Static $iYOffset = 14 ; Y offset to account for the text in the group control Local $hWnd = IsHWnd($iCtrl) ? $iCtrl : GUICtrlGetHandle($iCtrl) ; Handle used to get the control position Local $aCtrlArea = ControlGetPos(_WinAPI_GetParent($hWnd), "", $iCtrl) ; Get the control position Local $lblReturn = GUICtrlCreateLabel("", $aCtrlArea[0] + $iBorder, $aCtrlArea[1] + $iYOffset, $aCtrlArea[2] - $iBorder * 2, $aCtrlArea[3] - $iYOffset - $iBorder) ; Create a label that's used for the back color inside the group control GUICtrlSetColor($lblReturn, $iColor) GUICtrlSetBkColor($lblReturn, $iColor) GUICtrlSetState($lblReturn, $GUI_DISABLE) GUICtrlSetBkColor($iCtrl, $iColor) Return $lblReturn ; Return the label, can be stored and used to update the color of this group later EndFunc ;==>GUICtrlSetGroupBkColor#include <Misc.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <File.au3> #include <Word.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <ColorConstantS.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <ListViewConstants.au3> #include <GuiListView.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> #include <GDIPlus.au3> #include <WinAPI.au3> Global $GUI = GUICreate("Opticiens-Atol", 800, 600) $Font1 = GUICtrlCreateLabel("", 5, 5, 185, 130) $Groupe1 = GUICtrlCreateGroup("Office1", 5, 5, 190, 135) ;Groupe OFFICE $Groupe2 = GUICtrlCreateGroup("Utilisateur2", 200, 5, 200, 195) ;Groupe Utilisateur $Groupe3 = GUICtrlCreateGroup("Accés réseau3", 405, 5, 390, 120) ;Groupe RESEAU $Groupe4 = GUICtrlCreateGroup("Lecture AD4", 405, 125, 390, 75) ;Groupe RESEAU GUICtrlSetGroupBkColor($Groupe1, 0x4486FA) GUISetState(@SW_SHOW, $GUI) While (1) Switch (GUIGetMsg()) Case $GUI_EVENT_CLOSE Exit 0 EndSwitch WEnd Func GUICtrlSetGroupBkColor(Const $iCtrl, Const $iColor) Local Static $iBorder = 4 ; Border of the group control, this is the grey line around the edges Local Static $iYOffset = 14 ; Y offset to account for the text in the group control Local $hWnd = IsHWnd($iCtrl) ? $iCtrl : GUICtrlGetHandle($iCtrl) ; Handle used to get the control position Local $aCtrlArea = ControlGetPos(_WinAPI_GetParent($hWnd), "", $iCtrl) ; Get the control position Local $lblReturn = GUICtrlCreateLabel("", $aCtrlArea[0] + $iBorder, $aCtrlArea[1] + $iYOffset, $aCtrlArea[2] - $iBorder * 2, $tCtrlArea[3] - $iYOffset - $iBorder) ; Create a label that's used for the back color inside the group control GUICtrlSetColor($lblReturn, $iColor) GUICtrlSetBkColor($lblReturn, $iColor) GUICtrlSetState($lblReturn, $GUI_DISABLE) GUICtrlSetBkColor($iCtrl, $iColor) Return $lblReturn ; Return the label, can be stored and used to update the color of this group later EndFunc ;==>GUICtrlSetGroupBkColor You might get a more desirable result if you just created a square using some labels and using them as the border for your "group" and then you can create another label for the actual background of the group.1 point -
https://sourceforge.net/p/scintilla/bugs/1896/ labels: Folding Problems --> Folding Problems, scintilla, folding, lua status: open --> open-accepted assigned_to: Neil Hodgson Priority: 2 --> 5 EDIT: btw. You may want to look also here: https://sourceforge.net/p/scintilla/bugs/1833/1 point
-
Simple, quick CSV parser
argumentum reacted to dgood71 for a topic
I found that a few CSV files I have contain a space between the comma delimiter and and fields containing double quotes. This caused the Regular Expression to choke. I was able to fix the regular expression in FichteFoll's modified library by changing the line $pattern &= '(?:' to $pattern &= '(?: *' in _CSVReadFile (Note, I just added a space and an asterisk after the colon in the bolded text above. This may not show up well in my post so I figured I'd spell it out) This eats any extra spaces that may exist. Here's an example of data that caused the issue: -76.38470000, 40.54840000, "AA3RG/145.17000-", "Pine Grove PL:110.9 DCS: IRLP: ECHO:" -76.37270000, 40.50400000, "AA3RG-R/146.64000-", "Brookside PL: DCS: IRLP: ECHO:149493" -79.18292900, 41.85703200, "AB3AA/145.27000-", "Warren PL:173.8 DCS: IRLP: ECHO:"1 point -
That was a very quick adoption of my code @ur .1 point
-
[SOLVED]Question about User name and logins
caramen reacted to JLogan3o13 for a topic
Something like this, perhaps: Local $sQuery = InputBox("User name", "Plz enter the user name and lastname", "Answer", "") Local $aSplit = StringSplit($sQuery, " ") If IsArray($aSplit) Then ConsoleWrite(StringLeft($aSplit[1], 1) & StringLeft($aSplit[2], 1) & StringLower(StringTrimLeft($aSplit[2], 1)) & @CRLF) EndIf Now, I am sure you could do it with Regex, unfortunately regex makes my eyes bleed. This is as close as I could come. Perhaps one of our regex geniuses will wander by and improve upon it. Only works if the last name is not all caps. #include <StringConstants.au3> Local $sQuery = InputBox("User name", "Plz enter the user name and lastname", "Answer", "") Local $aSplit = StringRegExp($sQuery, '[A-Z]+[a-z]+', $STR_REGEXPARRAYGLOBALMATCH) Local $aAnswer = StringLeft($aSplit[0], 1) & $aSplit[1] ConsoleWrite($aAnswer & @CRLF)1 point