Aceguy Posted September 12, 2008 Share Posted September 12, 2008 expandcollapse popup#include<GDIPlus.au3> #include<WindowsConstants.au3> #include<SliderConstants.au3> #include<WinAPI.au3> Global $hGUI, $hWnd, $hGraphic, $hPen,$Slider1 GUIRegisterMsg($WM_HSCROLL, "WM_HVSCROLL") ; Create GUI $hGUI = GUICreate("GDI+", 400, 300) $hWnd = WinGetHandle("GDI+") $Slider1=GUICtrlCreateSlider(5,5,150,25,$TBS_NOTICKS) GUISetState() ; Draw line _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd) while 1 sleep(200) WEnd ; Clean up resources _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() Func WM_HVSCROLL($hWndGUI, $MsgID, $WParam, $LParam) Switch $LParam Case GUICtrlGetHandle($Slider1) _GDIPlus_GraphicsDrawLine($hGraphic, 10, GUICtrlRead($Slider1)+150, 390, 150, $hPen) _WinAPI_RedrawWindow(_WinAPI_GetDesktopWindow(), "", "", BitOR($RDW_INVALIDATE, $RDW_UPDATENOW, $RDW_FRAME, $RDW_ALLCHILDREN)) EndSwitch EndFunc ;==>WM_HVSCROLL [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
Szhlopp Posted September 12, 2008 Share Posted September 12, 2008 expandcollapse popup#include<GDIPlus.au3> #include<WindowsConstants.au3> #include<SliderConstants.au3> #include<WinAPI.au3> Global $hGUI, $hWnd, $hGraphic, $hPen,$Slider1 GUIRegisterMsg($WM_HSCROLL, "WM_HVSCROLL") ; Create GUI $hGUI = GUICreate("GDI+", 400, 300) $hWnd = WinGetHandle("GDI+") $Slider1=GUICtrlCreateSlider(5,5,150,25,$TBS_NOTICKS) GUISetState() ; Draw line _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd) while 1 sleep(200) WEnd ; Clean up resources _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() Func WM_HVSCROLL($hWndGUI, $MsgID, $WParam, $LParam) Switch $LParam Case GUICtrlGetHandle($Slider1) _GDIPlus_GraphicsDrawLine($hGraphic, 10, GUICtrlRead($Slider1)+150, 390, 150, $hPen) _WinAPI_RedrawWindow(_WinAPI_GetDesktopWindow(), "", "", BitOR($RDW_INVALIDATE, $RDW_UPDATENOW, $RDW_FRAME, $RDW_ALLCHILDREN)) EndSwitch EndFunc ;==>WM_HVSCROLL Easy... Once you shutdown GDI you can't just call one of the functions =) RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' Link to comment Share on other sites More sharing options...
Aceguy Posted September 12, 2008 Author Share Posted September 12, 2008 aaaah, thanks for quick response, but i dont have a clue how to sort it. [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
dbzfanatic Posted September 12, 2008 Share Posted September 12, 2008 I tried taking out the _GDIPlus_Shutdown() function to see what would happen and it resulted in the same behavior so I doubt that _GDIPlus_Shutdown() alone is the cause. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
Szhlopp Posted September 12, 2008 Share Posted September 12, 2008 aaaah, thanks for quick response, but i dont have a clue how to sort it.You know what. I'm a nib.You don't ever reach the _ShutDown()I tried this script and it draws a GDI line when I move the slider. Is that what it's supposed to do? RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' Link to comment Share on other sites More sharing options...
Aceguy Posted September 12, 2008 Author Share Posted September 12, 2008 (edited) yes just want it to move the left Y axis for the moment but, it flickers like crazy, and when i stop moving the slider, nothing appears. (line dissapears) Edited September 12, 2008 by Aceguy [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
Szhlopp Posted September 12, 2008 Share Posted September 12, 2008 (edited) yes just want it to move the left Y axis for the moment but, it flickers like crazy, and when i stop moving the slider, nothing appears. (line dissapears) Try this? Edit: WAY less flicker (if any) expandcollapse popup#include<GDIPlus.au3> #include<WindowsConstants.au3> #include<SliderConstants.au3> #include<WinAPI.au3> Global $hGUI, $hWnd, $hGraphic, $hPen,$Slider1 GUIRegisterMsg($WM_HSCROLL, "WM_HVSCROLL") ; Create GUI $hGUI = GUICreate("GDI+", 400, 300) $hWnd = WinGetHandle("GDI+") $Slider1=GUICtrlCreateSlider(5,5,150,25,$TBS_NOTICKS) GUISetState() ; Draw line _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd) while 1 sleep(200) WEnd ; Clean up resources _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() Func WM_HVSCROLL($hWndGUI, $MsgID, $WParam, $LParam) Switch $LParam Case GUICtrlGetHandle($Slider1) GUISetBkColor(0xF0F0F0) Sleep(1) _GDIPlus_GraphicsDrawLine($hGraphic, 10, GUICtrlRead($Slider1)+150, 390, 150, $hPen) _WinAPI_RedrawWindow(_WinAPI_GetDesktopWindow(), "", "", BitOR($RDW_INVALIDATE, $RDW_UPDATENOW, $RDW_FRAME, $RDW_ALLCHILDREN)) Sleep(50) EndSwitch EndFunc ;==>WM_HVSCROLL Edited September 12, 2008 by Szhlopp RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' Link to comment Share on other sites More sharing options...
monoceres Posted September 12, 2008 Share Posted September 12, 2008 (edited) To avoid flickering, use a backbuffer, I posted an example a couple of days ago #577036If you wish to keep everything in the GUI, you better register the WM_PAINT message.Also, I think you should call RedrawWindow before you start painting.>_< Edited September 12, 2008 by monoceres Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Aceguy Posted September 12, 2008 Author Share Posted September 12, 2008 sorry guys, thanks for you help, but im way out of my depth here. [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock 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