sinon il y a un exemple interessant vu le forum anglais pour ceux que ca interessent...
il faut une DLL telechargeable ici:
http://radasm.visualassembler.com/
et un exemple de code pour l'exploiter :
Code : Tout sélectionner
;
; Sample from the RAGrid package: GridTest.
; Translated to PureBasic (more or less: this one doesn't use a resource dialog)
;
Global menuID
Structure COLUMN
colwt.l
lpszhdrtext.l
halign.l
calign.l
ctype.l
ctextmax.l
lpszformat.l
himl.l
hdrflag.l
colxp.l
edthwnd.l
EndStructure
Structure ROWDATA
lpszName.l
nId.l
EndStructure
#GM_ADDCOL = #WM_USER+1 ;wParam=0, lParam=lpCOLUMN
#GM_ADDROW = #WM_USER+2 ;wParam=0, lParam=lpROWDATA (can be NULL)
#GM_SETBACKCOLOR = #WM_USER+21 ;wParam=nColor, lParam=0
#GM_SETGRIDCOLOR = #WM_USER+23 ;wParam=nColor, lParam=0
#GM_SETTEXTCOLOR = #WM_USER+25 ;wParam=nColor, lParam=0
#GA_ALIGN_LEFT = 0
#GA_ALIGN_RIGHT = 2
#TYPE_EDITTEXT = 0 ;String
#TYPE_EDITLONG = 1 ;Long
Global *ClassBuffer
*ClassBuffer = AllocateMemory(64)
Procedure CreateGrids(hwnd, lParam)
If *ClassBuffer
GetClassName_(hwnd, *ClassBuffer, 64)
If PeekS(*ClassBuffer, 6)="Static"
hGrid = CreateWindowEx_($00000200, "RAGrid", "Grid test", $5001000D, 0, 0, 195, 260, hwnd, menuID, LibraryID(0), 0)
If hGrid
SendMessage_(hGrid, #WM_SETFONT, hFont, #False)
SendMessage_(hGrid, #GM_SETBACKCOLOR, $0C0FFFF, 0)
SendMessage_(hGrid, #GM_SETGRIDCOLOR, $808080, 0)
SendMessage_(hGrid, #GM_SETTEXTCOLOR, $800000, 0)
col.COLUMN
col\colwt = 130
col\lpszhdrtext = @"Name"
col\halign = #GA_ALIGN_LEFT
col\calign = #GA_ALIGN_LEFT
col\ctype = #TYPE_EDITTEXT
col\ctextmax = 31
col\lpszformat = 0
col\himl = 0
col\hdrflag = 0
SendMessage_(hGrid, #GM_ADDCOL, 0, @col)
;Number column
col\colwt = 42
col\lpszhdrtext = @"ID"
col\halign = #GA_ALIGN_RIGHT
col\calign = #GA_ALIGN_RIGHT
col\ctype = #TYPE_EDITLONG
col\ctextmax = 11
col\lpszformat = 0
col\himl = 0
col\hdrflag = 0
SendMessage_(hGrid, #GM_ADDCOL, 0, @col)
;Add some rows
Dim rdta.ROWDATA(3)
For i=0 To 3
SendMessage_(hGrid, #GM_ADDROW, 0, @rdta(i))
Next i
ShowWindow_(hGrid, #SW_SHOW)
menuID+1
EndIf
EndIf
ProcedureReturn #True
Else
ProcedureReturn #False
EndIf
EndProcedure
Procedure DestroyGrids(hwnd, lParam)
If *ClassBuffer
GetClassName_(hwnd, *ClassBuffer, 64)
If PeekS(*ClassBuffer, 6)="Static"
hGrid = GetWindow_(hwnd, #GW_CHILD)
GetClassName_(hGrid, *ClassBuffer, 64)
If PeekS(*ClassBuffer, 6)="RAGrid"
DestroyWindow_(hGrid)
EndIf
EndIf
ProcedureReturn #True
Else
ProcedureReturn #False
EndIf
EndProcedure
If OpenWindow(0, 100, 200, 195, 260, #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget, "PureBasic Window")
If OpenLibrary(0, "RAGrid.DLL")
InitCommonControls_()
hFont = SendMessage_(WindowID(), #WM_GETFONT, 0, 0)
If CreateGadgetList(WindowID())
Panel = PanelGadget(0, 0, 0, 195, 260)
For j=1 To 6
AddGadgetItem(0, -1, "Tab "+Str(j))
Next j
EnumChildWindows_(Panel, @CreateGrids(), 0)
CloseGadgetList()
Repeat
EventID = WaitWindowEvent()
If EventID=#PB_Event_CloseWindow
Quit = 1
EndIf
Until Quit=1
EndIf
EnumChildWindows_(Panel, @DestroyGrids(), 0)
EndIf
CloseLibrary(0)
EndIf
End