j'ai un soucis avec les process, certains fonctionnent d'autres non.
comme c'est plus simple de comprendre avec un prog, le voila :
Code : Tout sélectionner
;/ Created with PureVisionXP v2.13
;/ Fri, 30 Dec 2005 16:33:39
;/ by Nicolas Djurovic
;-Global Variables and Constants
Global hwnd_gadget
;-Window Constants
Enumeration 1
#Window_Form
EndEnumeration
#WindowIndex=#PB_Compiler_EnumerationValue
;-Gadget Constants
Enumeration 1
;Window_Form
#Gadget_Form_Panel
#Gadget_Form_Tab_1
#Gadget_Form_Tab_2
#Gadget_Form_String
#Gadget_Form_Text
#Gadget_Form_Button_compile
#Gadget_Form_Button_Link
#Gadget_Form_Button_Run
#Gadget_Form_Editor_Output
#Gadget_Form_Button_Quit
#Gadget_Form_Editor_File
#Gadget_Form_Button_OK
EndEnumeration
#GadgetIndex=#PB_Compiler_EnumerationValue
Procedure.l Window_Form()
If OpenWindow(#Window_Form,80,80,740,625,#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_Invisible,"Compiler Info")
If CreateGadgetList(WindowID(#Window_Form))
PanelGadget(#Gadget_Form_Panel,10,10,725,610)
AddGadgetItem(#Gadget_Form_Panel,-1,"Output")
hwnd_gadget=EditorGadget(#Gadget_Form_String,5,460,710,120)
SetGadgetFont(#Gadget_Form_String,LoadFont(#Gadget_Form_String,"Courier New",8,0))
SendMessage_(hwnd_gadget, #EM_SETTARGETDEVICE, #Null, 0)
SendMessage_(hwnd_gadget, #EM_SETREADONLY, #True, #Null) ;On ne peut rien saisir
TextGadget(#Gadget_Form_Text,5,445,60,15,"Info")
SetGadgetFont(#Gadget_Form_Text,LoadFont(#Gadget_Form_Text,"",8,0))
ButtonGadget(#Gadget_Form_Button_compile,655,5,60,40,"Compile")
ButtonGadget(#Gadget_Form_Button_Link,655,50,60,40,"Link")
ButtonGadget(#Gadget_Form_Button_Run,655,95,60,40,"Run")
EditorGadget(#Gadget_Form_Editor_Output,5,5,645,440)
SetGadgetFont(#Gadget_Form_Editor_Output,LoadFont(#Gadget_Form_Editor_Output,"Courier New",10,0))
ButtonGadget(#Gadget_Form_Button_Quit,655,185,60,40,"Quit")
AddGadgetItem(#Gadget_Form_Panel,-1,"File:<>")
EditorGadget(#Gadget_Form_Editor_File,5,5,710,555)
SetGadgetFont(#Gadget_Form_Editor_File,LoadFont(#Gadget_Form_Editor_File,"",10,0))
ButtonGadget(#Gadget_Form_Button_OK,655,565,60,20,"OK")
CloseGadgetList()
HideWindow(#Window_Form,0)
ProcedureReturn WindowID()
EndIf
EndIf
EndProcedure
Procedure proc_Do(TheVal.l)
Select TheVal
Case 1
AddGadgetItem(#Gadget_Form_String,-1, "Compiling...")
AddGadgetItem(#Gadget_Form_String,-1, GetProgramResult("cmd /c type out.asm"))
Commande.s="fasm out.asm"
text.s = GetProgramResult(Commande)
AddGadgetItem(#Gadget_Form_String,-1, text)
Case 2
AddGadgetItem(#Gadget_Form_String,-1, "Linking...")
Commande.s="ld out.obj libkernel32.a libuser32.a libmsvcrt.a -o out.exe -s --verbose"
text.s = GetProgramResult(Commande)
AddGadgetItem(#Gadget_Form_String,-1, text)
Case 3
AddGadgetItem(#Gadget_Form_String,-1, "Running...")
Commande.s="cmd /c out.exe" ; <- PB ICI RIEN NE SE PASSE"dir *.asm *.exe"
text.s = GetProgramResult(Commande)
AddGadgetItem(#Gadget_Form_String,-1, text)
EndSelect
EndProcedure
;-Main Loop
If Window_Form()
SendMessage_(hwnd_gadget, #EM_SETBKGNDCOLOR, 0, RGB(160,160,160)) ;couleur de fond
quitForm=0
Repeat
EventID =WaitWindowEvent()
MenuID =EventMenuID()
GadgetID =EventGadgetID()
WindowID =EventWindowID()
Select EventID
Case #PB_Event_CloseWindow
If WindowID=#Window_Form
quitForm=1
EndIf
Case #PB_Event_Gadget
Select GadgetID
Case #Gadget_Form_Tab_1
Case #Gadget_Form_Tab_2
Case #Gadget_Form_String
Case #Gadget_Form_Button_compile
SetGadgetText(#Gadget_Form_String, "")
proc_Do(1)
Case #Gadget_Form_Button_Link
proc_Do(2)
Case #Gadget_Form_Button_Run
proc_Do(3)
Case #Gadget_Form_Editor_Output
Case #Gadget_Form_Button_Quit
quitForm = 1
Case #Gadget_Form_Editor_File
Case #Gadget_Form_Button_OK
EndSelect
EndSelect
Until quitForm
CloseWindow(#Window_Form)
EndIf
End
Code : Tout sélectionner
;*****************************************************************************
; ***** Generated Code "out.asm" - 28/12/05, 00:14:57 - Flaith Gen 0.4
; *****************************************************************************
format MS COFF
extrn _ExitProcess@4
extrn _printf
; *****************************************************************************
; ***** Code
; *****************************************************************************
section '.text' code readable executable
public _mainCRTStartup
_mainCRTStartup:
push _value_print
call _printf
push 0
call _ExitProcess@4
; *****************************************************************************
; ***** Data
; *****************************************************************************
section '.data' Data readable writeable
_value_print db "---- Test de generation d'un fichier asm",13,10
db ">fasm out.asm",13,10
db ">ld out.obj libkernel32.a libuser32.a libmsvcrt.a -o out.exe -s",13,10
db "---- Si changement de :",13,10
db "---- public _mainCRTStartup par _Start, par exemple, faire :",13,10
db ">ld -e _Start out.obj libkernel32.a libuser32.a libmsvcrt.a -o out.exe -s",13,10
db 0
ou rien ne se passe, alors qu'il ne doit afficher que du texte ??? Quelqu'un a une idée du pourquoi ? D'avance merciCommande.s="cmd /c out.exe"

ps: Il faut la lib de Droopy (merci à lui pour cette lib)
