Verssuss Posted April 6, 2017 Share Posted April 6, 2017 i have 2 examples what i made but both dont even works perfect at first example while changing size right and bottom side 'jumping' at second exemple space inside flashing sometimes... sorry but i need PERFECT one First example expandcollapse popup#include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #Include <Misc.au3> #Include <ScreenCapture.au3> HotKeySet("{ESC}", "On_Exit") $GUI = GUICreate("box", 150, 150,-1,-1) GUISetState() $button_get_image = GUICtrlCreateButton("get box", -1,-1) Local $hGui ; Local ?? Global ?? i dont get it what is right $size = 50 While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $button_get_image _getimg() EndSwitch Sleep(50) WEnd Func _getimg() HotKeySet("{[}", "_boxminus") HotKeySet("{]}", "_boxplus") GUISetState(@SW_MINIMIZE, $GUI) $pos = WinGetPos($hGUI) $hGUI = GUICreate(" Test", $size, $size, $pos[0] - ($size / 2), $pos[1] - ($size / 2), $WS_POPUP,-1,$GUI) GUISetBkColor(0x00FF00) GUISetState() _GDIPlus_Startup() $aPos = WinGetPos($hGUI) $hPath = _GDIPlus_PathCreate() _GDIPlus_PathAddRectangle($hPath, 0, 0, $aPos[2], $aPos[3]) $hReg = _GDIPlus_RegionCreateFromPath($hPath) $hReg2 = _GDIPlus_RegionCreateFromRect(2, 2, $aPos[2] - 4, $aPos[3] - 4) _GDIPlus_RegionCombineRegion($hReg, $hReg2, 3) $hRGN = _GDIPlus_RegionGetHRgn($hReg) _WinAPI_SetWindowRgn($hGUI, $hRGN) _WinAPI_DeleteObject($hRGN) _GDIPlus_RegionDispose($hReg) _GDIPlus_RegionDispose($hReg2) _GDIPlus_PathDispose($hPath) _GDIPlus_Shutdown() $lupa_aktywna = True While $lupa_aktywna = True $pos = MouseGetPos() WinMove($hGUI, "", $pos[0] - ($size / 2), $pos[1] - ($size / 2), $size, $size) While _IsPressed('01') GUISetState(@SW_HIDE, $hGUI) GUISetState(@SW_RESTORE, $GUI) $lupa_aktywna = False HotKeySet("[") HotKeySet("]") WEnd WEnd EndFunc ;==> crate box Func _boxplus() $size = $size + 10 If $size < 400 Then $pos = MouseGetPos() WinMove($hGUI, "", $pos[0] - ($size / 2), $pos[1] - ($size / 2), $size, $size) _GDIPlus_Startup() $aPos = WinGetPos($hGUI) $hPath = _GDIPlus_PathCreate() _GDIPlus_PathAddRectangle($hPath, 0, 0, $aPos[2], $aPos[3]) $hReg = _GDIPlus_RegionCreateFromPath($hPath) $hReg2 = _GDIPlus_RegionCreateFromRect(2, 2, $aPos[2] - 4, $aPos[3] - 4) $aPos = WinGetPos($hGUI) _GDIPlus_RegionCombineRegion($hReg, $hReg2, 3) $hRGN = _GDIPlus_RegionGetHRgn($hReg) _WinAPI_SetWindowRgn($hGUI, $hRGN) _WinAPI_DeleteObject($hRGN) _GDIPlus_RegionDispose($hReg) _GDIPlus_RegionDispose($hReg2) _GDIPlus_PathDispose($hPath) _GDIPlus_Shutdown() Else HotKeySet("{]}") MsgBox(0,"ERROR", "Maximum size already exist") HotKeySet("{]}", "_boxplus") EndIf EndFunc Func _boxminus() If $size >= 40 Then $size = $size - 5 If $size < 40 Then $size = $size - 1 If $size > 4 Then $pos = MouseGetPos() WinMove($hGUI, "", $pos[0] - ($size / 2), $pos[1] - ($size / 2), $size, $size) _GDIPlus_Startup() $aPos = WinGetPos($hGUI) $hPath = _GDIPlus_PathCreate() _GDIPlus_PathAddRectangle($hPath, 0, 0, $aPos[2], $aPos[3]) $hReg = _GDIPlus_RegionCreateFromPath($hPath) $hReg2 = _GDIPlus_RegionCreateFromRect(2, 2, $aPos[2] - 4, $aPos[3] - 4) _GDIPlus_RegionCombineRegion($hReg, $hReg2, 3) $hRGN = _GDIPlus_RegionGetHRgn($hReg) _WinAPI_SetWindowRgn($hGUI, $hRGN) _WinAPI_DeleteObject($hRGN) _GDIPlus_RegionDispose($hReg) _GDIPlus_RegionDispose($hReg2) _GDIPlus_PathDispose($hPath) _GDIPlus_Shutdown() Else HotKeySet("{[}") MsgBox(0,"ERROR", "Minimum size already exist") HotKeySet("{[}", "_boxminus") EndIf EndFunc Func On_Exit() Exit EndFunc Second example expandcollapse popup#include <GuiConstantsEx.au3> #include <Windowsconstants.au3> #include <SendMessage.au3> #include <WinAPI.au3> #Include <Misc.au3> #Include <ScreenCapture.au3> HotKeySet("{ESC}", "On_Exit") $GUI = GUICreate("Clicker", 150, 150,-1,-1) GUISetState() $button_get_image = GUICtrlCreateButton("get box", -1,-1) Local $hGui ; Local ?? Global ?? i dont get it what is right $size = 50 While 1 $pos = MouseGetPos() Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $button_get_image _getimg() EndSwitch WEnd Func _getimg() HotKeySet("{[}", "_boxminus") HotKeySet("{]}", "_boxplus") GUISetState(@SW_MINIMIZE, $GUI) $hGUI = GUICreate("", $size, $size, -1, -1, $WS_POPUP, BitOr($WS_EX_LAYERED, $WS_EX_COMPOSITED, $WS_EX_TOPMOST)) $pos = WinGetPos($hGUI) GUISetBkColor(0x00FF00) GuiCtrlCreateLabel("", 2, 2, $size-4, $size-4) GUICtrlSetBkColor(-1, 0xABCDEF) GUICtrlSetResizing(-1, $GUI_DOCKBORDERS) GUISetState() _WinAPI_SetLayeredWindowAttributes($hGui, 0xABCDEF) $lupa_aktywna = True While $lupa_aktywna = True $pos = MouseGetPos() WinMove($hGUI, "", $pos[0] - ($size / 2), $pos[1] - ($size / 2), $size, $size) While _IsPressed('01') GUISetState(@SW_HIDE, $hGUI) GUISetState(@SW_RESTORE, $GUI) $lupa_aktywna = False HotKeySet("[") HotKeySet("]") WEnd WEnd EndFunc Func _boxminus() If $size >= 50 Then $size = $size - 5 If $size < 50 Then $size = $size - 1 If $size > 4 Then Sleep(0) Else HotKeySet("{[}") MsgBox(0,"ERROR", "Minimum size already exist") HotKeySet("{[}", "_boxminus") EndIf EndFunc Func _boxplus() If $size < 400 Then $size = $size + 10 Else HotKeySet("{]}") MsgBox(0,"ERROR", "Maximum size already exist") HotKeySet("{]}", "_boxplus") EndIf EndFunc Func On_Exit() Exit EndFunc i have more examples made by myself but always something working wrong. hope u can help me THX Link to comment Share on other sites More sharing options...
Verssuss Posted April 7, 2017 Author Share Posted April 7, 2017 anyone ? Link to comment Share on other sites More sharing options...
mLipok Posted April 7, 2017 Share Posted April 7, 2017 (edited) Quote Local $hGui ; Local ?? Global ?? i dont get it what is right As this is outside function you should use Global btw. In relation to your other question in this thread: You should wait at least 24 hour until you BUMP your questions, as this is not 24/7/366 Support forum, all everyone here are a volunteer. I'm sure that somebody answer you ASAP. Edited April 7, 2017 by mLipok Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
Verssuss Posted April 7, 2017 Author Share Posted April 7, 2017 (edited) Local working as well anyway and sorry about 'spamm'. i read rulles and somehow i didint notice that paragraph btw i dont see any point to declare any variable coz i will do it in function anyway Edited April 7, 2017 by Verssuss Link to comment Share on other sites More sharing options...
mLipok Posted April 7, 2017 Share Posted April 7, 2017 This is not 'spamm' and not rulles, rather netiquete. You just have to be a little patient/understanding. mLipok Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
Verssuss Posted April 7, 2017 Author Share Posted April 7, 2017 so...i just wake up and im horny about new knowledge mLipok 1 Link to comment Share on other sites More sharing options...
mLipok Posted April 7, 2017 Share Posted April 7, 2017 me too Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
Verssuss Posted April 8, 2017 Author Share Posted April 8, 2017 up Link to comment Share on other sites More sharing options...
mikell Posted April 8, 2017 Share Posted April 8, 2017 Suggestion : in script #2 use a small sizing step, the sizing is slower but smoother Func _boxplus() If $size < 400 Then $size = $size + 2 ;..... Link to comment Share on other sites More sharing options...
Verssuss Posted April 9, 2017 Author Share Posted April 9, 2017 20 hours ago, mikell said: Suggestion : in script #2 use a small sizing step, the sizing is slower but smoother Func _boxplus() If $size < 400 Then $size = $size + 2 ;..... sure it not jumping anymore but it take to long to make big box. in future i will delete "If $size < 400 Then" to make box much bigger. i cant belive that simple function not exist yet Link to comment Share on other sites More sharing options...
Verssuss Posted April 11, 2017 Author Share Posted April 11, 2017 up still hope Link to comment Share on other sites More sharing options...
Verssuss Posted April 12, 2017 Author Share Posted April 12, 2017 there is a way to do that ? Link to comment Share on other sites More sharing options...
Verssuss Posted April 17, 2017 Author Share Posted April 17, 2017 ideas ?? Link to comment Share on other sites More sharing options...
Verssuss Posted May 10, 2017 Author Share Posted May 10, 2017 any perfect script for that ? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now