Search found 397 matches

by breeze4me
Tue Apr 16, 2024 9:57 am
Forum: Coding Questions
Topic: Modify or create frame around explorer window
Replies: 10
Views: 313

Re: Modify explorer window

Try this. Procedure Event_ResizeWnd() Protected Wnd = EventWindow() Protected w = WindowWidth(Wnd) Protected h = WindowHeight(Wnd) Static img If IsImage(img) : FreeImage(img): EndIf If w > 0 And h > 0 img = CreateImage(#PB_Any, w, h, 24, #Red) If img If StartDrawing(ImageOutput(img)) Box(10, 10, w -...
by breeze4me
Tue Apr 16, 2024 9:12 am
Forum: Coding Questions
Topic: ListIconGadget - resize content to fit perfectly
Replies: 3
Views: 190

Re: ListIconGadget - resize content to fit perfectly

Macro ScaleUp(value) (((value)*DpiScale)>>#PB_DpiBits) EndMacro Macro ScaleDown(value) (((value)<<#PB_DpiBits)/DpiScale) EndMacro No. That one pixel error is due to rounding when scaling up and down, so your scaling up and down macros have the same error. At 125%, the left margin is 5 pixels and th...
by breeze4me
Mon Apr 15, 2024 11:12 am
Forum: Coding Questions
Topic: ListIconGadget - resize content to fit perfectly
Replies: 3
Views: 190

Re: ListIconGadget - resize content to fit perfectly

Your code has the same left and right margins at 100% screen scale. But, to make it look right at screen scales greater than 100%, you need to handle the size in pixels, which is a bit complicated. To ensure that there is not even a single pixel of error, it is not recommended to use PB native funct...
by breeze4me
Thu Apr 11, 2024 10:42 am
Forum: Windows
Topic: ListIcon and image transparency
Replies: 20
Views: 855

Re: ListIcon and image transparency

FillRect_() does not paint the background color because the values of the fields in the ptRECT structure are all 0.
The structure variable is only populated after the #LVM_GETSUBITEMRECT message call below.
by breeze4me
Thu Apr 11, 2024 9:21 am
Forum: Windows
Topic: ListIcon and image transparency
Replies: 20
Views: 855

Re: ListIcon and image transparency

Fill in the background color as shown below. Global ImgList, OldWndProc, ListIcon Procedure ListIcon_SetItemImage(tempListIconGadget, index_item.w, index_subitem.w, index_image.w) Protected itemLV.LVITEM ; tagLVITEM itemLV\mask = #LVIF_IMAGE itemLV\iItem = index_item itemLV\iSubItem = index_subitem ...
by breeze4me
Tue Apr 09, 2024 10:10 am
Forum: Windows
Topic: Detect if a window has curved corners?
Replies: 6
Views: 240

Re: Detect if a window has curved corners?

I've looked recently, too, and there's no such general way(APIs or registry values, etc.). Nevertheless, you can get some hints from the link below.

https://learn.microsoft.com/en-us/windo ... ed-corners
by breeze4me
Tue Apr 09, 2024 5:11 am
Forum: Bugs - Windows
Topic: [Done] [6.10LTS WIN x86 ASM / C] SvgVectorOutput() causes IMA
Replies: 10
Views: 258

Re: [6.10LTS WIN x86 ASM / C] SvgVectorOutput() causes IMA

Confirmed. The IMA error occurs only in PB 6.10 x86 both ASM and C backend. If StartVectorDrawing(SvgVectorOutput("test.svg", 400, 200)) AddPathBox(50, 50, 200, 50) AddPathBox(150, 75, 200, 50) VectorSourceColor(RGBA(255, 0, 0, 255)) StrokePath(10) StopVectorDrawing() EndIf
by breeze4me
Sun Apr 07, 2024 4:48 pm
Forum: Coding Questions
Topic: How to create constants automatically?
Replies: 12
Views: 459

Re: How to create constants automatically?

That's not possible with a numeric constant, but it is with a string constant. #MyColor$ = "A unique string that is never used in the code." *p = @"A unique string that is never used in the code." R=$00 G=$B2 B=$FF PokeS(*p, Str(RGB(R,G,B))) color.l = Val(#MyColor$) a.s = #MyColo...
by breeze4me
Wed Apr 03, 2024 6:20 pm
Forum: Windows
Topic: ListIcon and image transparency
Replies: 20
Views: 855

Re: ListIcon and image transparency

In practice, the custom drawing is shorter if you do a few calculations like RASHAD's code. :wink: Fixed some glitches in the previous code. Import "Msimg32.lib" TransparentBlt(hdcDest, xoriginDest.l, yoriginDest.l, wDest.l, hDest.l, hdcSrc, xoriginSrc.l, yoriginSrc.l, wSrc.l, hSrc.l, crTr...
by breeze4me
Sat Mar 30, 2024 2:10 pm
Forum: Bugs - Windows
Topic: FileSize Function And Extended Paths
Replies: 5
Views: 228

Re: FileSize Function And Extended Paths

I tested it with a few files and it seems to work fine for local disk files.
Note that the return value is a quad type.
Tested with 6.10 LTS x64/x86.

Code: Select all

sz.q = FileSize("\\?\Z:\test.txt")
by breeze4me
Sat Mar 30, 2024 2:00 pm
Forum: Windows
Topic: ListIcon and image transparency
Replies: 20
Views: 855

Re: ListIcon and image transparency

This is a trick using a background image. Edit: Fixed a drawing issue when returning from offscreen. Procedure Add_Icon_To_ImageList(ImgList, DLL_Path.s, index) Protected hIcon, img_index = -1 hIcon = ExtractIcon_(#Null, DLL_Path, index) If hIcon img_index = ImageList_AddIcon_(ImgList, hIcon) Destro...
by breeze4me
Thu Mar 28, 2024 9:15 am
Forum: Coding Questions
Topic: Problem with Mouse and F10 key ...
Replies: 16
Views: 495

Re: Problem with Mouse and F10 key ...

Problem 1: For my program, I want to use the keyboard function keys for selection of my SUB programs. If i use F1...F9 there is no problem and it work very well, but if I use F10, it blocks the mouse and other Function keys If I push again F10 all works well ... PB5.73x64 / Win 10 pro Try this. Pro...
by breeze4me
Mon Mar 25, 2024 5:09 am
Forum: Tricks 'n' Tips
Topic: Edge WebGadget - Set BrowserArguments, UserDataFolder (Windows)
Replies: 4
Views: 385

Re: Edge WebGadget - Set BrowserArguments, UserDataFolder (Windows)

Thank you breeze4me for the example of setting webgadget parameters at startup. Unfortunately, I was unable to test the second example due to a lack of intelligence and now I feel completely stupid. :cry: Would you be so kind as to add a few more explanations? What happens to the code? How can I te...
by breeze4me
Sun Mar 24, 2024 9:05 am
Forum: Coding Questions
Topic: How to catch the keyboard layout switch event?
Replies: 4
Views: 270

Re: How to catch the keyboard layout switch event?

I haven't tried it with PB, but the answer below might be helpful. https://stackoverflow.com/questions/8289492/find-out-when-keyboard-layout-is-changed If I open the cmd.exe console, I can't get the keyboard layout even though the system tray text switches The console part is MS's issue. https://git...