Search found 71 matches

by CalamityJames
Sat Nov 15, 2025 11:34 am
Forum: Coding Questions
Topic: How to detect when a window created by another process is closed in PureBasic?
Replies: 3
Views: 787

Re: How to detect when a window created by another process is closed in PureBasic?

This seems to work: ; https://learn.microsoft.com/en-us/windows/win32/winauto/event-constants
; This program is adapted from https://purebasic.developpez.com/sources/?page=Pg_windows#read_url (Lecture des adresses URL des navigateurs Internet exploreur ou Firefox.)

EnableExplicit
#WINEVENT ...
by CalamityJames
Wed Mar 05, 2025 12:54 pm
Forum: Coding Questions
Topic: Remove diacritic chars
Replies: 17
Views: 1739

Re: Remove diacritic chars

It isn't quite the same as what you are asking but here is some code written by Wilbert in answer to a question I asked on the forum 12(!) years ago, which covers the same ground http://www.purebasic.fr/english/viewtop ... 06#p412706. I'm still using it.
by CalamityJames
Sun Feb 11, 2024 7:39 pm
Forum: Coding Questions
Topic: The new #PB_WebView_ICoreController Flag for the WebGadget
Replies: 0
Views: 358

The new #PB_WebView_ICoreController Flag for the WebGadget

The new flag for the WebGadget looks interesting, but I don't have any idea how to get started. Would someone please post an example so that I can "get off the ground floor"?
by CalamityJames
Thu Feb 08, 2024 5:33 pm
Forum: Coding Questions
Topic: Unable to Stream Rich Text to Editor Gadget
Replies: 3
Views: 684

Re: Unable to Stream Rich Text to Editor Gadget

Thanks to Rashad. I had a feeling that it was one of those things which are simple - when you know how!
by CalamityJames
Thu Feb 08, 2024 4:21 pm
Forum: Coding Questions
Topic: Unable to Stream Rich Text to Editor Gadget
Replies: 3
Views: 684

Unable to Stream Rich Text to Editor Gadget

I am unable to stream rich text format text into the Editor Gadget in PB 6.04 (or 6.10 for that matter). The coding to stream the text is clearly correct because I can stream text into a Rich Edit Control created by the windows function CreateWindowEx. The following code illustrates the point ...
by CalamityJames
Wed Feb 07, 2024 11:20 am
Forum: Announcement
Topic: PureBasic 6.10 LTS is out !
Replies: 344
Views: 126498

Re: PureBasic 6.10 beta 5 is out !

For me, one of the best improvements for this version is the introduction of the WebViewGadget. Up to now I have been using the WebGadget and the excellent CoMate plus to automate the logging in to some websites by entering text and "pressing" buttons. This has become less effective as the WebGadget ...
by CalamityJames
Sun May 14, 2023 5:32 pm
Forum: Coding Questions
Topic: Please Check This DPI Changer for Windows
Replies: 0
Views: 749

Please Check This DPI Changer for Windows

I was adapting a program to be DPI aware, and I had to keep toggling my desktop scaling manually from its recommended 100% to 150% (to make any positioning errors clear). This got a bit tedious but I found the information on the internet to change the scaling and adapted it to Pure Basic. The source ...
by CalamityJames
Mon Dec 14, 2020 5:10 pm
Forum: Coding Questions
Topic: Sunset/sunrise calculation
Replies: 6
Views: 2773

Re: Sunset/sunrise calculation

Davido sent me a message ages ago, drawing my attention to this post, but I have only just seen it! Coincidentally I have just written a post about moon phases (here: https://www.purebasic.fr/english/viewtopic.php?f=13&t=61671 You will find a link which points to some Applesoft Basic programs which ...
by CalamityJames
Mon Dec 14, 2020 4:52 pm
Forum: Coding Questions
Topic: Moon Phases
Replies: 13
Views: 5062

Re: Moon Phases

I think anyone reading this thread would be interested in the algorithms offered by "Sky and Telescope" magazine back in the 1980s. They published Applesoft Basic programs for all sorts of thing including phases of the moon. Amazingly, the source code for these programs is still available ( https ...
by CalamityJames
Fri Apr 24, 2020 11:58 am
Forum: Coding Questions
Topic: Same Calculation, different results
Replies: 10
Views: 3321

Re: Same Calculation, different results

Thanks to those who replied, particulary to PeDe whose observation skills are clearly above average!. The fact that the order of calculation made a difference made me wonder which of the results was closer to the right answer so I used the Casio calculator here: https://keisan.casio.com/calculator ...
by CalamityJames
Wed Apr 22, 2020 3:10 pm
Forum: Coding Questions
Topic: Same Calculation, different results
Replies: 10
Views: 3321

Same Calculation, different results

I was interested in the PureBasic routines for the Haversine (a calculation of the distances between two points on a curved surface) found here: https://www.purebasic.fr/english/viewtopic.php?t=47853 . This question is not about the formula but about two ways of calculating it. The code below shows ...
by CalamityJames
Sun Jan 28, 2018 6:00 pm
Forum: Coding Questions
Topic: bitmap copy to/get from canvas
Replies: 4
Views: 1586

Re: bitmap copy to/get from canvas

Try adding this procedure to your program somewhere convenient (It creates a PB image from the canvas gadget and copies it to the clipboard):
Procedure CopyHdcToClip()
Protected BitMapHandle.i, MemNeeded.i, MemPtr.i, BitMapWidth.i, BitMapHeight.i
Protected ImageHdc.i, hBmp.i
Protected CanvasDc.i ...
by CalamityJames
Fri Jun 09, 2017 5:38 pm
Forum: Tricks 'n' Tips
Topic: Adding a context menu to a Combo Box in Windows
Replies: 5
Views: 2888

Re: Adding a context menu to a Combo Box in Windows

In attempting to simplify my code Rashad has spoilt the consistent interface I tried to create and reduced its functionality. I wanted it to be possible to right-click anywhere on the combo box, including the drop-down part, and have the entry returned (in the variable LookupWord) so it could be ...
by CalamityJames
Thu Jun 08, 2017 7:47 pm
Forum: Tricks 'n' Tips
Topic: Adding a context menu to a Combo Box in Windows
Replies: 5
Views: 2888

Adding a context menu to a Combo Box in Windows

I wanted to add a context menu to a combo box gadget and it proved trickier than I expected. The following code does seem to work and might save someone some time if they want to do the same thing.

EnableExplicit

Structure ComboBoxInfo
cbSize.l
rcItem.RECT
rcButton.RECT
stateButton.l ...
by CalamityJames
Sun Sep 25, 2016 9:34 pm
Forum: Coding Questions
Topic: A Question about Procedures in Threads
Replies: 2
Views: 1426

Re: A Question about Procedures in Threads

Thank you for your reply. I was running some gadget updates (SetGadgetText mostly), so I moved them to the main loop and I have been able to run many iterations on 3 different computers with no problems.

There is certainly no problem in principle going to a procedure in thread.