Search found 3126 matches

by BarryG
Sat Apr 20, 2024 11:00 am
Forum: Coding Questions
Topic: Thread Parameters?
Replies: 15
Views: 786

Re: Thread Parameters?

The Semaphore approach isn't going to work for me, because "Global Semaphore.i = CreateSemaphore()" is global and my threads are going to be called more than once, so a global semaphore for a thread is going to send the signal to the wrong thread callers, right?
by BarryG
Fri Apr 19, 2024 11:37 am
Forum: Announcement
Topic: PureBasic 6.10 LTS is out !
Replies: 330
Views: 41232

Re: PureBasic 6.10 LTS is out !

EXE compressors also sometimes have the opposite effect on anti-virus software: they become suspect. Hmm, not in my experience. Like I said, my apps get several false positives without UPX, and none with UPX. But I also manually replace the 3 x "UPX" text bytes from the file header of the...
by BarryG
Fri Apr 19, 2024 11:18 am
Forum: Coding Questions
Topic: Thread Parameters?
Replies: 15
Views: 786

Re: Thread Parameters?

@STARGÅTE: Thanks for showing that. I should switch my Delays() to Semaphores() then for my threads? But, can I just use the one semaphore for all my different threads, or does each thread need its own dedicated semaphore? What I mean is, is doing it like this safe? It appears to be. ; Enable thread...
by BarryG
Thu Apr 18, 2024 10:14 pm
Forum: Feature Requests and Wishlists
Topic: PureBasic Librarian
Replies: 27
Views: 2539

Re: PureBasic Librarian

Axolotl wrote: Thu Apr 18, 2024 2:59 pmthe IDE does not support read only files
Say what? Yes, it does. I have dozens of read-only files included in my source. Have used them for years.
by BarryG
Thu Apr 18, 2024 10:09 pm
Forum: Coding Questions
Topic: Thread Parameters?
Replies: 15
Views: 786

Re: Thread Parameters?

In both cases the information is passed just as a reference to the thread, and not as a variable or copy. That's why my example has "text$=PeekS(params)" as the first line of the thread: to create a local copy of the params so they're not lost. Sometimes you'll need a small delay after cr...
by BarryG
Thu Apr 18, 2024 12:38 am
Forum: Coding Questions
Topic: EditorGadget() placeholder text
Replies: 8
Views: 491

Re: EditorGadget() placeholder text

; Created by ChatGPT4 ; Konstanten für die Gadget-IDs Enumeration #Editor EndEnumeration ; Initialer Platzhaltertext Global Placeholder$ = "Bitte Text eingeben..." ; Fenster und EditorGadget erstellen If OpenWindow(0, 100, 100, 300, 100, "Editor mit Platzhalter", #PB_Window_Syst...
by BarryG
Thu Apr 18, 2024 12:33 am
Forum: Coding Questions
Topic: Thread Parameters?
Replies: 15
Views: 786

Re: Thread Parameters?

A simpler alternative if speed isn't an issue: ; Enable thread safety in Compiler Options! Procedure MyThread(params) text$=PeekS(params) n=CountString(text$,",")+1 For i=1 To n p$=StringField(text$,i,",") If p$ Debug p$ EndIf Next EndProcedure text$="1,2,3,4,5" ; Five ...
by BarryG
Mon Apr 15, 2024 10:00 pm
Forum: Coding Questions
Topic: Detect TaskBar events [Resolved]
Replies: 8
Views: 655

Re: Detect TaskBar events

What type of events? But yes, you can detect mouse clicks, and if it's visible, etc. Not as "events" but you can manually poll for them.
by BarryG
Mon Apr 15, 2024 8:43 am
Forum: Windows
Topic: Cancel shutdown/reboot?
Replies: 4
Views: 231

Re: Cancel shutdown/reboot?

Maybe this helps -> https://stackoverflow.com/questions/7538006/prevent-windows-shutdown-with-custom-message It says: "If you need to block shutdown you call ShutdownBlockReasonCreate passing the handle to your main window and the reason as a string. This string is what is displayed in the shut...
by BarryG
Mon Apr 15, 2024 8:24 am
Forum: Announcement
Topic: PureBasic 6.10 LTS is out !
Replies: 330
Views: 41232

Re: PureBasic 6.10 LTS is out !

Marc56us wrote: Mon Apr 15, 2024 7:43 amEXE compressors also sometimes have the opposite effect on anti-virus software: they become suspect.
With UPX it's no problem because it's so well-known that every AV just decompresses the exe before scanning.
by BarryG
Sun Apr 14, 2024 10:22 pm
Forum: Coding Questions
Topic: Can't fetch a specific webpage.
Replies: 12
Views: 539

Re: Can't fetch a specific webpage.

jassing wrote: Sun Apr 14, 2024 2:34 amIt seems PB's receivehttp is unreliable
It'd more likely be the website's server setup, otherwise every website wouldn't work with ReceiveHTTP...(). Some websites compress their data which can make it return "gibberish". I've posted about this before.
by BarryG
Sun Apr 14, 2024 1:34 pm
Forum: Coding Questions
Topic: Setting and Getting GadgetITemData on a ListIconGadget
Replies: 7
Views: 491

Re: Setting and Getting GadgetITemData on a ListIconGadget

charvista wrote: Sun Apr 14, 2024 1:12 pmAt school, we learned to count from one, not from zero
Reminds me of this -> https://youtu.be/76J3mHnHHOE?si=loTImLs-VuU0YJeE&t=89 :mrgreen:
by BarryG
Sun Apr 14, 2024 4:45 am
Forum: General Discussion
Topic: PureBasic v6.10 is producing a file size 5 times bigger than v6.04
Replies: 21
Views: 1533

Re: PureBasic v6.10 is producing a file size 5 times bigger than v6.04

Maya wrote: Sat Apr 13, 2024 7:12 pmIs this is happening with me only?
No, others have reported it. It's the price of progress. Personally I like the 6.10 improvements (Date lib for years up to 9999 for one); and I use UPX to shrink my exe from 10 MB to 4 MB (which also has the benefit of reducing VirusTotal false positives).
by BarryG
Sat Apr 13, 2024 9:06 am
Forum: Coding Questions
Topic: Debug mode execution speed can vary on source whitespace.
Replies: 12
Views: 737

Re: Debug mode execution speed can vary on source whitespace.

Confirmed here: 150ms with no blank lines above the procedure, and 220ms when there is. :shock: When DisableDebugger is used, both are 25ms. Never seen how the source code itself can affect the runtime of a compiled exe. Although... I have had PureBasic's IDE not open until I quit a running exe that...
by BarryG
Wed Apr 10, 2024 1:35 pm
Forum: Windows
Topic: Detect if a window has curved corners?
Replies: 6
Views: 282

Re: Detect if a window has curved corners?

Thanks guys, I'll do some testing to see which suits best. :)