flat assembler
Message board for the users of flat assembler.
Index
> Windows > simple win64 program Goto page Previous 1, 2 |
Author |
|
tixvin 14 Apr 2013, 10:25
I have already fix this. The function createwindowex returns zero
that means the window failed to create but not to show |
|||
14 Apr 2013, 10:25 |
|
tixvin 14 Apr 2013, 10:27
I have already fixed it see code.
the thing is that createwindowex returns zero that means that the window failed to create but not to show |
|||
14 Apr 2013, 10:27 |
|
tixvin 14 Apr 2013, 10:28
try this code at your machine maybe you will success
|
|||
14 Apr 2013, 10:28 |
|
ACP 14 Apr 2013, 11:19
tixvin wrote: look at This is a sample code to illustrate how you should call CreateWindowEx() function and not the complete solution. Have you tried compiling provided C code? Probably note since it is incomplete. When porting from one language to another one you need to have complete code or be sure to setup environment proper way. Just my 2 cents... |
|||
14 Apr 2013, 11:19 |
|
tixvin 14 Apr 2013, 11:28
see thie code on this link below there you read:
<Here is the complete code to create the window. Remember that WindowProc is still just a forward declaration of a function.> |
|||
14 Apr 2013, 11:28 |
|
revolution 14 Apr 2013, 17:01
tixvin: The C-code you posted is not complete in any way. I suggest you look at the fasm example for 64-bit window creation. The fasm example works correctly. Don't bother with broken C-code you found somewhere, it is wasting your time.
Last edited by revolution on 14 Apr 2013, 18:15; edited 1 time in total |
|||
14 Apr 2013, 17:01 |
|
HaHaAnonymous 14 Apr 2013, 18:10
[ Post removed by author. ]
Last edited by HaHaAnonymous on 28 Feb 2015, 21:04; edited 1 time in total |
|||
14 Apr 2013, 18:10 |
|
tixvin 26 Apr 2013, 16:17
and now it works. if you click a left button then you will hear a beep)
Code: ;10:32 AM 4/7/2013 format PE64 GUI 5.0 entry start include 'win64a.inc' section '.text' code readable executable ftoten: xor rcx, rcx call [PostQuitMessage] ret signal: mov rcx, 600 mov rdx, 2000 sub rsp, 20h call [Beep] add rsp, 20h ret fproz: sub rsp, 8 cmp edx, 2h jne .weiter call ftoten .weiter: cmp edx, 513 jne .alles call signal .alles: sub rsp, 20h call [DefWindowProcA] add rsp, 20h add rsp, 8 ret start: sub rsp, 8 mov [wc.style], CS_HREDRAW + CS_VREDRAW + CS_GLOBALCLASS mov rax, fproz mov [wc.lpfnWndProc], rax xor rcx, rcx call [GetModuleHandleA] mov [wc.hInstance], rax mov [wc.cbClsExtra], 0 mov [wc.cbWndExtra], 0 xor rcx, rcx mov rdx, 32512 call [LoadIconA] mov [wc.hIcon], rax xor rcx, rcx mov rdx, 32512 call [LoadCursorA] mov [wc.hCursor], rax mov [wc.hbrBackground], COLOR_BTNFACE+1 mov [wc.lpszMenuName], 0 mov [wc.lpszClassName], kls mov rcx, wc sub rsp, 20h call [RegisterClassA] add rsp, 20h mov rcx, 0 lea rdx, [kls] lea r8, [titel] mov r9,WS_VISIBLE+WS_DLGFRAME+WS_SYSMENU; push 0 push [wc.hInstance] push 0 push 0 push 512 push 512 push 256 push 256 sub rsp, 8*4 call [CreateWindowExA] add rsp, 8*12 mov [fnstr], rax _zyklus: lea rcx, [nouvelle] mov rdx, 0 mov r8, 0 mov r9, 0 sub rsp, 20h call [GetMessageA] add rsp, 20h or rax, rax jz _fertig mov rcx, nouvelle call [TranslateMessage] mov rcx, nouvelle call [DispatchMessageA] jmp _zyklus _fertig: mov rcx, [nouvelle.wParam] call [ExitProcess] section '.data' data readable writeable fnstr dq 0 wc WNDCLASS titel db ' fenster',0 kls db 'klass', 0 nouvelle MSG section '.idata' import data readable writeable library kernel32,'KERNEL32.DLL',\ user32,'USER32.DLL' include 'api\kernel32.inc' include 'api\user32.inc' |
|||
26 Apr 2013, 16:17 |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.