How to scroll the window without displaying the scroll bar

Ask for help, how to use AHK_H, etc.
arcticir
Posts: 694
Joined: 17 Nov 2013, 11:32

How to scroll the window without displaying the scroll bar

11 Jul 2017, 14:34

One of my scripts uses the AHKGUI simulation menu to make the menu more flexible and elegant.
But I have been unable to solve its rolling problem.
In AHKGUI, use the "WS_VSCROLL" style, you can scroll it, but this scroll bar can not be hidden, can not be set, and can not modify it, it destroys the beauty of the menu.

So I tried to use the WINAPI GUI to create a scroll bar to hide it by defining its width, but unfortunately it could not scroll the main window. Who knows where it was wrong?

Code: Select all

GuiCreate()
WS_CHILD := 0x40000000
WS_VSCROLL := 0X200000
WS_VISIBLE := 0x10000000

hwnd:=CreateWindowEx(0, "AutoHotkeyGui", "", 0, 200, 200, 400, 400, 0, 0, 0, 0)
loop 20
CreateWindowEx(0, "static", A_Index "______________________________", WS_CHILD | WS_VISIBLE, 25, 50*(A_Index-1), 400, 40, hwnd, 0, 0, 0)
vWinExStyle := 0
vWinClass := "ScrollBar"
vWinText := ""
;SBS_VERT := 0x1 ;SBS_RIGHTALIGN := 0x4
WS_CHILD := 0x40000000 ,WS_VISIBLE := 0x10000000
vWinStyle := WS_CHILD | WS_VISIBLE | 0x5
vPosX := 0, vPosY := 0, vPosW := 10, vPosH := 8000
hWndParent := hwnd
hMenu := 0, hInstance := 0, vParam := 0
hCtl := CreateWindowEx(0x200000, vWinClass, vWinText, vWinStyle, vPosX, vPosY, vPosW, vPosH, hWndParent, hMenu, hInstance, vParam)
ShowWindow(hwnd,  4)
Return
Image

Image
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: How to scroll the window without displaying the scroll bar

11 Jul 2017, 15:32

Try this:

Code: Select all

GUI:=GuiCreate("VSCROLL","TEST")
Loop 20
   Gui.AddText(,A_Index)
Gui.Show("w200 h200")
ShowScrollBar(gui.hwnd,1,false)
OnMessage(0x20A,"WHEEL") ;WM_MOUSEWHEEL
OnMessage(0x20E,"WHEEL") ;WM_MOUSEHWHEEL
Return
WHEEL(){
   SetTimer "HideScroll",-1
}
HideScroll:
   ShowScrollBar(gui.hwnd,1,false)
Return
arcticir
Posts: 694
Joined: 17 Nov 2013, 11:32

Re: How to scroll the window without displaying the scroll bar

11 Jul 2017, 17:06

Thanks. If it does not flicker, is perfect.
Also I am curious, AHKGUI can not add more custom options? For example, "+ Border" border color, "VSCROLL" width.
This does not conflict with the original function, but is more free.
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: How to scroll the window without displaying the scroll bar

11 Jul 2017, 17:12

I don't think you can change border color and neither Scroll width :(
arcticir
Posts: 694
Joined: 17 Nov 2013, 11:32

Re: How to scroll the window without displaying the scroll bar

11 Jul 2017, 18:12

It seems that the use of WINAPI GUI is also hopeless to solve this problem...
The question seems forever will never be resolved. :(

Code: Select all

GuiCreate()
WS_CHILD := 0x40000000
WS_VSCROLL := 0X200000
WS_VISIBLE := 0x10000000

hwnd:=CreateWindowEx(0, "AutoHotkeyGui", "", 0, 200, 200, 400, 400, 0, 0, 0, 0)
loop 20
CreateWindowEx(0, "static", A_Index "______________________________", WS_CHILD | WS_VISIBLE, 25, 50*(A_Index-1), 400, 40, hwnd, 0, 0, 0)
CreateWindowEx(0, "ScrollBar", "", WS_CHILD | WS_VISIBLE | 0x5, 0, 0, 10, 800, hwnd, 0, 0, 0)
ShowWindow(hwnd,  4)
Return
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: How to scroll the window without displaying the scroll bar

11 Jul 2017, 19:32

@arcticir: That GUI looks really nice thanks for posting the image. Could you provide your code in full, so that I can experiment. I tried using what you and HotKeyIt have provided so far but there seem to be bits missing.

In case any of the scrollbar styles are useful:
Scroll Bar Control Styles (Windows)
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
arcticir
Posts: 694
Joined: 17 Nov 2013, 11:32

Re: How to scroll the window without displaying the scroll bar

12 Jul 2017, 08:33

Thanks. but i tried these styles still can not scroll the main window.

Return to “Ask for Help”

Who is online

Users browsing this forum: No registered users and 37 guests