TwoCanoe Posted Wednesday at 10:48 PM Posted Wednesday at 10:48 PM Hello again. I'm trying to create a sidebar gui. Creating the gui is simple enough, (permanently) reserving the desktop space is the problem. I searched all the sidebar (or taskbar like) related posts, but don't see anything about reserving space. Resizing each and every window that opens is likely to be a pain. One possibility, is there perhaps a reg key that sets the maximum window size or width?
argumentum Posted Thursday at 01:15 AM Posted Thursday at 01:15 AM 2 hours ago, TwoCanoe said: I'm trying to create a sidebar gui Make it topmost and visible if the mouse single click the edge ?. As a side bar, it would be functional and unintrusive. My 2 cents Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
TwoCanoe Posted Thursday at 01:47 AM Author Posted Thursday at 01:47 AM (edited) What I am trying to do is have a list of macro keys in the sidebar, see the attached screenshot. The bar on the right-hand side is (the beginings of) my sidebar. The contents of the sidebar will depend on the active window. Running Office will display a different list of keys, and so on. I use a Razer Tarturus as a macro pad. Thats around 120 keys available for each application that I might run. The bar in the screenshot is a list of keys and their commands. I would like the sidebar to be constantly present. There are two ways of doing that: 1) Resize every windows that opens. 2) Reserve space for the sidebar. Forcing any windows that open fit between the taskbar and the sidebar. Option 2 would be far easier. I just don't now any way to force all windows to open between the taskbar and the sidebar. I hope all that makes sense. Sorry about uploading pics, don't know how else to explain. Edited Thursday at 01:49 AM by TwoCanoe Apology
argumentum Posted Thursday at 02:45 AM Posted Thursday at 02:45 AM 49 minutes ago, TwoCanoe said: Sorry about uploading pics, don't know how else to explain. Actually, thanks for that. I could not make sense of what you wanted. Now I see what you're up to. I don't have the answers you're looking for. If memory serves, it was possible in XP but don't remember where I've seen it ( here in this forum ). And am not sure if the other program ( Notepad++ in this case ) would accept a max/min, just as you would with your own code. It is a head scratcher ( for me anyway ). I don't have the time to look into it but I'd try to make the other a child om a GUI of mine, if that don't work, then an API. Else, resize it when is maximized. 🤷♂️ Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
TwoCanoe Posted Thursday at 02:58 AM Author Posted Thursday at 02:58 AM I have tried making the sidebar a child and resizing, but gets messy. I also had a look at '_WinAPI_SystemParametersInfo' with '$SPI_GETWORKAREA' and '$SPI_SETWORKAREA', but not sure if that would work - way above my head! In the meantime, I'll keep scratching...
ioa747 Posted Thursday at 03:32 AM Posted Thursday at 03:32 AM Take a look for an idea. 209312-side-scrollribon twothirtyone 1 I know that I know nothing
TwoCanoe Posted Thursday at 04:20 AM Author Posted Thursday at 04:20 AM Hello again ioa747. Tried running your script in SciTE several times, but my mouse cursor becomes unstable/uncontrolable.
argumentum Posted Thursday at 04:25 AM Posted Thursday at 04:25 AM $hRibonForm = GUICreate("RibonForm", $FW, $FH, $hWinPos[0], ($hWinPos[1] - $FH) / 2, $WS_POPUPWINDOW, $WS_EX_TOOLWINDOW) GUISetBkColor(0x666600) ; <---- added this to see it Nice. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
Solution ioa747 Posted Thursday at 04:31 AM Solution Posted Thursday at 04:31 AM (edited) There is definitely room for improvement (exploring the scrolling) and that's why I said it as an idea. The idea where you can use one of this type (auto-hide) where no extra space is needed (as its purpose is only to call a command) expandcollapse popup#include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GUIConstantsEx.au3> Global $g_bAutoHide = True Global $idBtnAutoHide Global $g_hTriggerGUI, $g_hRibonGUI ;~ $g_hTriggerGUI = TriggerGUI() $g_hTriggerGUI = TriggerGUI(0xF0F0F0, 15, 100, 250) $g_hRibonGUI = RibonGUI() ;********************************** While Sleep(50) TriggerCheck() WEnd ;********************************** ;---------------------------------------------------------------------------------------- Func GoToExit() ; exit Exit EndFunc ;==>GoToExit ;---------------------------------------------------------------------------------------- Func TriggerGUI($BkColor = 0xF0F0F0, $Width = 12, $Height = 50, $Trans = 50) Local $hWnd = GUICreate("TriggerGUI", $Width, $Height, -7, (@DesktopHeight - $Height) * 0.4, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST)) GUISetBkColor($BkColor) WinSetTrans($hWnd, "", $Trans) GUICtrlCreateLabel("", 0, 0, $Width, $Height) WinSetState($hWnd, "", @SW_SHOW) Return $hWnd EndFunc ;==>TriggerGUI ;---------------------------------------------------------------------------------------- Func TriggerCheck() ;if mouse over Trigger Local $aTrigger = GUIGetCursorInfo($g_hTriggerGUI) If $aTrigger[4] Then ;Make the RibonGUI Local $WinPos = WinGetPos($g_hRibonGUI) Local $BakPos = $WinPos WinMove($g_hRibonGUI, "", $WinPos[0], $WinPos[1], $WinPos[2], $WinPos[3]) GUISetState(@SW_SHOW, $g_hRibonGUI) ;Show the RibonGUI For $i = 1 To $WinPos[2] Step 5 WinMove($g_hRibonGUI, "", $WinPos[0], $WinPos[1], $i, $WinPos[3]) Next Local $aRibon ;********************************** While 1 $aRibon = GUIGetCursorInfo($g_hRibonGUI) If $aRibon[4] = 0 And $g_bAutoHide = True Then ExitLoop Sleep(100) WEnd ;********************************** ;Hide the RibonGUI For $i = $WinPos[2] To 1 Step -5 WinMove($g_hRibonGUI, "", $WinPos[0], $WinPos[1], $i, $WinPos[3]) Next GUISetState(@SW_HIDE, $g_hRibonGUI) WinMove($g_hRibonGUI, "", $BakPos[0], $BakPos[1], $BakPos[2], $BakPos[3]) EndIf EndFunc ;==>TriggerCheck ;---------------------------------------------------------------------------------------- Func RibonGUI() ; Ribon make Opt("GUIOnEventMode", 1) ;0=disabled, 1=OnEvent mode enabled GUISetOnEvent($GUI_EVENT_CLOSE, "GoToExit") ConsoleWrite("@DesktopWidth=" & @DesktopWidth & @CRLF) ConsoleWrite("@DesktopHeight=" & @DesktopHeight & @CRLF) ConsoleWrite("@OSVersion=" & @OSVersion & @CRLF) ConsoleWrite("@AutoItX64=" & @AutoItX64 & @CRLF) Local $Width = 320 Local $Height = @DesktopHeight - 40 ; $DTs[1] Local $hWnd = GUICreate("RibonGUI", $Width, $Height, -7, -1, $WS_POPUPWINDOW, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST)) ; $idLblHead = GUICtrlCreateLabel("", 0, 0, $Width, 32) ; GUICtrlSetBkColor(-1, 0x004A7F) Local $iStep = 2 $idBtnAutoHide = GUICtrlCreateButton("◀", $Width - 30, $iStep, 28, 28) GUICtrlSetFont(-1, 14) GUICtrlSetTip(-1, "Auto Hide ") GUICtrlSetOnEvent(-1, "Ribon_BtnAutoHide") $iStep += 50 GUICtrlCreateLabel("$idInput1", 10, $iStep, 300, 15) $iStep += 15 $idInput1 = GUICtrlCreateInput("Tex1", 10, $iStep, 305, 22) GUICtrlSetFont(-1, 12, 400, 0, "DejaVuSansMono") $iStep += 40 GUICtrlCreateLabel("$idInput2", 10, $iStep, 300, 15) $iStep += 15 $idInput2 = GUICtrlCreateInput("Tex2", 10, $iStep, 305, 22) GUICtrlSetFont(-1, 12, 400, 0, "DejaVuSansMono") $iStep += 40 GUICtrlCreateLabel("$idInput3", 10, $iStep, 300, 15) $iStep += 15 $idInput3 = GUICtrlCreateInput("Tex3", 10, $iStep, 305, 22) GUICtrlSetFont(-1, 12, 400, 0, "DejaVuSansMono") $iStep += 40 GUICtrlCreateLabel("$idInput4", 10, $iStep, 300, 15) $iStep += 15 $idInput4 = GUICtrlCreateInput("Tex4", 10, $iStep, 305, 22) GUICtrlSetFont(-1, 12, 400, 0, "DejaVuSansMono") GUICtrlCreateLabel("", 0, 0, $Width, $Height, $SS_GRAYFRAME) Return $hWnd EndFunc ;==>RibonGUI ;---------------------------------------------------------------------------------------- Func Ribon_BtnAutoHide() If $g_bAutoHide = True Then $g_bAutoHide = False GUICtrlSetData($idBtnAutoHide, "⏸️") Else $g_bAutoHide = True GUICtrlSetData($idBtnAutoHide, "◀️") EndIf EndFunc ;==>Ribon_BtnAutoHide ;---------------------------------------------------------------------------------------- Edited Thursday at 05:28 AM by ioa747 update argumentum and CYCho 2 I know that I know nothing
TwoCanoe Posted Thursday at 04:50 AM Author Posted Thursday at 04:50 AM Added the line argumentum added (after line 117). I now see a vertical bar in the SciTE number column, tried to hover over it, but nothing. Mouse cursor still had a life of its own.
TwoCanoe Posted Thursday at 04:57 AM Author Posted Thursday at 04:57 AM (edited) ioa747. Tried the script you posted above. Mouse cursor is a lot better, but when I hover over the bar, I get a flickering bar a few pixels high and maybe 200 pixels wide. Edited Thursday at 04:57 AM by TwoCanoe
ioa747 Posted Thursday at 05:31 AM Posted Thursday at 05:31 AM I modified the above, try it and tell me. I know that I know nothing
TwoCanoe Posted Thursday at 05:39 AM Author Posted Thursday at 05:39 AM Success! Admittedly I wasn't looking to use a hidden gui window but would save me some desktop space. Thanks. ioa747 1
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