Specifically talking about porting Iczelion's tut24 (mousehook.asm) there is an exe and a dll to be made, therefore I require two projects. Assuming win 7 64bit, UAC off, C:\masm32 and C:\WinAsm and tut24 already unpacked in c:\tut24 (probably any folder would do for this one)
(First of this is my second asm encounter, first time WinAsm, I'm a newbie.)
First, I deleted mousehook.dll and mousehook.exe just to make sure I'm rebuilding them. I don't know what's with the mousehook.lib but if I delete that it won't be recreated.
Then, opened WinAsm, File->New Project->Empty Project->Standard EXE
Project->Add Files or Ctrl+D
in C:\tut24
Selected
mousehook.asm
mousehook.inc
mousehook.rc
Removed untitled1.asm rightclick on it remove, don't save
Then, Make->Go All
Asked to save project , save in c:\tut24 with name tut24 to get tut24.exe when compiled. Must be saved in same folder as sources (apparently, from the DLL project below)
I get two errors:
Then Make->Go All again
this made tut24.exe but it will complain it doesn't have mousehook.dll
No problem, let's make second project for this DLL
File->New Project->Empty Project->Standard DLL
Project->Add Files
navigate to folder C:\tut24\HookDLL\
selected
mousehook.asm
mousehook.def
Removed untitled2.asm from project
Make->Go All
Asked to save project, navigated to c:\tut24\HookDLL\ and put name
mousehook as name, this will yield mousehook.dll It didn't want to compile when project was saved in c:\tut24\ but sources were in subfolder HookDLL, because it was trying to find the .obj file in subfolder but it was in c:\tut24\
Now either copy/move the mousehook.dll from c:\tut24\HookDLL\ to c:\tut24\
or better yet, make a symlink to it:
run Start->Run->cmd
c:
cd \tut24
C:\tut24>
mklink mousehook.dll HookDLL\mousehook.dllsymbolic link created for mousehook.dll <<===>> HookDLL\mousehook.dll
Now run tut24.exe
Should work.
The mousehook.wap project could have been anything if you're going to make the symlink, just use mklink mousehook.dll HookDLL\projname.dll
where projname.wap exists there
I also made these changes(in bold) in mousehook.asm from c:\tut24 , because it's recommended to use GetModuleHandleEx
;invoke GetModuleHandle,NULL
;mov hInstance,eax
invoke GetModuleHandleEx, GET_MODULE_HANDLE_EX_FLAG_PIN, NULL, ADDR hInstance
cmp eax,0
jz fail1 invoke DialogBoxParam,hInstance,IDD_MAINDLG,NULL,addr DlgFunc,NULL
fail1: invoke ExitProcess,NULL
the part with cmp eax,0 is probably equivalent with xor eax,eax ? that's one part that I remember(EDIT: wrongly) from long ago. EDIT: thanks to shoorick in next post for the very useful info related to this!

EDIT2: btw, the only reason I made this post is so that people that are as newbie as me would find this useful or even make tut24 run, since this is the first tut that I came across while needing to understand(and don't yet know) how a hook of a method like SetWindowTheme works at lower than c#/C++ level - at win32 api level.