virhonestum Posted April 8, 2015 Share Posted April 8, 2015 (edited) Edit: Now I'm going to expand the question, how do I create a custom title bar? So you have custom buttons (I already have those), but also have a part at the top, with which you can drag the window around. I don't need an icon or a title, so the only thing I need is this draggable part. Original Question: I want to make a GUI, which doesn't use the Windows buttons and has custom minimize/close-buttons. But when I add the $WS_POPUP style to my GUI, and have the minimize button execute GUISetState(@SW_MINIMIZE) the window has no minimize animation, where the window shrinks and retracts into the task bar. Is there any way I can remove the border and the upper bar but still have the animation? Thank you very much Virhonestum (Vir) Edited April 9, 2015 by virhonestum Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted April 8, 2015 Moderators Share Posted April 8, 2015 virhonestum, it is just a tad difficult to troubleshoot the issue off a single line of code. How about providing your entire code, or at least a fair reproducer of the problem? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
virhonestum Posted April 9, 2015 Author Share Posted April 9, 2015 Sorry for the late response, but this the important part of what I'm currently working with: #Include <GUIConstants.Au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Calculator = GUICreate("", 298, 100, 556, 260, $WS_POPUP) GUISetBkColor(0xFFFFFF) $Button_Exit = GUICtrlCreateLabel("×", 256, 0, 41, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetBkColor(-1, 0xDC0000) GUICtrlSetColor(-1, 0xF2F2F2) $Button_Minimize = GUICtrlCreateLabel("_", 224, 0, 25, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetBkColor(-1, 0x1E1E1E) GUICtrlSetColor(-1, 0xF2F2F2) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button_Exit Exit Case $Button_Minimize GUISetState(@SW_MINIMIZE) EndSwitch WEnd Link to comment Share on other sites More sharing options...
JohnOne Posted April 9, 2015 Share Posted April 9, 2015 With your code, I see the window animation. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
virhonestum Posted April 9, 2015 Author Share Posted April 9, 2015 (edited) This is how it looks for me: On this one the window just disappears And this is how I want it (I removed the $WS_POPUP here) On this one it shrinks, fades out, and retracts to the task bar Edited April 9, 2015 by virhonestum Link to comment Share on other sites More sharing options...
virhonestum Posted April 9, 2015 Author Share Posted April 9, 2015 I just realized that you cannot drag the window around either, so I added another question (I edited the whole topic) How am I able to drag the window around? Link to comment Share on other sites More sharing options...
Solution JohnOne Posted April 9, 2015 Solution Share Posted April 9, 2015 Create an empty label where title bar would normally be, and add the parentdrag style to it. virhonestum 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
reb Posted April 9, 2015 Share Posted April 9, 2015 I picked this drag routine from the forums and use it a lot. I cannot remember who posted it. #Include <GUIConstants.Au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> ; <---------------- Added Global Const $SC_DRAGMOVE = 0xF012 ; <---------------- Added $Calculator = GUICreate("", 298, 100, 556, 260, $WS_POPUP) GUISetBkColor(0xFFFFFF) $Button_Exit = GUICtrlCreateLabel("×", 256, 0, 41, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetBkColor(-1, 0xDC0000) GUICtrlSetColor(-1, 0xF2F2F2) $Button_Minimize = GUICtrlCreateLabel("_", 224, 0, 25, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetBkColor(-1, 0x1E1E1E) GUICtrlSetColor(-1, 0xF2F2F2) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button_Exit Exit Case $Button_Minimize GUISetState(@SW_MINIMIZE) EndSwitch _SendMessage($Calculator, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0) ; <---------------- Added WEnd This runs on my machine. win8.1 64 REB MEASURE TWICE - CUT ONCE Link to comment Share on other sites More sharing options...
virhonestum Posted April 9, 2015 Author Share Posted April 9, 2015 @JohnOne Thanks, that's what I needed! @reb Definitely gonna save that for later but in this case I don't want it to be draggable everywhere on the window 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