Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/23/2023 in all areas

  1. Clear as mud. Totally no idea what you are talking about. Produce some code that does not work. Explain what you expect based on that code.
    2 points
  2. A while back, a few of us came up with a method to move the MsgBox window and to change button text. It was rather clumsy. I wrote a dll solution for moving the MsgBox to the center of the parent GUI window that owned it for most of my personal work. I decided to port it over to AutoIt rather continue to port the dll with all my AutoIt work, in addition I added the button text changing to the solution as well. The examples should be self explanatory on how to use the functions provided. * Note - I did not take the time to a $MB_OK type of Constant variable, they are there ( eg. $__iMsgBox_IDOK ), but they are designed for internal use only.Example: #include <MsgBoxUDF.au3> #region 3 piece function call ; Regardless of Coords, if a handle is passed, it will center messagebox to window of handle _MsgBox_SetWindowPos(200, 100) ; The same flag passed for buttons 0-6 should be set for both messagebox and setbuttontext _MsgBox_SetButtonText(4, "Button1", "Button2") _MsgBox(4 + 262144, "Title", "Hello World One") Sleep(250) ; See now that it reset back to default _MsgBox(4 + 262144, "Title", "Hello World Two") #endregion 3 piece function call #region stand alone all in one call Sleep(250) ; Change buton 1 to Button1; Move to top left corner of desktop _MsgBoxEx(4 + 262144, "Title", "Hello World Three", -1, -1, "Button1", -1, -1, 0, 0) Sleep(250) ; Center to active window _MsgBoxEx(4 + 262144, "Title", "Hello World Four", -1, WinGetHandle(""), -1, "Button2", -1, 0, 0) #endregion stand alone all in one call MsgBoxUDF.au3
    1 point
  3. Like I already told you, if you have listen, you would have seen this :
    1 point
  4. https://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/AutoIt3Wrapper.html
    1 point
  5. Yes it does... the #pragma directive is read by aut2exe. The #Autoit3Wrapper directives makes the changes after the exe is created when done by AutoIt3Wrapper.
    1 point
  6. orbs, I have not forgotten this - but as yet I cannot work out how to cater for RTL scrolling within the UDF. I will keep digging. M23
    1 point
  7. I posted the modified code above to fit your request. Anyway this question and many variations of this has been answered multiple times on the forum.
    1 point
  8. It doesn't. What are you talking about? #include <GDIPlus.au3> #include <GuiConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> $g_hGUI = GUICreate("Test", 250, 250, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED,$WS_EX_TOOLWINDOW)) _GDIPlus_Startup() $g_hImage = _GDIPlus_ImageLoadFromFile(@ProgramFilesDir & "\AutoIt3\Examples\GUI\Torus.png") $g_aDim = _GDIPlus_ImageGetDimension($g_hImage) $hImagetemp = _GDIPlus_BitmapCreateFromScan0($g_aDim[0], $g_aDim[1]) $hContext = _GDIPlus_ImageGetGraphicsContext($hImagetemp) _GDIPlus_GraphicsClear($hContext, 0xFFABCDEF) $hAttribute_Alpha = _GDIPlus_ImageAttributesCreate() $tColorMatrix = _GDIPlus_ColorMatrixCreateTranslate(0, 0, 0, -0.85) ;0 = opaque, -1 = transparent _GDIPlus_ImageAttributesSetColorMatrix($hAttribute_Alpha, 0, True, DllStructGetPtr($tColorMatrix)) $g_hImage2 = _GDIPlus_BitmapCreateFromScan0($g_aDim[0], $g_aDim[1]) $g_hGfx = _GDIPlus_ImageGetGraphicsContext($g_hImage2) _GDIPlus_GraphicsDrawImageRectRect($g_hGfx, $hImagetemp, 0, 0, $g_aDim[0], $g_aDim[1], 0, 0, $g_aDim[0], $g_aDim[1], $hAttribute_Alpha) _GDIPlus_GraphicsDrawImageRect($g_hGfx, $g_hImage, 10, 10, 200, 200) SetBitmap($g_hGUI, $g_hImage2, 255) GUISetState() ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE _GDIPlus_GraphicsDispose($hContext) _GDIPlus_ImageAttributesDispose($hAttribute_Alpha) _GDIPlus_ImageDispose($g_hImage) _GDIPlus_ImageDispose($g_hImage2) _GDIPlus_BitmapDispose($hImagetemp) _GDIPlus_GraphicsDispose($g_hGfx) _GDIPlus_Shutdown() Func SetBitmap($hGUI, $hImage, $iOpacity) Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend $hScrDC = _WinAPI_GetDC(0) $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC) $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) $hOld = _WinAPI_SelectObject($hMemDC, $hBitmap) $tSize = DllStructCreate($tagSIZE) $pSize = DllStructGetPtr($tSize) DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth($hImage)) DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage)) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) $tBlend = DllStructCreate($tagBLENDFUNCTION) $pBlend = DllStructGetPtr($tBlend) DllStructSetData($tBlend, "Alpha", $iOpacity) DllStructSetData($tBlend, "Format", 1) _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteDC($hMemDC) EndFunc ;==>SetBitmap
    1 point
  9. This question and few similar has been answered several times on the forum. Just use the search.
    1 point
  10. Not sure if anyone is still interested, but I found the source code for the DLL over on the Russian forum.
    1 point
×
×
  • Create New...