Search found 2201 matches

by deltarho[1859]
Mar 27, 2020 6:37
Forum: General
Topic: Corona virus simulator
Replies: 39
Views: 1159

Re: Corona virus simulator

UEZ wrote:well done but the move of the pixels are too turbulent imho...

@ShawnLG

Have a look at 'Randomize , 5'. Not only do we get a 'slowing down' but we also get top drawer randomness.
by deltarho[1859]
Mar 24, 2020 12:36
Forum: General
Topic: Corona virus simulator
Replies: 39
Views: 1159

Re: Corona virus simulator

Without Randomize: 166 dead Five runs with Randomize: 196, 150, 151, 174, 184 dead With Randomize and many more runs will give us a potential upper bound on deaths; that is a worst-case scenario. With more than 30 runs we can then use the normal distribution to calculate confidence limits on the exp...
by deltarho[1859]
Mar 15, 2020 13:05
Forum: Windows
Topic: Messagebox timeout
Replies: 11
Views: 309

Re: Messagebox timeout

@José

I have just belted through your last two posts and now need a lie down in a darkened room. Not a problem because I often have a nap in the afternoon. Image
by deltarho[1859]
Mar 15, 2020 12:09
Forum: Windows
Topic: Messagebox timeout
Replies: 11
Views: 309

Re: Messagebox timeout

Although MessageBoxTimeout is undocumented, it has been available and unaltered since Windows XP. Point taken. I took a similar stance with NtSetTimerResolution and NtQueryTimerResolution because they are used by timeBeginPeriod. Found this:- "It is unlikely that Microsoft will depricate this ...
by deltarho[1859]
Mar 15, 2020 9:19
Forum: Windows
Topic: Messagebox timeout
Replies: 11
Views: 309

Re: Messagebox timeout

It is worth mentioning that all return values of messagebox are positive so if you want to do something specific for a time out then check if the return value of TimedMessageBox() is -1.
by deltarho[1859]
Mar 15, 2020 8:56
Forum: Windows
Topic: Messagebox timeout
Replies: 11
Views: 309

Re: Messagebox timeout

@adeyblue

In this context I'm not sure that idEvent would be an issue. Anyway, notwithstanding that, I have replaced your &Hdeadf00d with &HFabC0de. Image
by deltarho[1859]
Mar 15, 2020 6:52
Forum: Windows
Topic: Messagebox timeout
Replies: 11
Views: 309

Re: Messagebox timeout

@adeyblue Blimey, Raymond Chen's code predates mine by about five years and no one at PowerBASIC spotted it. It seems that I was lucky to get away with quite a bit of stuff with Windows being uncharacteristically forgiving. At the moment I am trying to figure out why you gave the parent a dummy hand...
by deltarho[1859]
Mar 15, 2020 4:35
Forum: Windows
Topic: Messagebox timeout
Replies: 11
Views: 309

Re: Messagebox timeout

I had to make a correction.

PowerBASIC is a 32-bit compiler. Windows handles are 64-bit in 64-bit mode so I am now using

Code: Select all

Cast( Uinteger, hWnd )

so that it will compile in either 32-bit or 64-bit. Image
by deltarho[1859]
Mar 15, 2020 0:58
Forum: Tips and Tricks
Topic: WIN-API without any #Include "..."
Replies: 13
Views: 465

Re: WIN-API without any #Include "..."

I have ported it to FreeBASIC: Messagebox timeout
by deltarho[1859]
Mar 15, 2020 0:56
Forum: Windows
Topic: Messagebox timeout
Replies: 11
Views: 309

Messagebox timeout

There are some Windows undocumented functions for timing out a messagebox. Here is a method, ported from PowerBASIC, which does not use undocumented functions. I got the idea from a Microsoft technician about 10 years ago and have used it many times since without issue. The Long value returned by Ti...
by deltarho[1859]
Mar 14, 2020 23:32
Forum: Tips and Tricks
Topic: WIN-API without any #Include "..."
Replies: 13
Views: 465

Re: WIN-API without any #Include "..."

Over at the PowerBASIC forums there have been many message box timeout procedures using various methods other than the undocumented functions. Eventually, I chipped in with a version which uses the least amount of code. It was frowned upon by one of the PB members until I mentioned that I got the id...
by deltarho[1859]
Mar 14, 2020 18:55
Forum: Tips and Tricks
Topic: WIN-API without any #Include "..."
Replies: 13
Views: 465

Re: WIN-API without any #Include "..."

@dodicat

With regard the 'time out' function if we use it in forum published code we should mention that MessageBoxTimeoutA, and the other two variants, are undocumented functions.
by deltarho[1859]
Mar 13, 2020 12:12
Forum: Windows
Topic: Epoch time.
Replies: 30
Views: 877

Re: Epoch time.

I had a Sharp PC-1350, or was it a PC-1360, I cannot remember. Anyway, back in 1990 a friend of mine was a Collector of Taxes with the UK's Inland Revenue, now Her Majesty's Revenue and Customs. He took legal action on tax debtors and calculated, manually, interest due on the debt from the date it w...
by deltarho[1859]
Mar 12, 2020 23:52
Forum: Windows
Topic: Epoch time.
Replies: 30
Views: 877

Re: Epoch time.

And going back further to the Sinclair ZX81, programming the Z80 CPU going flat out at 2.5MHz, being kept cool in the summer with a little Pifco fan and 'duck' tape on the 16KiB ram pack to stop it wobbling and crashing the machine, displayed on an old 14" black and white TV. Until I got an ass...
by deltarho[1859]
Mar 12, 2020 20:21
Forum: Windows
Topic: Epoch time.
Replies: 30
Views: 877

Re: Epoch time.

@dodicat

That is absolutely awesome! Image

Go to advanced search