CreateWindowExA

phenix

New member
Member
VIP
Local time
12:06 PM
Messages
254
This code makes szDisplayName1 and AppName the same.
RegisterClassExA was executed after filling those 2 fields.
This code does not put a window to the screen.
Bombs at CreateWindowExA.
Program is GoAsm 64-bit.
Running Windows Pro 64-bit with all updates

BytesRead dq 0
hFile4 dq 0
holdbottom1 dd 0
savemiddleofY dd 0 ; vertical middle of screen
AppName db 30 dup (0)
prog1 db 30 dup (0)
szDisplayName1 db 30 dup (0)

WinMain:
FRAME hInst,hPrevInst,CmdLine,CmdShow
LOCAL ovl:WNDCLASSEXA,RR:RECT,hWnd
-------------------------------
mov D[ovl.cbSize],SIZEOF WNDCLASSEXA
mov D[ovl.style],CS_BYTEALIGNWINDOW | CS_HREDRAW | CS_VREDRAW
mov rax,offset ScrnWndProc1
mov Q[ovl.lpfnWndProc],rax
mov D[ovl.cbClsExtra],NULL
mov D[ovl.cbWndExtra],NULL
push [hInst]
pop [ovl.hInstance]
invoke LoadIcon,NULL,IDI_APPLICATION
mov Q[ovl.hIcon], rax
invoke LoadCursor,NULL,IDC_ARROW
mov Q[ovl.hCursor],rax
invoke CreateSolidBrush,[colorbk] ; background color
mov Q[hBrush],rax
mov Q[ovl.hbrBackground],rax
mov Q[ovl.lpszMenuName],NULL
mov Q[ovl.lpszClassName],offset szDisplayName1
mov Q[ovl.hIconSm],0
--------------------------
invoke ReadFile, [hFile4],addr prog1,30,addr BytesRead,NULL
----------------------------------
xor rsi,rsi
.n1
cmp rsi,30 ; this puts the keyed in name to AppName/szDisplayName1
jge >>.n3
mov al,B[prog1+rsi]
mov B[AppName+rsi],al
mov B[szDisplayName1+rsi],al
inc rsi
jmp <.n1
.n3
-----------
mov eax,[RR.bottom]
shr eax,1
mov D[holdbottom1],eax ; vertical middle of screen
---------------------------
invoke RegisterClassExA, addr ovl
invoke SystemParametersInfo, SPI_GETWORKAREA,0,addr RR,0
---------
invoke CreateWindowExA NULL,addr szDisplayName1,addr AppName,\
WS_VSCROLL or WS_OVERLAPPEDWINDOW,[RR.left],[RR.top],[RR.right],\
[holdbottom1],NULL,NULL,[hInst],NULL
mov Q[hWnd],rax
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
had the system built by PCsandParts
OS
windows 7 Pro 64 bit
CPU
mini tower
Motherboard
h110m-k (lga1151)
Memory
4g
Graphics Card(s)
nvidia geforce gt730 graphics card
Sound Card
high definition audio device
Monitor(s) Displays
19" dell ultra sharp
Screen Resolution
1280 x 800
Hard Drives
Kingston SSD
PSU
?
Case
?
Cooling
?
Keyboard
standard ps/2 keyboard
Mouse
ps/2 compatible optical
Internet Speed
fiber optics
Antivirus
ESET Smart Security
Browser
IE11
Other Info
no Wifi. Bose speakers, optical drive tsstcorp dvd+-RW
Sure could use some help with this.
I have the same program in MASM32 that works.
But not in 64-bit mode.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
had the system built by PCsandParts
OS
windows 7 Pro 64 bit
CPU
mini tower
Motherboard
h110m-k (lga1151)
Memory
4g
Graphics Card(s)
nvidia geforce gt730 graphics card
Sound Card
high definition audio device
Monitor(s) Displays
19" dell ultra sharp
Screen Resolution
1280 x 800
Hard Drives
Kingston SSD
PSU
?
Case
?
Cooling
?
Keyboard
standard ps/2 keyboard
Mouse
ps/2 compatible optical
Internet Speed
fiber optics
Antivirus
ESET Smart Security
Browser
IE11
Other Info
no Wifi. Bose speakers, optical drive tsstcorp dvd+-RW
This isn't really a programming forum. I don't think you will find much help here with assembly language programming.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
HP
OS
Windows 7 Pro 64 bit
CPU
Xeon W3520
Memory
8 GB
Graphics Card(s)
Nvidia Geforce 210
Back
Top