Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/15/2013 in all areas

  1. [NEW VERSION] - 2 Aug 18 Added: When specifying the icon to use, if the $vIcon parameter is set to the name of an ico or exe file, the main icon within will be displayed, but if a trailing "|" followed by the icon index is added to the name, that icon from within the file is used New UDF and example in the zip below. Details of previous versions: Changelog.txt A forum query about the small pop-ups that some apps produce from the systray led me to create my version of how this can be done. By the way, I call these small GUIs "Toasts" for obvious reasons! A zip containing the UDF, an example script and my StringSize UDF (which is also required): Toast.zip As always, kind comments and constructive criticisms welcome - particularly the former! M23
    1 point
  2. I have an idea for an AutoIt feature or more probably syntactical sugar. I'd like to return an array from a function like this: Global $my_array = return_array() Func return_array() Return [1, 2, 3, 4, 5] EndFunc Will that make a good feature to request? I did some searching but I don't know what this feature would be named so I hope I didn't miss any prior discussions.
    1 point
  3. coffeeturtle, I do not see why not - the Toast is a simple GUI, so if you have code to create a hyperlink you should be able to use it within the Toast just as you can a button: #include "Toast.au3" Opt("GUIOnEventMode", 1) HotKeySet("{ESC}", "On_Exit") Global $sMsg, $hProgress, $aRet[2] Global $fClicked = False _Show_Toast() While 1 Sleep(10) WEnd Func _Show_Toast() $sMsg = " " & @CRLF & " " & @CRLF & " " & @CRLF & " " & @CRLF & " " & @CRLF & " " & @CRLF _Toast_Set(Default) ; Show the Toast $aRet = _Toast_Show(0, "Button", $sMsg, 0) ; No delay ; Show the button $hButton = GUICtrlCreateButton("Test", 10, 50, 80, 30) GUICtrlSetOnEvent(-1, "_Clicked") ; Start a timer $iBegin = TimerInit() ; Now wait for a preset time or until a button is pressed Do Sleep(10) Until TimerDiff($iBegin) > 20000 Or $fClicked = True ; Reset the flag $fClicked = False _Toast_Hide() Exit EndFunc Func _Clicked() ; Do what you want MsgBox(0, "Clicked", "Button was clicked") ; Set the flag $fClicked = True EndFunc Func On_Exit() Exit EndFunc Any use? M23
    1 point
  4. Here a workaround (fast hack): #include <GDIPlus.au3> #include <GUIConstantsEx.au3> _GDIPlus_Startup() Global Const $STM_SETIMAGE = 0x0172, $IMAGE_BITMAP = 0 $hGUI = GUICreate("TEST", 200, 100) $idLabel = GUICtrlCreateLabel("LABEL", 5, 5, 80, 20) GUICtrlSetBkColor(-1, 0xb0c4de) GUICtrlSetColor(-1, 0x483d8d) ConsoleWrite(_GDIPlus_CreateCtrlBorder($hGUI, $idLabel, 0xFF5D233E) & @LF) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _GDIPlus_Shutdown() GUIDelete() Exit Case $idLabel MsgBox(0, "Test", "Label was clicked") EndSwitch WEnd Func _GDIPlus_CreateCtrlBorder($HWnd, $idCtrl, $iColor, $iPenSize = 1, $bETCHED = False) ;coded by UEZ build 2013-01-15 If Not Int($iColor) Then Return SetError(1, 0, 0) Local $aPos = ControlGetPos($HWnd, "", $idCtrl) If @error Then Return SetError(2, 0, 0) Local $hPen = _GDIPlus_PenCreate(0, $iPenSize) Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $aPos[2] + 2, "int", $aPos[3] + 2, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0) Local $hCtxt = _GDIPlus_ImageGetGraphicsContext($aResult[6]), $iD = 1 If $bETCHED Then $iD = -Floor($iPenSize / 2 - 1 * ($iPenSize = 1)) _GDIPlus_PenSetColor($hPen, 0xFFFEFEFE) _GDIPlus_PenSetWidth($hPen, $iPenSize * 2) _GDIPlus_GraphicsDrawRect($hCtxt, $iPenSize, $iPenSize, $aPos[2] - $iPenSize + 1, $aPos[3] - $iPenSize + 1, $hPen) EndIf _GDIPlus_PenSetColor($hPen, $iColor) _GDIPlus_PenSetWidth($hPen, $iPenSize) _GDIPlus_GraphicsDrawRect($hCtxt, Int($iPenSize / 2), Int($iPenSize / 2), $aPos[2] - $iPenSize + $iD + (Not ($bETCHED > 0)), $aPos[3] - $iPenSize + $iD + (Not ($bETCHED > 0)), $hPen) Local $iPic = GUICtrlCreatePic("", $aPos[0] - 1, $aPos[1] - 1, $aPos[2] + 1, $aPos[3] + 1) GUICtrlSetState(-1, $GUI_DISABLE) Local $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($aResult[6]) $hB = GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBitmap) If $hB Then _WinAPI_DeleteObject($hB) _GDIPlus_PenDispose($hPen) _GDIPlus_BitmapDispose($aResult[6]) _WinAPI_DeleteObject($hHBitmap) Return 1 EndFunc ;==>_GDIPlus_CreateCtrlBorder Br, UEZ
    1 point
  5. Because 0 is False. ConsoleWrite((-1 = True) & @LF) As stated in the helpfile on Language Reference > Datatypes
    1 point
  6. Flaky, From "Language Reference - Data Types" kylomas
    1 point
  7. water

    Portability of C++ EXE/DLL

    I read Mat's reply as if he means the first selection "Multi-threaded (/MT)"
    1 point
×
×
  • Create New...