Search found 3134 matches

by BarryG
Thu Apr 25, 2024 11:22 am
Forum: Windows
Topic: Get menu and drop-down combobox dimensions?
Replies: 0
Views: 32

Get menu and drop-down combobox dimensions?

Hi all. I want to draw a rectangle around the current open menu (and systray menu) of my app, and also around the drop-down area of a combobox. I thought the GetForegroundWindow_() API would give me the handles to these, but it doesn't. What would you do? Thanks.
by BarryG
Thu Apr 25, 2024 5:26 am
Forum: Bugs - Windows
Topic: 6.10 and 6.11b1 LoadSound crashes
Replies: 7
Views: 319

Re: 6.10 and 6.11b1 LoadSound crashes

Confirmed returns 0 on 6.04, and division by zero error on 6.10.

But it works on 6.10 with this API version:

Code: Select all

PlaySound_("d:\temp\howdy.wav",0,0)
by BarryG
Wed Apr 24, 2024 8:12 am
Forum: Off Topic
Topic: Looking for Powerbasic Poffs v2.35 Sourcecode
Replies: 7
Views: 389

Re: Looking for Powerbasic Poffs v2.35 Sourcecode

jacdelad wrote: Tue Apr 23, 2024 5:35 pmYou should address this to a different forum. :wink:
Yep. This has zero to do with PureBasic.
by BarryG
Mon Apr 22, 2024 8:53 am
Forum: Coding Questions
Topic: Thread Parameters?
Replies: 25
Views: 1393

Re: Thread Parameters?

@Berry - your solution doesn't work, just press the button multiple time and you'll see it Seems to work fine here? Here's a sample debug output when I rapidly click the button. It shows each new thread alternating (the "T1" line followed by a "T2" line) with no misses. The idea...
by BarryG
Mon Apr 22, 2024 8:44 am
Forum: Announcement
Topic: PureBasic 6.10 LTS is out !
Replies: 336
Views: 42181

Re: PureBasic 6.10 LTS is out !

Is it because of the 3 "UPX" texts replacement in the header, that it's tagged as "corrupt" (malformed and will not execute in a real system)! Removing the 3 x "UPX" texts definitely seems to confuse the anti-virus apps, and it stops lay users from decompressing the ex...
by BarryG
Sun Apr 21, 2024 11:12 am
Forum: Coding Questions
Topic: Thread Parameters?
Replies: 25
Views: 1393

Re: Thread Parameters?

The sleep is just for this example. In my real app, the threads do some processing that takes a while, so the sleep was used here to stop the thread exiting too early and to simulate the further processing.
by BarryG
Sun Apr 21, 2024 4:10 am
Forum: Coding Questions
Topic: Thread Parameters?
Replies: 25
Views: 1393

Re: Thread Parameters?

Okay, this seems to be working for me in the way I need it. I can't see anything wrong with this approach? The goal is to show the time and date, from different threads, each time the button is clicked. Having one single global semaphore doesn't seem to be a problem? I'm not overlooking anything? Se...
by BarryG
Sun Apr 21, 2024 3:04 am
Forum: Coding Questions
Topic: Speed up loop
Replies: 13
Views: 604

Re: Speed up loop

This part is always recalculating "height-1" and "width-1" with each loop iteration, which is not optimal: For y=0 To Height -1 ;Loop image height For x = 0 To width - 1 ;Loop image width So do the calculation for them just once, like this: h1 = Height - 1 w1 = width - 1 For y=0 ...
by BarryG
Sat Apr 20, 2024 11:00 am
Forum: Coding Questions
Topic: Thread Parameters?
Replies: 25
Views: 1393

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: 336
Views: 42181

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: 25
Views: 1393

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: 2756

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: 25
Views: 1393

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: 621

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: 25
Views: 1393

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 ...