Hi All

This is my attempt to convert Iczelion tutorials to HLA.


    [*]All code was compiled with HLA v 1.47
    [*]All code was written with RadASM v 2.0.1.8 So RadASM project files(.rap; .mnu ; .dlg) included.
    [*]While working at convertions I found several errors in hhf files included with HLA package. That's why I post updated includes also.


    Edit:
    04-Apr-2003 Tutorial #22 added. Includes not changed.
Posted on 2003-05-03 16:14:05 by Green Joe

Hi All

This is my attempt to convert Iczelion tutorials to HLA.


    [*]All code was compiled with HLA v 1.47
    [*]All code was written with RadASM v 2.0.1.8 So RadASM project files(.rap; .mnu ; .dlg) included.
    [*]While working at convertions I found several errors in hhf files included with HLA package. That's why I post updated includes also.


    Edit:
    04-Apr-2003 Tutorial #22 added. Includes not changed.


Great!
Thanks a lot.
I'll add these to the next release.
(I was trying to get v1.48 out the door tonight, but with these
changes I'll probably have to do it tomorrow night).
Cheers,
Randy Hyde
Posted on 2003-05-04 19:04:37 by rhyde
Hi All

New convertion:
Itczelion Tutorial #23: Tray Icon + shell32.hhf
Posted on 2003-05-04 19:07:20 by Green Joe
many thanks ! GREAT WORK!
Posted on 2003-05-06 07:19:11 by dreamweaver
Hi All

New convertion:
Itczelion Tutorial #24: "Windows Hooks"

IMHO so far this tute is the most intresting of all Iczelion tutes I converted.
It cost me much sweat:) There is a couple of points related to this tute I'd like to tell about.


1.
mhook.dll module from this tutorial uses WindowFromPoint API function, that resides in user32.dll. The point is that WindowFromPoint actually recieves two parameters not one as MSDN reference tells us.

WindowFromPoint as defined in MSDN
("http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/windowfrompoint.asp")


Syntax

HWND WindowFromPoint( POINT Point );

Parameters

Point
Specifies a POINT structure that defines the point to be checked.




This parameter is a pointer to POINT structure that contains x and y coords of mouse.
While actually it recieves two coords separatly (_Point.x, _Point.y). user32.hhf defines WindowFromPoint also with one parameter.

2.
 


UninstallHook();
mov(false,HookFlag);
w.SetDlgItemText(hDlg,IDC_HOOK,HookText);
w.SetDlgItemText(hDlg,IDC_CLASSNAME,NULL);
w.SetDlgItemText(hDlg,IDC_HANDLE,NULL);
w.SetDlgItemText(hDlg,IDC_WNDPROC,NULL);


First call of SetDlgItemText works fine. It changes text on the button. Three following calls supposed to wipe out content of 3 edit boxes. But it is not the case neither in original Itczelion app nor in my convertion:(
Somebody knows what's wrong with this code?

Best Regards

GJ
Posted on 2003-05-06 10:53:20 by Green Joe

1.
mhook.dll module from this tutorial uses WindowFromPoint API function, that resides in user32.dll. The point is that WindowFromPoint actually recieves two parameters not one as MSDN reference tells us.

The MSDN reference is correct, it *is* one parameter, it's just not a dword. Don't forget that number of parameters does not necessarily have to equal total_parameters_byte_size / 4 (although it does in 99% of the cases).

This parameter is a pointer to POINT structure that contains x and y coords of mouse.

No it isn't, that would have been "POINT *Point" (or most likely POINT * lpPoint). POINT Point (without the asterix) is passing by value.

Thomas
Posted on 2003-05-06 11:42:53 by Thomas
Hi Thomas

Thank you for comment. Just never before encountered with such cases.
Intresting how it is implemented inside a function?

So definition of WindowFromPoint in user32.hhf is also correct.

It works...


WindowFromPoint: procedure
(
_Point : POINT
);
@stdcall;
@returns( "eax" );
@external( "__imp__WindowFromPoint@8" );


.....

w.CallNextHookEx(hHook,nCode,wParam,lParam);
mov(lParam,edx);
w.WindowFromPoint((type w.MOUSEHOOKSTRUCT [edx]).pt);



It works also ...


WindowFromPoint: procedure
(
[B](p0:dword; p1:dword);[/B]
);
@stdcall;
@returns( "eax" );
@external( "__imp__WindowFromPoint@8" );


.....

w.CallNextHookEx(hHook,nCode,wParam,lParam);
mov(lParam,edx);
w.WindowFromPoint([B](type w.MOUSEHOOKSTRUCT [edx]).pt.x, (type w.MOUSEHOOKSTRUCT [edx]).pt.y);[/B]


:confused:
This tutorial is driving me mad.:)

Regards
GJ
Posted on 2003-05-06 12:34:48 by Green Joe
Hi All

New convertion is ready
Tute #25 "Simple Bitmap"
Posted on 2003-05-06 12:42:06 by Green Joe
It works...

code:-- ------------------------------------------------------------------------------
WindowFromPoint: procedure
(
_Point : POINT
);
@stdcall;
@returns( "eax" );
@external( "__imp__WindowFromPoint@8" );


.....

w.CallNextHookEx(hHook,nCode,wParam,lParam);
mov(lParam,edx);
w.WindowFromPoint((type w.MOUSEHOOKSTRUCT ).pt);

--------------------------------------------------------------------------------


It works also ...

code:--------------------------------------------------------------------------------
WindowFromPoint: procedure
(
(p0:dword; p1:dword);
);
@stdcall;
@returns( "eax" );
@external( "__imp__WindowFromPoint@8" );


.....

w.CallNextHookEx(hHook,nCode,wParam,lParam);
mov(lParam,edx);
w.WindowFromPoint((type w.MOUSEHOOKSTRUCT ).pt.x, (type w.MOUSEHOOKSTRUCT ).pt.y);

--------------------------------------------------------------------------------

This is because type POINT has the following definition in HLA:



 

type POINT: record
x: dword;
y: dword;
align(4);
endrecord;



When you pass a record by value as a procedure's parameter, HLA copies
all the bytes of the record onto the stack (C, btw, has the same behavior).
In both cases, the code passes two doublewords on the stack. The difference
between the two prototypes is that in one case you're passing a whole record
by value, in the other case you're passing an x-coordinate and a y-coordinate
by value. When you put the two parameters together, they have the same
memory layout as the POINT data type, hence they both look the same to the
Windows WindowFromPoint function.
Cheers,
Randy Hyde
Posted on 2003-05-06 22:41:20 by rhyde
Hi All

One more tutorial converted.
Iczelion tutorial #26 : "Splash Screen"
Posted on 2003-05-07 14:16:17 by Green Joe
Hi All

Tutorial #27: "Tooltip Controll"

Regards
GJ
Posted on 2003-05-09 12:06:12 by Green Joe
Hi All,

New tutorials converted:


    [*]#28 Win32 Debug API Part 1
    [*]#29 Win32 Debug API Part 2 (Second eg only)
    [*]#30 Win32 Debug API Part 3


    Note: Be patient with tute#30. This app counts the number of executed instuctions of debuggee (program being debugged). It takes about 40 sec on my Pentium IV 2.4Gh machine to trace tiny app (actually Hello World! app from tutorial #2).
Posted on 2003-05-20 17:32:09 by Green Joe
Hi All,
New convertion:

Tutorial #31 Listview Control + user32.hhf(updated)

Note: Macro wsprintf added to user32.hhf. Tute #31 needs it and won't work without it.

Regards,GJ
Posted on 2003-05-21 15:49:44 by Green Joe
Hi All,

New convertion:
Tutorial #32: Multiple Document Interface (MDI)

It is probably the last my convertion. Last 3 Iczelion Win32 tutes too complex for beginner to convert.
I have to read much to continue. Maybe sometime in the future...
Posted on 2003-05-23 06:20:12 by Green Joe
Hi All,
Old convertion, New download:

Tutorial#24: Windows Hooks (updated)

One bug fixed (When edit boxes couldn't be cleared)
For more detailes see:http://www.asmcommunity.net/board/index.php?topic=13265

Regards, GJ
Posted on 2003-05-24 16:36:39 by Green Joe