CreateWindowExA


  1. Posts : 254
    windows 7 Pro 64 bit
       #1

    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 Computer


  2. Posts : 254
    windows 7 Pro 64 bit
    Thread Starter
       #2

    Sure could use some help with this.
    I have the same program in MASM32 that works.
    But not in 64-bit mode.
      My Computer


  3. Posts : 2,497
    Windows 7 Pro 64 bit
       #3

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


 

Our Sites
Site Links
About 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 16:47.
Find Us