Acce Posted July 20, 2020 Share Posted July 20, 2020 Hi im having a problem , I somehow feel that im not the first one that have had this but couldn't easily find similar situation by searching. I want a $hGraphic to be placed on top of a label is that possible ? Here is my demo code which dosent work #include <GUIConstantsEx.au3> $hWin = GUICreate("Test", 200, 200) Local $hLabel = GUICtrlCreateLabel("", 1, 1, 198, 198) GUICtrlSetBkColor(-1, 0x875327) GUICtrlSetState(-1, $GUI_DISABLE) $hGraphic = GUICtrlCreateGraphic(50, 50 , 21, 21) GUICtrlSetBkColor(-1, 0x00FF00) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xFF0000, 0xFF0000) GUICtrlSetGraphic(-1, $GUI_GR_PIE, 10, 10, 10, 0, 360) GUISetState() While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE Exit Case $hGraphic Local $aInfo = GUIGetCursorInfo($hWin) $iOldPCM = Opt("PixelCoordMode", 2) Local $iColour = PixelGetColor($aInfo[0], $aInfo[1], $hWin) Opt("PixelCoordMode", $iOldPCM) If $iColour = 0xff0000 Then MsgBox(0, "", "Hit") EndSwitch WEnd Any help would be much appreciated Link to comment Share on other sites More sharing options...
Nine Posted July 20, 2020 Share Posted July 20, 2020 Here one way : #include <GUIConstants.au3> $hWin = GUICreate("Test", 200, 200) GUICtrlCreateLabel("", 1, 1, 198, 198) GUICtrlSetBkColor(-1, 0x875327) GUICtrlSetState(-1, $GUI_DISABLE) GUISetState() GUICreate ("", 21, 21, 50, 50, $WS_POPUP, $WS_EX_MDICHILD, $hWin) $hGraphic = GUICtrlCreateGraphic(0, 0, 21, 21) GUICtrlSetBkColor(-1, 0x00FF00) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xFF0000, 0xFF0000) GUICtrlSetGraphic(-1, $GUI_GR_PIE, 10, 10, 10, 0, 360) GUISetState() While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE Exit Case $hGraphic Local $aInfo = GUIGetCursorInfo($hWin) $iOldPCM = Opt("PixelCoordMode", 2) Local $iColour = PixelGetColor($aInfo[0], $aInfo[1], $hWin) Opt("PixelCoordMode", $iOldPCM) If $iColour = 0xff0000 Then MsgBox(0, "", "Hit") EndSwitch WEnd “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Acce Posted July 21, 2020 Author Share Posted July 21, 2020 Thanks for your reply and it does indeed work Im trying to tinker a bit with it, How do I alter the background color of this line : GUICreate ("", 21, 21, 50, 50, $WS_POPUP, $WS_EX_MDICHILD, $hWin) Link to comment Share on other sites More sharing options...
Acce Posted July 21, 2020 Author Share Posted July 21, 2020 Nevermind that was easy , its another GUI , right ? ok nice I´ll see if I can implement this into my main script which has a lot of tabs Link to comment Share on other sites More sharing options...
Acce Posted July 21, 2020 Author Share Posted July 21, 2020 I worked with this for a little hour now , and I tried using "Webdings" font as an alternate way to make a circle which I found a little better for me.. In one day I went from having 0 solutions into two different techniques -;) Thanks a bunch 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