Here it is:
Outlook style menu w/ or w/o images.



List of used API functions (for forum search engine :) ):


CallWindowProcA
CreateWindowExA
DefWindowProcA
DispatchMessageA
GetCursorPos
GetMessageA
GetSystemMetrics
GetWindowLongA
GetWindowRect
LoadBitmapA
LoadCursorA
LoadIconA
MessageBoxA
PostQuitMessage
PtInRect
RegisterClassExA
SendMessageA
SetTimer
SetWindowLongA
SetWindowPos
ShowWindow
TranslateMessage
UpdateWindow
ExitProcess
CreateFontA
GetStockObject
SetBkColor
SetTextColor


Any improvment ideas appreciated! Post here or mailto bazik@x-mail.net

Update:
- removed the two "NT-only" API calls
- combined both source files
Posted on 2001-09-29 21:08:46 by bazik
Looks great.. but you should bundle the main.asm with it. (I run 98se, so to use it with out crashing, i need to "write" more code just to see it work..)

Sounds lazy i know.. just a sugestion.

Good Work!
:alright:
NaN
Posted on 2001-09-29 23:33:56 by NaN
I have tested on win98 SE 4.10.2222.A. It crashes with giving below error



OUTLOOK_STYLE caused a general protection fault
in module KERNEL32.DLL at 0167:bff73641.
Registers:
EAX=00000000 CS=0167 EIP=bff73641 EFLGS=00010246
EBX=0063fd2c SS=016f ESP=00000000 EBP=0063fcf8
ECX=00000000 DS=016f ESI=00008d50 FS=591f
EDX=00000000 ES=016f EDI=00000000 GS=0000
Bytes at CS:EIP:
5f 5e c9 c2 0c 00 52 51 33 c0 48 50 50 65 ff 32
Stack dump:
d8c90f9e 00700465 09e60016 00700465 00700465
f000ff54 f0008008 f000e800 d0000000 0abe08d2
f000ef6f f000ef6f f000ef6f f000ef6f 09e6009a
00700465
Posted on 2001-09-30 10:46:24 by LaptoniC
strange... the only call to kernel32 is ExitProcess...
Posted on 2001-09-30 17:09:08 by bazik
I have tested it on win98 SE It crashes with giving error as LaptoniC explained as soon as a mouse is over the button.
Posted on 2001-09-30 19:39:24 by forge
Afternoon, All.

I received a similar error when the cursor is over one of the buttons. I found the 'bug' in the "MouseOver" proc.

Just save/restore 'edi'.

MouseOver proc hCtl :DWORD
invoke GetWindowLong, hCtl, GWL_EXSTYLE ; get extended style
.if (!(eax & WS_EX_CLIENTEDGE)) ; if WS_EX_CLIENTEDGE is not set (this check prevents flickering) ----+
push edi
mov edi, eax ; |
mov eax, WS_EX_CLIENTEDGE ; |
or eax, edi ; |
invoke SetWindowLong, hCtl, GWL_EXSTYLE, eax ; set it <-------------------------------------------|
invoke SetWindowPos, hCtl, 0, 0, 0, 0, 0, ; redraw window
SWP_NOSIZE or SWP_NOMOVE or \
SWP_NOZORDER or SWP_NOACTIVATE or \
SWP_FRAMECHANGED
pop edi
.endif
ret
MouseOver endp
:alright:

Thanks for the code, Bazik:) .

Cheers,
Scronty
Posted on 2001-09-30 22:19:38 by Scronty

The admisitrator has specified that you can only edit messages for 1440 minutes after you have posted. This limit has expired, so you must contact the administrator to make alterations on your message.


Hiro, could you please remove this limit? IMO it's very useless...

Here's the updated code. Thanx to Scronty for fixing the 9x bug!


P.S.: BTW, Hiro, what is a admisitrator ? :)

Update
- recompiled exe with fixed source -> thanx to NaN :alright:
Posted on 2001-10-01 02:27:23 by bazik
Just for those who think its still not working on their win 9x machines... you need to re-compile the source first, and ignore the .exe (as the .exe not an updated version, but the source is).

NaN
Posted on 2001-10-01 03:04:44 by NaN
save esi edi in your WndProc proc
WndProc proc uses edi esi ...
just add the three words.
Do it also in any CALLBACK proc where you may use ebx edi or esi

PS. Could anybody give me logical explonation why people
use those four stupid params in WinMain?
Posted on 2001-10-14 04:36:02 by The Svin
Using hInstance saves you a call to GetModuleHandle(NULL).

Using lpCmdLine saves you a call to GetCommandLine, and you
don't have to skip the program path (which can be passed in a
number of different ways).

nCmdShow allows you to take specific action depending on the way
the user wants to show your app (you could for instance trap "maximized",
and make it "fullscreen" instead).

... but of course all this is only if you use libc. Why people do it in
asm programs is pretty strange... old habits?
Posted on 2001-10-14 11:25:02 by f0dder

Using lpCmdLine saves you a call to GetCommandLine, and you
don't have to skip the program path (which can be passed in a
number of different ways).
Wouldn't GetModuleFileName be a good solution to this problem?
Posted on 2002-03-27 18:19:55 by Maverick