rake, sorry - I thought I had a comment in the top of that macros.inc file stating that most of them were harvested from this board, but that I had forgotten to note down names of who made them; appearantly that's either something I dreamt, or in one of the many copies of macros.inc that are in various source folders :stupid:
Posted on 2003-05-02 01:51:08 by f0dder
Rickey,

Thast fine in more complex apps but in a simple demo of a collection of techniques so that different people can learn from the demo, GetTickCount works fine and is very easy to understand.

In fancy stuff you would set up a multimedia timer if you had the need but again where simplicity for demo purposes is the criterion, Bill's choice of GetTickCount is a good one.

What I am in fact going to do is try and conn Bill into allowing this and I hope other demos to be used in the next service pack for MASM32 as I want exactly this type of clean simple code available to people who want to learn this stuff.

Regards,

hutch@movsd.com
Posted on 2003-05-02 02:36:41 by hutch--
Sleep() is shorter, simpler, cleaner, and more effective. And no, for something like this, you wouldn't use a multimedia timer - that would still be hogging the CPU.

As for the eye animation, that is quite different. It works okay in this demo, and to show a more "efficient" animation technique, more animation frames would be required. I might take a look at it later today, it could be a good example.
Posted on 2003-05-02 02:44:57 by f0dder
There is actually a place for discussion of algorithm design and that is in the source code forum so if anyone does feel they need to teach other people about Windows programming, let it be done in the correct forum.

This forum is for MASM32 related issues and I asked Bill to post his example in here as it will be part of MASM32 as soon aas I can con his permission to do so.

Now this by no means reduces anyone's right to espouse genius about how the world should be but simply a direction to the right place for such discussion.

Feel free to eulogise as much as you like in that forum as it was designed to do just that but do understand that I am not subject to talking heads with who I invite to post in this MASM32 forum or what I intend to put in MASM32 and when I see code as well written as Bill's, I will make that decision on the basis of what I see wiull be of advantage to the people who use MASM32.

Regards,

hutch@movsd.com
Posted on 2003-05-02 03:11:07 by hutch--
f0dder,

I think MO is a police term, I don?t know? In the old BBS days, before the Internet, it was a term often used. There was lots of abbreviating back then when you were online.

I love assembly language programming. It has always been a kind of therapy for me. A sort of deep focus that shuts out the rest of the world for a little while. Man over machine thingy perhaps. Anyway, the most important thing to me about ASM is that I find it so rewardingly fun!

Fun, that?s the key word for me here f0dder. How many people can say they actually make money while enjoying a hobby they find so pleasurable. I have never created a program up front with the intent to make money. I create something for my own use or someone else?s and it would be suggested that I offer it to the public. Through the years I have, to my surprise and delight, made money from some of my creations.

Steve,

I?ll post my ASM demo?s as I make um, I promise. I guess I?m just an old classic type of ASM programmer. I prefer plane vanilla MASM syntax and I don?t care much for macros though I do find a few like invoke convenient. When I write something for folks who want to learn ASM I tend to keep it as clear and simple as I possibly can.

You won?t see fancy macros or complicated clock saving efficiency but you will get code that is easy to understand and works well on most all Windows OS?s. Oh, and lets not forget the most important thing, it will be fun to play with as you learn.

By the way, you most certainly have my permission to include anything I create in your Masm32 package.


Regards,
Posted on 2003-05-02 06:13:44 by bcraven
Thanks Bill,

I will take you up on that as they leave the production line as i am sure they will be very useful to people learning assembler.

Must admit, its a pleasure to see professionally written clean looking masm code.

Regards,

hutch@movsd.com
Posted on 2003-05-02 06:20:08 by hutch--
There's an official API function to do all sorts of window animations, available from win98/win2k and up: AnimateWindow. Here's a C++ snippet for fading in/out the window with two calls:


const int WINDOW_FADE_TIME = 0x200; // in milliseconds

case WM_CREATE:
AnimateWindow(hWnd, WINDOW_FADE_TIME, AW_BLEND);
break;
case WM_CLOSE:
AnimateWindow(hWnd, WINDOW_FADE_TIME, AW_BLEND|AW_HIDE);
DestroyWindow(hWnd);
break;


Thomas
Posted on 2003-05-02 08:03:33 by Thomas
Thomas,

AnimateWindow?? C++?? Boring!! I?m sorry, I don?t get it. I thought this MASM32 forum pertained to programming assembly language using Masm not sh*t like C++!! Or are you just trying to be cute?? Yes cute, that?s it, right??


Regards,
Posted on 2003-05-02 16:19:21 by bcraven
Well in all fairness that c++ snippet is about 100% api calls, which would take all of about 60 seconds to convert to masm syntax. :rolleyes:
Posted on 2003-05-02 16:44:42 by Will
Originally posted by bcraven
AnimateWindow?? C++?? Boring!! I?m sorry, I don?t get it. I thought this MASM32 forum pertained to programming assembly language using Masm not sh*t like C++!! Or are you just trying to be cute?? Yes cute, that?s it, right??

:confused: Calm down... I never used AnimateWindow but I knew it exists so I did a quick test to see if it works. I usually do quick testing in C++ because it tests easier. I didn't feel like translating it to asm and since the code is so simple everyone will be able to translate it to asm (you really don't get it?) I've just shown you another way to do it.



WINDOW_FADE_TIME equ 200 ; in milliseconds
...in WndProc..
onCreate:
invoke AnimateWindow, hWnd, WINDOW_FADE_TIME, AW_BLEND
...
onClose:
invoke AnimateWindow, hWnd, WINDOW_FADE_TIME, AW_BLEND or AW_HIDE
invoke DestroyWindow, hWnd

Was that so hard?

Thomas
btw calling any language sh*t is being shortsighted, just because you don't like it doesn't mean it's sh*t. Hope you didn't mean it that way :rolleyes:. Also any asm programmer should be able to read C(++) at least a bit since most code examples are in that language.
Posted on 2003-05-02 17:51:56 by Thomas
I am very calm??..Oooooooommm??.Oooooooommm?.

It?s just that I don?t see C++ referenced anywhere in this forum. Reading your reference to C++ is kind of like all the junk email sh*t I constantly get these days. In my neck of the woods anything not relating to topic, such your C++ plug, is referred to as sh*t.

I believe the purpose of this particular forum is intended to be Masm32 related for those people wishing to learn MASM syntax style. If you are going to splat down some source code lets please keep it in the proper style.

Peace! ;)


Regards,
Posted on 2003-05-03 05:13:16 by bcraven
Bill, I understand a lot of people here (especially the older ones with an assembly background from when some of us were were diapers :grin: ) would like to see this board as a sort of refuge, free of all the highlevel junk. After all, it _is_ an assembly programmers forum, and hell if anybody is going to change that.

However, isn't a snippet like that better than no code at all? After all, there's hardly any "C" in it, it's not much more than API calls.

Interesting API I guess... something to keep in mind. I should think that Bills method will work on just about all win32 though, while AnimateWindow is >= 98/2000 only, iirc.
Posted on 2003-05-03 05:41:47 by f0dder
Originally posted by bcraven
It?s just that I don?t see C++ referenced anywhere in this forum. Reading your reference to C++ is kind of like all the junk email sh*t I constantly get these days. In my neck of the woods anything not relating to topic, such your C++ plug, is referred to as sh*t.

There have been several occasions where I've shown an example in C++ as an answer to people to get them started. I see no harm in this. With many questions I don't have an example ready nor have I ever really used it but I remember APIs that can be used for it. If I feel like it I try to write a simple example, and since most of the PSDK example code is in C and since I write C++ faster than asm, C++ is my choice. Another specific reason is that sometimes the APIs needed in the example are quite new and not included yet in MASM32's libraries or includes. I usually have the latest platform SDK so in C++ I never have any problem with undefined constants.

I'm sorry you get all kinds of C++ sh*t as junk mail but that doesn't say anything about the language itself, it's just that you don't like it. And that's fine, but be prepared to see the occasional C(++) example in posts. For example, look here. It would have taken me much longer to write an asm example and I probably wouldn't have. Still, the code was easy to follow, it gives people an insight in how to use the APIs I used, and the thread starter was happy.

I believe the purpose of this particular forum is intended to be Masm32 related for those people wishing to learn MASM syntax style. If you are going to splat down some source code lets please keep it in the proper style.

The purpose of *this* forum is the MASM32 package. Actually it is not intended for example source code. The reason Hutch asked you to post your code in this particular forum is that it will be part of the MASM32 package in the future. Actually the 'algorithms & source code' forum is for posting source and discussing/optimizing it.

Win32asm falls into two parts: windows(32) and assembly. Windows is a C(++) world, you will find most examples, tutorials, source code, information, etc. in that language. Win32asm code that uses the windows API usually consists mostly of API calls. There's not much assembly to learn from that, only how to use the API correctly. IMHO in those cases, the example language isn't that important. Sure, an example in assembly is preferred but any information is welcome.

Peace! ;)

Peace :)

Thomas
Posted on 2003-05-03 05:42:41 by Thomas