Search found 32 matches

by happer66
Fri Feb 24, 2017 2:47 am
Forum: Tricks 'n' Tips
Topic: LUA - Script with PureBasic
Replies: 22
Views: 12457

Re: LUA - Script with PureBasic

I'm perhaps not the most mac-savvy kinda guy ( mine's gathering dust in its little corner - it's .... err... an eco-friendly experiment I'm doing, very scientific. Don't ask, it's pretty advanced, so you wouldn't understand :D )

(PB 5.51, MacOS Sierra 10.12.3 x64)

Can happily report that the first ...
by happer66
Sat Apr 12, 2014 9:54 am
Forum: Coding Questions
Topic: Findstring case insensitive bug(?)
Replies: 4
Views: 1020

Re: Findstring case insensitive bug(?)

Haha, never entered my mind that I missed a param. The statusbar clearly points it out in bold too when you're entering it. :mrgreen:
Thanks!
by happer66
Thu Apr 10, 2014 1:55 am
Forum: Coding Questions
Topic: Findstring case insensitive bug(?)
Replies: 4
Views: 1020

Findstring case insensitive bug(?)

Maybe my brain isn't working as it should, but:
Changes in PB 5.10
- Added: #PB_String_NoCase mode parameter to FindString()

But the result doesn't match my expectations:

Debug FindString("The quick brown fox jumps over the lazy dog","brown",#PB_String_CaseSensitive)
;Default mode. Returns 11 ...
by happer66
Mon Aug 20, 2012 5:06 pm
Forum: Tricks 'n' Tips
Topic: info on your multi monitor setup
Replies: 5
Views: 3751

Re: info on your multi monitor setup

Hi IdeasVacuum, when using the 64-bit compiler:

Number of screens: 2
Screens are same format
Virtual Desktop Size Width: 4480 Height: 1440
Handle of Primary Monitor: 2164749
====================================================

Monitor: 1
Handle: 2164749
Origin: x0 y0
Screen Width: 0
Screen Height ...
by happer66
Mon Aug 20, 2012 1:35 pm
Forum: Tricks 'n' Tips
Topic: info on your multi monitor setup
Replies: 5
Views: 3751

Re: info on your multi monitor setup

iirc, structures with DWORD doesn't change size depending on the architecture of the OS. So you'll have to change the integers into longs for it to work correctly for both 32-bit and 64-bit.

#SM_XVIRTUALSCREEN = 76 ; x-coordinate of left upper corner of total display area
#SM_YVIRTUALSCREEN = 77 ...
by happer66
Fri Feb 24, 2012 12:47 pm
Forum: Coding Questions
Topic: PtInRect Parameters
Replies: 3
Views: 1323

Re: PtInRect Parameters

I might be wrong here but the PtInRect API always had 2 params, PB allowed the point structure to be specified individually and then it merged them into a point behind the scenes (as it did with other API calls that used point). This was later changed so it corresponded with MSDN. But replacing the ...
by happer66
Thu Dec 22, 2011 3:08 am
Forum: Coding Questions
Topic: Getting the screen resolution as the system user
Replies: 3
Views: 1295

Re: Getting the screen resolution as the system user

This is not an answer to your resolution question, but if you're doing the oembackground approach for the logon wallpaper you should be able to save several images with different resolutions and windows will pick the best suited one (depending on AR):
backgroundDefault.jpg (Default if no other ...
by happer66
Fri Dec 02, 2011 1:08 am
Forum: Windows
Topic: API function that returns the same information as NET USE?
Replies: 4
Views: 2336

Re: API function that returns the same information as NET US

I think it would be wise to start enumerating drive letters from A. A,B aren't restricted for floppy disks only, windows will happily map a network drive to anything between A-Z as long as it's not already occupied.

Line 17:

For DriveCount = 1 To 26 ; Go through all drive letters (A-Z)
by happer66
Mon Sep 26, 2011 11:46 pm
Forum: Coding Questions
Topic: Switching my app to Unicode breaks things
Replies: 5
Views: 1426

Re: Switching my app to Unicode breaks things

Another take, convert the string to ascii

Procedure.s DownloadHTML(url$)
<removed> pasted the wrong code!


Unicode characters are 2 bytes when stored in memory, when you want to count the number of characters you actually see you can use Len(), but when you want to know it's memory size you have ...
by happer66
Thu Aug 11, 2011 10:03 am
Forum: Tricks 'n' Tips
Topic: WM_COPYDATA: Sending complex data between apps
Replies: 12
Views: 9074

Re: WM_COPYDATA: Sending complex data between apps

Replace Len() with StringByteLength() in the sender code and it should be good to go.

Code: Select all

\cbData = StringByteLength(string2send)+SizeOf(CHARACTER)
Nice old gem btw netmaestro!
by happer66
Wed Jun 29, 2011 2:40 am
Forum: Coding Questions
Topic: X_Pos and Y_Pos ---> Button 1
Replies: 1
Views: 810

Re: X_Pos and Y_Pos ---> Button 1

Do you mean something like this?
(Sorry for the sloppy code)

Procedure WindowCallback(Window, Message, wParam, lParam)
Select Message
Case #WM_CLOSE

DestroyWindow_(Window)

Result = 0

Case #WM_DESTROY
PostQuitMessage_(0)
Result = 0
Default
Result = DefWindowProc_(Window, Message ...
by happer66
Sat Jun 04, 2011 11:29 pm
Forum: Coding Questions
Topic: CRC32FileFingerprint failure
Replies: 6
Views: 1723

Re: CRC32FileFingerprint failure

He shouldn't be able to move the files to another folder if another process has them locked though..?

You could try this code by Little John to test if they are indeed ''locked''
;Original code by Little John
;http://forums.purebasic.com/english/viewtopic.php?f=5&t=44978
EnableExplicit
Define ...
by happer66
Sun May 22, 2011 11:03 pm
Forum: Tricks 'n' Tips
Topic: Update from Website
Replies: 3
Views: 2187

Re: Update from Website

Simple yet efficient, thanks.

A few small changes and it should work:
Procedure Get_Current_Release_Version(website$, versionfile$)
result=OpenLibrary(0,"urlMON.dll")

If result
result=CallFunction(0,"URLDownloadToFileA",0,@website$,@versionfile$,0,0)
Delay(1000)
EndIf
CloseLibrary(0 ...
by happer66
Sun May 15, 2011 11:58 pm
Forum: Tricks 'n' Tips
Topic: Datepicker / calendargadget
Replies: 20
Views: 9836

Re: Datepicker / calendargadget

Not so much cleaning, but added leap years.

EnableExplicit ;the most important line in any code ;)
;Original author: jesperbrannmark
;http://www.purebasic.fr/english/viewtopic.php?f=12&t=46300

;init
UsePNGImageDecoder()
Global smartbooker_datepicker_month=Month(Date())
Global smartbooker ...
by happer66
Thu Apr 14, 2011 11:51 pm
Forum: Announcement
Topic: New version of the 'Audiere For Purebasic' pack
Replies: 28
Views: 15100

Re: New version of the 'Audiere For Purebasic' pack

Did you set

Code: Select all

source.SampleSource = AdrOpenSampleSource("12 - CHANGE THE FUTURE.mp3",#FF_AUTODETECT)
to point to a valid file?

That same line you mentioned also fails if you're trying to compile a unicode executable...