The MASM Forum

General => The Workshop => Topic started by: jj2007 on November 16, 2017, 09:12:26 PM

Title: Fun WITH Masm
Post by: jj2007 on November 16, 2017, 09:12:26 PM
include \masm32\include\masm32rt.inc    ; **** purest Masm32  ****
.code
WinMain proc
LOCAL msg:MSG
  include With.mac                      ; just for fun...
  With wc:WNDCLASSEX
        _ cbSize = WNDCLASSEX
        _ style = CS_HREDRAW or CS_VREDRAW or CS_OWNDC
        _ lpfnWndProc = WndProc
        _ hInstance = GetModuleHandle(0)
        _ hIcon = LoadIcon(eax, IDI_APPLICATION)
        _ hIconSm = eax                 ; the rv macro returns results in eax
        _ hCursor = LoadCursor(NULL, IDC_ARROW)         ; get a cursor
        _ hbrBackground = COLOR_BTNFACE+1
        _ lpszClassName = chr$("Masm32GUI")
  EndWith
  invoke RegisterClassEx, addr wc      ; the window class needs to be registered
...
Title: Re: Fun WITH Masm
Post by: hutch-- on November 16, 2017, 09:49:53 PM
Seems to work OK here.
Title: Re: Fun WITH Masm
Post by: Vortex on November 17, 2017, 05:45:07 AM
Hi Jochen,

Nice work :t  The application works fine on XP 64-bit.
Title: Re: Fun WITH Masm
Post by: jj2007 on November 17, 2017, 08:14:16 AM
 :biggrin:

Just a demo to show what a MACRO assembler can do... I am not a fan of Visual Basic, but I always found the With command interesting.
Title: Re: Fun WITH Masm
Post by: Siekmanski on November 17, 2017, 08:23:42 AM
Works OK here too.
Title: Re: Fun WITH Masm
Post by: felipe on November 17, 2017, 08:59:30 AM
Nice one!
:icon14: