Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/21/2018 in all areas

  1. This seems to be a little better - based on a script by UEZ #include <WindowsConstants.au3> #include <WinApi.au3> #include <GDIPlus.au3> _GDIPlus_Startup() ; Create GUI Local $hGUI = GUICreate('Test', 500, 300, -1,-1,$WS_POPUP, $WS_EX_LAYERED) GUISetBkColor(0xABCDEF) Local $idPic = GUICtrlCreatePic('', 0, 0, 500, 300) Local $hPic = GUICtrlGetHandle($idPic) Local $hGDIBmp = _GDIPlus_CreateBitmapRoundCornerRect() _WinAPI_DeleteObject(GUICtrlSendMsg($idPic, 0x0172, $IMAGE_BITMAP, $hGDIBmp)) _WinAPI_SetLayeredWindowAttributes($hGUI, 0xABCDEF, 255) GUISetState(@SW_SHOW) Do Until GUIGetMsg() = -3 _WinAPI_DeleteObject($hGDIBmp) _GDIPlus_Shutdown() Func _GDIPlus_CreateBitmapRoundCornerRect($iW = 500, $iH = 300, $iColorBg = 0xFF505050, $iColorBorder = 0xFF505050, $iRadius = 15, $bGDIBmp = 1) Local Const $iX = 0, $iY = 0, $iPenSize = 1 Local Const $iWidth = $iW - $iPenSize, $iHeight = $iH - $iPenSize Local Const $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetSmoothingMode($hCtxt, $GDIP_SMOOTHINGMODE_HIGHQUALITY) _GDIPlus_GraphicsSetTextRenderingHint($hCtxt, $GDIP_TEXTRENDERINGHINT_ANTIALIASGRIDFIT) Local Const $hPath = _GDIPlus_PathCreate() _GDIPlus_PathAddArc($hPath, $iX + $iWidth - ($iRadius * 2), $iY, $iRadius * 2, $iRadius * 2, 270, 90) _GDIPlus_PathAddArc($hPath, $iX + $iWidth - ($iRadius * 2), $iY + $iHeight - ($iRadius * 2), $iRadius * 2, $iRadius * 2, 0, 90) _GDIPlus_PathAddArc($hPath, $iX, $iY + $iHeight - ($iRadius * 2), $iRadius * 2, $iRadius * 2, 90, 90) _GDIPlus_PathAddArc($hPath, $iX, $iY, $iRadius * 2, $iRadius * 2, 180, 90) _GDIPlus_PathCloseFigure($hPath) Local Const $hBrush = _GDIPlus_BrushCreateSolid($iColorBg) _GDIPlus_GraphicsFillPath($hCtxt, $hPath, $hBrush) Local Const $hPen = _GDIPlus_PenCreate($iColorBorder, $iPenSize) _GDIPlus_GraphicsDrawPath($hCtxt, $hPath, $hPen) _GDIPlus_PathDispose($hPath) _GDIPlus_BrushDispose($hBrush) _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($hCtxt) If $bGDIBmp Then Local $hGDIBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) Return $hGDIBmp EndIf Return $hBitmap EndFunc
    1 point
  2. removing my post for there is nothing I can say here without starting an argument so it is gone.
    1 point
  3. News Flash. It's not multi threaded this is never going to work as you want it to
    1 point
  4. We do not expect a PERFECT explanation, but we do expect that you TRY to explain your PROBLEM. What do you do in your next post? You quote the post again As it seems you do not read our replies and just keep repeating your initial post I'm out now!
    1 point
  5. You do not explain the problem, you explain the solution you try to implement. Explaining the problem would be like: "I have a script that runs application x. Sometimes a popup gets displayed. I need a function to wait for this popup and click a button"
    1 point
  6. 2 things: 1 - Dont quote a post directly above, it's anoying. 2 - That is not "running 2 functions simultaneously", that is alternating between 2 functions. HotKeySet("{ESC}", "Terminate") HotKeySet("{F2}", "OnOff") ;============================================================================= Local $Timer1, $RdmTime Local $On = 0 ;============================================================================= Func OnOff() If $On = 1 Then $On = 0 Else $On = 1 EndIf EndFunc ;==>OnOff ;============================================================================= Func _F3a_Func() ConsoleWrite('_F3a_Func - ' & @MSEC & @CRLF) EndFunc ;==>_F3a_Func ;============================================================================= Func _F4a_Func() ConsoleWrite('_F4a_Func - ' & @MSEC & @CRLF) EndFunc ;==>_F4a_Func ;============================================================================= While 1 If $On = 1 Then ;============================================================================= $RdmTime = Random(1000, 4000, 1) $Timer1 = TimerInit() Do If $On = 0 Then ExitLoop EndIf _F3a_Func() Sleep(100) Until TimerDiff($Timer1) > $RdmTime _F4a_Func() ;============================================================================= EndIf Sleep(100) WEnd ;============================================================================= Func Terminate() Exit 0 EndFunc ;==>Terminate ;=============================================================================
    1 point
  7. @careca this seems to be almost perfect, plenty better than what i had. i notice that hitting the pause still has f4 go off, is this unavoidable? i apologize, im not the best at explaining things. but you appear to understand what i was attempting to say. i really appreciate the help you have given. @water apologies, properly explaining things isn't one of my strengths. but i briefly mentioned in my original under the edit, and my first reply, of the problem being it was infinitely spamming. it seems i didnt quite make the issue of it quite clear. but it was spamming without any delay, and i was trying to get it to have proper delays.
    0 points
×
×
  • Create New...