Hi
   I got multhread.zip in this forum, an example from Hutch.
   I made this to create a separate window
.data
_ThreadClass   db "Thread_Class", 0
_DisplayName   db "Tabela de ficheiros",0
_ThreadPaint   dd 0
.code
ThreadProcA   proc  hWin:DWORD, uMsg:DWORD, wParam:DWORD, lParam:DWORD
        ;
        mov   eax, uMsg
        ;cmp   eax, WM_CREATE
        cmp   eax, WM_PAINT
        jne   _ThreadProcA1
        cmp   _ThreadPaint, 1
        je   _eThreadProcA
        ;
        mov   _ThreadPaint, 1
        invoke  ShowTabelaFic, hWin      ; print and wait for key
        invoke  SendMessage, hWin, WM_SYSCOMMAND, SC_CLOSE, 0       Â
        ;
        mov   _ThreadPaint, 0       Â
        jmp   _eThreadProcA
        ;
_ThreadProcA1: cmp   eax, WM_CLOSE
        jne   _eThreadProcA     Â
        ;
        invoke SetActiveWindow, _hWndCur      ; main window
        ;
        ; Destroy
        ; -------Â
        invoke PostQuitMessage, NULL
        xor   eax, eax
        ret
        ;
_eThreadProcA:Â invoke DefWindowProc, hWin, uMsg, wParam, lParam
        ret
ThreadProcAÂ Â Â endp
; ««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
RegisterWinClass proc lpWndProc:DWORD, lpClassName:DWORD,
           Icon:DWORD, Cursor:DWORD, bColor:DWORD
         LOCAL wc:WNDCLASSEX
         mov     wc.cbSize, sizeof WNDCLASSEX
         mov     wc.style, CS_BYTEALIGNCLIENT or CS_BYTEALIGNWINDOW
         mov     eax, lpWndProc Â
         mov     wc.lpfnWndProc, eax
         mov     wc.cbClsExtra, NULL
         mov     wc.cbWndExtra, NULL
         mov     eax, _hInstance
         mov     wc.hInstance, eax        Â
         mov     eax, bColor
         mov     wc.hbrBackground, eax Â
         mov     wc.lpszMenuName, NULL
         mov     eax, lpClassName        Â
         mov     wc.lpszClassName, eax
         mov     eax, Icon
         mov     wc.hIcon, eax
         mov     eax, Cursor
         mov     wc.hCursor, eax
         mov     eax, Icon        Â
         mov     wc.hIconSm, eax
         invoke   RegisterClassEx, ADDR wc
         ret
RegisterWinClass endp
; ««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
CreateNewThread proc
        ; ----------------------------------------------------------------
        ; each time this procedure is called a new thread has been created.
        ; ----------------------------------------------------------------
        LOCAL  hWin:DWORD
        LOCAL  hCursor:DWORD
        LOCAL  msg   :MSG
 ; --------------------------------------------
 ; register class name for CreateWindowEx call
 ; --------------------------------------------
  invoke LoadCursor, NULL, IDC_ARROW
  mov   hCursor, eax
  invoke RegisterWinClass, offset ThreadProcA, offset _ThreadClass,
               NULL, hCursor, COLOR_BTNFACE+1
  invoke CreateWindowEx, WS_EX_LEFT or WS_EX_ACCEPTFILES,
              offset _ThreadClass,
              offset _DisplayName,
              WS_OVERLAPPEDWINDOW,
              0,0, 800, 568,
              _hWndCur, NULL,
              _hInstance,NULL
  mov       hWin, eax
  ;
  invoke   ShowWindow, hWin, SW_SHOWNORMAL
  invoke   UpdateWindow, hWin
  invoke   SetActiveWindow, hWin
; ---------------------------------------------
; each seperate thread has its own message loop
; ---------------------------------------------
         push  ebx
         lea   ebx, msg                   Â
@@:       invoke GetMessage, ebx, NULL, 0, 0           Â
         cmp   eax,0h              ;check if return value=0 => exit
         je   @F                 ;go forward @@
         invoke TranslateMessage, ebx
         invoke DispatchMessage, ebx
         jmp   @B                 ;go backward @@        Â
         ;
@@:       pop   ebx
         mov   eax, msg.wParam
         ret       Â
; ------------------------------------------------------------------------------
CreateNewThread endp
; ««««««««««««««««««««««««««««««««««««««««««««««««««««««
CriaThreadAÂ Â Â proc
        LOCAL  hThreadA:DWORD Â
        ;
        mov   edx, 25
        invoke CreateThread,0,0, offset CreateNewThread, edx, 0, ADDR _IDThreadA
        mov   hThreadA, eax
        cmp   eax, 0
        jne   _eCriaThreadA
        ;
        ; Erro
        ;
_eCriaThreadA:Â ret
CriaThreadAÂ Â Â endp
but the window doenst open when i call  CriaThreadA . Whats wrong ?
Rui
Hi all
    It is already working. The problem is solved. Now i have a thread window to show
    some values the main prog is using.
    My special thanks to Hutch, Tedd, Donkey and MichaelW.
    Obrigado
    RuiLoureiro