Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/18/2021 in all areas

  1. Boy, has George got a lot to answer for. But then maybe he's just a comma medium ... comedian for short ... who have poetic lie sense I guess.
    2 points
  2. Enhanced the PowerPoint UDF to version 1.0. New functions will be added in the future! Comments are welcome!
    1 point
  3. As far as I can remember the recoloring aka HUE modification works only for color images. Your icon is nearly a b/w image. In this case you can do something like this here: #include <GDIPlus.au3> #include <WinAPISysWin.au3> #include <WinAPIShellEx.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Example_1() Func _SetBkIcon($ControlID, $iForeground_old, $iForeground_new, $iBackground, $sIcon, $iIndex, $iWidth, $iHeight) Local Static $STM_SETIMAGE = 0x0172 Local $hBitmap, $hImage, $hIcon, $hBkIcon, $hGfx $hIcon = _WinAPI_ShellExtractIcon($sIcon, $iIndex, $iWidth, $iHeight) $hImage = _GDIPlus_BitmapCreateFromHICON($hIcon) Local $aRemapTable[2][2] $aRemapTable[0][0] = 1 $aRemapTable[1][0] = $iForeground_old $aRemapTable[1][1] = $iForeground_new Local $hImgAttr = _GDIPlus_ImageAttributesCreate() _GDIPlus_ImageAttributesSetRemapTable($hImgAttr, $aRemapTable) Local $iW = _GDIPlus_ImageGetWidth($hImage), $iH = _GDIPlus_ImageGetHeight($hImage) $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH) $hGfx = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsClear($hGfx, $iBackground) _GDIPlus_GraphicsDrawImageRectRect($hGfx, $hImage, 0, 0, $iW, $iH, 0, 0, $iW, $iH, $hImgAttr) $hBkIcon = _GDIPlus_HICONCreateFromBitmap($hBitmap) GUICtrlSendMsg($ControlID, $STM_SETIMAGE, $IMAGE_ICON, _WinAPI_CopyIcon($hBkIcon)) _WinAPI_RedrawWindow(GUICtrlGetHandle($ControlID)) _WinAPI_DeleteObject($hIcon) _WinAPI_DeleteObject($hBkIcon) _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_ImageDispose($hImage) _GDIPlus_ImageDispose($hBitmap) _GDIPlus_ImageAttributesDispose($hImgAttr) Return SetError(0, 0, 1) EndFunc ;==>_SetBkIcon Func Example_1() Local $hGui = GUICreate("GDI+", 200, 50) GUISetState(@SW_SHOW) _GDIPlus_Startup() GUICtrlCreateIcon("", -1, 10, 10, 32, 32) _SetBkIcon(-1, 0xFF000000, 0xFFFFFFFF, 0xFF000000, @ScriptDir & "\git.ico", -1, 32, 32) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete($hGui) EndFunc ;==>Example_1 It will change the foreground color from black to white and set the background color to black.
    1 point
  4. Have you tried with _WinAPI_ShellOpenFolderAndSelectItems?
    1 point
  5. .... you don't need to compile an .au3 file to run it, you can use a line like this instead: Run(@AutoItExe & " /AutoIt3ExecuteScript " & "YourScript.au3") I don't know if I understand your goal correctly, but it might worth to take a look at this @LarsJ's udf: https://www.autoitscript.com/forum/topic/202618-implementing-irunningobjecttable-interface/ with that you could load the data of your txt file into an array; share that array via a "ROT Object" and accessing it simultaneously from several scripts running in parallel. In particular, take a look at the script "...\Examples\2) IPC Demo\Array\1) Server.au3" found in the zip attached to the first post of the LarsJ's topic. or, as already mentioned above by @jchd, you could use SQLite ; for example you could import the data into a SQLite archive and then run several scripts to access and process data in the sqlite archive at the same time. P.S. Here is a nice example (also by @jchd) on how to read and also write simultaneously from multiple scripts on an SQLite DB: https://www.autoitscript.com/forum/topic/154901-two-processes-sharing-a-file/?tab=comments#comment-1119112
    1 point
  6. To answer the original question: No. You have to do it manually, the way you are.
    1 point
×
×
  • Create New...