; *** CREATE_WND ***
; ENTRY: EBX = Pointer to structure CreateWindowEx structure
; LEAVE: EAX = Handle to window, or null if failed
; CY = 0 Successful, 1 otherwise.
; ============================================================================================
Create_Wnd mov ecx, 48
sub esp, ecx ; Create stack frame for CreateWindowEx
mov edx, esp ; Need this pointer in EDI
push esi
push edi ; Save registers
mov edi, edx
mov esi, ebx ; Setup for movsd
shr ecx, 2 ; Number of dwords to move
cld
rep movsd ; Copy parameters into stack area
pop edi
pop esi ; Restore index registers and create
call _CreateWindowExA@48 ; window
and eax, eax
jnz .Done + 1 ; If non zero, then was successful
; Error handling code will eventually go here
.Done stc ; Set error flag
ret