Page 2 sur 3

Publié : sam. 12/mars/2005 18:33
par Anonyme2
Le Soldat Inconnu a écrit :il s'agit du fichier "APIFunctionListing.txt" dans le dossier "compiler" de PB
La description de certaine fonction de l'API y est.

Donc c'est ce fichier qu'il faut compléter :wink:
Oui, certaines API sont commentées (je n'avais pas fait attention, j'a mis l'api sendmessage et j'ai mis le curseur dessus et je n'ai pas vu la synthaxe affichée)

Sorry gansta93 :roll: , mais bon, ça ne change pas le fait qu'il faille la doc à portée de main.

APIFunctionListing.txt:
Je ne pensais plus à ce fichier.
Pour le modifier et ajouter ces API, ne pas oublier d'augmenter la valeur du début de fichier de 48

Publié : sam. 12/mars/2005 19:07
par Anonyme2
J'ai modifié le fichier APIFunctionListing.txt pour qu'il prenne en compte ces API, ça permet que leur ortographe se corrige avec les majuscules/minuscules

je n'ai ajouté aucun commentaire sur ces API pour la barre de tâche, s'il y a un courageux...

ce fichier est à mettre à la place de celui existant (faites une sauvegarde du votre avant) dans le dossier compiler de Purebasic

le zip est ici

Publié : sam. 12/mars/2005 19:34
par gansta93
Donc si j'ai bien compris, si je rajoute une fonction dedans, je dois augmenter de 48 la valeure du début ?
Comment ça fonctionne exactement en fait ?
Pourquoi DLLImporter ne le fait-il pas ?
:?: :?: :?: :?: :?:

Publié : sam. 12/mars/2005 19:43
par Flype
oui c vrai, pas bête, il faudrait le proposer à fred dans les suggestions :roll:

Publié : sam. 12/mars/2005 19:44
par Anonyme2
gansta93 a écrit :Donc si j'ai bien compris, si je rajoute une fonction dedans, je dois augmenter de 48 la valeure du début ?
Comment ça fonctionne exactement en fait ?
Pourquoi DLLImporter ne le fait-il pas ?
:?: :?: :?: :?: :?:
Si tu veut ajouter les fonctions d'une dll, qu'elles soient MS ou de ta conception, tu doit créer un fichier pbl (fait le avec l'éditeur Purebasic)
Ce fichier comporte au début le nom de la dll qui sera en fait le nom des 2 fichiers que Dllimporter va créer.

Puis le nom de chaque commande (les nom d'API pour MS) suivi d'un espace (ou plusieurs ?) puis le nombre d'argument de la fonction

Voici le texte de ce fichier pbl pour les thèmes XP


Code : Tout sélectionner

; PureBasic DLL import file
;
UxTheme.DLL
    CloseThemeData 1
    DrawThemeBackground 6
    DrawThemeBackgroundEx 6
    DrawThemeEdge 8
    DrawThemeIcon 7
    DrawThemeParentBackground 3
    DrawThemeText 9
    EnableThemeDialogTexture 2
    EnableTheming 1
    GetCurrentThemeName 6
    GetThemeAppProperties 0
    GetThemeBackgroundContentRect 6
    GetThemeBackgroundExtent 6
    GetThemeBackgroundRegion 6
    GetThemeBool 5
    GetThemeColor 5
    GetThemeDocumentationProperty 4
    GetThemeEnumValue 5
    GetThemeFilename 6
    GetThemeFont 6
    GetThemeInt 5
    GetThemeIntList 5
    GetThemeMargins 7
    GetThemeMetric 6
    GetThemePartSize 7
    GetThemePosition 5
    GetThemePropertyOrigin 5
    GetThemeRect 5
    GetThemeString 6
    GetThemeSysBool 2
    GetThemeSysColor 2
    GetThemeSysColorBrush 2
    GetThemeSysFont 3
    GetThemeSysInt 3
    GetThemeSysSize 2
    GetThemeSysString 4
    GetThemeTextExtent 9
    GetThemeTextMetrics 5
    GetWindowTheme 1
    HitTestThemeBackground 9
    IsAppThemed 0
    IsThemeActive 0
    IsThemeBackgroundPartiallyTransparent 3
    IsThemeDialogTextureEnabled 0
    IsThemePartDefined 3
    OpenThemeData 2
    SetThemeAppProperties 1
    SetWindowTheme 3
Une fois le fichier enregistré avec l'extension pbl, utilise Dllimporter et donne le chemin de ce fichier

Il met automatiquement les 2 fichiers dans les bon répertoire et cré aussi un fichier def (qui n'est pas utilisé ?) dans le même répertoire que le fichier pbl

Dllimporter a terminé.

Si tu veux que l'orthographe majuscule/minuscule soient prise en compte il faut modifier le fichier APIFunctionListing.txt à la main en augmentant le compteur du début et en mettant dans l'ordre alphabétique les nouvelles commandes , ordre alphabétique incluant les commandes existantes.
J'ai utilisé word pour trier puis réimporté dans notepad car word ajoute des trucs.

Maintenant, c'est Fred qui dira pourquoi il faut modifier à la main :D
Idem pour mettre des commentaires

Publié : sam. 12/mars/2005 19:55
par gansta93
Pour le DLLImporter j'ai tout compris...
mais après, ça devien plus dure :-).
En claire
Disons que j'ai trois fonctions dans ma dll, je les ai bien importées avec... DLLImporter.
J'ouvre APIFunctionListing.txt (dsl pour l'orthographe).
J'augmente le nombre du début de trois, et j'ajoute mes fonction en faisant attention qu'elles soient bien en ordre alphabétique.
Mais comment je présante pour les commentaires ?
comme ça ?

Code : Tout sélectionner

Fonction1(param1,param2,param3,param4) - Description
Si j'ai bien compris... dsl pour toutes ces questions qui sont à mon habitude, lourdes.

Publié : sam. 12/mars/2005 20:25
par Anonyme2
C'est dans le fichier APIFunctionListing.txt qu'il faut regarder
J'en déduis par exemple pour l' API acmMetrics

Code : Tout sélectionner

acmMetrics (hao, uMetric, pMetric)
qu'il faut mettre ce qui apparait dans la barre de tache entre parenthèses

Publié : sam. 12/mars/2005 20:47
par gansta93
Donc pas moyen de mettre une description... OK.
Il faudrait que Fred explique un peu le système pour voir...
Je vais poster dans suggestion et améliorations pour demander que DLLImporter édite le fichier APIFunctionListing.txt je trouve que ça serait pas mal.

Publié : dim. 13/mars/2005 19:03
par Le Soldat Inconnu
pas forcément l'éditer mais en faire un autre ou l'on puisse mettre ses fonctions.
car le fichier de base peut être écrasé lors d'une mise à jour :D

Publié : dim. 13/mars/2005 20:02
par Anonyme2
Le Soldat Inconnu a écrit :pas forcément l'éditer mais en faire un autre ou l'on puisse mettre ses fonctions.
car le fichier de base peut être écrasé lors d'une mise à jour :D
Il y a d'ailleurs avec smartupdate ce fichier listing des API... mais pas à jour des API des thèmes
Et il me semble aussi UXTHEME (j'ai envoyé le fichier pbl à Fred, je ne sais pas si ça vient de là).

Publié : sam. 16/avr./2005 13:01
par Le Soldat Inconnu
bon, un exemple d'utilisation :D

j'ai également récupérer les constantes nécessaires.

Par contre, les consttantes pour GetThemeMetric sont introuvables :(

Code : Tout sélectionner

; Auteur : Le Soldat Inconnu
; Version de PB : 3.9
;
; Explication du programme :
; Pour faire des programmes de test rapidement, il ne reste qu'a rajouter les gadgets et la gestion des évènements.

;{- "Window" (i.e., non-client) Parts & States
; UxThemeWindowParts
#WP_CAPTION = 1
#WP_SMALLCAPTION = 2
#WP_MINCAPTION = 3
#WP_SMALLMINCAPTION = 4
#WP_MAXCAPTION = 5
#WP_SMALLMAXCAPTION = 6
#WP_FRAMELEFT = 7
#WP_FRAMERIGHT = 8
#WP_FRAMEBOTTOM = 9
#WP_SMALLFRAMELEFT = 10
#WP_SMALLFRAMERIGHT = 11
#WP_SMALLFRAMEBOTTOM = 12
; window frame buttons
#WP_SYSBUTTON = 13
#WP_MDISYSBUTTON = 14
#WP_MINBUTTON = 15
#WP_MDIMINBUTTON = 16
#WP_MAXBUTTON = 17
#WP_CLOSEBUTTON = 18
#WP_SMALLCLOSEBUTTON = 19
#WP_MDICLOSEBUTTON = 20
#WP_RESTOREBUTTON = 21
#WP_MDIRESTOREBUTTON = 22
#WP_HELPBUTTON = 23
#WP_MDIHELPBUTTON = 24
; scrollbars
#WP_HORZSCROLL = 25
#WP_HORZTHUMB = 26
#WP_VERTSCROLL = 27
#WP_VERTTHUMB = 28
; dialog
#WP_DIALOG = 29
; hit-test templates
#WP_CAPTIONSIZINGTEMPLATE = 30
#WP_SMALLCAPTIONSIZINGTEMPLATE = 31
#WP_FRAMELEFTSIZINGTEMPLATE = 32
#WP_SMALLFRAMELEFTSIZINGTEMPLATE = 33
#WP_FRAMERIGHTSIZINGTEMPLATE = 34
#WP_SMALLFRAMERIGHTSIZINGTEMPLATE = 35
#WP_FRAMEBOTTOMSIZINGTEMPLATE = 36
#WP_SMALLFRAMEBOTTOMSIZINGTEMPLATE = 37
; UxThemeFrameStates
#FS_ACTIVE = 1
#FS_INACTIVE = 2
; UxThemeCaptionStates
#CS_ACTIVE = 1
#CS_INACTIVE = 2
#CS_DISABLED = 3
; UxThemeMaxCaptionStates
#MXCS_ACTIVE = 1
#MXCS_INACTIVE = 2
#MXCS_DISABLED = 3
; UxThemeMinCaptionStates
#MNCS_ACTIVE = 1
#MNCS_INACTIVE = 2
#MNCS_DISABLED = 3
; UxThemeHorzScrollStates
#HSS_NORMAL = 1
#HSS_HOT = 2
#HSS_PUSHED = 3
#HSS_DISABLED = 4
; UxThemeHorzThumbStates
#HTS_NORMAL = 1
#HTS_HOT = 2
#HTS_PUSHED = 3
#HTS_DISABLED = 4
; UxThemeVertScrollStates
#VSS_NORMAL = 1
#VSS_HOT = 2
#VSS_PUSHED = 3
#VSS_DISABLED = 4
; UxThemeVertThumbStates
#VTS_NORMAL = 1
#VTS_HOT = 2
#VTS_PUSHED = 3
#VTS_DISABLED = 4
; UxThemeSysButtonStates
#SBS_NORMAL = 1
#SBS_HOT = 2
#SBS_PUSHED = 3
#SBS_DISABLED = 4
; UxThemeMinButtonStates
#MINBS_NORMAL = 1
#MINBS_HOT = 2
#MINBS_PUSHED = 3
#MINBS_DISABLED = 4
; UxThemeMaxButtonStates
#MAXBS_NORMAL = 1
#MAXBS_HOT = 2
#MAXBS_PUSHED = 3
#MAXBS_DISABLED = 4
; UxThemeRestoreButtonStates
#RBS_NORMAL = 1
#RBS_HOT = 2
#RBS_PUSHED = 3
#RBS_DISABLED = 4
; UxThemeHelpButtonStates
#HBS_NORMAL = 1
#HBS_HOT = 2
#HBS_PUSHED = 3
#HBS_DISABLED = 4
; UxThemeCloseButtonStates
#CBS_NORMAL = 1
#CBS_HOT = 2
#CBS_PUSHED = 3
#CBS_DISABLED = 4
;}
;{- "Button" Parts & States
; UxThemeButtonParts
#BP_PUSHBUTTON = 1
#BP_RADIOBUTTON = 2
#BP_CHECKBOX = 3
#BP_GROUPBOX = 4
#BP_USERBUTTON = 5
; UxThemePushButtonStates
#PBS_NORMAL = 1
#PBS_HOT = 2
#PBS_PRESSED = 3
#PBS_DISABLED = 4
#PBS_DEFAULTED = 5
; UxThemeRadioButtonStates
#RBS_UNCHECKEDNORMAL = 1
#RBS_UNCHECKEDHOT = 2
#RBS_UNCHECKEDPRESSED = 3
#RBS_UNCHECKEDDISABLED = 4
#RBS_CHECKEDNORMAL = 5
#RBS_CHECKEDHOT = 6
#RBS_CHECKEDPRESSED = 7
#RBS_CHECKEDDISABLED = 8
; UxThemeCheckBoxStates
#CBS_UNCHECKEDNORMAL = 1
#CBS_UNCHECKEDHOT = 2
#CBS_UNCHECKEDPRESSED = 3
#CBS_UNCHECKEDDISABLED = 4
#CBS_CHECKEDNORMAL = 5
#CBS_CHECKEDHOT = 6
#CBS_CHECKEDPRESSED = 7
#CBS_CHECKEDDISABLED = 8
#CBS_MIXEDNORMAL = 9
#CBS_MIXEDHOT = 10
#CBS_MIXEDPRESSED = 11
#CBS_MIXEDDISABLED = 12
; UxThemeGroupBoxStates
#GBS_NORMAL = 1
#GBS_DISABLED = 2
;}
;{- "Rebar" Parts & States
; UxThemeRebarParts
#RP_GRIPPER = 1
#RP_GRIPPERVERT = 2
#RP_BAND = 3
#RP_CHEVRON = 4
#RP_CHEVRONVERT = 5
; UxThemeChevronStates
#CHEVS_NORMAL = 1
#CHEVS_HOT = 2
#CHEVS_PRESSED = 3
;}
;{- "Toolbar" Parts & States
; UxThemeToolBarParts
#TP_BUTTON = 1
#TP_DROPDOWNBUTTON = 2
#TP_SPLITBUTTON = 3
#TP_SPLITBUTTONDROPDOWN = 4
#TP_SEPARATOR = 5
#TP_SEPARATORVERT = 6
; UxThemeToolBarStates
#TS_NORMAL = 1
#TS_HOT = 2
#TS_PRESSED = 3
#TS_DISABLED = 4
#TS_CHECKED = 5
#TS_HOTCHECKED = 6
;}
;{- "Status" Parts & States
; UxThemeStatusParts
#SP_PANE = 1
#SP_GRIPPERPANE = 2
#SP_GRIPPER = 3
;}
;{- "Menu" Parts & States
; UxThemeMenuParts
#MP_MENUITEM = 1
#MP_MENUDROPDOWN = 2
#MP_MENUBARITEM = 3
#MP_MENUBARDROPDOWN = 4
#MP_CHEVRON = 5
#MP_SEPARATOR = 6
; UxThemeMenuStates
#MS_NORMAL = 1
#MS_SELECTED = 2
#MS_DEMOTED = 3
;}
;{- "ListView" Parts & States
; UxThemeLISTVIEWParts
#LVP_LISTITEM = 1
#LVP_LISTGROUP = 2
#LVP_LISTDETAIL = 3
#LVP_LISTSORTEDDETAIL = 4
#LVP_EMPTYTEXT = 5
; UxThemeLISTITEMStates
#LIS_NORMAL = 1
#LIS_HOT = 2
#LIS_SELECTED = 3
#LIS_DISABLED = 4
#LIS_SELECTEDNOTFOCUS = 5
;}
;{- "Header" Parts & States
; UxThemeHEADERParts
#HP_HEADERITEM = 1
#HP_HEADERITEMLEFT = 2
#HP_HEADERITEMRIGHT = 3
#HP_HEADERSORTARROW = 4
; UxThemeHEADERITEMStates
#HIS_NORMAL = 1
#HIS_HOT = 2
#HIS_PRESSED = 3
; UxThemeHEADERITEMLEFTStates
#HILS_NORMAL = 1
#HILS_HOT = 2
#HILS_PRESSED = 3
; UxThemeHEADERITEMRIGHTStates
#HIRS_NORMAL = 1
#HIRS_HOT = 2
#HIRS_PRESSED = 3
; UxThemeHEADERSORTARROWStates
#HSAS_SORTEDUP = 1
#HSAS_SORTEDDOWN = 2
;}
;{- "Progress" Parts & States
; UxThemePROGRESSParts
#PP_BAR = 1
#PP_BARVERT = 2
#PP_CHUNK = 3
#PP_CHUNKVERT = 4
;}
;{- "Tab" Parts & States
; UxThemeTABParts
#TABP_TABITEM = 1
#TABP_TABITEMLEFTEDGE = 2
#TABP_TABITEMRIGHTEDGE = 3
#TABP_TABITEMBOTHEDGE = 4
#TABP_TOPTABITEM = 5
#TABP_TOPTABITEMLEFTEDGE = 6
#TABP_TOPTABITEMRIGHTEDGE = 7
#TABP_TOPTABITEMBOTHEDGE = 8
#TABP_PANE = 9
#TABP_BODY = 10
; UxThemeTABITEMStates
#TIS_NORMAL = 1
#TIS_HOT = 2
#TIS_SELECTED = 3
#TIS_DISABLED = 4
#TIS_FOCUSED = 5
; UxThemeTABITEMLEFTEDGEStates
#TILES_NORMAL = 1
#TILES_HOT = 2
#TILES_SELECTED = 3
#TILES_DISABLED = 4
#TILES_FOCUSED = 5
; UxThemeTABITEMRIGHTEDGEStates
#TIRES_NORMAL = 1
#TIRES_HOT = 2
#TIRES_SELECTED = 3
#TIRES_DISABLED = 4
#TIRES_FOCUSED = 5
; UxThemeTABITEMBOTHEDGESStates
#TIBES_NORMAL = 1
#TIBES_HOT = 2
#TIBES_SELECTED = 3
#TIBES_DISABLED = 4
#TIBES_FOCUSED = 5
; UxThemeTOPTABITEMStates
#TTIS_NORMAL = 1
#TTIS_HOT = 2
#TTIS_SELECTED = 3
#TTIS_DISABLED = 4
#TTIS_FOCUSED = 5
; UxThemeTOPTABITEMLEFTEDGEStates
#TTILES_NORMAL = 1
#TTILES_HOT = 2
#TTILES_SELECTED = 3
#TTILES_DISABLED = 4
#TTILES_FOCUSED = 5
; UxThemeTOPTABITEMRIGHTEDGEStates
#TTIRES_NORMAL = 1
#TTIRES_HOT = 2
#TTIRES_SELECTED = 3
#TTIRES_DISABLED = 4
#TTIRES_FOCUSED = 5
; UxThemeTOPTABITEMBOTHEDGESStates
#TTIBES_NORMAL = 1
#TTIBES_HOT = 2
#TTIBES_SELECTED = 3
#TTIBES_DISABLED = 4
#TTIBES_FOCUSED = 5
;}
;{- "Trackbar" Parts & States
; UxThemeTRACKBARParts
#TKP_TRACK = 1
#TKP_TRACKVERT = 2
#TKP_THUMB = 3
#TKP_THUMBBOTTOM = 4
#TKP_THUMBTOP = 5
#TKP_THUMBVERT = 6
#TKP_THUMBLEFT = 7
#TKP_THUMBRIGHT = 8
#TKP_TICS = 9
#TKP_TICSVERT = 10
; UxThemeTRACKBARStates
#TKS_NORMAL = 1
; UxThemeTRACKStates
#TRS_NORMAL = 1
; UxThemeTRACKVERTStates
#TRVS_NORMAL = 1
; UxThemeTHUMBStates
#TUS_NORMAL = 1
#TUS_HOT = 2
#TUS_PRESSED = 3
#TUS_FOCUSED = 4
#TUS_DISABLED = 5
; UxThemeTHUMBBOTTOMStates
#TUBS_NORMAL = 1
#TUBS_HOT = 2
#TUBS_PRESSED = 3
#TUBS_FOCUSED = 4
#TUBS_DISABLED = 5
; UxThemeTHUMBTOPStates
#TUTS_NORMAL = 1
#TUTS_HOT = 2
#TUTS_PRESSED = 3
#TUTS_FOCUSED = 4
#TUTS_DISABLED = 5
; UxThemeTHUMBVERTStates
#TUVS_NORMAL = 1
#TUVS_HOT = 2
#TUVS_PRESSED = 3
#TUVS_FOCUSED = 4
#TUVS_DISABLED = 5
; UxThemeTHUMBLEFTStates
#TUVLS_NORMAL = 1
#TUVLS_HOT = 2
#TUVLS_PRESSED = 3
#TUVLS_FOCUSED = 4
#TUVLS_DISABLED = 5
; UxThemeTHUMBRIGHTStates
#TUVRS_NORMAL = 1
#TUVRS_HOT = 2
#TUVRS_PRESSED = 3
#TUVRS_FOCUSED = 4
#TUVRS_DISABLED = 5
; UxThemeTICSStates
#TSS_NORMAL = 1
; UxThemeTICSVERTStates
#TSVS_NORMAL = 1
;}
;{- "Tooltips" Parts & States
; UxThemeTOOLTIPParts
#TTP_STANDARD = 1
#TTP_STANDARDTITLE = 2
#TTP_BALLOON = 3
#TTP_BALLOONTITLE = 4
#TTP_CLOSE = 5
; UxThemeCLOSEStates
#TTCS_NORMAL = 1
#TTCS_HOT = 2
#TTCS_PRESSED = 3
; UxThemeSTANDARDStates
#TTSS_NORMAL = 1
#TTSS_LINK = 2
; UxThemeBALLOONStates
#TTBS_NORMAL = 1
#TTBS_LINK = 2
;}
;{- "TreeView" Parts & States
; UxThemeTREEVIEWParts
#TVP_TREEITEM = 1
#TVP_GLYPH = 2
#TVP_BRANCH = 3
; UxThemeTREEITEMStates
#TREIS_NORMAL = 1
#TREIS_HOT = 2
#TREIS_SELECTED = 3
#TREIS_DISABLED = 4
#TREIS_SELECTEDNOTFOCUS = 5
; UxThemeGLYPHStates
#GLPS_CLOSED = 1
#GLPS_OPENED = 2
;}
;{- "Spin" Parts & States
; UxThemeSPINStates
#SPNP_UP = 1
#SPNP_DOWN = 2
#SPNP_UPHORZ = 3
#SPNP_DOWNHORZ = 4
; UxThemeUPStates
#UPS_NORMAL = 1
#UPS_HOT = 2
#UPS_PRESSED = 3
#UPS_DISABLED = 4
; UxThemeDOWNStates
#DNS_NORMAL = 1
#DNS_HOT = 2
#DNS_PRESSED = 3
#DNS_DISABLED = 4
; UxThemeUPHORZStates
#UPHZS_NORMAL = 1
#UPHZS_HOT = 2
#UPHZS_PRESSED = 3
#UPHZS_DISABLED = 4
; UxThemeDOWNHORZStates
#DNHZS_NORMAL = 1
#DNHZS_HOT = 2
#DNHZS_PRESSED = 3
#DNHZS_DISABLED = 4
;}
;{- "Page" Parts & States
; UxThemePageParts
#PGRP_UP = 1
#PGRP_DOWN = 2
#PGRP_UPHORZ = 3
#PGRP_DOWNHORZ = 4
; Pager uses same States as Spin
;}
;{- "Scrollbar" Parts & States
; UxThemeSCROLLBARParts
#SBP_ARROWBTN = 1
#SBP_THUMBBTNHORZ = 2
#SBP_THUMBBTNVERT = 3
#SBP_LOWERTRACKHORZ = 4
#SBP_UPPERTRACKHORZ = 5
#SBP_LOWERTRACKVERT = 6
#SBP_UPPERTRACKVERT = 7
#SBP_GRIPPERHORZ = 8
#SBP_GRIPPERVERT = 9
#SBP_SIZEBOX = 10
; UxThemeARROWBTNStates
#ABS_UPNORMAL = 1
#ABS_UPHOT = 2
#ABS_UPPRESSED = 3
#ABS_UPDISABLED = 4
#ABS_DOWNNORMAL = 5
#ABS_DOWNHOT = 6
#ABS_DOWNPRESSED = 7
#ABS_DOWNDISABLED = 8
#ABS_LEFTNORMAL = 9
#ABS_LEFTHOT = 10
#ABS_LEFTPRESSED = 11
#ABS_LEFTDISABLED = 12
#ABS_RIGHTNORMAL = 13
#ABS_RIGHTHOT = 14
#ABS_RIGHTPRESSED = 15
#ABS_RIGHTDISABLED = 16
; UxThemeSCROLLBARStates
#SCRBS_NORMAL = 1
#SCRBS_HOT = 2
#SCRBS_PRESSED = 3
#SCRBS_DISABLED = 4
; UxThemeSIZEBOXStates
#SZB_RIGHTALIGN = 1
#SZB_LEFTALIGN = 2
;}
;{- "Edit" Parts & States
; UxThemeEDITParts
#EP_EDITTEXT = 1
#EP_CARET = 2
; UxThemeEDITTEXTStates
#ETS_NORMAL = 1
#ETS_HOT = 2
#ETS_SELECTED = 3
#ETS_DISABLED = 4
#ETS_FOCUSED = 5
#ETS_READONLY = 6
#ETS_ASSIST = 7
;}
;{- "ComboBox" Parts & States
; UxThemeComboBoxParts
#CP_DROPDOWNBUTTON = 1
; UxThemeComboBoxStates
#CBXS_NORMAL = 1
#CBXS_HOT = 2
#CBXS_PRESSED = 3
#CBXS_DISABLED = 4
;}
;{- "Taskbar Clock" Parts & States
; UxThemeCLOCKParts
#CLP_TIME = 1
; UxThemeCLOCKStates
#CLS_NORMAL = 1
;}
;{- "Tray Notify" Parts & States
; UxThemeTRAYNOTIFYParts
#TNP_BACKGROUND = 1
#TNP_ANIMBACKGROUND = 2
;}
;{- "TaskBar" Parts & States
; UxThemeTASKBARParts
#TBP_BACKGROUNDBOTTOM = 1
#TBP_BACKGROUNDRIGHT = 2
#TBP_BACKGROUNDTOP = 3
#TBP_BACKGROUNDLEFT = 4
#TBP_SIZINGBARBOTTOM = 5
#TBP_SIZINGBARRIGHT = 6
#TBP_SIZINGBARTOP = 7
#TBP_SIZINGBARLEFT = 8;}
;{- "TaskBand" Parts & States
; UxThemeTASKBANDParts
#TDP_GROUPCOUNT = 1
#TDP_FLASHBUTTON = 2
#TDP_FLASHBUTTONGROUPMENU = 3
;}
;{- "StartPanel" Parts & States
; ; UxThemeSTARTPANELParts
#SPP_USERPANE = 1
#SPP_MOREPROGRAMS = 2
#SPP_MOREPROGRAMSARROW = 3
#SPP_PROGLIST = 4
#SPP_PROGLISTSEPARATOR = 5
#SPP_PLACESLIST = 6
#SPP_PLACESLISTSEPARATOR = 7
#SPP_LOGOFF = 8
#SPP_LOGOFFBUTTONS = 9
#SPP_USERPICTURE = 10
#SPP_PREVIEW = 11
; UxThemeMOREPROGRAMSARROWStates
#SPS_NORMAL = 1
#SPS_HOT = 2
#SPS_PRESSED = 3
; UxThemeLOGOFFBUTTONSStates
#SPLS_NORMAL = 1
#SPLS_HOT = 2
#SPLS_PRESSED = 3
;}
;{- "ExplorerBar" Parts & States
; UxThemeEXPLORERBARParts
#EBP_HEADERBACKGROUND = 1
#EBP_HEADERCLOSE = 2
#EBP_HEADERPIN = 3
#EBP_IEBARMENU = 4
#EBP_NORMALGROUPBACKGROUND = 5
#EBP_NORMALGROUPCOLLAPSE = 6
#EBP_NORMALGROUPEXPAND = 7
#EBP_NORMALGROUPHEAD = 8
#EBP_SPECIALGROUPBACKGROUND = 9
#EBP_SPECIALGROUPCOLLAPSE = 10
#EBP_SPECIALGROUPEXPAND = 11
#EBP_SPECIALGROUPHEAD = 12
; UxThemeHEADERCLOSEStates
#EBHC_NORMAL = 1
#EBHC_HOT = 2
#EBHC_PRESSED = 3
; UxThemeHEADERPINStates
#EBHP_NORMAL = 1
#EBHP_HOT = 2
#EBHP_PRESSED = 3
#EBHP_SELECTEDNORMAL = 4
#EBHP_SELECTEDHOT = 5
#EBHP_SELECTEDPRESSED = 6
; UxThemeIEBARMENUStates
#EBM_NORMAL = 1
#EBM_HOT = 2
#EBM_PRESSED = 3
; UxThemeNORMALGROUPCOLLAPSEStates
#EBNGC_NORMAL = 1
#EBNGC_HOT = 2
#EBNGC_PRESSED = 3
; UxThemeNORMALGROUPEXPANDStates
#EBNGE_NORMAL = 1
#EBNGE_HOT = 2
#EBNGE_PRESSED = 3
; UxThemeSPECIALGROUPCOLLAPSEStates
#EBSGC_NORMAL = 1
#EBSGC_HOT = 2
#EBSGC_PRESSED = 3
; UxThemeSPECIALGROUPEXPANDStates
#EBSGE_NORMAL = 1
#EBSGE_HOT = 2
#EBSGE_PRESSED = 3
;}
;{- "TaskBand" Parts & States
; UxThemeMENUBANDParts
#MDP_NEWAPPBUTTON = 1
#MDP_SEPERATOR = 2
; UxThemeMENUBANDStates
#MDS_NORMAL = 1
#MDS_HOT = 2
#MDS_PRESSED = 3
#MDS_DISABLED = 4
#MDS_CHECKED = 5
#MDS_HOTCHECKED = 6
;}



Procedure.l Ansi2Uni(ansi.s) 
  size.l=MultiByteToWideChar_(#CP_ACP,0,ansi,-1,0,0) 
  Dim unicode.w(size)
  MultiByteToWideChar_(#CP_ACP, 0, ansi, Len(ansi), unicode(), size) 
  ProcedureReturn @unicode() 
EndProcedure


; Création de la fenêtre principale
OpenWindow(0, 0, 0, 800, 600, #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget, "Test")
CreateGadgetList(WindowID())

CreateImage(0, 800, 600)
hDC= StartDrawing(ImageOutput())
  Box(0, 0, 800, 600, $FFFFFF)
  Zone.RECT\Left = 0
  Zone\Top = 0

  ;{- CheckBox
  hTheme = OpenThemeData_(WindowID(), Ansi2Uni("Button"))
  ; OpenThemeData_(WindowID.l, Class.s)
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_CHECKBOX, #CBS_UNCHECKEDNORMAL, @Zone, 0)
  Zone\Left + 20
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_CHECKBOX, #CBS_UNCHECKEDHOT, @Zone, 0)
  Zone\Left + 20
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_CHECKBOX, #CBS_UNCHECKEDPRESSED, @Zone, 0)
  Zone\Left + 20
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_CHECKBOX, #CBS_UNCHECKEDDISABLED, @Zone, 0)
  Zone\Left + 20
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_CHECKBOX, #CBS_CHECKEDNORMAL, @Zone, 0)
  Zone\Left + 20
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_CHECKBOX, #CBS_CHECKEDHOT, @Zone, 0)
  Zone\Left + 20
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_CHECKBOX, #CBS_CHECKEDPRESSED, @Zone, 0)
  Zone\Left + 20
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_CHECKBOX, #CBS_CHECKEDDISABLED, @Zone, 0)
  Zone\Left + 20
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_CHECKBOX, #CBS_MIXEDNORMAL, @Zone, 0)
  Zone\Left + 20
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_CHECKBOX, #CBS_MIXEDHOT, @Zone, 0)
  Zone\Left + 20
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_CHECKBOX, #CBS_MIXEDPRESSED, @Zone, 0)
  Zone\Left + 20
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_CHECKBOX, #CBS_MIXEDDISABLED, @Zone, 0)
  CloseThemeData_(hTheme)
  ;}
  ;{- Button
  hTheme = OpenThemeData_(WindowID(), Ansi2Uni("Button"))
  ; OpenThemeData_(WindowID.l, Class.s)
  Zone\Left + 20
  Zone\Right = Zone\Left + 50
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_PUSHBUTTON, #PBS_NORMAL, @Zone, 0)
  Zone\Left + 50
  Zone\Right = Zone\Left + 50
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_PUSHBUTTON, #PBS_HOT, @Zone, 0)
  Zone\Left + 50
  Zone\Right = Zone\Left + 50
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_PUSHBUTTON, #PBS_PRESSED, @Zone, 0)
  Zone\Left + 50
  Zone\Right = Zone\Left + 50
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_PUSHBUTTON, #PBS_DISABLED, @Zone, 0)
  Zone\Left + 50
  Zone\Right = Zone\Left + 50
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_PUSHBUTTON, #PBS_DEFAULTED, @Zone, 0)
  
  CloseThemeData_(hTheme)
  ;}
  ;{- Option
  hTheme = OpenThemeData_(WindowID(), Ansi2Uni("Button"))
  ; OpenThemeData_(WindowID.l, Class.s)
  Zone\Left + 50
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_RADIOBUTTON, #RBS_UNCHECKEDNORMAL, @Zone, 0)
  Zone\Left + 20
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_RADIOBUTTON, #RBS_UNCHECKEDHOT, @Zone, 0)
  Zone\Left + 20
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_RADIOBUTTON, #RBS_UNCHECKEDPRESSED, @Zone, 0)
  Zone\Left + 20
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_RADIOBUTTON, #RBS_UNCHECKEDDISABLED, @Zone, 0)
  Zone\Left + 20
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_RADIOBUTTON, #RBS_CHECKEDNORMAL, @Zone, 0)
  Zone\Left + 20
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_RADIOBUTTON, #RBS_CHECKEDHOT, @Zone, 0)
  Zone\Left + 20
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_RADIOBUTTON, #RBS_CHECKEDPRESSED, @Zone, 0)
  Zone\Left + 20
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_RADIOBUTTON, #RBS_CHECKEDDISABLED, @Zone, 0)
  
  CloseThemeData_(hTheme)
  ;}
  ;{- Group
  hTheme = OpenThemeData_(WindowID(), Ansi2Uni("Button"))
  ; OpenThemeData_(WindowID.l, Class.s)
  Zone\Left + 20
  Zone\Right = Zone\Left + 50
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_GROUPBOX, #GBS_NORMAL, @Zone, 0)
  Zone\Left + 50
  Zone\Right = Zone\Left + 50
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #BP_GROUPBOX, #GBS_DISABLED, @Zone, 0)
  
  CloseThemeData_(hTheme)
  ;}
  
  ;{- Caption
  hTheme = OpenThemeData_(WindowID(), Ansi2Uni("Window"))
  ; OpenThemeData_(WindowID.l, Class.s)
  Zone\Left = 0
  Zone\Top + 25
  Zone\Right = Zone\Left + 75
  Zone\Bottom = Zone\Top + 30
  DrawThemeBackground_(hTheme, hDC, #WP_CAPTION, #CS_ACTIVE, @Zone, 0)
  Zone\Left + 80
  Zone\Right = Zone\Left + 75
  Zone\Bottom = Zone\Top + 30
  DrawThemeBackground_(hTheme, hDC, #WP_CAPTION, #CS_INACTIVE, @Zone, 0)
  
  CloseThemeData_(hTheme)
  ;}
  ;{- MaxCaption
  hTheme = OpenThemeData_(WindowID(), Ansi2Uni("Window"))
  ; OpenThemeData_(WindowID.l, Class.s)
  Zone\Left + 80
  Zone\Right = Zone\Left + 75
  Zone\Bottom = Zone\Top + 30
  DrawThemeBackground_(hTheme, hDC, #WP_MAXCAPTION, #MXCS_ACTIVE, @Zone, 0)
  Zone\Left + 80
  Zone\Right = Zone\Left + 75
  Zone\Bottom = Zone\Top + 30
  DrawThemeBackground_(hTheme, hDC, #WP_MAXCAPTION, #MXCS_INACTIVE, @Zone, 0)
  
  CloseThemeData_(hTheme)
  ;}
  ;{- MinCaption
  hTheme = OpenThemeData_(WindowID(), Ansi2Uni("Window"))
  ; OpenThemeData_(WindowID.l, Class.s)
  Zone\Left + 80
  Zone\Right = Zone\Left + 75
  Zone\Bottom = Zone\Top + 30
  DrawThemeBackground_(hTheme, hDC, #WP_MINCAPTION, #MNCS_ACTIVE, @Zone, 0)
  Zone\Left + 80
  Zone\Right = Zone\Left + 75
  Zone\Bottom = Zone\Top + 30
  DrawThemeBackground_(hTheme, hDC, #WP_MINCAPTION, #MNCS_INACTIVE, @Zone, 0)
  
  CloseThemeData_(hTheme)
  ;}
  ;{- SmallCaption
  hTheme = OpenThemeData_(WindowID(), Ansi2Uni("Window"))
  ; OpenThemeData_(WindowID.l, Class.s)
  Zone\Left + 80
  Zone\Right = Zone\Left + 75
  Zone\Bottom = Zone\Top + 25
  DrawThemeBackground_(hTheme, hDC, #WP_SMALLCAPTION, #CS_ACTIVE, @Zone, 0)
  Zone\Left + 80
  Zone\Right = Zone\Left + 75
  Zone\Bottom = Zone\Top + 25
  DrawThemeBackground_(hTheme, hDC, #WP_SMALLCAPTION, #CS_INACTIVE, @Zone, 0)
  
  CloseThemeData_(hTheme)
  ;}
  ;{- Window frame buttons
  hTheme = OpenThemeData_(WindowID(), Ansi2Uni("Window"))
  ; On met une Caption en décors
  Zone\Left = 0
  Zone\Top + 35
  Zone\Right = Zone\Left + 800
  Zone\Bottom = Zone\Top + 30
  DrawThemeBackground_(hTheme, hDC, #WP_CAPTION, #CS_ACTIVE, @Zone, 0)
  
  ;- MinButton
  Zone\Left = 295
  Zone\Top + 5
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #WP_MINBUTTON, #MINBS_NORMAL, @Zone, 0)
  Zone\Left + 25
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #WP_MINBUTTON, #MINBS_HOT, @Zone, 0)
  Zone\Left + 25
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #WP_MINBUTTON, #MINBS_PUSHED, @Zone, 0)
  Zone\Left + 25
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #WP_MINBUTTON, #MINBS_DISABLED, @Zone, 0)
  
  ;- MaxButton
  Zone\Left + 25
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #WP_MAXBUTTON, #MAXBS_NORMAL, @Zone, 0)
  Zone\Left + 25
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #WP_MAXBUTTON, #MAXBS_HOT, @Zone, 0)
  Zone\Left + 25
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #WP_MAXBUTTON, #MAXBS_PUSHED, @Zone, 0)
  Zone\Left + 25
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #WP_MAXBUTTON, #MAXBS_DISABLED, @Zone, 0)
  
  ;- RestoreButton
  Zone\Left + 25
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #WP_RESTOREBUTTON, #RBS_NORMAL, @Zone, 0)
  Zone\Left + 25
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #WP_RESTOREBUTTON, #RBS_HOT, @Zone, 0)
  Zone\Left + 25
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #WP_RESTOREBUTTON, #RBS_PUSHED, @Zone, 0)
  Zone\Left + 25
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #WP_RESTOREBUTTON, #RBS_DISABLED, @Zone, 0)
  
  ;- HelpButton
  Zone\Left + 25
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #WP_HELPBUTTON, #HBS_NORMAL, @Zone, 0)
  Zone\Left + 25
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #WP_HELPBUTTON, #HBS_HOT, @Zone, 0)
  Zone\Left + 25
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #WP_HELPBUTTON, #HBS_PUSHED, @Zone, 0)
  Zone\Left + 25
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #WP_HELPBUTTON, #HBS_DISABLED, @Zone, 0)
  
  ;- CloseButton
  Zone\Left + 25
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #WP_CLOSEBUTTON, #CBS_NORMAL, @Zone, 0)
  Zone\Left + 25
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #WP_CLOSEBUTTON, #CBS_HOT, @Zone, 0)
  Zone\Left + 25
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #WP_CLOSEBUTTON, #CBS_PUSHED, @Zone, 0)
  Zone\Left + 25
  Zone\Right = Zone\Left + 20
  Zone\Bottom = Zone\Top + 20
  DrawThemeBackground_(hTheme, hDC, #WP_CLOSEBUTTON, #CBS_DISABLED, @Zone, 0)
  
  CloseThemeData_(hTheme)
  ;}
  
StopDrawing()

ImageGadget(0, 0, 0, 0, 0, UseImage(0))

Repeat
  Event = WaitWindowEvent()
  
  
  
Until Event = #PB_EventCloseWindow

End

Publié : sam. 16/avr./2005 14:00
par gansta93
Il faudrait créer un resident pour els constantes. non ?

Publié : sam. 16/avr./2005 14:50
par Anonyme2
@Régis,

c'est quelles constantes que tu cherches ?

@gansta93
Utilises le petit outil que j'ai écrit pour faire un résident (entre autre), voir le post ici

http://purebasic.hmt-forum.com/viewtopic.php?t=1792

Publié : sam. 16/avr./2005 16:05
par Le Soldat Inconnu
http://msdn.microsoft.com/library/defau ... metric.asp

c'est les constantes suivantes :
#TMT_WIDTH
#TMT_HEIGHT

Publié : sam. 16/avr./2005 16:28
par Anonyme2
Voilà ce qui revient sur internet

TMT_WIDTH 2416
TMT_HEIGHT 2417