Page 1 of 2
My first programs with PureBasic
Posted: Wed Aug 10, 2005 7:38 am
by DevilDog
Hey everyone,
I'm still learning Purebasic and I love it. I'm amazed at how much I've been able to do with it.
I've written a couple of programs that I thought I'd share in case anyone can use them and also to get some feedback on them.
There's three programs:
Astronomy Today - when you run this program it downloads the Astronomy Picture of the Day and sets it as your desktop background.
Buh-Bye - This program loads itself in the system tray and when you press the escape key it closes whatever the topmost application or window is.
Capture - This is my version of a screen capture utility I found but much smaller.
You can download them at
http://utils.isengardtech.com
I'm still learning and I'd appreciate any advice or feedback.
I haven't had this much fun programming in way too many years

Re: My first programs with PureBasic
Posted: Wed Aug 10, 2005 8:50 am
by PB
My thoughts:
> Astronomy Today
I don't use a wallpaper so I wouldn't use this, but I do visit "Astronomy
Picture of the Day" every now and then... it's a great site!
> Buh-Bye - This program loads itself in the system tray and when you press
> the escape key it closes whatever the topmost application or window is.
I personally wouldn't use this, because it's all too easy to hit Esc and close
something when you didn't want. What's wrong with ALT+F4 anyway?
> Capture - This is my version of a screen capture utility
I love your comment on your web site: Capture is a 56k exe, but the other
version that inspired it requires the 20 MB .NET runtime to do the same job!

Posted: Wed Aug 10, 2005 12:21 pm
by sec
Hi, DD.
You learn fast. I look forward to your other programs. Thanks.
Posted: Wed Aug 10, 2005 1:32 pm
by netmaestro
I don't find a use for the other two, but the capture could be handy. I'll keep it around and see if I use it. Something like that seems like a good candidate for the systray if a person is going to be using it much. The only critique I have to offer is that it doesn't seem to have any help function to give basic direction in how to use it at runtime. I ran it and had to go back to your website to see how to take a snapshot. Perhaps the ? symbol could raise a popup something along this line:
+ to Resize
x to Close
Double click window to save snapshot
visit author website
feedback
Posted: Wed Aug 10, 2005 3:27 pm
by DevilDog
Thanks everyone for the feedback.
netmaestro I'll look into putting some help into the capture program.
Thanks again.
Do they work ok?
Posted: Wed Aug 10, 2005 5:16 pm
by DevilDog
If you do decide to use any of the programs or even if you don't but at least are able to try them out on your system, let me know how they do as I don't have anything else other than win 2k to test and I would appreciate to know how they work on other systems.
thanks
Posted: Wed Aug 10, 2005 6:28 pm
by netmaestro
Good point, I've updated my sig with my hardware. I don't know how you're going about the window transparency so I can't say for sure, but I'll venture a guess that it won't work on Win9x. Which brings up another point, unless you've got some compelling reason for keeping it a secret, folks here on the forum like it best when programs are posted with full source. That way they can be (and likely will be) critiqued by PB gurus who can show all of us better and faster ways to do things. And that's really what the forum is all about, right? Just a bit of food for thought.
source code
Posted: Wed Aug 10, 2005 6:43 pm
by DevilDog
netmaestro, you're right of course and I cobbled most of the code in the programs from code I found here.
If I hesitate at all to post the source code it would only be because of my newbie status and I'm sure I'm doing quite a few things in the least optimal way
But nevertheless I will post the source code when I get a chance to clean it up a bit.
Posted: Thu Aug 11, 2005 12:11 pm
by dagcrack

Now you ask for the sources? The day I show you some of my projects you'll want the sources to "criticize" them too!!
My comment: I dont try out other's beginners applications, I never do. But.. For learning purposes, its ok to take someones code, change it to do what you want and keep on learning.. but posting as "my first programs" thats a little like a "copy&paste programmer wannabe" - Okey you're on the learning process (we all are on some aspects, thats true) But dont do that please.. I take it as robbing, to use someone elses code and take credit for it. Its just a comment im giving though. You aint making money out of it (you couldnt anyway!) But.. just remember to put the right credits when you use someone's routine or snippet..
About the programs... perhaps DevilDog finds them useful for himself.
Cheers
*covers his butt* By the way the first sentence of this post... its a joke, just in case.
what did I say?
Posted: Thu Aug 11, 2005 3:20 pm
by DevilDog
OK dagcrack I guess you got up on the wrong side of the bed.
When I say "my first programs", I mean with PureBasic. I've been programming since 1987, so it will be almost 20 years in a year and a half so I think I'm a bit past a "programmer wannabe" as you so eloquently put it.
As for "robbing" by using code that has been posted on here, I don't even know how to address that. That's why it's been posted, isn't it? Did I not say I had taken the code from various places on this board? Do I need to name each post and author in order to use it?
*** Announcement ***
I did not write the original code in these programs. I took a little from here, a little from there and combined them into programs that do something else. You are under no obligation to use any of these programs. You will not hurt my feelings if you choose not to.
*** End of Announcement ***
Is that better dagcrack?
Man, try to share something and get smacked for it. Nice world.
Posted: Thu Aug 11, 2005 3:51 pm
by netmaestro
@dagcrack: Keep it down, will you son? The men are talking.

Posted: Thu Aug 11, 2005 4:36 pm
by Gansta93
For the program on systray whish close the current window when Escape is have been press : others shortcut would be good : hide the window, minimize and maximize. Simples suggestions. I'm refering me just with your first message in this post, I'm going to try thes.
EDIT: I have just tested Bye and Capture. Capture doesn't work because of problem of libraries (User32.dll) compatibility. About bye: it doesn't seem to work. I am on Windows 98 SE fully updated.
Posted: Thu Aug 11, 2005 4:43 pm
by Kale
DevilDog wrote:I did not write the original code in these programs. I took a little from here, a little from there and combined them into programs that do something else. You are under no obligation to use any of these programs. You will not hurt my feelings if you choose not to.
Thats how i see it too! All code on this public forums is considered Public Domain and free to use how ever and when ever you like unless expressed by an author and even then it might just be a mention in credits.
netmaestro wrote:Which brings up another point, unless you've got some compelling reason for keeping it a secret, folks here on the forum like it best when programs are posted with full source
Asking an author to reveal his source code should be done politely. And even then he/she doesn't have to.
dagcrack wrote:
My comment: I dont try out other's beginners applications, I never do. But.. For learning purposes, its ok to take someones code, change it to do what you want and keep on learning.. but posting as "my first programs" thats a little like a "copy&paste programmer wannabe" - Okey you're on the learning process (we all are on some aspects, thats true) But dont do that please.. I take it as robbing, to use someone elses code and take credit for it. Its just a comment im giving though. You aint making money out of it (you couldnt anyway!) But.. just remember to put the right credits when you use someone's routine or snippet..
This is total bullshit i'm afraid. I copy and paste peoples code from here and other places all the time, why should i give credit to other people (if they havn't expressly asked me to do so)? Am i a "copy&paste programmer wannabe"? Probably i am then! :roll: I look at it as why should i re-invent the wheel when i find a useful piece of code that somebody else has happened to write? This is a community and we post purely to help each other out and share tips and code. There is absolutely no problem with taking code from this forum.
Give DevilDog a break, he's sharing programs he doesn't have to, if you find them useful, then try them out, if not just skip this page. :roll: I hate the way some people are thought of as noobs just because their post count is low, some people here are extremely advanced coders but don't post much and share only brief snippets.
Posted: Thu Aug 11, 2005 4:50 pm
by Gansta93
Oops, Bye works on Win 98 SE. But a "SystrayIconTooltip" would be very nice for accessibility reasons.

feedback
Posted: Thu Aug 11, 2005 4:53 pm
by DevilDog
Gansta93, thanks for the feedback on this. I will see what I can do about testing it in a win98 pc. Maybe I can get a VM program so I can load 98 and test it. Thanks again.
Kale, I agree and hopefully, and from what I've seen so far, this is just a slight bump in the road. Everyone on this board is amazingly helpful and ver sharp, which is another reason I went ahead and paid for PB.