Leaderboard
Popular Content
Showing content with the highest reputation on 07/31/2018 in all areas
-
Hide drives
ModemJunki and one other reacted to Simpel for a topic
Hi. I just wrote a script to hide some drives. I don't want to see some of them because they are fixed backup drives or drives including only licenses (dongle). #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> ;~ #include <NoFocusLines.au3> ; UDF to hide dots around checkboxes ;~ _NoFocusLines_Global_Set() ; UDF to hide dots around checkboxes Global $g_sKeyName = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" Global $g_sValueName = "NoDrives" Local $iRegistryReadValue = RegRead($g_sKeyName, $g_sValueName) If @error Then $iRegistryReadValue = 0 Global $g_hCheckboxLW[26] ; one checkbox for every drive letter Local $iPowerOfTwo Global $hGui = GUICreate("Hide Drives", 26 * 40 + 20, 95) For $i = 0 To 25 $g_hCheckboxLW[$i] = GUICtrlCreateCheckbox(Chr($i + 65) & ":", 10 + $i * 40, 15, -1, -1, BitOR($BS_CHECKBOX, $BS_AUTOCHECKBOX, $BS_RIGHTBUTTON, $BS_RIGHT)) $iPowerOfTwo = 2 ^ $i If BitAND($iRegistryReadValue, $iPowerOfTwo) = $iPowerOfTwo Then GUICtrlSetState(-1, $GUI_CHECKED) Next Local $hCheckAll = GUICtrlCreateButton("Check all drives", 10, 50, 200, 30) Local $hCheckNone = GUICtrlCreateButton("Uncheck all drives", 220, 50, 200, 30) Local $hSetToRegistry = GUICtrlCreateButton("Set to registry", 840, 50, 200, 30) GUISetState(@SW_SHOW) Local $sMsg While 1 $sMsg = GUIGetMsg() Switch $sMsg Case $GUI_EVENT_CLOSE Exit Case $hCheckAll For $i = 0 To 25 GUICtrlSetState($g_hCheckboxLW[$i], $GUI_CHECKED) Next Case $hCheckNone For $i = 0 To 25 GUICtrlSetState($g_hCheckboxLW[$i], $GUI_UNCHECKED) Next Case $hSetToRegistry _SetToRegistry() If Not @error Then MsgBox(0, 'Success', "Drives are set hidden to registry." & @CRLF & @CRLF & "Please logoff to activate.") Else MsgBox(0, 'Error', "Can't write to registry.") EndIf EndSwitch WEnd Func _SetToRegistry() Local $iValue = 0 For $i = 0 To 25 If GUICtrlRead($g_hCheckboxLW[$i]) = $GUI_CHECKED Then $iValue += 2 ^ $i EndIf Next ConsoleWrite($iValue & @CRLF) Local $iSuccess = RegWrite($g_sKeyName, $g_sValueName, "REG_DWORD", $iValue) Return SetError(@error, 0, $iSuccess) EndFunc This script works for the current user. Regards, Simpel2 points -
text aligning
Deye and one other reacted to JoHanatCent for a topic
You can use a fixed width font. Local Const $sFont = "Courier New" Local $hGUI = GUICreate("Example", 785, 400) Local $idOK = GUICtrlCreateButton("OK", 310, 370, 85, 25) Global $sdata, $idInput = GUICtrlCreateEdit("", 10, 10, 760, 310) ;, BitOR($ES_AUTOVSCROLL, $ES_WANTRETURN, $WS_VSCROLL)) GUICtrlSetFont(-1, 9, $FW_DONTCARE , "", $sFont)2 points -
Create PDF from your application
felix12123 reacted to taietel for a topic
If you look to output PDF's from your application (generate reports, graphics, tables etc), this UDF can be very useful. In the zip file are examples, images for testing and the UDF. Enjoy! I have removed some of the previous versions due to the lack of space, but they are still available on request. [uPDATED June 22] v.1.0.1 Added more page formats, two more fonts, example table ... [uPDATED July 30] v1.0.2 Solved issues with Adobe Reader. StuffByDennis added two more functions (Thanks Dennis). [uPDATED August 10] v1.0.3 Rewrote entirely _LoadResImage function - optimize for speed/size of the pdf. Fixed the Example_Image2PDF Thanks to xavierh for finding a missing space in the _LoadFontTT function (even it looks insignificant, that solved an issue with text justification when using Adobe Reader, not Foxit Reader) Total downloads old versions: 2044 + 21 Version 1.0.3: MPDFv103.zip1 point -
Hide drives
ModemJunki reacted to Simpel for a topic
And you can access the drive from windows explorer too. You only have to type the letter followed by colon in the address bar.1 point -
This is a weird one
Earthshine reacted to TheSaint for a topic
Mmm, that sounds wise, but I am not sure I can test something that is not gonna tell me there is an error. It has to know that first INI entry is there but unreadable. And even if i could devise a test, am I really gonna have that run every time I use an INI function? Just not intuitive or feasible. Surely this is some kind of bug that needs fixing? And rather have it fixed where it should be, than me apply the bandaid approach. P.S. At this point, I could just elect for the simple approach, and make sure all my INI files have a blank line at the start. I do that once, and then only again, if _FileCreate is used. I say that method, because at this point, I don't know for sure what creates the issue, and it could potentially happen any time. Sure, I could go to the extra trouble of making sure, every INI file is created first with FileOpen, but what if that isn't enough? Of course, I could just FileDelete the file instead of using _FileCreate, if that is indeed the culprit.1 point -
This is how SQL works, by design. SQL is based on relational algebra and is (roughly) dealing with mathematical sets and ternary logic. Sets have no intrinsic order so if you're asked to list elements of the set of natural integers between 1 and 5 inclusive, you're free to say "4, 2, 5, 3, 1" or "3, 4, 5, 2, 1" or "1, 2, 3, 5, 4" or whatever order you want. All these answers are correct. Of course you can define a partial or complete order over many sets and if the task specifies "... in increasing order" then the only correct answer is "1, 2, 3, 4, 5" if "increasing" means > (the greater than mathematical operator). Moral: in SQL the query SELECT * FROM MyTable may return rows (if any) in any order. In this context, first, last, previous, next have no sense. Many RDBMS offer windowing functions which allow to navigate ad libidum inside a resultset, but such functions are not (yet) available in SQLite. SQLite is like its name says: lite!1 point
-
Convert from C++ to Autoit for ATEM Mixer
Earthshine reacted to Danyfirex for a topic
Hello. I think the best and easy alternative for you is use .NET I think SDK has some C# examples, because convert this to AutoIt is a little hard if you dont have at least basic knowledge of C++ / AutoIt. Saludos1 point -
text aligning
Deye reacted to FrancescoDiMuro for a topic
I don't know if it could be more compact with StringRegExpReplace(), but try these two "workarounds" First workaround: Second workaround: Hope that helps1 point -
Navigate to previous, next record in SQLite db
panoss reacted to FrancescoDiMuro for a topic
@panoss I don't see anything wrong with the suggest of @BrewManNH. It's a functional, smart, and easy solution for what you're trying to do Just query the Database, store the result in an array, and navigate through the array.1 point -
send sms free using autoit
ibrahem reacted to FrancescoDiMuro for a topic
Hi @ibrahem Look at the Skype UDF1 point -
Navigate to previous, next record in SQLite db
Earthshine reacted to BrewManNH for a topic
SQLite doesn't automatically store the rows in the order you inserted them, you'd need to index the table otherwise the rows could be in any order and you can't go forwards and backwards the way I think you're wanting to do. Better to just read the whole table into an array and navigate through it instead.1 point -
Here you go #include <ColorConstantS.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> #include <GUIConstants.au3> #include <IE.au3> #include <INet.au3> #include <GUIConstantsEx.au3> #include <Date.au3> #include <File.au3> Opt("GUIOnEventMode", 1) _IEErrorHandlerRegister() $GUIname = "GUI Name" ; Calculate visible screen dimensions. $one_percent_width = @DesktopWidth / 100 $one_percent_height = @DesktopHeight / 100 $width = $one_percent_width * 98 $height = $one_percent_height * 91 Local $form = GUICreate($GUIname, @DesktopWidth, @DesktopHeight, 1, 1, $WS_MAXIMIZE + $WS_OVERLAPPEDWINDOW + $WS_VISIBLE) GUISetFont(9, 300) GUICtrlCreateTab(5, 5, $width, $height) GUICtrlCreateTabItem("Gas Network") $oIE = _IECreateEmbedded() $address = "URL" $GUIActiveX = GUICtrlCreateObj($oIE, 5, 28, $width, $height) _IENavigate($oIE, $address) GUICtrlCreateTabItem("Gas Leaks") $oIE1 = _IECreateEmbedded() $address1 = "URL" $GUIActiveX1 = GUICtrlCreateObj($oIE1, 5, 30, $width, $height) _IENavigate($oIE1, $address1) GUICtrlCreateTabItem("Cathodic Protection") $oIE2 = _IECreateEmbedded() $address2 = "URL" $GUIActiveX2 = GUICtrlCreateObj($oIE2, 5, 30, $width, $height) _IENavigate($oIE2, $address2) ; Show GUI. GUISetState(@SW_MAXIMIZE) GUISetOnEvent($GUI_EVENT_CLOSE, "_Close") $i = 0 $Timer = TimerInit ; Waiting for user to close the window. While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect checkConnection() Sleep(10) WEnd GUIDelete() Exit Func checkConnection() While 1 Sleep(10) WEnd EndFunc ;==>checkConnection Func _Close() GUIDelete() Exit EndFunc ;==>_Close1 point
-
Project is still alive and thus I want to announce version v1.80 Build 2018-07-20 after a long period of absence. If you are interested have to look to post #1.1 point