I've often wondered why M$ didn't make creating a window a simple as registering a class in that only one 32 bit value need be passed to calling routine. Although this is not ground breaking code design it does facilitate calling code only set EBX to point to all values required by CreateWindowEx.
Window Creation
; *** 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
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
Tight_Coder_Ex 17 Posting Whiz in Training
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.