Remove border from Progress? Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
User avatar
PuzzledGreatly
Posts: 726
Joined: 29 Sep 2013, 22:18

Remove border from Progress?

05 May 2019, 01:25

Is there any way to completely remove the border effect from a progress. Consider:

Code: Select all

Gui, Color, black, black
Gui, add, progress, x0 y0 w600 h50 CBlack BackgroundBlack disabled -border
Gui, show, maximize
I see a border around the progress. Is there any way to make it flat so in the above gui the progress would be indistinguishable from the background? Thanks
just me
Posts: 6300
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Remove border from Progress?

05 May 2019, 03:01

AFAIR:

Code: Select all

Gui, Add, Progress, x0 y0 w600 h50 CBlack BackgroundBlack Disabled -E0x0200 ; WS_EX_CLIENTEDGE = 0x0200
User avatar
PuzzledGreatly
Posts: 726
Joined: 29 Sep 2013, 22:18

Re: Remove border from Progress?

05 May 2019, 03:10

Fantastic! That's very useful for making fancy guis and gui coloured buttons. Thank you.

I spoke too soon. On my Windows 7 machine I can still see an edge around the progress. So unfortunately it's not seamless. Is there any way to make a progress totally flat?
Last edited by PuzzledGreatly on 05 May 2019, 03:19, edited 1 time in total.
Klarion
Posts: 176
Joined: 26 Mar 2019, 10:02

Re: Remove border from Progress?

05 May 2019, 03:30

in my previous experiences
MS UIs are good in general, sometimes they are amazing enough
But, the other times they are amazingly silly - inconvenient and useless

So, I made a rule to keep.
Stop at some point.
That is my best.

OR you have to pay some USD 1,000.- for really professional and easy solution from 3rd party.
Which is your choice ?
just me
Posts: 6300
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Remove border from Progress?

05 May 2019, 03:48

Code: Select all

Gui, Add, Progress, x0 y0 w600 h50 cBlack BackgroundBlack Disabled HwndHPB
Control, ExStyle, -0x0200, , ahk_id %HPB%
Better?
User avatar
PuzzledGreatly
Posts: 726
Joined: 29 Sep 2013, 22:18

Re: Remove border from Progress?

05 May 2019, 07:19

Klarion wrote:
05 May 2019, 03:16
use the help file, all are there already
https://www.autohotkey.com/docs/misc/Styles.htm#Edit
I looked at the help file before I posted. Do you have any specific suggestions to try?
Last edited by PuzzledGreatly on 05 May 2019, 07:23, edited 1 time in total.
User avatar
PuzzledGreatly
Posts: 726
Joined: 29 Sep 2013, 22:18

Re: Remove border from Progress?

05 May 2019, 07:22

just me wrote:
05 May 2019, 03:48

Code: Select all

Gui, Add, Progress, x0 y0 w600 h50 cBlack BackgroundBlack Disabled HwndHPB
Control, ExStyle, -0x0200, , ahk_id %HPB%
Better?
Thanks, just me but I'm not seeing any difference.
Klarion
Posts: 176
Joined: 26 Mar 2019, 10:02

Re: Remove border from Progress?

05 May 2019, 11:43

That is my best
User avatar
jeeswg
Posts: 6399
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Remove border from Progress?

05 May 2019, 17:49

Some other styles to consider, that the window has:
WS_BORDER := 0x800000
WS_DLGFRAME := 0x400000
WS_EX_WINDOWEDGE := 0x100

Presumably you are tiling controls, so it would be better to give some example code that shows this. It's hard to observe anything if the control is the same size as the window. Thanks.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
User avatar
PuzzledGreatly
Posts: 726
Joined: 29 Sep 2013, 22:18

Re: Remove border from Progress?

05 May 2019, 18:31

Thanks for the suggestions jeeswg. I tired them but didn't see a useful result. I'm creating some backgrounds. Consider the code below. I can see a clear difference between using the png and the progress. The progress has an edge. I'd like to be able to stop using pngs and just use progress or some other way to create backgrounds with flat colors. Thanks again.

Code: Select all

X := A_ScreenWidth
Y := A_ScreenHeight
V := Y - (X/10)
TB := floor(X/10)

Gui, Back:New, -Caption  +ToolWindow -DPIScale
Gui, Back:Color, c99ff66, black
Gui, Back:add, progress, x0 y0 w%X% h%TB% Background%bc% Disabled  HwndHPB
Control, ExStyle, -0x0200, , ahk_id %HPB%
Gui, Back:add, picture, x0 y%V% w%X% h%TB%,  bckBlack.png
Gui, Back:show, center w%X% h%Y%, BackPlate
Gui, Back:maximize, 

return

esc:: exitapp
bckBlack.png
bckBlack.png (306 Bytes) Viewed 357 times
User avatar
jeeswg
Posts: 6399
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Remove border from Progress?

05 May 2019, 18:53

- Thanks for the script, I tried with/without the png. I tested on Windows 7. I didn't see any border, and couldn't see one even after printscreening and zooming in.
- So maybe you could give a better example script to demonstrate the problem, or a printscreen.
- If nothing else works, you could try making a window 1 pixel bigger in each of the 4 directions, and then using WinSet Region.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
User avatar
PuzzledGreatly
Posts: 726
Joined: 29 Sep 2013, 22:18

Re: Remove border from Progress?

06 May 2019, 01:21

Thanks for taking the trouble with this. Are you using aero? My machine is adjusted for best performance and all visual effects are switched off. I've uploaded a composite file to show what I'm seeing. Zoom in and border on the progress is clearly visible.
Attachments
example.png
example.png (1.39 KiB) Viewed 323 times
just me
Posts: 6300
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Remove border from Progress?  Topic is solved

06 May 2019, 05:15

If you just want to create flat colored backgrounds:

Code: Select all

#NoEnv
Gui, Margin, 20, 20
Gui, Color, Black
Gui, Add, Pic, xm  ym w100 h100, % "HBITMAP:" . CreateDIB(0xFF0000) ; red
Gui, Add, Pic,     ym w100 h100, % "HBITMAP:" . CreateDIB(0x00FF00) ; green
Gui, Add, Pic, xm     w100 h100, % "HBITMAP:" . CreateDIB(0x0000FF) ; blue
Gui, Add, Pic, x+m yp w100 h100, % "HBITMAP:" . CreateDIB(0xFFFFFF) ; white
Gui, SHow, , Colors
Return

GuiClose:
ExitApp

; ==================================================================================================================================
; Modified version of a function by SKAN, 01-Apr-2014, autohotkey.com/boards/viewtopic.php?t=3203
; Creates an uni-colored bitmap of 1 * 1 pixels.
; ==================================================================================================================================
CreateDIB(Color) {
   VarSetCapacity(BMBITS, 4, 0)
   , Numput(Color, BMBITS, "UInt")
   , HBM := DllCall("CreateBitmap", "Int", 1, "Int", 1, "UInt", 1, "UInt", 24, "Ptr", 0, "UPtr")
   , HBM := DllCall("CopyImage", "Ptr", HBM, "UInt", 0, "Int", 0, "Int", 0, "UInt", 0x2008, "UPtr")
   , DllCall("SetBitmapBits", "Ptr", HBM, "UInt", 4, "Ptr", &BMBITS)
   Return HBM
}
User avatar
PuzzledGreatly
Posts: 726
Joined: 29 Sep 2013, 22:18

Re: Remove border from Progress?

06 May 2019, 16:50

Thanks just me., that's great. I've added the function to my master set. I should have been clearer about what I was after at the beginning. No need to use progress with it's unfortunate border any more.
Klarion
Posts: 176
Joined: 26 Mar 2019, 10:02

Re: Remove border from Progress?

07 May 2019, 00:49

so
you stopped at your point

Return to “Ask For Help”

Who is online

Users browsing this forum: flyingDman, MIRKOSOFT, Monoxide3009, RickC, teadrinker and 101 guests