-
Posts
3,951 -
Joined
-
Days Won
38
Andreik last won the day on July 17
Andreik had the most liked content!
About Andreik
- Birthday January 1
Profile Information
-
Member Title
Joker
Recent Profile Visitors
Andreik's Achievements
-
Count down in For...Next loop?
Andreik replied to emendelson's topic in AutoIt General Help and Support
For $x = 90 To 65 Step -1 ... Next -
Tutorial AutoIT - PHP -MySQL.v2.0 - (Moved)
Andreik replied to abarba's topic in AutoIt General Help and Support
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? -
Get Mica or Mica Alt color in Windows 11
Andreik replied to electryon's topic in AutoIt General Help and Support
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(). -
Keybanger reacted to a post in a topic: Gui not staying on top of pinned apps.
-
Dan_555 reacted to a post in a topic: Gui not staying on top of pinned apps.
-
Gui not staying on top of pinned apps.
Andreik replied to Keybanger's topic in AutoIt GUI Help and Support
If @Dan_555's solution doesn't work you can try this. -
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.
-
Andreik reacted to a post in a topic: BLAS/LAPACK-based Linear Algebra and nonlinear adjustment UDF
-
Andreik reacted to a post in a topic: BLAS/LAPACK-based Linear Algebra and nonlinear adjustment UDF
-
CYCho reacted to a post in a topic: zPlayer - My own little audio/video player
-
zPlayer - My own little audio/video player
Andreik replied to CYCho's topic in AutoIt Example Scripts
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. -
JohnnyMcDollar reacted to a post in a topic: Running Microsoft Photos application with Autoit3
-
Running Microsoft Photos application with Autoit3
Andreik replied to JohnnyMcDollar's topic in AutoIt GUI Help and Support
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 -
_FileListToArray versus _FileListToArrayRec
Andreik replied to mr-es335's topic in AutoIt General Help and Support
_FileListToArrayRec() search recursively for files in subdirectories and _FileListToArray() does not. -
HTTP.Send() ERROR thrown for GET Request
Andreik replied to Aviral's topic in AutoIt General Help and Support
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? -
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
-
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()
-
Trong reacted to a post in a topic: File Detect Type
-
Andreik reacted to a post in a topic: How to get or read a single data in SQLite database?
-
ioa747 reacted to a post in a topic: File Detect Type
-
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.