Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: CreateWindowExA

29 May 2014   #1
phenix

windows 7 Pro 64 bit
 
 
CreateWindowExA

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 System SpecsSystem Spec
.
30 May 2014   #2
phenix

windows 7 Pro 64 bit
 
 

Sure could use some help with this.
I have the same program in MASM32 that works.
But not in 64-bit mode.
My System SpecsSystem Spec
30 May 2014   #3
LMiller7

Windows 7 Pro 64 bit
 
 

This isn't really a programming forum. I don't think you will find much help here with assembly language programming.
My System SpecsSystem Spec
.

Reply

 CreateWindowExA




Thread Tools Search this Thread
Search this Thread:

Advanced Search



Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 09:47.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App