Leaderboard
Popular Content
Showing content with the highest reputation on 06/15/2023 in all areas
-
Thank you for your order, valued customer! We aim to serve! Will that be paid in cash, crypto, or by card?6 points
-
I've now actually coded something for this, and there is a real possibility that it might bear some fruit. So far, just with several quick checks, I have discovered some folders containing covers for ebooks on my Kobo device that are not showing on my Kobo device. Clearly the Image ID value is different. There are a lot of these folders, not belonging to ebooks on my Kobo device ... or at least not matching up in some cases with the Image ID values. Most of these images are for ebooks I own, but not yet on my device or for ebooks I don't own, but I have looked at at the Kobo store or have been targeted advertising to me. A possible solution for me, depending on how these numbered sub-folders work, is to either copy the correct Image ID files to the matching folders or just rename to the correct Image ID what is already there. I can only try it and see what happens, as I have no idea why many of my ebooks on the Kobo are missing image files. I could hazard a guess or two. One guess is that these particular ebooks were once on my Wishlist and so some kind of conflict happened when I subsequently bought them and downloaded them to my device. Or maybe a similar thing for those ebooks advertised to me or that I looked at while browsing. My second guess, is it might be related to how I got the ebooks on my device, which in many cases, and all the time now, is a forced download, where I am pretending I want to read that ebook now. I've been doing that every time sync fails to work or downloads get stuck on pending. As sync currently doesn't work for me, that's how I currently get my latest purchases onto my Kobo device. Perhaps covers aren't added properly or correctly when I use this method of downloading. I need to investigate this further. My new code isn't complete yet. I've added three new buttons to the 'Program Setting' window in a grouping called - Device Images Folder. The first creates a file list of every image folder that is occupied, and where it can, adds the Author and Title names to each. The second button shows that list as a plain text file, TAB delimited. The third button I am still working on, though it currently shows the list, sorted by Author & Title, in an _ArrayDisplay, along with column headers and a function that can be called for each selected row. The function executes the image for the selected row entry, though because the file extension is '.parsed' and not the '.jpg' it truly is, my image viewer program (IrfanView) always asks me if I want to rename to '.jpg'. This makes checking a pain. My intent is to have a GUI instead via that function, that will display multiple images that can be cycled to the next lot, one image for each ebook. It will probably show 20 cover image thumbnails at a time. This will allow me to very quickly discover things.1 point
-
An other way, without a hook #include <GUIConstantsEx.au3> #include <GuiRichEdit.au3> #include <WindowsConstants.au3> $hGui = GUICreate("Example", 320, 350, -1, -1) $hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 300, 220) GUISetState() _GUICtrlRichEdit_SetEventMask($hRichEdit, $ENM_KEYEVENTS) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") While 1 $iMsg = GUIGetMsg() Select Case $iMsg = $GUI_EVENT_CLOSE _GUICtrlRichEdit_Destroy($hRichEdit) ; needed unless script crashes Exit EndSelect WEnd Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $wParam Local $hWndFrom, $iCode, $tNMHDR, $tMsgFilter, $hMenu $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hRichEdit Select Case $iCode = $EN_MSGFILTER $tMsgFilter = DllStructCreate($tagMSGFILTER, $lParam) Switch DllStructGetData($tMsgFilter, "msg") Case $WM_KEYDOWN $key = DllStructGetData($tMsgFilter, "wparam") If $key = 13 Then _GUICtrlRichEdit_AppendText($hRichEdit, "<CR>") ; @CR EndSwitch EndSelect EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Edit To display the <CR> without processing the newline just add "Return 1" If $key = 13 Then _GUICtrlRichEdit_AppendText($hRichEdit, "<CR>") ; @CR Return 1 EndIf1 point
-
Do not worry, we do understand that as soon as user see something to download between x64 x32 he thinks So its ok, we do understand .1 point
-
For MySQL I use MySQL ODBC 8.0 Unicode Driver and connection string: But again, you must have the driver that you use installed. Use this code to list the installed drivers and show us the result. $aDriver = Get_ODBC_Drivers() For $Index = 1 To $aDriver[0] ConsoleWrite($aDriver[$Index] & @CRLF) Next Func Get_ODBC_Drivers($x64 = False) Local $sDrivers, $sDriver, $iInstance = 1 Do $sDriver = RegEnumVal('HKLM' & ($x64 ? '64' : '') & '\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers', $iInstance) If $sDriver Then $sDrivers &= $sDriver & Chr(1) $iInstance += 1 Until Not $sDriver Return StringSplit(StringTrimRight($sDrivers, 1), Chr(1)) EndFunc1 point
-
I still don't get this confusion. It's SQL Server or MySQL? They are not the same.1 point
-
@mLipok about this line dono if itl work with no {} so from $sDriver = "MySQL ODBC 8.0 ANSI Driver" to $sDriver = "{MySQL ODBC 8.0 ANSI Driver}" coz of clean in string usage?1 point
-
Install it or let us know what drivers you already have.1 point
-
so we had to check this snippet: #include <Array.au3> #include "ADO.au3" #variables... Local $s_QUERY = '' ; your query $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") _ArrayDisplay(Get_ODBC_Drivers()) Local $sDriver = "MySQL ODBC 8.0 ANSI Driver" ;https://dev.mysql.com/downloads/file/?id=517870 32-bit driver for 32bit autoit Local $sConnectionString = "Driver=" & $sDriver & ";" &"Server=" & $sServer & "; Database=" & $sDatabase & "; Uid=" & $sUsername & "; Pwd=" & $sPassword & ";" Local $oConnection = ObjCreate('ADODB.Connection') $oConnection.Open($sConnectionString) ; SQL Server authentication $oRowset = $oConnection.Execute($s_QUERY) $aData = $oRowset.GetRows() _ArrayDisplay($aData, 'TEST 1') $aData = _ADO_Execute($oConnection, '$s_QUERY', True,True) _ArrayDisplay($aData, 'TEST 2') Func _ErrFunc($oError) ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _ @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _ @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF) EndFunc Func Get_ODBC_Drivers($x64 = False) Local $sDrivers, $sDriver, $iInstance = 1 Do $sDriver = RegEnumVal('HKLM' & ($x64 ? '64' : '') & '\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers', $iInstance) If $sDriver Then $sDrivers &= $sDriver & Chr(1) $iInstance += 1 Until Not $sDriver Return StringSplit(StringTrimRight($sDrivers, 1), Chr(1)) EndFunc REMARK: without testing ... I have no access to MySQL even not saving this file and not testing with TIDY/AU3check1 point
-
so we have to use: Driver={MySQL ODBC 5.2 ANSI Driver};Server=myServerAddress;Port=3306;Database=myDataBase;User=myUsername;Password=myPassword;Option=3; instead: https://www.connectionstrings.com/mysql/ Specifying TCP port Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;Pwd=myPassword;1 point
-
next snippet to test: #include <Array.au3> #include "ADO.au3" #variables... $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") _ArrayDisplay(Get_ODBC_Drivers()) Local $sConnectionString = "Server=" & $sServer & "; Database=" & $sDatabase & "; Uid=" & $sUsername & "; Pwd=" & $sPassword & ";" Local $oConnection = ObjCreate('ADODB.Connection') $oConnection.Open($sConnectionString) ; SQL Server authentication Local $s_QUERY = $oRowset = $oConnection.Execute($s_QUERY) $aData = $oRowset.GetRows() _ArrayDisplay($aData, 'TEST 1') $aData = _ADO_Execute($oConnection, '$s_QUERY', True,True) _ArrayDisplay($aData, 'TEST 2') Func _ErrFunc($oError) ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _ @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _ @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF) EndFunc Func Get_ODBC_Drivers($x64 = False) Local $sDrivers, $sDriver, $iInstance = 1 Do $sDriver = RegEnumVal('HKLM' & ($x64 ? '64' : '') & '\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers', $iInstance) If $sDriver Then $sDrivers &= $sDriver & Chr(1) $iInstance += 1 Until Not $sDriver Return StringSplit(StringTrimRight($sDrivers, 1), Chr(1)) EndFunc EDIT: here I use modfied @Andreik example. As you can see we are using the same $oConnection but in different ways we get data. Local $sConnectionString = "Server=" & $sServer & "; Database=" & $sDatabase & "; Uid=" & $sUsername & "; Pwd=" & $sPassword & ";" Local $oConnection = ObjCreate('ADODB.Connection') $oConnection.Open($sConnectionString) ; SQL Server authentication Local $s_QUERY = $oRowset = $oConnection.Execute($s_QUERY) $aData = $oRowset.GetRows() _ArrayDisplay($aData, 'TEST 1') $aData = _ADO_Execute($oConnection, '$s_QUERY', True,True) _ArrayDisplay($aData, 'TEST 2')1 point
-
https://dev.mysql.com/downloads/file/?id=517870 32-bit driver for 32bit autoit or direct link https://dev.mysql.com/get/Downloads/Connector-ODBC/8.0/mysql-connector-odbc-8.0.33-win32.msi #include "ADO.au3" #include <Array.au3> #include <MsgBoxConstants.au3> #include <AutoItConstants.au3> _Example_ListProperties() Func _Example_ListProperties() Local $sConnectionString = _ADO_ConnectionString_MySQL('root', '', 'test', 'MySQL ODBC 8.0 ANSI Driver', 'localhost', '3306') Local $oConnection = _ADO_Connection_Create() _ADO_Connection_OpenConString($oConnection, $sConnectionString) If @error Then MsgBox(0,@error,@extended) Local $aRecordset = _ADO_Execute($oConnection, "SELECT * FROM testtable", True) If @error Then MsgBox(0,@error,@extended) _ADO_Connection_Close($oConnection) $oConnection = Null _ADO_Recordset_Display($aRecordset, 'Recordset content') If @error Then MsgBox(0,@error,@extended) EndFunc ;==>_Example_2_RecordsetDisplay1 point
-
Distinguish Left/Right Click Sub Menu
argumentum reacted to kjpolker for a topic
A bit silly, but my intention was for it to be a bit of an easter egg. A way to access back end information, but I admit the idea was more of a learning opportunity for me to get creative and I took advantage of the idea to improve my understanding of code. The actual script I am looking to implement it on is a glorified mouse clicker with a bunch of handy tools for interacting with Windows. This! I was looking down the right path but fell short. I was able to find WM_MENUSELECT and that was not working as desired. This is exactly what I was looking for and would not have been able to piece it together without help. I have zero understanding of how that Function is working which gives me a chance to read up1 point -
I usually work with the native SQL Server driver. Check if it's installed (the result of Get_ODBC_Drivers() function) and then try this code and let me know the result: #include <Array.au3> $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") $Username = 'sa' $Password = '<password>' _ArrayDisplay(Get_ODBC_Drivers()) Local $oADODB = ObjCreate('ADODB.Connection') ;~ $oADODB.Open('Provider=SQLNCLI11;Server=localhost;Database=master;Integrated Security=SSPI;') ; Windows authentication $oADODB.Open('Provider=SQLNCLI11;Server=localhost;Database=master;', $Username, $Password) ; SQL Server authentication $oRowset = $oADODB.Execute('SELECT TOP 5 * FROM sys.all_columns') $aData = $oRowset.GetRows() _ArrayDisplay($aData) Func _ErrFunc($oError) ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _ @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _ @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF) EndFunc Func Get_ODBC_Drivers($x64 = False) Local $sDrivers, $sDriver, $iInstance = 1 Do $sDriver = RegEnumVal('HKLM' & ($x64 ? '64' : '') & '\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers', $iInstance) If $sDriver Then $sDrivers &= $sDriver & Chr(1) $iInstance += 1 Until Not $sDriver Return StringSplit(StringTrimRight($sDrivers, 1), Chr(1)) EndFunc1 point
-
please try also: ConsoleWrite('VarGetType=' & VarGetType($oConnection) & @CRLF) ConsoleWrite('IsObj=' & IsObj($oConnection) & @CRLF) ConsoleWrite('ObjName=' & ObjName($oConnection, $OBJ_NAME) & @CRLF) ConsoleWrite('ObjName=' & ObjName($oConnection, $OBJ_STRING) & @CRLF) ConsoleWrite('ObjName=' & ObjName($oConnection, $OBJ_PROGID) & @CRLF)1 point
-
It is quite strange. I think problem occurs in _ADO_Connection_Create() try this modified code: ;includes... ;variables... _ADO_ComErrorHandler_UserFunction(_ADO_COMErrorHandler) _Example2() Func _Example2() Local $oConnection = _ADO_Connection_Create() If @error Then ConsoleWrite("! ---> @error=" & @error & " @extended=" & @extended & _ " : _ADO_Connection_Create()" & @CRLF) ConsoleWrite('VarGetType=' & VarGetType($oConnection) & @CRLF) ConsoleWrite('ObjName=' & ObjName($oConnection) & @CRLF) Local $sConnectionString = "Server=" & $sServer & "; Database=" & $sDatabase & "; Uid=" & $sUsername & "; Pwd=" & $sPassword & ";" _ADO_Connection_OpenConString($oConnection, $sConnectionString) If @error Then Return SetError(@error, @extended, $ADO_RET_FAILURE) Else MsgBox(1, ":D", "working") EndIf ; CleanUp _ADO_Connection_Close($oConnection) $oConnection = Null _ADO_REcordset_Display($aRecordset, $sTableName & ' - Recordset content') EndFunc ;==>_Example21 point
-
Damn flaky USB connection to my Kobo ereader device ... it played havoc for a while today, before finally settling down long enough to do the placebo images transfer. I started with the FIX COVERS option, and besides having to repeat a few due to the USB issue, I eventually did them all followed by two separate sittings where I transferred the placebo images, rebooting my Kobo device in-between and after. All the cover images that I fixed are now appearing on my Kobo device as they should. So that now definitely works. I am yet to see any evidence of success for having added a few missing covers (where the known sub-folders exist) or when filling empty sub-folders with placebo images. All those empty folders have 120 image files in each now, with an image file for each of the three sizes within ... all 74 folders. I added in the disable/enable controls code for the RELOCATE button process. I also tweaked the status label field, to accommodate a bit more text in the relocate process, which now also gets updated every two placebo folders copying. I had mistakenly called it files instead of folders. Also added another line in that process for the log file, plus a results dialog at the end. In regard to the flaky USB connection, it seems to me the issue is software related, especially as it will lose the connection, then not much later find it again ... but of course you need to respond to a dialog when that happens or it won't continue with the connection. So alas with this issue, Wifi becomes even more important to me. I've now downloaded my recent purchases from Kobo to the device, which will require me starting over with the whole process of my program, if I need to use it again ... which I will for the several ebooks I side-loaded yesterday, to fix their covers. Beyond all that, I am at an impasse now, with the ebooks that are not displaying a cover (just the default generic text based one). Anything else is purely a guess right now, and any possible solutions are too thin on the ground. I need to know more, about how the numbered sub-folder names are determined, and whether one or more database entries need creating or updating, and whether I can do that myself or not. I might even try contacting Kobo directly about those things or some of them. Before that, I might try contacting a few folk at the MobiRead Forum, but I suspect they will just recommend using calibre to add ebooks, which is not what I want to do, and I cannot do it properly from this old PC in any case, due to the version of calibre that can run on this PC. If I cannot get the information I need, then in the end, I will need to just side-load all the remaining ebooks that have cover issues ... either with the DRM (preferred) or DRM-Free version of each ebook. That will likely mean needing to use the FIX COVERS process for each side-loaded ebook, which would be simple enough if I did not have such a flaky USB connection with my Kobo device. Actually I have one idea remaining, that would not be difficult to try or investigate. I have been working on the principle (hoping) that the number sub-folders already exist for every ebook. My presumption so far, is that they were hopefully the empty ones, which now doesn't seem to be the case, unless some kind of database entry needs to also exist. It would seem those empty folders might just be for ebooks that did exist on my Kobo but were removed, and then not cleaned up like they should have been. I've certainly had to remove many ebooks that were automatically copied to my device during a sync, that I did not yet want on my device (mostly freebies by unknown authors, but also some large graphic ebooks only suitable for a large tablet screen). The stupid sync process, when it works, always downloads the last five purchases, if they don't exist on your device. it has occurred to me, that maybe it isn't about empty folders, but rather a folder with some kind of generic content, such that my program could not match anything. I'm going to think a bit more about that, and then maybe develop something. I am currently thinking that a kind of map (list) of every ebook and its sub-folder would be a handy thing. Basically this would be creating a sorted list of the content of every images sub-folder, to see what else gets revealed. DOWNLOAD Kobo Cover Fixer.au3 (45 downloads) SEE THE FIRST POST in this topic for the latest version. 141.9 kB FYI (maybe). Back in the earlier days of my Kindle ereader devices (E-Ink), I used to download every single ebook I purchased from Amazon, even the free ones by unknown to me authors. Eventually I ran out of space on my two Kindles, so I stopped downloading those free ones, and over time removed the ones already on my devices to claw back some storage space ... and I am still doing that, as I removed the less great seeming ones first. I decided to not make that mistake with my Kobo E-Ink device, so it is truly annoying that automatic process when syncing ... not smart to do that unnecessary file writing to my Kobo device drive either. It is only the Kindle For PC app on my PC, that has a full list & download of every ebook purchase, as it is set as the default device for each ebook ... every ebook prior to January 1st 2023 that is, as I refuse to update to a version of Kindle For PC that won't run on this PC.1 point
-
1 point
-
You can also specify Driver: https://www.connectionstrings.com/mysql-connector-odbc-5-2/ Specifying TCP/IP port Driver={MySQL ODBC 5.2 ANSI Driver};Server=myServerAddress;Port=3306;Database=myDataBase;User=myUsername;Password=myPassword;Option=3;1 point
-
https://www.connectionstrings.com/mysql/ Specifying TCP port Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;Pwd=myPassword; EDIT: So the solution should look like: Func _Example2() ; https://www.connectionstrings.com/mysql/ ; Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;Pwd=myPassword; Local $sConnectionString = 'Server=' & $sServer & ';Port=' & $sPort & ';Database=' & $sDatabase & ';Uid=' & $sUser & ';Pwd=' & $sPassword & ';'1 point
-
this following part: is wrong. EDTI: You wanted connect to MySQL but you are using connection string for mixed PostgreSQL+MS SQL Server1 point
-
Here is the complete working code: Global $ServiceManager $ServiceManager = ObjCreate("com.sun.star.ServiceManager") $MSword = $ServiceManager.createInstance("com.sun.star.frame.Desktop") $source = "C:\test.docx" $source2 = Convert2URL($source) Global $args[3] $args[0] = MakePropertyValue("ReadOnly", False) $args[1] = MakePropertyValue("Password", "") $args[2] = MakePropertyValue("Hidden", False) $doc1 = $MSword.loadComponentFromURL($source2, "_blank", 0, $args) $ViewCursor = $doc1.CurrentController.getViewCursor() $PageStyle = $ViewCursor.PageStyleName $Style = $doc1.StyleFamilies.getByName("PageStyles").getByName($PageStyle) $PageHeight = $Style.height/100 $PageWidth = $Style.width/100 $PageOrientation = $Style.isLandscape ConsoleWrite($PageHeight & " x " & $PageWidth &@LF) ConsoleWrite("Page is landscape: " & $PageOrientation &@LF) Func MakePropertyValue($cName, $uValue) Local $Pstruc $Pstruc = $ServiceManager.Bridge_GetStruct("com.sun.star.beans.PropertyValue") $Pstruc.Name = $cName $Pstruc.Value = $uValue Return $Pstruc EndFunc Func Convert2URL($fname) $fname = StringReplace($fname, ":", "|") $fname = StringReplace($fname, " ", "%20") $fname = "file:///" & StringReplace($fname, "\", "/") Return $fname EndFunc1 point
-
I believe you will have to resort to a Message handler. Here is an example which handles the WM_MENURBUTTONUP Windows Message ID. #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <GuiMenu.au3> Global $GUI, $menu, $subMenu $GUI = GUICreate("Example GUI", 300, 200) $menu = GUICtrlCreateMenu("&File") $subMenu = GUICtrlCreateMenuItem("Options", $menu) GUIRegisterMsg($WM_MENURBUTTONUP, "_WM_MENURBUTTONUP") ;Register Message Handler GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $subMenu MsgBox(0, "Test", "Left Clicked") EndSwitch WEnd Func _WM_MENURBUTTONUP($hWnd, $iMsg, $wParam, $lParam) Local $hMenu = GUICtrlGetHandle($menu) Switch $lParam ;Handle of triggering Menu Case $hMenu Local $iMenuIndexID = _GUICtrlMenu_GetItemID($hMenu, $wParam) ;Get ID using Handle of Menu Subitem ($wParam) Switch $iMenuIndexID Case $subMenu MsgBox(0, "Test", "Right Clicked") EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc1 point
-
A new day and a somewhat new beginning. My suspicion about the secondary copy option (Alternate Device Drive) proved to be true. I'd forgotten to set the overwrite flag. With the primary copy option, working with the cloned device folders, there wasn't an issue. This was because my code deliberately deleted any existing image file that was being replaced by the FIX COVERS process. The replacement file was then created at that location with the GDIPlus code. Then, if use of the Alternate Device Drive was enabled, a copy of that created file was copied across to that second location, which in my case was to the Kobo device itself, in the correct images sub-folder. That clearly did not happen yesterday, because overwrite was not specified. So problem solved for that process now. Then, because of the failure of the placebo images to reveal anything at this stage, I decided I should go all out and also try with the two other bigger image sizes, so I coded an option to allow doing that, plus a good amount of time testing to determine Font size and placement coordinates etc for these two new sizes. I also discovered an unnecessary bit of code in my original code with the smallest placebo image creation, which then made things simpler for the two bigger images. Note the 'Placebo Size' line in 'Other Options' in the following screenshot. While doing the additional placebo code, I also decided to add a hide/show status label near the top of the Results window. That got rid of one Splash screen and gives more feedback during the BUILD and RELOCATE button processes for placebo images. The status text is shown in red, as seen in the following screenshot. Every ten created images that text gets updated during the build process, and every 50 copied images in the RELOCATE process. I also realized I hadn't added the code to disable all controls during the BUILD process, so added that. And just now, laugh out loud, I realize I forgot to add it for the RELOCATE button process as well ... oh well ... all the placebo code might prove to be pointless anyway. I haven't yet tested anything again with my Kobo device, that's next. I did however have the mid size placebo images be created in readiness for relocation, all 2960 of them. By the way, my drive detection code did detect my Kobo device drive letter. DOWNLOAD Kobo Cover Fixer.au3 (47 downloads) SEE THE FIRST POST in this topic for the latest version. 138.36 kB1 point
-
This UDF can be used to draw at the Desktop Wallpaper (Windows 8+) with GDI+ without using files. The example runs with 60-120fps at my machine, so the speed is acceptable. When the script exits, the original wallpaper is restored. Have fun :). PS: The UDF uses the window between the background and the icons, so it could be used to add an own child window at the desktop. Just look at the begin of __Wallpaper_Startup ($hWorkerW). Example: WallpaperUDF.au3 WallpaperUDF Example.au31 point
-
Need a script that type @ - (Moved)
20Ice18 reacted to matteus_71 for a topic
Hello everyone! Newbie here. Something happened a while ago with my pc. I can´t get my keyboard to type @ I am only able to type it when using a virtual keyboard. Why this is, is beyond me. So...until I know why, I would like a script doing this: When I press a key on the keyboard, it will type @ I have searched help for Autoit and googled it but it has only made me more confused. How would you do it? Thanks!0 points -
$ES_WANTRETURN - Specifies that a carriage return be inserted when the user presses the ENTER key. (Default) This is just a default and will NOT SHOW it in the control...0 points
-
Active Directory problem - User Cannot Change Password
20Ice18 reacted to guaikahenguai for a topic
I want to modify the user account "User Cannot Change Password" option by remotely connecting to the Active Directory (using the same way as RSAT). Current situation: I run the following script on the local computer to connect to the Active Directory and modify the "User Cannot Change Password" option of the specified user account, the setting does not take effect. #NoTrayIcon ;~ #RequireAdmin #include <AD.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> _AD_ErrorNotify(1) Global $AD_user = "gg.com\ADadmin" ;ADadmin member of Domain Admins Global $AD_pswd = "Abcd.123654" Global $AD_domain = "gg.com" Global $nMsg, $sUser, $sUser1, $sUser2 _AD_Open($AD_user,$AD_pswd,"",$AD_domain) If @error Then Exit MsgBox(16, "Active Directory Example Skript", "Function _AD_Open encountered a problem. @error = " & @error & ", @extended = " & @extended) Global $iReply = MsgBox(308, "Enables/Disable change password", "This script Enables/Disable the specified user to change their password." & @CRLF & @CRLF & _ "Are you sure you want to change the Active Directory?") If $iReply <> 6 Then Exit #region ### START Koda GUI section ### Form= Global $Form1 = GUICreate("Active Directory Functions - Example 1", 714, 124) GUICtrlCreateLabel("User to change (FQDN or sAMAccountName):", 8, 10, 231, 17) Global $IUser = GUICtrlCreateInput("", 241, 10, 459, 21) Global $BDisable = GUICtrlCreateButton( "Disable", 8, 72, 121, 33) Global $BEnable = GUICtrlCreateButton( "Enable", 260, 72, 121, 33) Global $BCancel = GUICtrlCreateButton("Cancel", 628, 72, 73, 33, BitOR($GUI_SS_DEFAULT_BUTTON, $BS_DEFPUSHBUTTON)) GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $BCancel Exit Case $BDisable $sUser1 = GUICtrlRead($IUser) _DisablePasswordChange($sUser1) ExitLoop Case $BEnable $sUser2 = GUICtrlRead($IUser) _EnablePasswordChange($sUser2) ExitLoop EndSwitch WEnd Func _DisablePasswordChange($sUser) Local $iValue1 = _AD_DisablePasswordChange($sUser) ConsoleWrite("Result: " & $iValue1 & ", error: " & @error & ", extended: " & @extended) If $iValue1 = 1 Then MsgBox(64, "Disable Password Change", "User '" & $sUser & "' successfully changed") ElseIf @error = 1 Then MsgBox(64, "Disable Password Change", "User '" & $sUser & "' does not exist") Else MsgBox(64, "Disable Password Change", "Return code '" & @error & "' from Active Directory") EndIf EndFunc Func _EnablePasswordChange($sUser) Local $iValue2 = _AD_EnablePasswordChange($sUser) ConsoleWrite("Result: " & $iValue2 & ", error: " & @error & ", extended: " & @extended) If $iValue2 = 1 Then MsgBox(64, "Enable Password Change", "User '" & $sUser & "' successfully changed") ElseIf @error = 1 Then MsgBox(64, "Enable Password Change", "User '" & $sUser & "' does not exist") Else MsgBox(64, "Enable Password Change", "Return code '" & @error & "' from Active Directory") EndIf EndFunc _AD_Close() I get the _AD_ErrorNotify(1) error message: COM Error Encountered in _AD_DisablePasswordChange.au3 AD UDF version = 1.6.1 @AutoItVersion = 3.3.15.4 @AutoItX64 = 1 @Compiled = 0 @OSArch = X64 @OSVersion = WIN_10 Scriptline = 1322 NumberHex = 0x80020009 Number = -2147352567 WinDescription = Exception occurred. Description = Source = HelpFile = HelpContext = 0 LastDllError = 0 The script can modify the user's "User Cannot Change Password" option and take effect when running in Active Directory. I've been working on this for a few days and can't figure it out. Does anyone have the same problem and I need help.😭 thanks in advance!0 points