E1M1 Posted April 17, 2011 Share Posted April 17, 2011 I cant figure out how this window roll up is made. http://www.actualtools.com/windowrollup/ Only method I know is how to draw title bar completely myself. I know that I can set ws_popup and then I am able to use my custom image as title bar, and draw buttons on it, but how is it possible to draw buttons with out such trick? Window rollup I linked somehow creates button on title bar with out changing window style. Also it doesnt draw it's own window over target window. Does anyone know how it's being done? edited Link to comment Share on other sites More sharing options...
guinness Posted April 17, 2011 Share Posted April 17, 2011 This might get you started >> UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 17, 2011 Moderators Share Posted April 17, 2011 guinness, Good find. I am constantly amazed at what AutoIt can do in the right hands. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
E1M1 Posted April 17, 2011 Author Share Posted April 17, 2011 This works but not the way I am looking for. This http://www.actualtools.com/windowrollup/ doesn't create any window over original window. It just acts as control. edited Link to comment Share on other sites More sharing options...
GEOSoft Posted April 17, 2011 Share Posted April 17, 2011 A long time back someone wrote a function to add things like a combobox to the title bar and I can't find it now. Perhaps someone else has saved the link or you may find it with enough searching. I'm reasonably sure the principal would be the same. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
E1M1 Posted April 17, 2011 Author Share Posted April 17, 2011 (edited) I remember I once saw example script that used winapi/uxtheme calls to draw custom title bar with out having to draw extra window or with out turning part of client area into title bar but I don't remember what keywords I used to search. Of if I searched for something at all. Sadly I dint add it into bookmarks. I usually add interesting finds to my bookmarks. If I had that script I could try to write my script based on this.. All I remember is that scipt wasn't xskin or any other well known script. Edited April 17, 2011 by E1M1 edited Link to comment Share on other sites More sharing options...
jlv Posted June 8, 2011 Share Posted June 8, 2011 Actualtool's Window Rollup tool is one of the few that seem to get the roll-up/window-shade effect correct for all windows. Most tools that do this (like the Au3 script "Rollup-Pro") simply set the window height to 0 or 1, which works for many but not all windows. On Windows XP, that fails with all the ribbon-based Office programs. On Windows 7, it doesn't work for IE, Explorer and Cmd windows (both of which have a minimum height; e.g,. the Explorer window can't be resized that small). I'm not sure how Actual does it, but their program does this correctly. (I've tried Rollup-Pro, and am looking for something quicker, less clunky, and that I can add hot-keys to... I actually don't want something that adds it's own titlebar button!) Link to comment Share on other sites More sharing options...
rover Posted June 8, 2011 Share Posted June 8, 2011 (edited) I remember I once saw example script that used winapi/uxtheme calls to draw custom title bar with out having to draw extra window or with out turning part of client area into title bar but I don't remember what keywords I used to search. Of if I searched for something at all. Sadly I dint add it into bookmarks. I usually add interesting finds to my bookmarks. If I had that script I could try to write my script based on this.. All I remember is that scipt wasn't xskin or any other well known script. @E1M1 Perhaps this is the post you have in mind. WM_NCLBUTTONDOWN does not work like expected Costum titlebar This example uses themes to paint a button on the titlebar caption area. If this is what you want, see if the amount of code required is worth it to you. *additional code still required* *XP Only - does not work on Vista/7* requires mode code, maybe DWM or another method for Vista/7 Note: The state and behaviour of the button follows titlebar button behaviour (min/max/close) no focus state or focus highlighting, not clickable with spacebar, no BCN_HOTITEMCHANGE message handling for dragging held down mouse between buttons or hot focus transfer to other controls. Note: This button is not a control so it does not get focus and cannot be tabbed to. *Some custom themes have not properly handled a titlebar buttons clickable area and may be clickable past the left border of last button max/min, also some themes do not have a pressed state image. *Theme change requires code to correct button size/placement as it can move slightly off the titlebar into the client area and to the left of its previous position. Theme part metrics required to correct button placement. You can use 'Window' theme for titlebar buttons that have same theme as min/max/close or paint your own bitmap button. *NOTE: This example does not have the required _WinAPI_DrawFrameControl() code to create the button if the theme service is off or the classic theme is used. see example in help file for GUIRegisterMsg(). *Gui resizing code should move the button relative to the changed width. All of the UDF DLLCalls should be modified versions with a DllOpen() handle for improved optimization. *XP Only - does not work on Vista/7* requires mode code, maybe DWM or another method for Vista/7 There is no end to it... Edit1: additional verbiage Edit2: removed unfinished/unnecessary code, added theme font code, a few additional changes, still XP only expandcollapse popup;Author: coded by rover for themes from example by Funkey 2k11 ;WM_NCLBUTTONDOWN does not work like expected Costum titlebar ;http://www.autoitscript.com/forum/topic/125012-wm-nclbuttondown-does-not-work-like-expected/page__p__868177__fromsearch__1#entry868177 ;Thanks to Yashied for the theme engine API's in WinAPIEx.au3 ;#forceref not used in WinAPIEx.au3 and APIConstants.au3 ;too many declared, but not used errors if this line used ;#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <APIConstants.au3> #include <FrameConstants.au3> #include <GUIConstantsEx.au3> #Include <Constants.au3> #include <WinAPI.au3> #Include <WinAPIEx.au3> #include <WindowsConstants.au3> If @OSVersion <> "WIN_XP" Then MsgBox(262144+48, "XP ONLY", "This only works on XP"&@CRLF&"Vista and 7 use DWM,"&@CRLF&"so a different method is required to do this") Exit EndIf Opt('MustDeclareVars', 1) ;need non-client area dimensions here Global $tRECT = _WinAPI_CreateRectEx(300, 3, 40, 18) ;quick hack to set rect in non-client area Global $tRECTx = _WinAPI_CreateRectEx(300, -22, 35, 16) Global $msg, $nState = 1, $hTheme, $nPrev = -1, $fBtnTFont = True Global $fNCKeyDn = False, $fNCKeyUp = False, $fBtnHot = False Global $hGui = GUICreate("Title bar button", 500, 300, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX)) Global $cBtn1 = GUICtrlCreateButton("Disable", 40, 40, 100, 25) Global $cBtn2 = GUICtrlCreateButton("Hide", 40, 100, 100, 25) Global $cBtnTBar = GUICtrlCreateDummy() $hTheme = _WinAPI_OpenThemeData($hGui, 'Button') If @error Then $hTheme = 0 Global $tLOGFONT = _WinAPI_GetThemeFont($hTheme, 1, 1, $TMT_FONT) ;ConsoleWrite('- DllStructGetData($tLOGFONT, "FaceName") = ' & DllStructGetData($tLOGFONT, "FaceName") & @crlf) Global $hFont = _WinAPI_CreateFontIndirect($tLOGFONT) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hFont = ' & $hFont & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console ;no theme font, so use default If $hFont = 0 Then $hFont = _WinAPI_GetStockObject($DEFAULT_GUI_FONT) $fBtnTFont = False EndIf GUIRegisterMsg($WM_THEMECHANGED, "_WinProc") GUIRegisterMsg($WM_NCMOUSEMOVE, "_WinProc") GUIRegisterMsg($WM_NCHITTEST, "_WinProc") GUIRegisterMsg($WM_NCLBUTTONUP, "_WinProc") GUIRegisterMsg($WM_NCLBUTTONDOWN, "_WinProc") GUIRegisterMsg($WM_NCLBUTTONDBLCLK, "_WinProc") GUIRegisterMsg($WM_NCACTIVATE, "_WinProc") GUIRegisterMsg($WM_NCPAINT, "_WinProc") GUISetState() Do $msg = GUIGetMsg() Switch $msg Case $cBtnTBar;title/caption bar button ConsoleWrite("+ Title bar button clicked" & @CRLF) Case $cBtn1;enable/disable If $nState <> -1 Then Switch $nState Case 1 $nState = 4 GUICtrlSetData($cBtn1, "Enable") Case 4 $nState = 1 GUICtrlSetData($cBtn1, "Disable") EndSwitch _WinAPI_RedrawWindow($hGui, $tRECT, 0, BitOR($RDW_INVALIDATE, $RDW_FRAME)) EndIf Case $cBtn2;hide/show Switch $nState Case -1 $nState = $nPrev GUICtrlSetData($cBtn2, "Hide") _WinAPI_RedrawWindow($hGui, $tRECT, 0, BitOR($RDW_INVALIDATE, $RDW_FRAME)) Case Else $nPrev = $nState $nState = -1 GUICtrlSetData($cBtn2, "Show") _WinAPI_SetWindowPos($hGui, -1, 0, 0, 0, 0, BitOR($SWP_FRAMECHANGED, $SWP_NOACTIVATE, $SWP_NOMOVE, $SWP_NOSIZE)) EndSwitch EndSwitch Until $msg = -3 If $hTheme <> 0 Then _WinAPI_CloseThemeData($hTheme) If $hFont <> 0 Then _WinAPI_DeleteObject($hFont) Exit Func _WinProc($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam Local $hDC, $x, $y, $tPoint Switch $iMsg Case $WM_THEMECHANGED If $hTheme <> 0 Then _WinAPI_CloseThemeData($hTheme) If $hFont <> 0 Then _WinAPI_DeleteObject($hFont) $hTheme = _WinAPI_OpenThemeData($hWnd, 'Button') If @error Or $hTheme = 0 Then Return $GUI_RUNDEFMSG Local $tLOGFONT = _WinAPI_GetThemeFont($hTheme, 1, 1, $TMT_FONT) ;ConsoleWrite('- DllStructGetData($tLOGFONT, "FaceName") = ' & DllStructGetData($tLOGFONT, "FaceName") & @crlf) $hFont = _WinAPI_CreateFontIndirect($tLOGFONT) If $hFont = 0 Then $hFont = _WinAPI_GetStockObject($DEFAULT_GUI_FONT) $fBtnTFont = False Else $fBtnTFont = True EndIf Case $WM_NCMOUSEMOVE ;when mouse moves over or moves off of button, redraw button in Hot or Normal state If $hWnd <> $hgui Then Return $GUI_RUNDEFMSG ;when mouse moved off button, redraw button in Normal state If ($wParam = $HTCAPTION Or $wParam = $HTTOP) And ($nState = 2 Or $nState = 3) Then $nState = 1 $fBtnHot = False _WinAPI_RedrawWindow($hWnd, $tRECT, 0, BitOR($RDW_INVALIDATE, $RDW_FRAME)) EndIf ;when mouse moves over button, redraw button in Hot state If $wParam = $HTBORDER And $nState <> 4 And $nState <> -1 Then ;return from WM_NCHITTEST is HTBORDER $tPoint = DllStructCreate($tagPOINT) DllStructSetData($tPoint, 1, BitAND($lParam, 0x0000FFFF)) DllStructSetData($tPoint, 2, BitShift($lParam, 16)) _WinAPI_ScreenToClient($hWnd, $tPoint) If _WinAPI_PtInRect($tRECTx, $tPoint) Then If $fBtnHot = False Then $nState = 2 $fBtnHot = True _WinAPI_RedrawWindow($hWnd, $tRECT, 0, BitOR($RDW_INVALIDATE, $RDW_FRAME)) EndIf EndIf EndIf Return $GUI_RUNDEFMSG Case $WM_NCHITTEST If $hWnd <> $hgui Then Return $GUI_RUNDEFMSG $tPoint = DllStructCreate($tagPOINT) DllStructSetData($tPoint, 1, BitAND($lParam, 0x0000FFFF)) DllStructSetData($tPoint, 2, BitShift($lParam, 16)) _WinAPI_ScreenToClient($hWnd, $tPoint) If _WinAPI_PtInRect($tRECTx, $tPoint) Then $fNCKeyDn = True Return $HTBORDER ; tell the window the mouse is clicking on the border so we get a WM_NCLBUTTONUP message EndIf $fNCKeyDn = False ;required to prevent key down message if titlebar clicked after keyup on button Return $GUI_RUNDEFMSG Case $WM_NCLBUTTONUP If $hWnd <> $hgui Then Return $GUI_RUNDEFMSG If $nState = 2 Then $nState = 1 $fBtnHot = False _WinAPI_RedrawWindow($hWnd, $tRECT, 0, BitOR($RDW_INVALIDATE, $RDW_FRAME)) EndIf If $fNCKeyDn = True And $fNCKeyUp = True Then $fNCKeyUp = False $nState = 2 GUICtrlSendToDummy($cBtnTBar) _WinAPI_RedrawWindow($hWnd, $tRECT, 0, BitOR($RDW_INVALIDATE, $RDW_FRAME)) $x = BitAND($lParam, 0x0000FFFF) $y = BitShift($lParam, 16) ConsoleWrite("+Up at " & $x & "/" & $y & @cr) EndIf Return $GUI_RUNDEFMSG ;WM_NCLBUTTONDBLCLK: optionally allow fast clicking of button, otherwise some repeated clicks are missed. Case $WM_NCLBUTTONDOWN, $WM_NCLBUTTONDBLCLK If $hWnd <> $hgui Then Return $GUI_RUNDEFMSG If $fNCKeyDn = True And $nState <> 4 And $nState <> -1 Then $fNCKeyUp = True $nState = 3 _WinAPI_RedrawWindow($hWnd, $tRECT, 0, BitOR($RDW_INVALIDATE, $RDW_FRAME)) $x = BitAND($lParam, 0x0000FFFF) $y = BitShift($lParam, 16) ConsoleWrite("-Down at " & $x & "/" & $y & @cr) EndIf Return $GUI_RUNDEFMSG Case $WM_NCACTIVATE, $WM_NCPAINT If $hWnd <> $hgui Then Return $GUI_RUNDEFMSG If $nState = -1 Then Return $GUI_RUNDEFMSG Local $Res = _WinAPI_DefWindowProc($hWnd, $iMsg, $wParam, $lParam) ;theme button, theme window caption bar buttons or custom bitmap If $hTheme <> 0 Then $hDC = _WinAPI_GetWindowDC($hWnd) _WinAPI_DrawThemeBackground($hTheme, 1, $nState, $hDC, $tRECT) If $fBtnTFont = False Then Local $hOldFont = _WinAPI_SelectObject($hDC, $hFont) ;DrawThemeText uses the last font in the DC if no theme font is available. ;therefore the DEFAULT_GUI_FONT must be selected into the DC. _WinAPI_DrawThemeText($hTheme, 1, $nState, $hDC, 'OK', $tRECT, BitOR($DT_CENTER, $DT_SINGLELINE, $DT_VCENTER)) If $fBtnTFont = False Then _WinAPI_SelectObject($hDC, $hOldFont) _Winapi_ReleaseDC($hWnd, $hDC) Else ;needs DrawFrameControl code EndIf Return $Res EndSwitch Return $GUI_RUNDEFMSG EndFunc Edited June 9, 2011 by rover I see fascists... Link to comment Share on other sites More sharing options...
E1M1 Posted June 9, 2011 Author Share Posted June 9, 2011 rover what that code you posted here supposed to do? Nothing happens when I click enable/disable. edited Link to comment Share on other sites More sharing options...
rover Posted June 9, 2011 Share Posted June 9, 2011 rover what that code you posted here supposed to do? Nothing happens when I click enable/disable.You are running Vista or 7?This only works on XP.Vista and 7 use DWM, so a different method is required to do this.The forum has some examples with DWM code that can be used to do this,but from what I read on a blog on this subject, it's very involved and there are many fixesrequired to make it work on Vista/7, but it can be done.Setting up a custom title bar on Vista/Windows 7http://delphihaven.wordpress.com/2010/04/19/setting-up-a-custom-titlebar/Setting up a custom title bar – reprisehttp://delphihaven.wordpress.com/2010/04/22/setting-up-a-custom-title-bar-reprise/It comes back to what I said in my previous post:"If this is what you want, see if the amount of code required is worth it to you.""*additional code still required" - for the above example in XP, and more for Vista/7and finally, when it comes to customizing like this with all the attendant issues to deal with."There is no end to it..." I see fascists... 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