Jump to content

Andreik

Active Members
  • Posts

    3,951
  • Joined

  • Days Won

    38

Andreik last won the day on July 17

Andreik had the most liked content!

3 Followers

About Andreik

  • Birthday January 1

Profile Information

  • Member Title
    Joker

Recent Profile Visitors

5,805 profile views

Andreik's Achievements

  1. What are you talking about, how it's related to AutoIt and why did you post in this section of the forum reserved for example scripts?
  2. Global Const $DWMWA_SYSTEMBACKDROP_TYPE = 38 $tResult = DllStructCreate('int DWM_SYSTEMBACKDROP_TYPE;') $hWin = WinGetHandle('[ACTIVE]') ; Change with your window handle DllCall('Dwmapi.dll', 'long', 'DwmGetWindowAttribute', 'hwnd', $hWin, 'dword', $DWMWA_SYSTEMBACKDROP_TYPE, 'ptr', DllStructGetPtr($tResult), 'int', DllStructGetSize($tResult)) ConsoleWrite('DWM_SYSTEMBACKDROP_TYPE: ' & $tResult.DWM_SYSTEMBACKDROP_TYPE & @CRLF) Possible results: 0 - DWMSBT_AUTO 1 - DWMSBT_NONE 2 - DWMSBT_MAINWINDOW 3 - DWMSBT_TRANSIENTWINDOW 4 - DWMSBT_TABBEDWINDOW Or simply use _WinAPI_DwmGetWindowAttribute().
  3. If @Dan_555's solution doesn't work you can try this.
  4. You get the answer if you read the documentation. Use a custom GUI with an input or edit control and I think you are fine.
  5. Awesome work, thanks for sharing. One thing I couldn't get to work because I don't know where is _la_adj() defined? It's called on line 44 in example_adjustment_circle.au3. I suppose it's a relic and should be _la_adjustment().
  6. Maybe a mouse hook will work so you can get the info about what window is clicked from MOUSEHOOKSTRUCT structure. In order to find if it's a simple click or a double click you can use a timer and GetDoubleClickTime() function.
  7. ShellExecute('ms-photos:viewer?fileName={Your image path here}') or if your default app for certain file extension is already MS Photos you can simply use ShellExecute('{Your image path here}') PS: brackets above mark a placeholder, you don't need them
  8. _FileListToArrayRec() search recursively for files in subdirectories and _FileListToArray() does not.
  9. Same script works on different machines and you still think it's still something wrong with AutoIt but not with a specific machine or the network or a firewall or anything else, right? Also why don't you use ObjEvent() so you have at least an error code or a message as a starting point to identify the issue?
  10. Just use ControlFocus() and focus another control or if you want to prevent dotted focus lines then check out this thread. #include <WinAPISysWin.au3> $hGUI = GUICreate('Test') $cButton = GUICtrlCreateButton('Click Me', 100, 100, 100, 30) $hButton = GUICtrlGetHandle($cButton) $cDummy = GUICtrlCreateLabel('', 0, 0, 0, 0) GUISetState(@SW_SHOW, $hGUI) While True Switch GUIGetMsg() Case -3 ; GUI_EVENT_CLOSE Exit Case $cButton MsgBox(0, '', 'You clicked the button') EndSwitch If _WinAPI_GetFocus() = $hButton Then ControlFocus($hGUI, '', $cDummy) WEnd
  11. Here is an example about what @jchd told you about having a foreign key on Category and an update example. #include <SQLite.au3> #include <Array.au3> _SQLite_Startup() $hDB = _SQLite_Open() ; Create categories and products tables _SQLite_Exec($hDB, 'CREATE TABLE categories(' & _ 'idCategory INTEGER PRIMARY KEY,' & _ 'Category VARCHAR(32) NOT NULL' & _ ');' _ ) _SQLite_Exec($hDB, 'CREATE TABLE products' & _ '(idProduct INTEGER PRIMARY KEY,' & _ 'idCategory INTEGER NOT NULL,' & _ 'ProductName VARCHAR(64) NOT NULL,' & _ 'Price DECIMAL(10, 5) NOT NULL,' & _ 'RegisterDate DATETIME NOT NULL,' & _ 'Description TEXT,' & _ 'FOREIGN KEY(idCategory) REFERENCES categories(idCategory)' & _ ');' _ ) ; Insert categories _SQLite_Exec($hDB, 'INSERT INTO categories(Category) VALUES("Book"), ("Pen"), ("Eraser");') ; Insert some products _SQLite_Exec($hDB, 'INSERT INTO products(idCategory, ProductName, Price, RegisterDate) VALUES' & _ '(1, "Book A", 55000, "2024/09/05 10:10:10"),' & _ '(1, "Book B", 35000, "2024/09/01 15:10:10"),' & _ '(1, "Book C", 75000, "2024/09/02 11:10:10"),' & _ '(1, "Book D", 15000, "2024/09/04 10:10:10"),' & _ '(2, "Pen A", 15000, "2024/09/03 15:10:10"),' & _ '(2, "Pen B", 25000, "2024/09/03 13:10:10"),' & _ '(2, "Pen C", 35000, "2024/09/04 08:10:10"),' & _ '(2, "Pen D", 20000, "2024/09/04 09:10:10"),' & _ '(3, "Eraser A", 25000, "2024/08/04 23:10:10"),' & _ '(3, "Eraser B", 25000, "2024/10/04 13:10:10"),' & _ '(3, "Eraser C", 25000, "2022/08/04 15:10:10"),' & _ '(3, "Eraser D", 25000, "2025/03/04 23:50:10")' _ ) Local $aResult, $iRows, $iColumns ; Read all products from table _SQLite_GetTable2d($hDB, 'SELECT p.idProduct, c.Category, p.ProductName, p.Price, p.RegisterDate, p.Description ' & _ 'FROM products p INNER JOIN categories c ON p.idCategory=c.idCategory;', $aResult, $iRows, $iColumns) _ArrayDisplay($aResult) ; Read all products from table ordered by date descending _SQLite_GetTable2d($hDB, 'SELECT p.idProduct, c.Category, p.ProductName, p.Price, p.RegisterDate, p.Description ' & _ 'FROM products p INNER JOIN categories c ON p.idCategory=c.idCategory ' & _ 'ORDER BY RegisterDate DESC;', $aResult, $iRows, $iColumns) _ArrayDisplay($aResult) ; Update description of the first product _SQLite_Exec($hDB, 'UPDATE products SET Description = "Whatever you want" WHERE idProduct = 1;') _SQLite_GetTable2d($hDB, 'SELECT p.idProduct, c.Category, p.ProductName, p.Price, p.RegisterDate, p.Description ' & _ 'FROM products p INNER JOIN categories c ON p.idCategory=c.idCategory;', $aResult, $iRows, $iColumns) _ArrayDisplay($aResult) _SQLite_Close($hDB) _SQLite_Shutdown()
  12. In this case you should save date and time in database as a single column as datetime type. If you need certain portions of this data then use SQLite Date and Time functions.
  13. You can use TrIDLib. It's capable to ID many files based on their signature. Here is a full list with definitions. #include-once #include <Array.au3> Global Const $TRID_GET_RES_NUM = 1 ; Get the number of results Global Const $TRID_GET_RES_FILETYPE = 2 ; Filetype descriptions Global Const $TRID_GET_RES_FILEEXT = 3 ; Filetype extension Global Const $TRID_GET_RES_POINTS = 4 ; Matching points Global Const $TRID_GET_VER = 1001 ; TrIDLib version Global Const $TRID_GET_DEFSNUM = 1004 ; Filetypes definitions loaded $aInfo = TrIDLib_AnalyzeFile('<FilePath>') _ArrayDisplay($aInfo) Func TrIDLib_AnalyzeFile($sFile, $DefsPack = '', $bVerbose = False, $LibPath = 'TrIDLib.dll') Local $aRet, $hTrIDLib, $iTotal = 0 $hTrIDLib = DllOpen($LibPath) If $hTrIDLib = -1 Then Return False If $bVerbose Then $aRet = DllCall($hTrIDLib, 'int', 'TrID_GetInfo', 'int', $TRID_GET_VER, 'int', 0, 'str', 0) ConsoleWrite(Round($aRet[0] / 100, 2) & @CRLF) EndIf $aRet = DllCall($hTrIDLib, 'int', 'TrID_LoadDefsPack', 'str', $DefsPack) If Not $aRet[0] Then DllClose($hTrIDLib) Return Null EndIf If Not FileExists($sFile) Then Return Null $aRet = DllCall($hTrIDLib, 'int', 'TrID_SubmitFileA', 'str', $sFile) If Not $aRet[0] Then DllClose($hTrIDLib) Return Null EndIf $aRet = DllCall($hTrIDLib, 'int', 'TrID_Analyze') If Not $aRet[0] Then DllClose($hTrIDLib) Return Null EndIf $aRet = DllCall($hTrIDLib, 'int', 'TrID_GetInfo', 'int', $TRID_GET_RES_NUM, 'int', 0, 'str', 9) If $aRet[0] < 1 Then DllClose($hTrIDLib) Return Null EndIf Local $aMatches[$aRet[0] + 1][4] $aMatches[0][0] = $aRet[0] For $Index = 1 To $aRet[0] $aRet = DllCall($hTrIDLib, 'int', 'TrID_GetInfo', 'int', $TRID_GET_RES_FILETYPE, 'int', $Index, 'str', 0) $aMatches[$Index][0] = $aRet[3] $aRet = DllCall($hTrIDLib, 'int', 'TrID_GetInfo', 'int', $TRID_GET_RES_FILEEXT, 'int', $Index, 'str', 0) $aMatches[$Index][1] = $aRet[3] $aRet = DllCall($hTrIDLib, 'int', 'TrID_GetInfo', 'int', $TRID_GET_RES_POINTS, 'int', $Index, 'str', 0) $aMatches[$Index][2] = $aRet[0] $iTotal += $aRet[0] Next If $iTotal > 0 Then For $Index = 1 To $aMatches[0][0] $aMatches[$Index][3] = Round($aMatches[$Index][2] * 100 / $iTotal, 2) Next EndIf DllClose($hTrIDLib) Return $aMatches EndFunc Here you can download the required dll.
×
×
  • Create New...