
ahmet
-
Posts
274 -
Joined
-
Last visited
-
Days Won
1
Reputation Activity
-
ahmet got a reaction from WildByDesign in DwmColorBlurMica
What about sqlite database? You can have table names with prefixes or sufixes, ie. Calcultor_perApp, Class1_perClass, OtherClass_perClass. You can embed needed dll into script and load it from memory without writing to disk anything if the licence permits it.
-
ahmet got a reaction from pixelsearch in ListView group header alignment
Here are my results on Win 10.
-
ahmet got a reaction from Netol in how update combo automatically after change a value
Then most probably solution from @Dan_555 will work for you.
-
ahmet got a reaction from ioa747 in _UpdateRegKey and Error Checking
If you look in the help file for RegWrite there are following lines:
Return Value
Success: 1.
Failure: 0 and sets the @error flag to non-zero if error writing registry key or value.
@error: 1 = unable to open requested key
2 = unable to open requested main key
3 = unable to remote connect to the registry
-1 = unable to open requested value
-2 = value type not supported.
So if @error=1 then if for any reason RegWrite files to open key you will get that first splash message
"NOTICE!!", "The Reg String " & $sString & " was not succesfully updated!" If you want that message to be shown for each error that is listed above then you should write: "If @error Then" which means "if @error is anything except 0 then".
When there is not an error, when everything goes well, then @error has value of 0.
-
ahmet got a reaction from VAN0 in How to get onChange event for control created by _WinAPI_CreateWindowEx()?
What about following
Global Const $HKM_GETHOTKEY = $WM_USER + 2 Global Const $HOTKEYF_SHIFT=0x01;https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-sethotkey .... func onChange() $key=SendMessage($hInput, $HKM_GETHOTKEY) ConsoleWrite("onChange: " & $key & @CRLF) $loword=_WinAPI_LoWord($key) $lobyte=_WinAPI_LoByte($loword) $hibyte=_WinAPI_HiByte($loword) ConsoleWrite("LOBYTE=" & $lobyte & @CRLF) ConsoleWrite("HIBYTE=" & $hibyte & @CRLF) If ($lobyte<>0 And $hibyte=$HOTKEYF_SHIFT) Then ConsoleWrite("hotkey changed" & @CRLF) EndIf EndFunc HKM_GETHOTKEY has valuable information about how to get what keys are pressed. If you need further help feel free to ask.
-
ahmet got a reaction from NassauSky in Create a custom angled speech bubble
Here is your code modified from first post
#include <GuiConstantsEx.au3> #include <GDIPlus.au3> #include <WinAPIHObj.au3> ; For _GDIPlus_MatrixCreate Opt('MustDeclareVars', 1) _Main() Func _Main() Local $hGUI, $hWnd, $hImage, $hGraphic, $cPic Local $outputImage = "SpeechBubble.png" FileDelete($outputImage) Local $fAngle = InputBox( "Enter Angle", "Please enter the angle of the speech bubble pointer",10) ConsoleWrite("Required Angle: " & $fAngle & @CRLF) ; Create GUI $hGUI = GUICreate("GDI+", 220, 220) $cPic = GUICtrlCreatePic('', 0, 0, 220, 220) $hWnd = WinGetHandle("GDI+") GUISetState() ; Create a blank image _GDIPlus_Startup() $hImage = _GDIPlus_BitmapCreateFromScan0(220, 220) $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage) ; Create fill brushes and draw pens Local $hBrush = _GDIPlus_BrushCreateSolid(0xFF00FF00) ; Light green color Local $hBrush2 = _GDIPlus_BrushCreateSolid(0xFF0000FF) ; Light blue color Global $hPen = _GDIPlus_PenCreate(0xFF8800AA, 2) Global $hPen2 = _GDIPlus_PenCreate(0xFFFF0000, 2) ; Draw a Triangle Global $tWidth = 220 Global $tHeight = 150 Global $TriangleBase = 60 Global $TriangleHeight = 60 Global $TriangleX = 110 - $TriangleBase / 2 Global $TriangleY = 65 ; $CircleY + $CircleDiameter / 2 Local $aPoints[4][2] ; Create Points Array (Row 0 Col 0 holds row count) $aPoints[0][0] = 3 ;Number of points $aPoints[1][0] = $TriangleX $aPoints[1][1] = $TriangleY $aPoints[2][0] = $TriangleX + $TriangleBase $aPoints[2][1] = $TriangleY $aPoints[3][0] = $TriangleX + $TriangleBase / 2 $aPoints[3][1] = $TriangleY - $TriangleHeight _GDIPlus_GraphicsFillPolygon($hGraphic, $aPoints, $hBrush) _GDIPlus_GraphicsDrawPolygon($hGraphic, $aPoints, $hPen) ; Draw a circle Local $CircleDiameter = 150 Local $CircleX = (220 - $CircleDiameter) / 2 Local $CircleY = (220 - $CircleDiameter) / 2 _GDIPlus_GraphicsFillEllipse ( $hGraphic, $CircleX, $CircleY, $CircleDiameter, $CircleDiameter, $hBrush) _GDIPlus_GraphicsDrawEllipse($hGraphic, $CircleX, $CircleY, $CircleDiameter, $CircleDiameter, $hPen) ;This in new - pen for drawing axes lines Local $hPenArrow = _GDIPlus_PenCreate(0xFF000000, 1) _GDIPlus_PenSetEndCap($hPenArrow, $GDIP_LINECAPARROWANCHOR) Local $hPenArrow_ForRotated = _GDIPlus_PenCreate(0xFFF00F00, 1);yellow line - rotated _GDIPlus_PenSetEndCap($hPenArrow_ForRotated, $GDIP_LINECAPARROWANCHOR) Local $fAxesCenterX=$CircleX+$CircleDiameter/2, $fAxesCenterY=$CircleY+$CircleDiameter/2;center coordinates ConsoleWrite("X=" & $fAxesCenterX & "; Y=" & $fAxesCenterY & @CRLF) _GDIPlus_GraphicsDrawLine($hGraphic,$fAxesCenterX,$fAxesCenterY,$fAxesCenterX+100,$fAxesCenterY,$hPenArrow);notice value of center coordinates ; Create a matrix and rotate the image by $fAngle degrees ;Rotation Matrix Local $hMatrix = _GDIPlus_MatrixCreate() _GDIPlus_MatrixTranslate($hMatrix,+$fAxesCenterX,+$fAxesCenterY);https://www.vbforums.com/showthread.php?841185-GDIPLUS-how-rotate-an-image-by-a-center&s=f20f7a20e35573308599859c5bb9c70d&p=5123549&viewfull=1#post5123549 _GDIPlus_MatrixRotate($hMatrix, $fAngle, False) _GDIPlus_MatrixTranslate($hMatrix,-$fAxesCenterX,-$fAxesCenterY) _GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix);https://www.vbforums.com/showthread.php?841185-GDIPLUS-how-rotate-an-image-by-a-center&s=f20f7a20e35573308599859c5bb9c70d&p=5123549&viewfull=1#post5123549 _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0);"Origin display rotated" - comment this line to see axes BitmapToCtrl($hImage, $cPic) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE ; Save the image to $outputImage ;_GDIPlus_ImageSaveToFile($hImage, $outputImage) _GDIPlus_PenDispose($hPenArrow) _GDIPlus_BrushDispose($hBrush2) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_BitmapDispose($hImage) _GDIPlus_Shutdown() ;If FileExists($outputImage) Then ShellExecute($outputImage) EndFunc ;==>_Main Func BitmapToCtrl($hBitmap, $cCtrl) Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _WinAPI_DeleteObject(GUICtrlSendMsg($cCtrl, 0x0172, 0, $hHBITMAP)) _WinAPI_DeleteObject($hHBITMAP) EndFunc Rotation about center taken from here.
-
ahmet got a reaction from argumentum in Date and Time in Tab Control - (Moved)
Date-time control supports only spin button. Do you expect to show a clock when you would "click" time control?
-
ahmet got a reaction from Eddie987 in Mouse movement inside a specific window
No, but if you want to interact with a slider from a gui that you have not made look for _GUICtrlSlider... functions.
-
ahmet got a reaction from Eddie987 in Mouse movement inside a specific window
Look for MouseCoordMode under AutoItSetOption.
-
ahmet reacted to SOLVE-SMART in Change titlebar colors of AutoIt gui
There seems to be many way to achieve something like you're looking for, thanks to this nice and experienced community 👍 .
Nevertheless I want to show you @taurus905 a quick example of a custom title bar which I created out of GUI snippets that I used in other projects before.
💡 Please keep in mind, I usually would modularize the code into separate files (depending on the duties), but in this case I just did it in a single script file.
#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #AutoIt3Wrapper_AU3Check_Stop_OnWarning=y #AutoIt3Wrapper_Run_Au3Stripper=y #AutoIt3Wrapper_UseUpx=n #Au3Stripper_Parameters=/sf /sv /mo /rm /rsln #include-once #include <GUIConstants.au3> #include <Misc.au3> Global $mGui[], $mTitleBar[] Global $mClosingCrossIcon[], $mMinimizeIcon[] Global $mTitleBarColor[] $mTitleBarColor.background = 0xD9534F $mTitleBarColor.font = 0xFBEDED $mTitleBarColor.faviconIcon = $GUI_BKCOLOR_TRANSPARENT $mTitleBarColor.hoverMinimize = 0xE5E5E5 $mTitleBarColor.hoverClose = 0xE81123 _Actions() Func _Actions() _CreateGui() _CreateTitleBar() _AddTitleBarButtons() _ShowGui() _GuiEventListener() EndFunc Func _CreateGui() $mGui.Width = 600 $mGui.Height = 350 $mGui.Style = $WS_POPUP $mGui.Handle = GUICreate('', $mGui.Width, $mGui.Height, Default, Default, $mGui.Style) EndFunc Func _CreateTitleBar() ; background $mTitleBar.X = 0 $mTitleBar.Y = 0 $mTitleBar.W = ($mGui.Width - 137) $mTitleBar.H = 26 $mTitleBar.ButtonWidth = 25 $mTitleBar.ButtonHeight = $mTitleBar.ButtonWidth $mTitleBar.cId = GUICtrlCreateLabel('', $mTitleBar.X, $mTitleBar.Y, $mTitleBar.W, $mTitleBar.H) GUICtrlSetBkColor($mTitleBar.cId, $mTitleBarColor.background) GUICtrlSetStyle($mTitleBar.cId, -1, $GUI_WS_EX_PARENTDRAG) ; favicon icon GUICtrlCreateLabel('🎲', 4, 5.5) ; I used the cube icon as example which can be pasted in by pressing [WIN] + [.] GUICtrlSetBkColor(-1, $mTitleBarColor.faviconIcon) GUICtrlSetFont(-1, 11) ; title GUICtrlCreateLabel('GUI with custom title bar', 24, 5.5, ($mGui.Width / 2)) GUICtrlSetColor(-1, $mTitleBarColor.font) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetFont(-1, 9) EndFunc Func _AddTitleBarButtons() _AddClosingCrossIcon() _AddMaximizeIcon() _AddMinimizeIcon() EndFunc Func _AddClosingCrossIcon() ; background $mClosingCrossIcon.X = ($mGui.Width - 45) $mClosingCrossIcon.Y = 0 $mClosingCrossIcon.W = $mTitleBar.ButtonWidth + 20 $mClosingCrossIcon.H = $mTitleBar.ButtonHeight + 1 $mClosingCrossIcon.cId = GUICtrlCreateLabel('', $mClosingCrossIcon.X, $mClosingCrossIcon.Y, $mClosingCrossIcon.W, $mClosingCrossIcon.H) GUICtrlSetBkColor($mClosingCrossIcon.cId, $mTitleBarColor.background) ; icon GUICtrlCreateLabel(ChrW(0xCD), ($mGui.Width - 31), 5.5, $mTitleBar.ButtonWidth, $mTitleBar.ButtonHeight) GUICtrlSetFont(-1, 14, 100, Default, 'Wingdings 2') GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) EndFunc Func _AddMaximizeIcon() ; background GUICtrlCreateLabel('', ($mGui.Width - 92), 0, $mTitleBar.ButtonWidth + 22, $mTitleBar.ButtonHeight + 1) GUICtrlSetBkColor(-1, $mTitleBarColor.background) ; icon GUICtrlCreateLabel(ChrW(0xA3), ($mGui.Width - 75), 6.5, $mTitleBar.ButtonWidth, $mTitleBar.ButtonHeight) GUICtrlSetFont(-1, 11, 100, Default, 'Wingdings 2') GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0xCCCCCC) EndFunc Func _AddMinimizeIcon() ; background $mMinimizeIcon.X = ($mGui.Width - 137) $mMinimizeIcon.Y = 0 $mMinimizeIcon.W = $mTitleBar.ButtonWidth + 20 $mMinimizeIcon.H = $mTitleBar.ButtonHeight + 1 $mMinimizeIcon.cId = GUICtrlCreateLabel('', $mMinimizeIcon.X, $mMinimizeIcon.Y, $mMinimizeIcon.W, $mMinimizeIcon.H) GUICtrlSetBkColor($mMinimizeIcon.cId, $mTitleBarColor.background) ; icon GUICtrlCreateLabel(ChrW(0x2015), ($mGui.Width - 119), 6.5, $mTitleBar.ButtonWidth, $mTitleBar.ButtonHeight) GUICtrlSetFont(-1, 8, 100, Default, 'Segoe UI') GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) EndFunc Func _ShowGui() GUISetState(@SW_SHOW, $mGui.Handle) EndFunc Func _GuiEventListener() AdlibRegister('_HoverActions', 100) Local Const $iGuiEventClose = -3 While True Switch GUIGetMsg() Case $iGuiEventClose, $mClosingCrossIcon.cId ExitLoop Case $mMinimizeIcon.cId GUISetState(@SW_MINIMIZE, $mGui.Handle) EndSwitch WEnd _GuiDisposeAndExit() EndFunc Func _GuiDisposeAndExit() AdlibUnRegister('_HoverActions') GUIDelete($mGui.Handle) Exit EndFunc Func _HoverActions() Local $aMouseData = MouseGetPos() Local $aGuiData = WinGetPos($mGui.Handle) If Not _HoverTitleBar($aMouseData, $aGuiData) Then _ResetHoverColor() Return EndIf Select Case _HoverMinimizeIcon($aMouseData, $aGuiData) GUICtrlSetBkColor($mMinimizeIcon.cId, $mTitleBarColor.hoverMinimize) GUICtrlSetBkColor($mClosingCrossIcon.cId, $mTitleBarColor.background) Case _HoverClosingCrossIcon($aMouseData, $aGuiData) GUICtrlSetBkColor($mClosingCrossIcon.cId, $mTitleBarColor.hoverClose) GUICtrlSetBkColor($mMinimizeIcon.cId, $mTitleBarColor.background) Case Else _ResetHoverColor() EndSelect EndFunc Func _ResetHoverColor() GUICtrlSetBkColor($mClosingCrossIcon.cId, $mTitleBarColor.background) GUICtrlSetBkColor($mMinimizeIcon.cId, $mTitleBarColor.background) EndFunc Func _HoverTitleBar($aMouseData, $aGuiData) Return _IsMouseOnControl( _ $aMouseData[0] - $aGuiData[0], _ $aMouseData[1] - $aGuiData[1], _ $mTitleBar.X, $mTitleBar.Y, $mGui.Width, $mTitleBar.H) EndFunc Func _HoverMinimizeIcon($aMouseData, $aGuiData) Return _IsMouseOnControl( _ $aMouseData[0] - $aGuiData[0], _ $aMouseData[1] - $aGuiData[1], _ $mMinimizeIcon.X, $mMinimizeIcon.Y, $mMinimizeIcon.W, $mMinimizeIcon.H) EndFunc Func _HoverClosingCrossIcon($aMouseData, $aGuiData) Return _IsMouseOnControl( _ $aMouseData[0] - $aGuiData[0], _ $aMouseData[1] - $aGuiData[1], _ $mClosingCrossIcon.X, $mClosingCrossIcon.Y, $mClosingCrossIcon.W, $mClosingCrossIcon.H) EndFunc Func _IsMouseOnControl($iXMouse, $iYMouse, $iXControl, $iYControl, $iWidthControl, $iHeightControl) If $iXMouse >= $iXControl And _ $iYMouse >= $iYControl And _ $iXMouse <= $iXControl + $iWidthControl And _ $iYMouse <= $iYControl + $iHeightControl Then Return True Else Return False EndIf EndFunc It was more complex than I thought, but as a proof of concept I enjoyed it 😅 .
Please notice that you can minimize or close the GUI like you would expect it. Also the GUI is draggable by the title bar.
👓 Open the spoiler box to see the example:
Best regards
Sven
-
ahmet got a reaction from SOLVE-SMART in Change titlebar colors of AutoIt gui
I think it does work if you use the updated version by @AutoBert. I have not done much testing but everything seems to be working.
-
-
ahmet got a reaction from robertocm in is there a command shell in autoit - (Moved)
AutoIt3 Interpreter might be of interest.
-
ahmet got a reaction from LukasChury in SelectString LIKE in ControlListView
Look at _guictrllistview_findtext and _guictrllistview_setitemselected
-
ahmet got a reaction from Gianni in AutoItObject Pure AutoIt
@kurtykurtyboy regarding event handlers have you checked GUIRegisterMsg20 - Subclassing Made Easy ?
-
-
ahmet reacted to markyrocks in ObjectCreateInterface callback
I've found that anytime you need to use virtually any kind of pointer in a tag just using "ptr" works.
-
-
ahmet got a reaction from MattHiggs in Open windows explorer with items already highlighted
Have you tried with _WinAPI_ShellOpenFolderAndSelectItems?
-
ahmet reacted to Zedna in How to create this kind control by autoit
ahmet already fully answered your question, giving you link to required GUI control:
Note: Andreik's UDF code is AutoIt wrapper over standard Windows control msctls_hotkey32
-
ahmet got a reaction from Terenz in Regex get month and year
Can this help
$sTestString="my_business_032020" $btest=StringRegExp($sTestString,".*\d\d.*\d\d\d\d") MsgBox(0,"Test",($btest ? "There is" : "There is not") & " date") You can look at regex101.com for explanation
-
-
ahmet got a reaction from Muhammad_Awais_Sharif in InetGet correct way of checking error during downloading a file
You are welcome
-
ahmet got a reaction from Aadithyaan in Personal Minimize Button with Graphics
If you catch the event when user presses one of those buttons use GUISetState(@SW_MINIMIZE) to minimize.
-
ahmet reacted to UEZ in Two images in one GUI control with ability to move image
SetBitMap($TransparentButtonTest, $hImageButton, 192) will set the dragable image semi transparent.