Нашол хорошую статью по теме http://www.wasm.ru/article.php?article=1001019, но там код под masm, под fasm не работает, просто не создаёт окно (возвращает 0),заменяю "SysTreeView32" на "edit" всё отлично, вот код: Код (Text): invoke CreateWindowEx,NULL,TreeViewClass,NULL,\ WS_CHILD+WS_VISIBLE+TVS_HASLINES+TVS_HASBUTTONS+TVS_LINESATROOT,\ 0,0,100,100,[hwnd],NULL,\ [wc.hInstance],NULL По "GetLastError" возвращает код 2. Мстика
Вот весь код(изменённный пример "MINIPAD"): Код (Text): format PE GUI 4.0 entry start include 'INCLUDE\win32a.inc' section '.data' data readable writeable _class db 'Test',0 _title db 'Test',0 TreeViewClass db 'SysTreeView32',0 wc WNDCLASSEX 48,0,WindowProc,0,0,NULL,NULL,NULL,COLOR_APPWORKSPACE,NULL,_class,0 msg MSG section '.code' code readable executable start: invoke GetModuleHandle,0 mov [wc.hInstance],eax invoke LoadIcon,eax,17 mov [wc.hIcon],eax invoke LoadCursor,0,IDC_ARROW mov [wc.hCursor],eax invoke RegisterClassEx,wc invoke CreateWindowEx,0,_class,_title,WS_OVERLAPPED+WS_CAPTION+WS_SYSMENU+WS_MINIMIZEBOX+WS_MAXIMIZEBOX+WS_VISIBLE,100,100,256,256,NULL,0,[wc.hInstance],NULL msg_loop: invoke GetMessage,msg,NULL,0,0 or eax,eax jz end_loop invoke TranslateMessage,msg invoke DispatchMessage,msg jmp msg_loop end_loop: invoke ExitProcess,[msg.wParam] invoke InitCommonControls proc WindowProc hwnd,wmsg,wparam,lparam push ebx esi edi cmp [wmsg],WM_CREATE je wmcreate cmp [wmsg],WM_DESTROY je wmdestroy defwndproc: invoke DefWindowProc,[hwnd],[wmsg],[wparam],[lparam] jmp finish wmcreate: invoke CreateWindowEx,NULL,TreeViewClass,NULL,\ WS_CHILD+WS_VISIBLE+TVS_HASLINES+TVS_HASBUTTONS+TVS_LINESATROOT,\ 0,0,100,100,[hwnd],NULL,\ [wc.hInstance],NULL cmp eax,0 jne @1 invoke ExitProcess,0 @1: jmp finish wmdestroy: invoke PostQuitMessage,0 xor eax,eax finish: pop edi esi ebx ret endp section '.idata' import data readable writeable library kernel,'KERNEL32.DLL',\ user,'USER32.DLL',\ gdi,'GDI32.DLL' import kernel,\ GetModuleHandle,'GetModuleHandleA',\ ExitProcess,'ExitProcess' import user,\ RegisterClassEx,'RegisterClassExA',\ CreateWindowEx,'CreateWindowExA',\ DefWindowProc,'DefWindowProcA',\ GetMessage,'GetMessageA',\ TranslateMessage,'TranslateMessage',\ DispatchMessage,'DispatchMessageA',\ LoadCursor,'LoadCursorA',\ LoadIcon,'LoadIconA',\ PostQuitMessage,'PostQuitMessage' import comctl32,\ InitCommonControls,'InitCommonControls'