The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: Bill Cravener on July 28, 2008, 04:10:11 PM

Title: I like emoticons! Update.
Post by: Bill Cravener on July 28, 2008, 04:10:11 PM
UPDATE 08/22/08: I was asked how one could round the corners of the custom window in my example below. I have added the code required and commented the change.

Those of you who have read my posts here on the board may have noticed that I like using emoticons. I visit a half dozen or so message boards on a daily bases and find that most board default emoticons are lacking emotion. I'm fortunate enough that I have my own website where I can store emoticons, smilies, pictures and such. Now with this little utility I wrote I can easily use my own graphics by using the board's img tags and simply clicking on the url link of the graphic I want to use to express myself.

PasteIt.asm shows how you can:

(1) Create a simple custom bitmap window with rounded corners.
(2) How to drag the custom bitmap window.
(3) Create a simple bitmap exit button.
(4) Create a simple double click listbox.
(5) Create a window procedure for the listbox.
(6) Read in a list of items from a text file.
(7) Parse all items read from the text file.
(8) Fill the listbox with all parsed items.
(9) Copy clicked on item to Windows clipboard.

I have a link to this little utility in my quick links bar and with one click it loads. I then double click on the url emoticon link I wish to use then click on the boards img tag right click between the start and end img tags and paste the link between them. Quick and simple!

Anyway, I thought others might find it interesting. (http://www.quickersoft.com/wink.gif)


[attachment deleted by admin]
Title: Re: I like emoticons!
Post by: hutch-- on July 28, 2008, 04:19:21 PM
Bill,

I wondered where you were getting them from, some of them look great and they are cheeky enugh for general use.
Title: Re: I like emoticons!
Post by: Bill Cravener on July 28, 2008, 04:37:22 PM
Hi Steve,

Yes there are lots of free emoticons out there on the web and I'm slowly collecting a good number of them. I tend to collect those I find the most, well, emotional! (http://www.quickersoft.com/happy.gif)

I know on my family message board the emoticons are 15x15 where as most of the ones I have collected are 20x20 and I don't know if the board software handles that size or not. I've never bothered to investigate as to rather phpbb supports that size. I know the 20x20's tend to space the lines of text farther apart then the 15x15's do.
Title: Re: I like emoticons!
Post by: shankle on July 31, 2008, 12:39:04 PM
Hi CS,
Incredimail has tons of emoticons that you might want to look at.
JPS
Title: Re: I like emoticons!
Post by: Bill Cravener on August 01, 2008, 08:46:55 AM
Thanks shankle, I'll have a look see.  :bg









(http://www.quickersoft.com/buggy.gif)
Title: Re: I like emoticons!
Post by: shankle on August 01, 2008, 11:11:31 AM
Hi CS,
You would probably howl for a week if you could see me trying to get the nat off of my screen.
I thought it was on the outside and then I realized it must be on the inside.
Then I realized it must be from you. Clever.....
JPS
Title: Re: I like emoticons!
Post by: Bill Cravener on August 01, 2008, 12:07:14 PM
I know, I'm bad! (http://www.quickersoft.com/gigglesmile.gif)
Title: Re: I like emoticons!
Post by: Bill Cravener on August 22, 2008, 01:26:11 PM
I was asked how one could round the corners of the custom window in my example above. I have added the code required and commented the change.
Title: Re: I like emoticons! Update.
Post by: hutch-- on August 22, 2008, 01:36:53 PM
Bill,

I just downloaded the example and ran it. Looks great.  :thumbu
Title: Re: I like emoticons! Update.
Post by: Bill Cravener on August 22, 2008, 01:45:31 PM
Thanks buddy, it's fun making these little gizmos. Wish I had more time to play! :bg
Title: Re: I like emoticons! Update.
Post by: hutch-- on August 22, 2008, 03:03:47 PM
I have been playing with a fully skined window using the non client message and I have it almost working properly. Its a POPUP window that draws its own title bar, status bar and side borders and is sizeable, maximise and minimise etc ...

I will post it shortly and by using 1 pixel wide bitmaps with LoadImage, you can keep the size down as well.
Title: Re: I like emoticons! Update.
Post by: hutch-- on August 23, 2008, 07:10:52 AM
Bill,

There is something wrong with this code, I can actually understand it.  :P Not only do I use you fade technique, but I will shortly have a play with this one as well.

Thanks for posting it.  :U
Title: Re: I like emoticons! Update.
Post by: Bill Cravener on August 23, 2008, 09:49:42 AM
Quote from: hutch-- on August 22, 2008, 03:03:47 PM
I have been playing with a fully skined window using the non client message and I have it almost working properly. Its a POPUP window that draws its own title bar, status bar and side borders and is sizeable, maximise and minimise etc ...

I will post it shortly and by using 1 pixel wide bitmaps with LoadImage, you can keep the size down as well.

Please do Steve, the thing I enjoy the most when coming here to the board is when someone posts some code that I can read over. You know your a bit geeky (I'm speaking of myself here) when you enjoy reading assembly code as much as I do.
Title: Re: I like emoticons! Update.
Post by: Bill Cravener on August 23, 2008, 10:08:21 AM
Quote from: hutch-- on August 23, 2008, 07:10:52 AM
Bill,

There is something wrong with this code, I can actually understand it.  :P Not only do I use you fade technique, but I will shortly have a play with this one as well.

Thanks for posting it.  :U

Your welcome Steve, I got a giggle out of your comment above. (http://www.quickersoft.com/gigglesmile.gif)  Its a habit of mine to lay out my source code in an easily readable orderly fashion. I have a utility I author and sale that contains over 6500 lines of assembly source code. If I wasn't neat about my programming style I'd get completely lost when I need to correct or change something.

I have some over examples I'll get around to posting when I can take a little time to clean them up a bit. I need to fix a couple of my examples you include in your masm32 package also. The volume example and the registry example do not work in Vista. Just haven't had the free time to fix them.
Title: Re: I like emoticons! Update.
Post by: hutch-- on August 25, 2008, 12:02:06 PM
Bill,

Here is the new "skins" example I have been playing with, it uses 3 1 pixel wide bitmaps loaded with LoadImage to make the top and botom strips and the two side strips. I wanted it to be free of the standard sizing border so I made it a POPUP window and trapped the WM_NCHITTEST message to return the valus to do the sizing off the displayed border.

It is still a bit rough around the edges, the top right system buttons are a bit flickery on fast resizing but most of it is doing what I had in mind.

[attachment deleted by admin]
Title: Re: I like emoticons! Update.
Post by: Bill Cravener on August 25, 2008, 02:05:06 PM
Hi Steve,

Had a quick look over your source as far as programming style goes I'd say you and I were similar. Your source is easy to read and I'm going to enjoy reading thru it and playing around with your example.

I do get some flicker from the min max exit buttons as you said when resizing. I would probably create tiny bitmaps of the buttons an blit them onto the titlebar. That would eliminate flicker but regardless your window looks sharp and it's a great example to show others how it can be done.

I really enjoy examples like this and it reminds me of the old days when we asm coders loved to post interesting and often useful asm examples. Thanks for posting another asm toy to play with!  (http://www.quickersoft.com/thumbup.gif)
Title: Re: I like emoticons! Update.
Post by: BlackVortex on August 28, 2008, 05:53:06 PM
Really good work guys !

I learned some new things ! Oh, and hutch, your example is great !

Could you point me to the right direction for fade-in/out effects ? I've been using AnimateWindow but it has serious problems in vista aero   :snooty:

Title: Re: I like emoticons! Update.
Post by: hutch-- on August 29, 2008, 02:17:46 AM
BlackVortex,

Have a look at Bill's examples in the current masm32 version. I pinched Bill's technique some years ago for making fade in entries with a started application. It works well because it ests if the function is available in the particular OS version, runs it if it is and bypasses it if its not.
Title: Re: I like emoticons! Update.
Post by: BlackVortex on August 29, 2008, 02:39:19 AM
I just rummaged through all the folders inside "examples" but found zilch !
       (http://www.freesmileys.org/smileys/char066.gif)


I failed you hutch    :red

P.S.: I like emoticons, too !
Title: Re: I like emoticons! Update.
Post by: BlackVortex on August 29, 2008, 04:14:11 AM
Sorry for the double-posting, but maybe I missed the fade effects because I use WindowBlinds with a custom windows theme (on xp fully updated)

I mean, shouldn't the version of TopGun.exe in the masm32 v10 package fade in ? It doesn't. I think I noticed it on one of my other computers (in another house now, lol, can't test, I'm stranded with only my main working PC and my virtual machines don't work properly)

Plz direct me to an example source code.
Title: Re: I like emoticons! Update.
Post by: hutch-- on August 29, 2008, 06:49:09 AM

drv:\masm32\examples\bcraven\calender\calender.asm


Bill's algo does both fade in and fade out.
Title: Re: I like emoticons! Update.
Post by: BlackVortex on August 29, 2008, 07:23:45 AM
Gee !

That was a lot of consts and procs and structs and timers,sleeps,painting etc. Took me 10 minutes to get it to assemble, tested successfully but I decided it's not worth it for an aesthetic gimmick.

I did learn some new things looking at the code and that's more important than copy/pasting , thanks for helping me out   :P
Title: Re: I like emoticons! Update.
Post by: hutch-- on August 29, 2008, 07:40:21 AM
Try this, its a stripped down version of Bill's algo only for win2000 and higher.


; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

WindowFadeIn proc hWin:DWORD,msdelay:DWORD,step:DWORD,swattr:DWORD

    ; --------------------------------------------------
    ; hWin      = handle of window to fade in.
    ; msdelay   = delay between fade level changes
    ; step      = incremental fade rate change up to 255
    ; swattr    = ShowWindow style
    ; --------------------------------------------------

    LOCAL wstyle    :DWORD

    push esi
    xor esi, esi

    invoke GetWindowLong,hWin,GWL_EXSTYLE           ; get current window style
    mov wstyle, eax
    or eax,WS_EX_LAYERED
    invoke SetWindowLong,hWin,GWL_EXSTYLE,eax       ; add the WS_EX_LAYERED style

    invoke SetLayeredWindowAttributes,hWin,0,0,2

    invoke ShowWindow,hWin,swattr

  doloop:
    invoke SetLayeredWindowAttributes,hWin,esi,esi,1 or 2
    invoke Sleep, msdelay

    invoke UpdateWindow,hEdit
    invoke UpdateWindow,hRebar
    invoke UpdateWindow,hStatus
    invoke UpdateWindow,hWin

    add esi,step
    cmp esi,255
    jl doloop

    invoke SetLayeredWindowAttributes,hWin,0,255,2
    invoke UpdateWindow,hWin

    invoke SetWindowLong,hWin,GWL_EXSTYLE,wstyle    ; restore original window style

    pop esi

    ret

WindowFadeIn endp

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
Title: Re: I like emoticons! Update.
Post by: Sean1337 on August 29, 2008, 09:08:29 AM
This is an awesome program and a great idea for using custom emoticons on message boards..props..nice job dude.
Title: Re: I like emoticons! Update.
Post by: Bill Cravener on August 29, 2008, 09:37:37 AM
QuoteI did learn some new things looking at the code and that's more important than copy/pasting

BlackVortex,

That is what I love about reading interesting asm source code examples the new things you learn! (http://www.quickersoft.com/wink.gif)


Steve,

Hard to believe its been 5 years since I created that calendar example. The years go by too quickly! (http://www.quickersoft.com/cry.gif)


QuoteThis is an awesome program and a great idea for using custom emoticons on message boards..props..nice job dude.

Sean1337,

Thanks, its nice knowing I'm not the only one who likes using emoticons! (http://www.quickersoft.com/happy.gif)