In the testing phase of MyProg.exe I got this error message:
" MyProg.exe has stopped working"
No 1st screen or anything. I put messagebox code right after the START
and it did not execute. So I assume something else is happening.
.code
start:
; test begin
;TM3 db 'at start',0
invoke MessageBox, NULL,[TM3],[TM3],MB_YESNO
cmp eax,MB_YESNO
je > Twrite
Twrite:
; test end
invoke GetModuleHandleA, NULL
mov [hInstance],eax
invoke GetCommandLine
invoke WinMain
invoke ExitProcess,eax
WinMain:
FRAME hInst,hPrevInst,CmdLine,CmdShow,hInstance;
LOCAL msg,MSG,hWnd,hBrush,rc:RECT,wc:WNDCLASSEXA;,cc:codecode
mov D[wc.cbSize], SIZEOF WNDCLASSEXA
mov D[wc.style], CS_BYTEALIGNWINDOW
mov D[wc.lpfnWndProc], OFFSET WndProc
mov D[wc.cbClsExtra], NULL
mov D[wc.cbWndExtra], NULL
push [hInst]
pop [wc.hInstance]
invoke LoadIcon, NULL,IDI_APPLICATION
mov D[wc.hIcon], eax
invoke LoadCursor, NULL,IDC_ARROW
mov D[wc.hCursor], eax
invoke CreateSolidBrush, [colorbk] ; background color
mov D[hBrush], eax
mov D[wc.hbrBackground], eax
mov D[wc.lpszMenuName], NULL
mov D[wc.lpszClassName], OFFSET szDisplayName
mov D[wc.hIconSm], 0
invoke RegisterClassExA, addr wc
invoke SystemParametersInfoA, SPI_GETWORKAREA,0,addr rc,0
mov eax,[rc.left]
mov [holdleft], eax
mov eax,[rc.right]
mov [holdright],eax
mov eax,[rc.bottom]
mov [holdbottom],eax
mov eax,[rc.top]
mov [holdtop],eax
push edx
push ebx
xor edx,edx
mov eax,[holdright]
mov ebx,2
div ebx
mov [savemiddleofX],eax
pop ebx
pop edx
INVOKE CreateWindowExA, NULL,addr szDisplayName,addr AppName,\
WS_OVERLAPPEDWINDOW,[rc.left],[rc.top],[rc.right],\
[rc.bottom],NULL,NULL,[hInst],NULL
mov [hWnd],eax
INVOKE ShowWindow, [hWnd], SW_SHOWNORMAL
INVOKE UpdateWindow, [hWnd]
.StartLoop
INVOKE GetMessageA, addr msg,NULL,0,0
cmp eax,0
je >.ExitLoop
INVOKE TranslateMessage, addr MSG
INVOKE DispatchMessageA, addr MSG
jmp .StartLoop
.ExitLoop
mov eax,[MSG.wParam]
ret
ENDF