Home

Reverse engineering of Graphical User Interfaces based

image

Contents

1. event D sah reationDate string temporalOperator Bia string E string event Type string condition ventContext string initiation isPositive boolean vice string isNegative boolean logicalOperator onditionType pre post m O n action Blue AND OR XOR IMPLIES d sting termination _ Eargetia string Ename string 7 1 ton string 7 Bid string _ id string cuiRelationship X ncs ame string 1 n Source p string string lefaultContent string or ruleTerm transformationSystem lefaulticon uri Bid string lefaultHelp uri n MethodCall transition EnethodName String EfransitionidRef string remy asl eng ths Tay icai applicationOrder graphicalRelationship 1 1 methodCallParam string vocalRelationship cuiDialogControl i n Ihs
2. EEZ I OW OqwARS dw ZEZ NII NALINNIW TET 3411539089 091 325 25 NALINNIW OEZ 34 no3 972g WOlVNYVd3S WILINNIW Sez JeLu 98 4000 WILINNIW 102 329195 NALINNIN 907 NILINNIN 502 AARIN NALINNIN POZ L241201M do NALINNINW 07 J 201972 NALINNIW VOLVUVdIS WILINNIW ZOZ A ponopews TOZ NALINNIW 87 dfidOd VOLVYVdIS WILINNIW uoises 9 5 NALINNIW ZET j uomses NALINNIW WOlVNVd3S WILINNIW TET dod OET 5e4 Wolvuvdas LTT TWX STI X91 T9 Wa LIQNGM ETT 40d WILINNIW TIT 741 Sv WALINNIW Sv WALINNIW uodx3g PST 90 079 8 410 WALINNIW EST 8 41 19 WALINNIW ZST ueipu3 z 5on WILINNIW TST uapu z SOn WILINNIW OST 19 99 WILINNIW 911 d VIUS AGO OARS WILINNIW OTT S UNS HION 9 9S WNALINNIW 907 5 1101 NALINNINW SOT SAHIN WELLINNGW POT WILINNIW O yS ino oueusp4g poires usdo WELINNGW 09 TOT N HIOW MONS NALINNINW Sn HSh5N3 ONVIENS HSNONT ONVI 39Vn9NY1 3125
3. TOULNOD T 5 8 E NN Tm H fitit EEE 90 Appendix Appendix B Comparison of the resource files given by the decompilers First example Untitled SciTE File Search View Tools Options Language Help Find what Match whole word only C Match case Regular expression v Wrap around Transform backslash expressions Resource Tuner 400 DIALOG 30 73 275 84 STYLE DS_SETFONT DS_MODALFRAME DS_3DLOOK WS_POPUPWINDOW WS_DLGFRAME CAPTION Find LANGUAGE LANG ENGLISH SUBLANG ENGLISH US FONT 8 MS Shell Dig t Restorator LTEXT Fi amp nd what 1 5 7 45 8 COMBOBOX 222 50 5 145 50 NOT CBS SIMPLE CBS DROPDOWN CBS AUTOHSCROLL AUTOCHECKBOX Match amp whole word only 232 5 22 120 10 WS GROUP AUTOCHECKBOX Match amp case 233 5 34 130 10 WS GROUP AUTOCHECKBOX Regular amp expression 239 5 46 120 10 5 GROUP AUTOCHECKBOX Wrap aroun amp d 240 5 58 120 10 WS GROUP AUTOCHECKBOX Transform amp backslash expressions 241 5 70 160 10 WS GROUP GROUPBOX Direction 1 135 22 60 34 WS GROUP AUTORADIOBUTTON amp Up 234 140 30 45 12 NOT WS TABSTOP WS GROUP AUTORADIOBUTTON amp Down 235 140 42 45 12 NOT WS TABSTOP DEFPUSHBUTTON amp Find Next 1 205 5 65 14 WS GROUP PUSHBUTTON amp Mark All 245 205 23 65 14 PUSHBUTTON Cancel 2 2
4. iso tbe Soie 59 6 1 1 Correspondences table sisirin 59 6 1 1 1 Resources of type dialog a ud 60 61 1 2 Resources of type Teil iua fente des 66 6 1 2 MPSA MH 66 62 Pl g in development 70 6 2 1 HOw Pep 70 6 2 2 How tO 71 6 2 3 RP 72 6 2 4 Description of le mie Mt d OIL 73 7 CORDON mou 83 MMO STAD Ne EO nent 85 Appendix Example of complete resource file Appendix B Comparison of the resource files given by the decompilers Appendix Documentation of UML diagrams modeling a resource file Appendix D Source code 1 Introduction Software development as it s commonly practiced today doesn t look much like engineering but it should Methods models and automated tools composing software engineering practices are requited to deliver software of high quality and with low costs The major source of software problems is poor requirements specification The extraction of these requirements is the hardest function of software engineering as the most important one since the cost of late corrections is prohibitive The user interface in particular rarely satisfies the real expectations at the first time it s from the look and the manipulation of the final product that we see really what is wrong The requirements are also
5. PARAMETERS rc PARAMETERSNONMODAL rc Mes documents TABSIZE rc Poste de travail Nom de fichier ALL RESOURCES rc Favoris r seau Fichiers du type Resource script files 1c v Annuler set S of avalable resources Import Resources S can p h ase Select resources for import Importing resources E MENU MENU DIALOG BOX DIALOG BOX S not empty ABOUT S empty subset of S icm non empty Process phase INSABBREV PARAMETERS PARAMETERSNONMODAL TABSIZE 55 255 401 message resourse s generated L into GrafiXML This section will serves also as user manual and show that the interaction with the plug in is simple The graphical interface is composed of two dialog boxes ve chosen javax Swing package to create in Java the graphical interfaces The user has to choose a file to load and the resources to import The user can then continue its works on the editor of grafiXML Note that before importing a file the user must before create a new project or open an existing one 81 See http java sun com j2se 1 4 2 docs api javax swing package summary html 71 6 2 3 Specifications I state here clearly the requirements of the plug in the what Pre specifications and post specifications of my program are established as Input An existing Windows resource script file rc f Output f is closed and unchanged The us
6. St 40159 175 Y30809 SM MAISI SM 07 8 8 02 s anouS 5 27 zt ott st 40158 175 3308 SM 1 378151 SM SM TIOMISHOLNY 53 1431 53 LIGA 00 7 10 8 8 s s SM 318ISIA SM sues SW 8 INOJ Sn HSNONT ONVIGNS HSTIONS 5Nv139vVn9Nv1 5J9398J8d 4 4 5 5 E 89 MITT weg yz T t O8VOX0 GOPOXO uonersug1 amvA 42019 lt t uoris jn pod INTIVA ues INTIVA 3X33105 SWSUPLIISUIONO amwA Aq 002 8661 146u4do 3 3195 amwA 097 Tu UOMO APE ANTVA VOL peseq 5 3195 40191425994 INTIVA euewAueduio 04 060 0 32019 4 5 32018 1X0 3dAL3114 vO00 X0 503714 07 NOISYSALNGOwd 27 OJNINOISYJA T 0 T 021 NODI 3105 ADHLUIA 1ON1NOO 17 ZSZ TIA 1 1OH1NOO POZ 0 AJXLMIA 1081NO2 EOZ X 5 8 5 44 5 2 33 1 1 a 1 111 3 5 g CC 1 ZOS 94 AJALYIA 94 106 1 L4IHS TOULNOD 0 ADHLUIA
7. Ouq r deung dVW LIS fINSHSAS SM SM ndO4 SM TIALS 58 OCT Th 97 DOTWIG TWOOWNONSUALSW ENE pt ss 08 oz 40158 1 SM 3181511 SM auo SM NOLLNGHSNd 59 77 15295 TOULNOD ss 06 9 401581 SM 318ISIA SM QUHO SM NOLLNSHSNdIIQ 58 NOLLNA 71 2 3 1044402 ZT ott c9 st do1Sgv L SM SM IJEISIA SM SM MOWSHOLNY 53 1497 53 EOE TO8LNOD 9 oct s 4 SM 318ISIA SM SM 1447 55 1 52 TOULNOD JOS sues SH 2 1 04 Sn ONVIENS HSTIONT 39vn9NY1 NOLLAVI nN3WSAS SM NOLLdV2 SM 1 dndOd SM INVHIIVION SQ TIALS OOT OET 97 9O1VIG Su313Wvivd PT 0 52 act dOLSAVL SM 2181511 SM QUHI SM 58 NOLLNG 7 2u95 TOWLNOD vt 105 oz od 20158 1 SM 278151 SM QUHI SM NOLINGHSNd430 S8 NOLLNG T 1 95UT2 1044402 88 90T 9 OL 40158 1 SM TIOUDSA SM aigisiA SM QUI SM SONRILSSVH 58211805 582 5 5821 SEO XOGOGNOD PPT TOHLNOD 8 59 e s aNOwD SM 3 81SIA SM SM 1431 SS 211 15 T uoneisiqqwe JOS sues SW 9 LNOd Sn HSTI9N3 SNv18ns HSTIONT 39vn9NY1 UongrAsiqqy NOLLdV2 nN3WSAS SM NOLLAVI SM 1 dndOd SM 50 31415 Sv TST 719792 501VIG A3588VvSNI 4
8. SS SS SS GRAYFRAME 55 ETCHEDFRAME ZIE TE TIVIET SS WHITEFRAME A decompiler that checks the presence of bits when generating its resource text file could not specify for example that the text of a static control is both centered and right justified in the rectangle this is an icon 34 4 3 Resource files structure I show in this section the format of a resource script file and how the user interface specified in this language instanciates my UML class diagrams the meta model 4 3 1 Resources of type dialog box 4 3 1 1 Dialog box template We have seen in my examples that a dialog box is described in a specific language specifying its height width style and the controls it contains with again a specific size placement and style This type of resource is defined in a dialog box template included in the resource script file Here is the format id DIALOG EX x width height lt helpId gt STYLE lt style gt EXSTYLE ex style CAPTION LANGUAGE lt anguage gt lt sublanguage gt FONT lt pointsize gt typeface weight lt italic gt gt lt control_def gt Note that the order of the lines after the first and before the controls block can sometime be different With Resource Builder lt control_def gt also go between BEGIN and END instead of lt an
9. leftNoWordWrap designates a simple rectangle and displays the given text left justified in the rectangle Tabs are expanded but words are not wrapped Text that extends past the end of a line is clipped The next attributes can modify a static control that has any of the previous text styles NoPrefix Boolean Normaly Windows will interpret an ampersand amp character in the control s text to be a prefix character for the keyboard access key the ampersand is removed and the next character in the string is underlined This feature is not always wanted If true the static control displays an ampersand as an ordinary character EndEllipsis Boolean If true replaces part of the given string characters at the end of the string with ellipses if necessary so that the result fits in the specified rectangle PathEllipsis Boolean If true replaces part of the given string characters in the middle of the string with ellipses if necessary so that the result fits in the specified rectangle If the string contains backslash characters preserves as much of the text after the last backslash as possible WordEllipsis Boolean Truncates any word that does not fit in the rectangle and adds ellipses Static controls can be used to draw frames Frame black gray white undefined Defines a box that is not filled and does not display text The three first values do not necessary mean that the color are black gray and wh
10. addFlag BS AUTORADIOBUTTON 0x9 addFlag BS GROUPBOX 0x7 This last button style is still inserted even if its value is 0 because it has a common prefix with BS PUSHLIKE addFlag BS PUSHBUTTON 0x0 Static styles note that value of SS LEFT is 0x0 addFlag SS RIGHT 0x2 addFlag SS CENTER Oxl addFlag SS ICON 0 3 Edit style value of ES LEFT is 0x0 List box style addFlag LBS NOTIFY 0x1 Combobox style addFlag CBS SIMPLE 0 1 Scroll bar style value of SBS HORZ is 0x0 By default in the default notation for each types addFlag WS VISIBLE 0x10000000 addFlag WS CHILD 0x40000000 addFlag WS CHILDWINDOW 0x40000000 By default in the default notation for some types addFlag WS BORDER 0x800000 addFlag WS TAPSTOP 0x10000 addFlag WS GROUP 0x20000 addFlag WS VSCROLL 0x200000 Add the remaining flag used in my correspondance rules addFlag CBS DROPDOWN 0x2 addFlag CBS DROPDOWNLIST 0x3 addFlag DS SETFONT 0x40 addFlag DS SHELLFONT 0x48 addFlag WS CAPTION 0xC00000 addFlag WS THIRCKFRAME 0x40000 addFlag WS SIZEBOX 0x40000 addFlag WS DISABLED 0x8000000 addFlag WS EX TOPMOST 0x8 addFlag DS SYSMODAL 0x8 addFlag BS LEFT 0x100 addFlag BS CENTER 0x300 addFlag BS RIGHT 0x200 addFlag BS PUSHLIKE 0x1000 addFlag BS BITMAP 0x80 addFlag BS ICON 0x40 addFlag BS OWNERDRAW OxB addFlag BS
11. 131 BUTTON BS OWNERDRAW WS TABSTOP 222 11 56 14 PUSHBUTTON Insert Chord 105 222 30 56 14 EDITTEXT 107 97 149 88 12 AUTOCHECKBOX 109 189 149 13 12 BS PUSHLIKE CHECKBOX amp Edit Diagram 108 222 55 56 14 BS PUSHLIKE LISTBOX 110 221 73 58 11 NOT LBS NOTIFY LBS NOINTEGRALHEIGHT LBS MULTICOLUMN WS 5 9 Resource Builder 22 DIALOG 76 29 284 174 99 Appendix B STYLE DS 3DLOOK DS_SETFONT DS_MODALFRAME DS_NOIDLEMSG DS_CONTEXTHELP WS_POPUP WS_SYSMENU 5 CAPTION Chord Builder FONT 8 MS Sans Serif LANGUAGE LANG_NEUTRAL 0 BEGIN CONTROL amp Fundamental 24 STATIC SS LEFT 5 WS_VISIBLE 8 4 60 10 CONTROL 101 COMBOBOX CBS DROPDOWNLIST WS CHILD WS VSCROLL WS_TABSTOP WS_VISIBLE 8 15 76 115 CONTROL amp Chord 25 STATIC SS LEFT 5 CHILD WS GROUP WS VISIBLE 8 31 54 10 CONTROL 102 5 DROPDOWNLIST WS CHILD WS VSCROLL WS TABSTOP WS VISIBLE 8 42 76 100 CONTROL amp Fifth 26 STATIC SS LEFT WS CHILD WS VISIBLE 8 62 32 10 CONTROL 5 301 5 WS CHILD WS TABSTOP WS VISIBLE 47 61 21 10 CONTROL 5 302 BUTTON BS AUTOCHECKBOX 5 CHILD WS TABSTOP WS VISIBLE 69 61 21 10 CONTROL amp Ninth 27 STATIC SS LEFT 5 CHILD WS VISIBLE 8 74 38 10 CONTROL 9 401 BUTTON BS_AUTOCHECKBOX WS CHILD WS TABSTOP WS VISIBLE 47 73 21 10
12. Boolean Center Boolean HeaderDragDrop Boolean Subitemimages Boolean Transparent Boolean DATETIMEPICKER MONTHCALENDAR Boolean Format longDate shortDate shortDateCentury time RightAlign Boolean ShowNone Boolean UpDown Boolean DayState Boolean Multiselection Boolean NoToday Boolean NoTodayCircle Boolean WeekNumbers Boolean 4 2 3 Documentation The full documentation of the diagrams is in appendix C In this section I explain some concepts related to my examples There are three general styles of window WINDOW class a popup window is a temporary subsidiary window a child window can divide a window in various regions and an overlapped window is a program s main application window In a graphical Windows based application dialog boxes DIALOG class are windows rectangular areas of the screen and then inherit the window s attributes A dialog box used to communicate with the user and to supply services that are too complicated to be in a menu takes form of a pop up window GeneralStyle popup containing various child window controls through which the user interacts Note that there is a curiosity in the fourth example the dialog is defined as a child window This is certainly because it is not really a dialog box but a part of the dialog box to confogure the software a child window stay always in the sam
13. FONT 8 MS Shell Dlg 4 yi break case StreamTokenizer TT_NUMBER It s an id Another resource has been reached because an empty line hasControls false resources separator is not respected in the file Example of scenario st ttype VE st pushBack 400 DIALOG 30 73 275 84 142 Appendix D break CAPTION Find 401 DIALOG 36 44 285 110 Generate into GrafiXML this dialog box Grafi generateDialog id width height text styles extendedStyles faire renvoyer aussi r f rence du container mettre dans une variable pass e en param tre lors des appels de cr ation des components Specify the font that will be used in the conatiner generated Grafi fontName fontName Grafi fontSize fontSize Grafi bold bold Grafi italic italic Process the child window controls if hasControls or BEGIN has been encountered in the template There is then a controls definition part styles 0 extendedStyles 0 text The size of the text field always specified in the generic notation is 0 when no value TO DO A first scan storing x y w h in a tab of vector to construct boxes into the CUI model r mark 1024 enought Read the next token different from EOL while st nextToken StreamTokenizer TT_EOL while st ttype It remains at least one line defining a child window control Process the next line s
14. Height height val Height HelpID Z 1 lt helpld gt val HelpID 3Dlook true lt style gt DS_3DLOOK 0x00000004 AbsoluteAligment true lt style gt DS_ABSALIGN 0x00000001 Center true style 05 CENTER 0x00000800 And additional information can be found between hooks in the dialog box template The measurements in a dialog box template are specified in dialog template units not in screen units pixels The system uses the average character width of the dialog box font to calculate the position and dimensions of the dialog box 38 For example Language french and Sublanguage belgian gives SUBLANG FRENCH BELGIAN 36 CenterMouse true ContextHelp true DialogIsControl true FixedSys true LocalEdit true ModalFrame true NoFailCreate true NoldleMessage true SetForeGroud true SysModal true val Language not NULL val Sublanguage not NULL SetFont true FontName FontSize Italic true Italic false Weight 1 ShellFont true lt style gt DS_CENTERMOUSE lt style gt DS_CONTEXTHELP style 05 CONTROL style DS FIXEDSYS style 05 LOCALEDIT style DS_MODALFRAME lt style gt DS_NOFAILCREATE lt style gt DS_NOIDLEMSG lt style gt DS_SETFOREGROUND lt style gt DS_SYSMODAL language LANG upper val Language 3 sublanguage SUBLANG language upper val Sublanguage st
15. above In addition to those inherited each control has specific attibutes I will define some of them The text value of Text in the rectangle of the first static control STATIC class from the first example is left justified TextStyle left which is not the case for example for the first one from the fourth example TextStyle center But static controls can be used to draw frames or lines separating other controls like in the third example three static controls are 1 dialog unit high with etched top and bottom edges EtchedHorizontal true They can also be used to display images like the second control of the same example Icon true In this case the width and the height values are ignored the control is automatically resized to fit the image The selected radio button is turned on and others in the group are turned off automatically The user can also move between these buttons with the TAB key but only in one order SHIFT TAB to move to the previous control 30 But the first control Bitmap true uses a style that prevents this RealSizeImage true This is why the 154x256 bitmap image according to Resource Tuner bitmap resource doesn t fit all the left area of the dialog as in reality As mentioned in the fourth example where two controls have HorizontalAlignment right text in a push button PUSHBUTTON class can also be positioned in different way in the rectangle In the same example the text of
16. cancel addActionListener this list addListSelectionListener new ListListener Handles the ok and Cancel buttons public void actionPerformed ActionEvent e Object b e getSource if b ok Object s list getSelectedValues Vector temp new Vector for int 0 i lt s length i temp add s i v retainAll temp this dispose else v removeAllElements this dispose KK KR RK IK RK KK IK IR KK KK RR ke IK IR KK KK RR k ok IR RK RA AOR OR RIK RA k kk OR RR IK RK OK OK An inner class to detect list selection events de e H de ee k k k k k k eo k k k oe private class ListListener implements ListSelectionListener public void valueChanged ListSelectionEvent e if e getValuelsAdjusting false if list getSelectedIndex 1 No selection disable the ok button ok setEnabled false else Selection enable the ok button ok setEnabled true BR RRR RK RK KR RK KK IK OR RK RR RK KK IK OR KK KK RK AR ok IR RR oaaao ok IR KR IK A ko kk kk kk ko ko kk RA AOR OR RR IK RR AK ek OK An inner class to detect if the dialog box is closed k k k k k k k k k k k k k k k k k k k k k k k k k kk k k kk k k private class WindowListener extends Windo
17. public static String fontName public static byte fontSize public static boolean bold italic public static void generateDialog String id short width short height String text int styles int extendedStyles System out println Dialog box id generated into GrafiXML System out println TO DO change also the type void return reference of the container Generate a graphical component or eventually a graphical container corresponding to information given in parameters into GrafiXML public static void generateControl String id String ctrlClass short x short y short width short height String text int styles int extendedStyles System out println Control id generated into GrafiXML System out println 4 TO DO rA Generate a menu into GrafixML 4 public static void generateMenu TO DO mm a Se eS Se es Return the n bits starting at the position p in x 0 p 31 and n 32 p lt lt shift bits left filling in with zeros gt gt gt shift bits right filling in with zeros amp bitwise AND bitwise complement prefix unary operator private int readBits int x short p short n return x gt gt gt 1 amp 0 lt lt n
18. the user can expand or collapse the associated list of subitems that is the child items are displayed below the parent item or the child items are not displayed The starting item of the tree is called the root and represents the beginning of the tree it is not unusual to have a tree list that has many roots Each item including the root that belongs to the tree is referred to as a node CheckBoxes Boolean If true check boxes appear next to each item in the tree view control DisableDragDrop Boolean If true prevents the tree view control from sending a notification message to the parent window when the user starts to drag an item with the left mouse button so prevents the control to support drag and drop operations EditLabels Boolean 142 By single clicks an item label the tree view control selects and sets the focus to the item Then the user can press the direction keys to navigate in the hierarchy left and right to collapse and expand up and down to move the focus vertically in the tree move the mouse before releasing the mouse button to optionally drag and drop the item or even click again the label of the focused item to optionally edit it a timer can make it possible for the tree view to avoid entering edit mode immediately if the user double clicks the label item toggles between the expanded and collapsed state when the control sends the TVM_EXPAND message With the TVN_BEGINDRAG notif
19. 11 56 14 CONTROL amp insert Chord 105 BUTTON BS PUSHBUTTON WS CHILD WS VISIBLE WS TABSTOP 222 30 56 14 CONTROL 107 EDIT ES LEFT WS CHILD 5 VISIBLE WS BORDER WS TABSTOP 97 149 88 12 CONTROL 109 BUTTON BS AUTOCHECKBOX BS PUSHLIKE WS CHILD WS VISIBLE WS TABSTOP 189 149 13 12 CONTROL amp Edit Diagram 108 BUTTON BS CHECKBOX BS PUSHLIKE WS CHILD WS VISIBLE WS TABSTOP 222 55 56 14 CONTROL 110 LISTBOX LBS NOINTEGRALHEIGHT LBS MULTICOLUMN WS CHILD WS VISIBLE WS BORDER WS TABSTOP 221 73 58 11 B 100 Appendix C Appendix Documentation of UML diagrams modeling resource file WINDOW In a graphical Windows based application dialog boxes and controls are windows rectangular areas of the screen where the application displays output and receives input from the user Text String If the dialog box has a caption bar also called title bar it is the text put in it Text can also be displayed with each button or static child window for all the other control the value is an empty string In this case an ampersand 42 inside the value causes the letter that follows to be underlined in the interface to indicate the keyboard shortcut for that control the mnemonic and the ampersand is not displayed The input focus can then be moved to any of these controls by pressing ALT mnemonic value of Text value
20. 49 CONTROL amp KDirStat 1213 BUTTON BS AUTORADIOBUTTON WS CHILD WS VISIBLE WS GROUP WS TABSTOP 12 159 42 10 CONTROL Se amp quoiaView 1214 BUTTON BS AUTORADIOBUTTON WS CHILD WS VISIBLE 12 176 53 10 CONTROL Show amp Grid 1022 BUTTON BS AUTOCHECKBOX WS CHILD WS VISIBLE WS TABSTOP 76 150 54 10 CONTROL Grid amp Color 1030 BUTTON BS PUSHBUTTON WS CHILD WS VISIBLE WS TABSTOP 134 150 85 14 0x00001000 CONTROL H amp ighlight Rectangle 1202 BUTTON 5 PUSHBUTTON WS CHILD WS VISIBLE WS TABSTOP 76 175 143 14 0x00001000 CONTROL Static 1219 STATIC 55 CENTER WS CHILD WS VISIBLE WS GROUP 339 7 32 8 CONTROL Static 1218 STATIC 55 CENTER WS CHILD WS VISIBLE WS GROUP 305 7 32 8 CONTROL Static 1217 STATIC 55 CENTER WS CHILD WS VISIBLE WS GROUP 271 7 32 8 CONTROL Static 1216 STATIC 55 CENTER WS CHILD WS VISIBLE WS GROUP 237 7 32 8 CONTROL Static 1215 STATIC SS LEFT WS CHILD WS VISIBLE WS GROUP 7 7 211 124 22 In this case the two hexadecimal numbers 1000 means that the thirteenth bit from the right is set to 1 which correspond to the flag WS EX RIGHT since it is an extended dialog the controls can have extended styles that occur here to the end of a line Using this style with a push button control has the same effect as using the BS RIGHT style that right justifies the text in the button rectang
21. A specification language has to satisfy some requirements to be qualified 12 as UIDL The UIDL should be precise to enable automatic specifications processing It should be expressive enough to support software engineering techniques such as model derivation It should be compact expressed in a standard format and as much as possible human readable to allow designers and developers to exchange their specifications This transformation completes the reverse engineering part The UIDL file then serves as input for forward engineering to generate UI code for a target computing platform 3 2 Methodological choices This section present the choices that made to instantiate the general method illustrated in the previous section The reverse engineering tool presented in this thesis is limited to operate on UI of MS Windows applications Its input is any Windows resource script file rc from which high level requirements will be extracted I ve chosen to focus my investigation on Windows UIs since this operating system has broken into the market But the scope of the analysed UIs could be enlarged by considering other formats of resource files Resources such as nib nib or images icns resource files can also be packaged with Mac OS based applications Nib resource files store UI information including windows dialogs and UI elements such as buttons sliders text objects and help tags for these elements They are a b
22. Boolean If true and if the bitmap or icon is smaller than the client area of the static control the rest of the client area is filled with the color of the pixel in the top left corner of the bitmap or icon RealSizeImage Boolean If true prevents a static icon or bitmap control from being resized as it is loaded or drawn If the icon or bitmap is larger than the destination area the image is clipped RightJustify Boolean If true the lower right corner of a bitmap or icon static control is to remain fixed when the control is resized Only the top and left sides are adjusted to accommodate a new bitmap or icon SCROLLBAR This class defines a scroll bar child window A window can display a content such as a document or a bitmap that is larger than the window s client area When provided with a scroll bar the user can scroll a content in the client area to expand the viewing space This is not a scrollbar added at the right and or the bottom of a window but it s a child window control that can appear anywhere in the parent window gt Type horizontal vertical sizeBox sizeGrip There are two types of scroll bars horizontal by default and vertical If it is not aligned with one of its edges the scroll bar has the height width and position specified by the window s attributes The control can also designate a size box If it is not aligned with one of its corners the size box has the height width and p
23. CONTROL 101 COMBOBOX CBS_DROPDOWNLIST WS_CHILD WS_VISIBLE WS_VSCROLL WS_TABSTOP 8 15 76 115 CONTROL amp Chord 25 STATIC SS_LEFT WS_CHILD WS_VISIBLE WS_GROUP 8 31 54 10 CONTROL 102 COMBOBOX CBS_DROPDOWNLIST WS_CHILD WS_VISIBLE WS_VSCROLL WS_TABSTOP 8 42 76 100 CONTROL amp Fifth 26 STATIC 55 LEFT WS CHILD WS VISIBLE 8 62 32 10 CONTROL 5 301 BUTTON BS AUTOCHECKBOX WS CHILD WS VISIBLE WS TABSTOP 47 61 21 10 CONTROL 5 302 BUTTON BS AUTOCHECKBOX WS CHILD WS VISIBLE WS TABSTOP 69 61 21 10 CONTROL amp Ninth 27 STATIC SS LEFT WS CHILD WS VISIBLE 8 74 38 10 CONTROL 9 401 BUTTON BS AUTOCHECKBOX WS CHILD WS VISIBLE WS TABSTOP 47 73 21 10 CONTROL 9 402 BUTTON BS AUTOCHECKBOX WS CHILD WS VISIBLE WS TABSTOP 69 73 21 10 CONTROL amp Inversions 28 STATIC 55 LEFT WS CHILD WS VISIBLE 8 90 63 10 CONTROL 103 COMBOBOX CBS DROPDOWNLIST WS CHILD WS VISIBLE WS VSCROLL WS TABSTOP 8 101 76 55 CONTROL 81 700 BUTTON BS AUTORADIOBUTTON WS CHILD WS VISIBLE WS GROUP WS TABSTOP 98 149 17 10 CONTROL amp 2 701 BUTTON BS AUTORADIOBUTTON WS CHILD WS VISIBLE 116 149 17 10 CONTROL amp 3 702 BUTTON BS AUTORADIOBUTTON WS CHILD WS VISIBLE 135 149 17 10 CONTROL amp 4 703 BUTTON BS AUTORADIOBUTTON WS CHILD WS VISIBLE 154 149 17 10 CONTROL
24. DownlsLeft true lt style gt TBS_DOWNISLEFT 0 00000400 EnableSelectionRange true lt style gt TBS_ENABLESELECTIONRANGE 0x00000020 FixedLenght true lt style gt TBS_FIXEDLENGHT 0 00000040 NoThumb true lt style gt TBS_NOTHUMB 0 00000080 NoTicks true lt style gt TBS_NOTICKS 0x00000010 Orientation horizontal lt style gt TBS_HORZ 0x00000000 Orientation vertical lt style gt TBS_VERT 0x00000002 Reversed true lt style gt TBS_REVERSED 0x00000200 TickMarks bottom lt style gt TBS_BOTTOM 0x00000000 TickMarks top style TBS_TOP 0x00000004 TickMarks left lt style gt TBS LEFT 0x00000004 TickMarks right lt style gt TBS_RIGHT 0x00000000 TickMarks both lt style gt TBS_BOTH 0x00000008 Tooltips Boolean lt style gt TBS_TOOLTIPS 0 00000100 Class UPDOWN lt class gt msctls_updown32 Attributes Alignment left lt style gt UDS_ALIGNLEFT 0x00000008 Alignment right lt style gt UDS_ALIGNRIGHT 0x00000004 ArrowKeys true lt style gt UDS_ARROWKEYS 0x00000020 AutoBuddy true lt style gt UDS_AUTOBUDDY 0 00000010 Horizontal true lt style gt UDS_HORZ 0 00000040 HotTrack true lt style gt UDS_HOTTRACK 0x00000100 NoThousands true lt style gt UDS_NOTHOUSANDS 0x00000080 SetBuddyInt true lt style gt UDS_SETBUDDYINT 0x00000002 Wrap true lt style gt UDS_WRAP 0x00000001 5 55 USERBUTTON value
25. If true allows the control to be vertically sized smaller than its contained combo box control If it is sized smaller than the combo box the combo box will be clipped PathwordBreakProc Boolean If true the edit box will use the slash backslash and period characters as word delimiters This makes keyboard shortcuts for word by word cursor movement effective in path names and URLs STATIC This class defines a static child window They are used to put information in the dialog and often act as labels for other controls the text is given in the window class but can used to draw frames or lines separating other controls or to display icons They do not expect user input and do not send back messages to their parent This is Static control Type text frame image enhencedMetafile ownerdraw The control can display text a frame an image or an enhanced metafile The owner of the static control can also be responsible for drawing the control Sunken Boolean If true a half sunken border is drawn around a static control Notify Boolean If true allow the parent window to receive notification messages when the user clicks the control P To make item images easily accessible an other type of combo box controls in Windows provide image list support see the LISTVIEW class for image lists These controls provide the functionality of a standart combo box without having to manually draw item graphics they create
26. In the transformation step human analyst can refine the model thanks to the transformation engine which makes it possible to manipulate augment and restructure of the resulting model to a graphical environment The transformation stage suggests specific graphical implementations and integrates them for user interface abstractions into the legacy code The AIUDL 2 environment was a pioneer approach in user interface UI reengineering The original UI is first translated in AUIDL Abstract UI Description Language This language is able to represent UI objects in terms of both structure and behaviour Different levels of abstractions can be defined To translate the interface in AUIDL user actions and system responses have to be identified using pattern matching techniques The Milner s process algebra is used to map out the behaviour of the system The spatial organization of display objects is explicitly described with two mechanisms containment and importation of attributes from other objects An abstract syntax tree is first obtained from the source code of the system A module extracts UI fragments from it and the abstract specification of the UI is then constructed This last step is semi automated a part of the code is parsed and automatically abstracted and the remaining is left to the programmer Finally the AUIDL specifications are translated in the EASEL language this language allows the automated 9 A legacy system is a comp
27. O Pastor amp J Falc o Cunha eds Lecture Notes in Computer Science Vol 3520 Springer Verlag Berlin 2005 pp 16 21 Calvary G Coutaz J Thevenin D Limbourg Q Bouillon L Vanderdonckt J Unifying Reference Framework for Multi Target User Interfaces Interacting with Computers Vol 15 No 3 June 2003 pp 289 308 Bouillon L Vanderdonckt J User Interface Reverse Engineering Proc of 2nd Int Conf on Universal Access in Human Computer Interaction UAHCI 2003 Creete 22 27 June 2003 Vol 4 Stephanidis C Eds Lawrence Erlbaum Associates Mahwah 2003 pp 1509 1513 Goodrich M T et R Matassia Data Structures and Algorithm in Java 2nd Edition John Wiley amp Sons 2001 Petzold C Programming Windows 6 Edition Microsoft Press 1998 Georgia Tech s reverse engineering group Georgia tech 30 apr 2001 available at http www cc gatech edu reverse Wiki page of UsiXML available at http www usixml org viewzwiki Documentation of resources on the MSDN Library available at http msdn microsoft com library Apple Human Interface Guidelines avalaible at http developer apple com documentation XML Markup Languages for User Interface Definition available at http www oasis open org cover userInterfaceXML html XML tutorial available on http www w3schools com xml xml_whatis asp BCHI ISYS research on reverse engineering availale on http www isys ucl ac be bchi r
28. OneClickActivate Boolean TrackSelect Boolean TwoClickActivate Boolean AutoArrange Boolean INoLabelWrap Boolean NoScroll Boolean NoColumnHeader Boolean Type tabs buttons Bottom Boolean FixedWidth Boolean FlatButtons Boolean FocusNever Boolean FocusOnButtonDown Boolean ForceLeft icon label HotTrack Boolean Multiline Boolean Multiselection Boolean OwnerDrawFixed Boolean RaggedRight Boolean Right Boolean RightJustify Boolean ScrollOpposite Boolean ToolTips Boolean Vertical Boolean NoSortHeader Boolean TOOLBAR OwnerDrawFixed Boolean ALTDrag Boolean CustomErase Boolean Flat Boolean REBAR Transparent Boolean AutoSize Boolean BandBorders Boolean FixedOrder Boolean NoDivider Boolean RegisterDrop Boolean VarHeight Boolean Vertical Boolean DoubleClickToggle Boolean VerticalGripper Boolean List Boolean RegisterDrop Boolean ToolTips Boolean WrapAble Boolean NoResize Boolean NoParentAlign Boolean Bottom Boolean NoDivider Boolean Adjustable Boolean FullRowSelect Boolean GridLines Boolean STATUTBAR SizeGrip Boolean ToolTips Boolean Top Boolean CUSTOMCONTROL ClassName String PAGER AutoScroll Boolean DragAndDrop Boolean Direction horizontal vertical ANIMATION AutoPlay
29. Read the bit at the position p in x 0 lt p lt 31 Return true if the bit is 1 else false private boolean readBit int x short return x gt gt amp 0 lt lt 1 1 BRR RRR RK RK IK RR KK KK IR KKK IK RR AK AK IR KR IR IR KK RR ke k ko k kk AK AR RR RA IO OR RRR IR IO OR RR k k kk OK k k k k For future work I k k package importresources import java io File public class SdfFile public static void process File f RK IK RK KK KK I A ARR IK RR ke k IK IR RK RR ke kk IR RK RR k e k ok IR RK RR RI IO IR RK RRR IR IO k k k k OR RR k kk k k kk ke For future work J RCKCKCKCKCKCKCKCKCKCKCKCKCKCKCKCICKCKCKCKCKCKCKCKCKCKCKCKCKCKCKCKCKCKCKCkCkCkCkCk Ck Ck Ck Ck Ck Ck CkCkCkCkCkCkCkCk package importresources import java io File public class NibFile public static void process File f 151 Appendix D 152
30. Suite Bwv 995 Prelude 00 tef ap File Display Edt Note Play 5 alela sal Acoustic Guitar Chord Manager Chord Builder Fundamental Ehord Chart Y 2 XX X X X X Chord Insert Chord 7 5 Edit Diagram 8 ERSA 8 Ninth J E B G D A E Inversions Suite BWV 995 Prelude Johann Sebastian Bach Resource Tuner 22 DIALOG 76 29 284 174 STYLE DS_SETFONT DS_MODALFRAME DS_NOIDLEMSG DS_3DLOOK DS_CONTEXTHELP WS_POPUPWINDOW WS_DLGFRAME EXSTYLE WS_EX_DLGMODALFRAME WS_EX_CONTEXTHELP CAPTION Chord Builder LANGUAGE LANG_NEUTRAL SUBLANG_NEUTRAL FONT 8 MS Sans Serif 98 Appendix B LTEXT amp Fundamental 24 8 4 60 10 NOT WS_GROUP COMBOBOX 101 8 15 76 115 CBS_DROPDOWN WS_VSCROLL LTEXT amp Chord 25 8 31 54 10 COMBOBOX 102 8 42 76 100 CBS_DROPDOWN WS_VSCROLL LTEXT amp Fifth 26 8 62 32 10 NOT WS_GROUP AUTOCHECKBOX 5 301 47 61 21 10 AUTOCHECKBOX 5 302 69 61 21 10 LTEXT amp Ninth 27 8 74 38 10 NOT WS GROUP AUTOCHECKBOX 9 401 47 73 21 10 AUTOCHECKBOX 9 402 69 73 21 10 LTEXT amp lInversions 28 8 90 63 10 NOT WS GROUP COMBOBOX 103 8 101 76 55 CBS DROPDOWN WS VSCROLL AUTORADIOBUTTON 81 700 98 149 17 10 WS GROUP AUTORADIOBUTTON amp 2 701 116 149 17 10 NOT WS TABSTOP AUTORADIOBUTTON 83 702 135 149 17 10 NOT WS TABSTOP AUTORADI
31. YOMINOO A Juss sues SW 2 LNOd Sn HSTIONT 5 HSMONS ONY 39 Vn9NY1 3195 NOLLdV2 nN3WSAS SM 1 SM ndOd SM Sa TIALS 056 Ty 97 SOTWIG 1no8v 1 206 31125 11008 WALINNIW 06 OPH 31958 NILINNIW 05 5 NALINNIW tos WILINNIW ame YOLVUVdTS WILINNIW abendura 1 4325 WILINNIW T9 a suondo 29508 WELINNIW 09 18207 WELINNEW 1 435 WILINNIW r1413018u04 WELINNEW I UIUS HIDI sumas uogeyguepu 1 435 WILINNIW 88 AJXLWIA JOULNOD 292 ADALYIA LJIHS 197 ADALYIA 2 097 E a d 5 E N e ARR ANA TERRA CHARS vi a i cS Vi vi eae 1 1 1 Sn HSTIONS ONVISNS HSTIONT ONY S YOLVYETTIIIV 57322 4 5 1437 55 DIAVIS 0 L9SPEZT TOMINOO SS JILVAS 0 1044409 8 0 8755 96 dnou5 5 706 LL oet 40158 1 SM 318 5088 LEE 83 5 5 o6 s o6r dO1SgVi b AN sm 1 a 1 anowo sm 1 3181511 S SM XOSHI2IMIOLNY 58 NO LING Tyz suois
32. amp 5 704 BUTTON BS AUTORADIOBUTTON WS CHILD WS VISIBLE 176 149 17 10 CONTROL 106 BUTTON BS GROUPBOX WS CHILD WS VISIBLE WS GROUP 92 138 116 29 CONTROL 600 SCROLLBAR 585 HORZ WS CHILD WS VISIBLE WS TABSTOP 93 107 81 9 CONTROL 601 SCROLLBAR 585 VERT WS CHILD WS VISIBLE WS TABSTOP 155 56 9 64 CONTROL amp Omit 799 BUTTON BS GROUPBOX WS CHILD WS VISIBLE WS GROUP 8 118 76 49 CONTROL 800 BUTTON BS CHECKBOX WS CHILD WS VISIBLE WS TABSTOP 14 128 30 10 CONTROL 801 BUTTON BS CHECKBOX WS CHILD WS VISIBLE WS TABSTOP 50 128 30 10 CONTROL 802 BUTTON BS CHECKBOX WS CHILD WS VISIBLE WS TABSTOP 14 140 30 10 CONTROL 803 BUTTON BS CHECKBOX WS CHILD WS VISIBLE WS TABSTOP 50 140 30 10 CONTROL 804 BUTTON BS CHECKBOX WS CHILD WS VISIBLE WS TABSTOP 14 152 30 10 CONTROL 805 BUTTON BS CHECKBOX WS CHILD WS VISIBLE WS TABSTOP 50 152 30 10 CONTROL Chord Chart 30 STATIC 55 CENTER WS CHILD WS VISIBLE 108 2 68 10 CONTROL 999 STATIC SS SIMPLE WS CHILD 92 12 116 108 CONTROL amp Close 2 BUTTON BS OWNERDRAW WS CHILD WS VISIBLE WS TABSTOP 222 135 56 14 CONTROL amp Add 1 BUTTON BS OWNERDRAW WS CHILD WS VISIBLE WS TABSTOP 222 153 56 14 CONTROL amp Play 131 BUTTON BS OWNERDRAW WS CHILD WS VISIBLE WS TABSTOP 222
33. amp RGB Macro 101 BUTTON BS AUTORADIOBUTTON WS CHILD WS GROUP WS TABSTOP WS VISIBLE 167 55 52 8 CONTROL He amp xadecimal 102 BUTTON BS AUTORADIOBUTTON 5 CHILD WS TABSTOP WS VISIBLE 167 65 56 8 CONTROL HTML amp Macro 103 BUTTON BS AUTORADIOBUTTON WS CHILD 5 TABSTOP WS VISIBLE 167 75 56 8 CONTROL 65535 STATIC SS_ETCHEDHORZ WS CHILD WS GROUP WS VISIBLE 118 86 195 1 CONTROL Specify the Color Swatch Size for Clipboard Copies 65535 STATIC SS LEFT WS CHILD WS GROUP WS VISIBLE 125 90 165 8 CONTROL 2000 65535 STATIC SS ICON WS CHILD WS VISIBLE 130 103 18 20 CONTROL amp Width 65535 STATIC SS LEFT 5 CHILD WS GROUP WS VISIBLE 167 103 22 8 CONTROL 104 EDIT ES NUMBER ES_AUTOHSCROLL ES LEFT WS CHILD WS BORDER WS TABSTOP 5 VISIBLE 193 100 30 12 CONTROL Spini 106 msctls updown32 WS CHILD 5 VISIBLE 0 7 222 100 10 12 CONTROL amp Height 65535 STATIC SS LEFT WS CHILD WS GROUP WS VISIBLE 167 115 22 8 CONTROL 105 EDIT ES NUMBER ES_AUTOHSCROLL ES LEFT WS CHILD WS BORDER WS TABSTOP WS VISIBLE 193 114 30 12 CONTROL Spin2 107 msctls updown32 WS CHILD WS VISIBLE 0 7 222 114 10 12 CONTROL 65535 5 55 ETCHEDHORZ 5 CHILD WS VISIBLE 118 129 195 1 CONTROL 2815 65535 5 55 ICON WS CHILD WS VISIBLE 130 131 18 20 CONTROL amp Camera Shutter Sound when Copying 109 BUTTON BS AUTOCHECKBOX WS CHILD WS TABSTOP WS VISIBLE 167 137 1
34. child windows in a dialog box have this attribute to true 98 The WM_HELP message 99 The WM_PARENTNOTIFY message 104 Appendix C Right Boolean If true and if the shell language is Hebrew Arabic or another language that supports reading order alignment the window has generic right aligned properties Otherwise the style is ignored Using this attribute for static or edit controls has the same effect as using TextStyle right or Alignment right respectively Using this attribute with button controls has the same effect as using HorizontalAligment right and RightButton true for check boxes and radio buttons RightScrollBar Boolean If true the vertical scroll bar if present is to the right of the client area This is the default RTLReading Boolean If true and if the shell language is Hebrew Arabic or another language that supports reading order alignment the window text is displayed using right to left reading order properties Otherwise the style is ignored ToolWindow Boolean If true it s a tool window i e a window intended to be used as a floating toolbar A tool window has a title bar that is shorter than a normal title bar and the window title is drawn using a smaller font A tool window does not appear in the task bar or in the window that appears when the user presses ALT TAB TopMost Boolean If true the window is placed above all no topmost windows and stay above them even when
35. for searching a string of length is O we visit at most 1 1 nodes of T and the time spent at each node is proportional to the size of the alphabet which is a constant 29 It is independent of the number of possible flags the size of S s EHO OOG Supposing that the tree store a well known and exhaustive set S of style flags and not words contained in any text the difference with a classic pattern matching problem is that we know that a flag f will match That we want to know is with which flag s it has matched to return the corresponding numeric value When a flag is read from the file a search is performed in T for a flag f by tracing down from the root the path indicated by the characters in When external node is reached then we know which flag is in question and the corresponding hexadecimal value is returned But it is not necessary to put in S all the existing flag It is much convenient to put only those that are used in my corresponding rules see chapter 6 Then if we terminate in an internal node fis not in 8 and the value 0 is returned Supposing later it s turned out that other flags have to be considered because my rules was not exhaustive or the UsiXML language evolves they could be added to the tree Moreover all the flag whose numeric values are equals to zero 0x00000000 are needless and can be suppressed from the tree In fact it is even not necessary to che
36. it is initially minimized SystemMenu Boolean If true the window has a system menu box in its caption bar implies Caption true You can then close or minimize the dialog move it around the display using the keyboard etc A popup window has often just the Close option ThickFrame Boolean If true a thick frame is added so the user can resize the dialog box and the Size option in the system menu is enabled VerticalScrollBar Boolean If true a vertical scroll bar is added at the right of the window Also valid for child windows a scroll bar can be added to a multiline edit control with the automatic scrolling style and to a list box Visible Boolean Specifies the initial state of the window If true this ensures for example that a control is visible when the dialog box is displayed The remaining attributes adds extended styles to the window ClientEdge Boolean If true the client area of the window has a 3D look that is a border with a sunken edge DialogModalFrame Boolean If true the window has a double border that may optionally be created with a title bar if Caption true StaticEdge Boolean If true the window has a three dimensional border style intended to be used for items that do not accept user input WindowEdge Boolean If true the window has a border with a raised edge AcceptFiles Boolean If true the window accepts drag and drop files AppWindow Boolean If true f
37. it is not naturally duplicated information The two formats are additive the number represents the other flags that are not textually specified whose numeric values are added to form this number Concerning the style illustrated above Resource Hacker gives 5001284 when Resource Tuner gives ws TABSTOP 0x00010000 and oxoo002B4c plus implicitly 5 0x40000000 and ws visiBLE 0x10000000 seeing that it uses of the shortcut notation To know if a flag used in my derivation rules is specified for a particular control or dialog box all I have to do is to check if an individual bit is positioned to 1 at a specific position The following is my method which read bits by using some Java bitwise operators For example readBits 0 3 returns the number formed by tree first bits of x n gt l is used when mutual exclusive flags are specified by a group of bits and readBits x 5 1 returns 1 if the bit at the fifth position is 1 or O if this bit is 0 bits eNe posicion pinia 20 lt lt salie loire lere fillino aim wilen zeros gt gt gt cire bles icine mitch Zeros amp bitwise AND bitwise complement prefix unary operator public int readBits int x short p short returni x gt gt gt rien amp 0 lt lt The expression x gt gt gt p 1 n shifts the selected bits to the right of the word 0 is a wo
38. private Vector children new Vector 1 Default constructor used for the root which store no character public TNode label Constructor with parameter public TNode char label c Set a numeric flag value to the node public int getFlagValue return flagValue Set a numeric flag value to the node public void setFlagValue int flagValue v Return the label at this position in the tree public char element return label Return a vector containing the children of the node public Vector getChildren return children Suppress all the children of the node public void suppressChildren children new Vector 1 For verification public String toString return label flagValue 150 Appendix D RK IK RR KK IK IK RK IK e e ke k ke kk kk kk ko KR ke k IK IR KA AR kk kk RR ke IK IR RK RRR ko IO IR KK RR IR IO OR OR OK RR RK AK OK k k k k A Grafi java Author Julien Marion This class is used to implement my transformation rules and contain the interface with the code of GrafiXML J RRR RRR RK KR KK kk ok kk oko k kk ok kk e e ek kk oko kk oko HRK oko kk oko koe k k package importresources Import declaration of package be ac ucl isys grafixml gui editor component be will be defined here See http www usixml org javadocs grafixml public class Grafi
39. the window is deactivated The dialog is then always displayed in the application This style does not prevent the user from accessing other windows on the desktop It is often used to signal there is a problem from the system like lack of resources no memory Transparent Boolean If true the window is transparent That is any windows that are beneath the window are not obscured by the window DIALOG This class defines a dialog box which is used to communicate with the user and to supply services that are too complicated to be in a menu It s a temporary subsidiary window and takes form of a pop up window containing various child window controls through which the user interacts DIgID either a unique name or a unique 16 bit unsigned integer value in the range 1 to 65 535 This unique identifier often a number is the reference of the program to identify the dialog box Extended Boolean If true it s an extended dialog i e with extended window styles X Integer 105 Appendix C Specifies the X coordinate in horizontal dialog units of the upper left corner of the dialog box relative to the client area of its parent when the dialog box is invoked by the program Y Integer Specifies the Y coordinate in vertical dialog units of the upper left corner of the dialog box relative to the client area of its parent when the dialog box is invoked by the program Width Integer Specifies the width of the dialo
40. v setFlagValue value Add the value in v private TNode expand TNode v String s TNode w null if isExternal v for int i 0 i lt s length i new TNode s charAt i v getChildren addElement V else v is an internal node and its children are not labelled with the first character of s Vector children v getChildren int i 0 while i children size amp amp TNode children elementAt i element s charAt 0 i TNode u new TNode s charAt 0 children insertElementAt u i if s length gt 1 w expand u s substring 1 else w u return w private void compress Vector p u getChildren for int i 0 i lt p size i TNode v TNode p elementAt i if isInternal v Vector q v getChildren TNode w v while isInternal w amp amp q size 1 amp amp w getFlagValue 0 TNode q elementAt 0 149 Appendix D w getChildren if isExternal w is a leaf and the chain of nodes after v consists of redundant nodes v setFlagValue w getFlagValue v suppressChildren else q size gt 1 w getFlagValue 0 compress Jl i SS ee eee Test wether node v is a leaf a ae tita oo i et oo om io i private boolean isExternal TNode v return v getChildren isEmpty a C Test wether node v is an internal node ll a a priv
41. 0 SZT T 0158 1 SM 378151 SM SM Nuni381NvM 53 70825 01 53 1431 53 EST 4 TOMLNOD 8 or 2 y SM 318ISIA SM SM 1497 SS 211 15 1 sues SW 8 INOJ Sn HST5N3 ONWIGNS HSTISN3 SNY139Vn9NY1 NOLLAVI 4 SM SQ 59 5 5 50 21415 EPZ 0 O Xaso1via SSZ vt 05 92 007 30158 1 SM 318ISIA SM q3IHO SM 5 58 19948 1044405 9 OOT dO1S8V1 SM 3 GISIA SM SM NOLINGHSNds30 58 NOLLNG ANE 710u1NO2 106 Or v o1savi sal dnouo SM 1 3 8ISIA SM 197142 SML DALIT 58 58 OEC 5q93 9508 TOMINOO ZT St pz 64 4015991 SM SM 378151 d L SM 53 1497 3 SZZ 1081NO2 8 oc 97 5 41089 SM 318ISIA SM SM LAIT SS 2 15 1 9z15 SM 439308 HO SM 53 1431 s3 422 TOULNOD 8 oz IHD SM 1431 SS DIAVAS T 25 4919 sues SH 8 INOJ Sn HSD5N3 ONVIANS HSNONS SNY139Vn9NY1 uoneyuspur NOILdV2 nN3WSAS SM NOLLdV2 SM ndOd SM INVASION sa TIALS SS SST 97 5O1VIG 32158 1 Et at 8 s anouo SM 3781511 SM coperte ZT
42. 0x00000001 Alignment left lt style gt LVS_ALIGNLEFT 0x00000800 Alignment top lt style gt LVS_ALIGNTOP 0x00000000 EditLabels true lt style gt LVS_EDITLABELS 0x00000200 OwnerData true lt style gt LVS_OWNERDATA 0x00001000 ShareImageLists true lt style gt LVS_SHAREIMAGELISTS 0x00000040 ShowSelectionAlways true lt style gt LVS_SHOWSELALWAYS 0x00000008 SingleSelect true lt style gt LVS_SINGLESEL 0x00000004 SortAscending true lt style gt LVS_SORTASCENDING 0x00000010 SortDescending true lt style gt LVS_SORTDESCENDING 0x00000020 CheckBoxes true ex style LVS_EX_CHECKBOXES 0x00000004 OneClickActivate true ex style LVS_EX_ONECLICKACTIVATE 0 00000040 TrackSelect true lt ex_style gt LVS_EX_TRACKSELECT 0x00000008 TwoClickActivate true ex style LVS_EX_TWOCLICKACTIVATE 0x00000080 AutoArrange true lt style gt LVS_AUTOARRANGE 0x00000100 NoLabelWrap true lt style gt LVS_NOLABELWRAP 0x00000080 NoScroll true lt style gt LVS_NOSCROLL 0x00002000 NoColumnHeader true lt style gt LVS_NOCOLUMNHEADER 0x00004000 NoSortHeader true lt style gt LVS_NOSORTHEADER 0x00008000 OwnerDrawFixed true lt style gt LVS_OWNERDRAWFIXED 0x00000400 FullRowSelect true lt ex_style gt LVS_EX_FULLROWSELECT 0x00000020 GridLines true ex style LVS_EX_GRIDLINES 0x00000001 HeaderDragDrop true style LVS_EX_HEADE
43. 0x0000000A is also possible but this flag is obsolete For this type of control a remark must be mentioned with text val Text When defining an SS ICON static control in the template the icon must be defined elsewhere in the resource file As I noted earlier the icon resource name must be specified as the text for the control When the icon s name is a number I notice that there are no more quotes in the template For example we can have the line CONTROL 10 1 STATIC WS CHILD WS VISIBLE SS ICON WS GROUP 5 10 15 20 and elsewhere the resource file 10 Icon MyIcon ico Same remark than for an icon 42 Class HEADER lt class gt SysHeader32 Attributes Buttons true lt style gt HDS_BUTTONS 0x00000002 DragDrop true lt style gt HDS_DRAGDROP 0x00000040 FilterBar true style HDS_FLAT Flat true lt style gt HDS_FILTERBAR FullDrag true lt style gt HDS_FULLDRAG 0 00000080 Hidden true lt style gt HDS_HIDDEN 0x00000008 Horizontal true style HDS_HORZ HotTrack true lt style gt HDS HOTTRACK 0x00000004 Class REBAR lt class gt ReBarWindow32 Attributes AutoSize true lt style gt RBS_AUTOSIZE 0x00002000 BandBorders true lt style gt RBS_BANDBORDERS 0x00000400 DoubleClickToggle true lt style gt RBS_DBLCLKTOOGGLE 0x00008000 FixedOrder true lt style gt RBS_FIXEDORDER 0 00000800 NoDi
44. 167 65 56 8 AUTORADIOBUTTON HTML amp Macro 103 167 75 56 8 LTEXT 1 118 86 195 1 SS ETCHEDHORZ LTEXT Specify the Color Swatch Size for Clipboard Copies 1 125 90 165 8 ICON 2000 1 130 103 18 20 LTEXT amp Width 1 167 103 22 8 EDITTEXT 104 193 100 30 12 ES AUTOHSCROLL ES NUMBER CONTROL Spini 106 msctls updown32 0x000000B7 222 100 10 12 LTEXT amp Height 1 167 115 22 8 EDITTEXT 105 193 114 30 12 ES AUTOHSCROLL ES NUMBER CONTROL Spin2 107 msctls updown32 0x000000B7 222 114 10 12 LTEXT 1 118 129 195 1 NOT WS GROUP SS ETCHEDHORZ ICON 2815 1 130 131 18 20 AUTOCHECKBOX amp Camera Shutter Sound when Copying 109 167 137 133 8 ICON 2525 1 131 149 18 20 AUTOCHECKBOX amp Sounds with Warning Dialog Boxes 110 167 154 126 8 Dialog 1000 n General C Launch Multiple Instances C Place Icon in Taskbar Tray Confirm Program E xit Select the Type of Macro to be Copied to Clipboard RGB Macro Hexadecimal O HTML Macro Specify the Color Swatch Size for Clipboard Copies Widh 002 Height 0 FI bi 4 Camera Shutter Sound when Copying Sounds with Warning Dialog Boxes It happens that styles are expressed with hexadecimal number instead of flag identifiers In reality a flag correspond to a bit or a group of bits for some mutual excusive flags positioned in a word of 32 bits in memor
45. 50 23 PM Monday June 20 2005 AppCanParse Boolean The user may want to edit the date value of the control A DTP control is equipped to verify the types of values that can be entered If true doesn t let the control to make this task but allows the owner to parse user input and take necessary action It enables users to edit within the client area of the control when they press the F2 key Format longDate shortDate shortDateCentury time There are three preset formats available for displaying the date and one for displaying time they cannot be combined JongDate displays the date in long format like Monday June 20 2005 shortDate displays the date in short format like 6 20 05 shortDateCentury is similar except the year is a four digit field like 6 20 2005 time display the time like 7 50 23 RightAlign Boolean By default the DTP control displays a combo box If the user clicks the arrow on the control a drop down month calendar displays see after If true the calendar will be right aligned with the control instead of left aligned which is the default ShowNone Boolean It is possible to have no date currently selected in the control If true the control displays a check box that users can check once they have entered or selected a date Until this check box is checked the application will not be able to retrieve the date from the control because in essence the control has no dat
46. 7 222 100 10 12 LTEXT amp Height 1 167 115 22 8 EDITTEXT 105 193 114 30 12 ES_AUTOHSCROLL ES_NUMBER CONTROL Spin2 107 msctls_updown32 0 000000 7 222 114 10 12 CONTROL 1 STATIC SS_ETCHEDHORZ 118 129 195 1 ICON 2815 1 130 131 18 20 AUTOCHECKBOX amp Camera Shutter Sound when Copying 109 167 137 133 8 ICON 2525 1 131 149 18 20 AUTOCHECKBOX amp Sounds with Warning Dialog Boxes 110 167 154 126 8 Resource Builder 1000 DIALOG 0 0 320 172 STYLE DS SETFONT DS_MODALFRAME WS_POPUP WS_CAPTION CAPTION General FONT 8 MS Sans Serif LANGUAGE LANG_ENGLISH 1 BEGIN CONTROL 1999 65535 STATIC SS_SUNKEN SS_REALSIZEIMAGE 55 WS_CHILD WS VISIBLE 7 7 18 20 CONTROL 2655 65535 STATIC SS_ICON WS_CHILD WS_VISIBLE 132 7 18 20 CONTROL amp Launch Multiple Instances 108 BUTTON BS_AUTOCHECKBOX WS_CHILD WS_TABSTOP WS_VISIBLE 167 5 99 8 CONTROL amp Place Icon in Taskbar Tray 111 BUTTON BS AUTOCHECKBOX WS CHILD WS_TABSTOP WS VISIBLE 167 17 99 8 CONTROL Confirm Program amp Exit 112 BUTTON BS AUTOCHECKBOX WS CHILD WS TABSTOP WS VISIBLE 167 29 79 8 CONTROL 65535 5 55 ETCHEDHORZ 5 CHILD WS VISIBLE 118 40 195 1 CONTROL Select the Type of Macro to be Copied to Clipboard 65535 STATIC SS LEFT WS CHILD WS GROUP WS VISIBLE 125 43 165 8 CONTROL 2535 65535 5 55 ICON WS CHILD WS VISIBLE 130 55 18 20 CONTROL
47. 8 CONTROL HTML amp Macro 103 BUTTON BS AUTORADIOBUTTON WS CHILD WS VISIBLE WS TABSTOP 167 75 56 8 CONTROL 1 STATIC 55 ETCHEDHORZ WS CHILD WS VISIBLE WS GROUP 118 86 195 1 CONTROL Specify the Color Swatch Size for Clipboard Copies 1 STATIC SS LEFT WS CHILD WS VISIBLE WS GROUP 125 90 165 8 CONTROL 2000 1 STATIC SS ICON WS CHILD WS VISIBLE 130 103 18 20 CONTROL amp Width 1 STATIC SS LEFT WS CHILD WS VISIBLE WS GROUP 167 103 22 8 CONTROL 104 EDIT ES LEFT ES AUTOHSCROLL ES NUMBER WS CHILD WS VISIBLE WS BORDER WS 5 0 193 100 30 12 CONTROL Spini 106 msctls updown32 UDS WRAP UDS SETBUDDYINT UDS ALIGNRIGHT UDS AUTOBUDDY UDS ARROWKEYS UDS NOTHOUSANDS WS CHILD WS VISIBLE 222 100 10 12 CONTROL amp Height 1 STATIC SS LEFT WS CHILD WS VISIBLE WS GROUP 167 115 22 8 CONTROL 105 EDIT ES LEFT ES AUTOHSCROLL ES NUMBER WS CHILD WS VISIBLE WS BORDER WS TABSTOP 193 114 30 12 CONTROL Spin2 107 msctls updown32 005 WRAP UDS SETBUDDYINT 005 ALIGNRIGHT 005 AUTOBUDDY 005 ARROWKEYS UDS NOTHOUSANDS WS CHILD WS VISIBLE 222 114 10 12 CONTROL 1 STATIC 55 ETCHEDHORZ WS CHILD WS VISIBLE 118 129 195 1 CONTROL 2815 1 STATIC SS ICON WS CHILD WS VISIBLE 130 131 18 20 CONTROL amp Camera Shutter Sound when Copying 109 BUTTON BS AUTOCHECKBOX WS CHILD WS VISIBL
48. 804 BUTTON BS CHECKBOX WS CHILD WS TABSTOP WS VISIBLE 14 152 30 10 CONTROL 805 BUTTON BS CHECKBOX WS CHILD WS TABSTOP WS VISIBLE 50 152 30 10 CONTROL Chord Chart 30 STATIC 55 CENTER WS CHILD 5 VISIBLE 108 2 68 10 CONTROL 999 STATIC 55 SIMPLE WS CHILD 92 12 116 108 CONTROL amp Close 2 BUTTON BS OWNERDRAW WS CHILD WS TABSTOP WS VISIBLE 222 135 56 14 CONTROL amp Add 1 BUTTON BS OWNERDRAW WS CHILD WS TABSTOP WS VISIBLE 222 153 56 14 CONTROL amp Play 131 BUTTON BS OWNERDRAW WS CHILD WS TABSTOP WS VISIBLE 222 11 56 14 CONTROL amp Insert Chord 105 BUTTON BS PUSHBUTTON WS CHILD WS TABSTOP 5 VISIBLE 222 30 56 14 CONTROL 107 EDIT ES LEFT WS CHILD WS BORDER 5 TABSTOP WS VISIBLE 97 149 88 12 CONTROL 109 BUTTON BS AUTOCHECKBOX BS PUSHLIKE WS CHILD WS TABSTOP WS VISIBLE 189 149 13 12 CONTROL amp Edit Diagram 108 BUTTON BS CHECKBOX BS PUSHLIKE WS CHILD WS WS VISIBLE 222 55 56 14 CONTROL 110 LISTBOX LBS MULTICOLUMN LBS NOINTEGRALHEIGHT WS CHILD WS BORDER WS TABSTOP WS VISIBLE 221 73 58 11 END It happens that a dialog box looks different in the resource editor tools but it s especially the case in this example Dialog 22 EN Dialog 22 Chord Builder Chord Builder Fundamental Chord Chart Fundam
49. Boolean Type horizontal vertical sizeBox sizeGrip Alignment left right top bottom bottom Right topLef none Type normal marquee smooth Vertical Boolean Type text frame image enhencedMetafile ownerdraw Sunken Boolean Notify Boolean TextStyle left right center simple leftNoWordWrap undefined NoPrefix Boolean EndEllipsis Boolean PathEllipsis Boolean WordEllipsis Boolean Frame black gray white undefined Rectangle black gray white undefined Etched frame horizontal vertical undefined Icon Boolean Bitmap Boolean Centerlmage Boolean RealSizelmage Boolean RightAdjust Boolean FullDrag Boolean Hidden Boolean Horizontal Boolean HotTrack Boolean TREEVIEW TAB LISTVIEW CheckBoxes Boolean DisableDragDrop Boolean EditLabels Boolean FullRowSelect Boolean HasButtons Boolean HasLines Boolean InfoType Boolean LinesAtRoot Boolean NoHorizontalScroll Boolean NonevenHeight Boolean NoScroll Boolean NoToolTips Boolean RightToLeftReading Boolean ShowSelectionAlways Boolean SingleExpand Boolean TrackSelect Boolean View icon smallicon list report Alignment left top EditLabels Boolean OwnerData Boolean SharelmageLists Boolean ShowSelectionAlways Boolean SingleSelect Boolean SortAscending Boolean SortDescending Boolean CheckBoxes Boolean
50. CHILD WS VISIBLE WS GROUP 67 187 71 8 CONTROL 1152 EDIT ES LEFT ES AUTOHSCROLL WS CHILD WS VISIBLE WS BORDER WS TABSTOP 144 184 164 12 CONTROL 1148 ComboBoxEx32 0x50210042 144 184 164 150 CONTROL Files of amp type 1089 STATIC SS LEFT 55 NOTIFY WS CHILD WS VISIBLE WS GROUP 67 203 71 8 CONTROL 1136 COMBOBOX CBS DROPDOWNLIST WS CHILD WS VISIBLE WS VSCROLL WS TABSTOP 144 201 164 100 CONTROL Open as amp read only 1040 BUTTON BS AUTOCHECKBOX WS CHILD WS VISIBLE WS TABSTOP 144 217 160 8 CONTROL amp Open 1 BUTTON BS DEFPUSHBUTTON WS CHILD WS VISIBLE WS GROUP WS TABSTOP 316 184 50 14 CONTROL Cancel 2 BUTTON BS PUSHBUTTON WS CHILD WS VISIBLE WS GROUP WS TABSTOP 316 200 50 14 The first static control has also the number 1000 as extended style corresponding to WS EX RIGHT which for static controls has the same effect as using 55 RIGHT The hexadecimal number 0 50012 4 for the tool bar control is the same as TBSTYLE TOOLTIPS TBSTYLE WRAPABLE TBSTYLE FLAT TBSTYLE CUSTOMERASE CCS NORESIZE CCS NOPARENTALIGN CCS NODIVIDER WS TABSTOP WS CHILD WS VISIBLE and the number 0 00000200 is the same as WS CLIENTEDGE The number 50210042 for the combo box control correpond to the styles CBS DROPDOWN CBS AUTOHSCROLL WS TABSTOP WS VSCROLL WS VISIBLE and WS CHILD Sixth example gt _TablEdit
51. Height Integer Specifies the height of the child window in dialog box units HelpID Integer Specifies a numeric expression that indicating the identifier of the control during help messages processing Position Integer Is a positive number that defines the order the controls are specified in the resource script file This value is used in conjunction with the Group and TabStop attributes from the WINDOW class The child classes correspond to predefined window classes in Windows used to create child window controls Additional window styles are used to define more precisely the appearance or functionality of these controls BUTTON This class defines a button child window A button control typically provides input to an application by notifying the parent window when the user clicks on the control with a mouse It can be used either alone or in groups and can appear either with or without a label the text is specified in the window class VerticalAlignment center bottom none Places text at the top centers text vertically or places text at the bottom in the button rectangle HorizontalAlignment left center right none Left aligns the text centers text horizontally or right aligns the text in the button rectangle or in the remainder rectangle after removing the check box or radio button Flat Boolean If true the button is two dimensional It does not use the default shading to create a 3 D im
52. Integer Is the number with which the item is identified by the program Text String This is what appears in the menu The string can contain this escape characters Va to right align the following text and X for a tab An ellipsis is habitually added to the end to indicate that a menu item invokes a dialog box An ampersand amp designates the letter that follows as the mnemonic Checked Boolean 174 The corresponding submenu is not displayed when the item is disabled or grayed 135 Appendix C If true a check mark v is to the left of the menu text This is useful to choose different program options from the menu State enabled disabled grayed Menu items can be enabled by default disabled or grayed Enabled or disabled items look the same to the user a disabled item is displayed but it cannot be selected Disabled and grayed item are used when options are not currently valid but a grayed item is displayed in gray text to let the user know the option is not valid Position Integer Each menu item is located in a specific position The leftmost item in the menu bar or the top item in a popup menu has Position 1 The position value is incremented for subsequent items SEPARATOR This class defines an inactive item that serves as a dividing bar between two items Position Integer Each separator is located in a specific position The leftmost item in the menu bar or the top item in a po
53. The context of use related to the notion of task determines the conception choices It is defined by tree elements Context Aware Modelling for Enabling and Leveraging Effective interactiON For more information about this framework see http giove cnuce cnr it cameleon documents html 50 The interactive task will be realized by a particular user stereotype or profile This task will be performed on a particular platform a set of devices and software which enables supporting the interactive task The user is immersed in a physical environment when realizing its task on the platform The FUI is the UI produced at the last step of the reification process It consists of the UI coded in any language like Java HTML or the language used in a resource script file to be interpreted or compiled It is then the operational UI running on a particular computing platform like a PC a Macintosh Mac OS web terminal a pocket PC a mobile phone There is for instance the rendering of the dialog box from my first example that I have simplified The CUI level abstracts a FUI independently of any platform The above push button control labelled Find next is for example abstracted into a button at the CUI level A CUI can also be considered as a reification of an AUI concretizing the UI for a given context of use into Concrete Interaction Objects CIOs so as to define widgets layout and interface navigation Widgets
54. Unsorted tCtri F7 424 MENUITEM SEPARATOR MENUITEM amp 2 Panels tF9 450 POPUP Toolbars lt MENUITEM Archive Toolbar 461 MENUITEM Standard Toolbar 460 MENUITEM SEPARATOR MENUITEM Large Buttons 462 MENUITEM Show Buttons Text 463 MENUITEM SEPARATOR MENUITEM Open Root Folder t 430 MENUITEM Up One Leve I tBackspace 431 MENUITEM Folders History tAlt F12 432 MENUITEM SEPARATOR MENUITEM amp Refresh tCtri R 440 POPUP F amp avorites POPUP amp Tools POPUP amp Help The next example is the options dialog from the File menu of the application It s now Resource Tuner that is used to see the resource 1000 DIALOG 0 0 320 172 STYLE DS SETFONT DS_MODALFRAME WS CAPTION WS_POPUP CAPTION General LANGUAGE LANG ENGLISH SUBLANG ENGLISH US FONT 8 MS Sans Serif CONTROL 1999 1 STATIC SS 55 REALSIZEIMAGE SS SUNKEN 7 7 18 20 ICON 2655 1 132 7 18 20 AUTOCHECKBOX amp Launch Multiple Instances 108 167 5 99 8 AUTOCHECKBOX amp Place Icon in Taskbar Tray 111 167 17 99 8 AUTOCHECKBOX Confirm Program amp Exit 112 167 29 79 8 LTEXT 1 118 40 195 1 NOT WS GROUP 55 ETCHEDHORZ LTEXT Select the Type of Macro to be Copied to Clipboard 1 125 43 165 8 ICON 2535 1 130 55 18 20 AUTORADIOBUTTON amp RGB Macro 101 167 55 52 8 WS GROUP AUTORADIOBUTTON He amp xadecimal 102
55. WS_VSCROLL WS_TABSTOP 0x00000042 144 184 164 150 LTEXT Files of amp type 1089 67 203 71 8 55 NOTIFY COMBOBOX 1136 144 201 164 100 CBS DROPDOWN WS VSCROLL AUTOCHECKBOX Open as amp read only 1040 144 217 160 8 DEFPUSHBUTTON amp Open 1 316 184 50 14 WS GROUP PUSHBUTTON Cancel 2 316 200 50 14 WS GROUP For tool bar control wS TABSTOP 0x00002B4C is the same as 0 50012 4 seeing that WS CHILD 0x40000000 and WS_VISIBLE 0x10000000 are implicit with the shorthand notation Restorator 1552 DIALOGEX 0 0 370 237 0 STYLE DS SETFONT DS MODALFRAME DS 3DLOOK DS CONTEXTHELP WS POPUPWINDOW WS VISIBLE WS CLIPCHILDREN WS CAPTION CAPTION Open FONT 8 MS Shell Dig 0 TRUE lt LTEXT Look amp in 1091 4 7 57 8 SS_NOTIFY WS_EX_RIGHT COMBOBOX 1137 66 4 174 300 CBS_DROPDOWNLIST CBS_OWNERDRAWFIXED CBS_HASSTRINGS WS_VSCROLL LTEXT 1088 248 4 80 14 NOT WS_VISIBLE NOT WS_GROUP CONTROL 1184 ToolbarWindow32 WS_TABSTOP 0x00002B4C 4 22 58 208 WS_EX_CLIENTEDGE LISTBOX 1120 66 22 300 156 LBS_SORT LBS_NOINTEGRALHEIGHT LBS_MULTICOLUMN NOT WS_VISIBLE WS_HSCROLL LTEXT File amp name 1090 67 187 71 8 SS_NOTIFY EDITTEXT 1152 144 184 164 12 ES_AUTOHSCROLL CONTROL 1148 ComboBoxEx32 WS_VSCROLL WS_TABSTOP 0x00000042 144 184 164 150 LTEXT Files of amp type 1089 67 203 71 8 SS_NOTIFY COMBOBOX
56. a resource file to the CUI model We cannot come to the conclusion when analysing correspondences that the language specific to the resources is covered by UsiXML Some properties of elements composing a Windows user interface could still be generalised The UsiXML language is still currently in development and may then evolve in the future In addition the layout defined for a dialog box is different box mechanism instead of relative coordinates which complicates its exact restitution 9 But documentation is turned out to be more difficult to find on the web for example and the format of such files cannot be obtained by decompilation using a PC 83 This work is concretized by the implementation in Java of a reverse engineering tool intagreted into GrafiXML and capable of extracting the model from a given resource file Unfortunately algorithm for the construction of boxes will be not implemented This evolution can be imagined as a future work A simple solution at the present time is to let the user draw manually the boxes in the reproduced dialog box the relative coordinates can be still used to generate object in the composer of GrafiXML The layout will be then automatically specified in UsiXML in the XML editor The current implementation makes also the assumption that each resource is separated by an empty line in the resource file as it s the case in files generated by the proposed decompilation tools This choice has been made f
57. a child combo box and perform owner draw tasks based on the assigned image list If an image list is not assign to the control it displays item text only 129 A metafile is a collection of structures that store a picture in a device independent format Device independence is the one feature that sets metafiles apart from bitmaps drawback they are generally drawn more slowly than bitmaps so if an application requires fast drawing and device independence is not an issue it should use bitmaps instead of metafiles The given text of the control is the name of a metafile An enhanced metafile static control has a fixed size The metafile is scaled to fit the static control s client area 159 Messages with STN_CLICKED STN_DBLCLK STN_DISABLE STN_ENABLE notifications 116 Appendix C Several attributes exist to define more precisely its layout The first defines the basic text styles for static controls TextStyle left right center simple leftNoWordWrap undefined As in edit child window the three first values specify if the text is left justified right justified or centered in the rectangle Words that extend past the end of a line are automatically wrapped to the beginning of the next line Words that are longer than the width of the control are truncated simple designates a simple rectangle and displays a single line of left justified text in the rectangle The line of text cannot be shortened or altered in any way
58. a familiar use of the term Here is a diagram 5 of the most traditional form of reverse engineering which is an in depth analysis usually starting with source code performing abstraction From the free on line dictionary of computing http foldoc doc ic ac uk foldoc alteration re think Reverse Engineering Forward Engineering Requirements i abstraction RSR refinement Implementation Implementation Existing system Target system compare cm functionality quality The most traditional method of development is referred to as forward engineering In the construction of UI designers develop a product by implementing engineering concepts and abstractions By contrast reverse engineering begins with final product and works backward to recreate the engineering concepts Due to the rapid changes and evolution of organisations and their business activities the challenge is to quickly adapt their UIs of their interactive applications to these changes Rather than create a new system reengineering can be used to redesign the existing system Note that reengineering involves reverse engineering followed by forward engineering It is not a super type of the two The goal of maintenance in software engineering is to obtain a new version which responds some modification requests There are tree types of modification a correction of detected faults an improvement to have a better quality performance usab
59. after receiving WM_COMMAND the parent window send BM_SETCHECK message to the child control 110 Appendix C 3state Boolean If true the box can display a third state it can be dimmed as well as checked A grey colour within the check box indicates to the user that the box cannot be checked i e that it is has been disabled RightButton Boolean If true positions the check box s square on the right side of the button rectangle the text appears to the left PushLike Boolean If true makes a check box look and act like a push button The button looks raised when it isn t pushed or checked and sunken when it is pushed or checked RADIOBUTTON A radio button looks like a check box except that it uses a circle rather than a box A dot within the circle indicates that it has been checked Text is usually displayed to its right Only one check may be made if there are multiple buttons groups of radio buttons are conventionally used to indicate mutually exclusive options Unlike check boxes they do not work as toggle that is when you click it a second time its state remains unchanged Auto Boolean Hado If true when the user selects it the system automatically sets the button s check state to checked and automatically sets the check state for all other buttons in the same group to cleared RightButton Boolean If true positions the radio button s circle on the right side of the button recta
60. character width 101 One vertical dialog unit is equal to 1 8 of the character height 102 This is a proportional font based on the Windows character set and is used by the operating system to display window titles menu names and text in dialog boxes The System font is always available Other fonts are available only if they have been installed 103 This is a monospace font compatible with the System font 16 bit versions of Windows 106 Appendix C LocalEdit Boolean If true directs edit controls in the dialog box to allocate memory from the application s data segment Otherwise edit controls allocate storage from a global memory object ModalFrame Boolean Dialog boxes are either modal or modeless If true it s a modal dialog box with a thick border It demands the user s attention before anything else can be done when displayed the user cannot switch between the dialog box and the window that created it the user must explicitly end the dialog box for instance by clicking the Cancel button The user can however switch to another program while displayed If false it s a modeless dialog box allowing the user to still work on the parent window It is similar to normal window usually with a caption bar and a system menu and is preferred when the user would find convenient to keep the dialog box displayed for a while NoFailCreate Boolean If true creates the dialog box even if errors occur for example if a child
61. default each column has a header in report view headers 155 Tf true avoids displaying column NoSortHeader Boolean If true column headers do not work like buttons This style can be used if clicking a column header in report view does not carry out an action such as sorting OwnerDrawFixed Boolean 1 If true the owner window can paint items in report view x The following attributes enable enhanced options in report view FullRowSelect Boolean If true when a row is selected all its fields are highlighted item and subitems 5 GridLines Boolean If true displays gridlines around rows and columns HeaderDragDrop Boolean If true enables drag and drop reordering of columns in the control SubItemImages Boolean If true allows images to be displayed for fields beyond the first subitems HEADER 155 Tf the user clicks one of them the list is sorted based on the sort criterion specified for the associated column 156 T response to WM DRAWITEM messages 157 A subitem is a string that in report view is displayed in a column separate from the item s icon and label items have the same number of subitems determined by the number of columns in the control 127 Appendix C A header control is a window that is usually positioned above columns of text or numbers It contains a title for each column The user can drag the dividers that separate the parts to set the width of
62. e e e e e e kk oko RK A HRK A kk oko AK package importresources public class Resource private int line private String id private char type D for DIALOG or DIALOGEX M for MENU private boolean selected public Resource int 1 String i char t line 1 id i type t selected false public int getLine return line public String getId return id public char getType return type public boolean isSelected return selected public void select selected true public void unselect selected false retirer pour tests public String toString String t if type D t dialog box else t menu return t at line line id 145 Appendix D J BRK RRR RK KK kk kk kk kk ko KR kk ke kk kk kk KKK k e kk kk kk kk Ck RR kk ke IR IR RK RR k e ko IR OR KK RR IR IO OR A RR k k k kk OK k k ke ResourcesSelection java Author Julien Marion Define the window used to let the user to select the resources that will be processed and generated into GrafiXML J RRR kk RK KR KKK kk oko A ko kk Ck ok kk e e e e e oko kk oko kk kk oko HRK kk ek Ke k k package importresources import java awt Color import java awt Component import java awt Dimension import java
63. each type of resource 49 5 UsiXML The first section of this chapter presents UsiXML User Interface eXtensible Markup Language and its levels of abstraction The second section gives the UML diagram modelling the Concrete User Interface level In the previous chapter I have seen the language used in a Windows resource file The goal of the next chapter will be to make an abstraction from the Final User Interface level expressed in this language up to the Concrete User Interface level expressed in the UsiXML language 5 1 Structure of UsiXML UsiXML is then not a new language for UI implementation but a User Interface Description Language UIDL based on XML It specifies the multiple models involved in UI design which are structured according the layers of the Cameleon reference framework To talk about the UsiXML language this framework has first to be presented The following illustrates the development process for two contexts of use Four layers development steps compose the framework Task and Concepts T amp C Abstract User Interface AUD Concrete User Interface CUI and Final User Interface FUD Source context Target context Task amp Concepts gt Task Concepts Abstract UI i Abstract UI Concrete Ul Concrete UI Final UI Final UI 5 Abstraction Reification pu Translation The Cameleon framework is intended to express the UI development life cycle for context sensitive interactive applications
64. for other child windows often toolbar controls A rebar control hosts one or more bands and each band can have any combination of a gripper bar a bitmap a text label and a child window However bands cannot contain more than one child window With both toolbar and rebar controls applications are more flexible Toolbars can be moved repositioned minimized and maximized within the rebar control This is for example a rebar control with two bands one that contains a combo box and another that contains a toolbar J sS E3 E3 83 AutoSize Boolean If true the layout of a band will automatically change when the size or position of its control changes BandBorders Boolean If true the rebar control displays narrow lines to separate adjacent bands DoubleClickToggle Boolean If true the rebar band will toggle its maximized or minimized state when the user double clicks the band Otherwise the maximized or minimized state is toggled when the user single clicks on the band FixedOrder Boolean If true the rebar control always displays bands in the same order A user can move bands to different rows but the band order is static 130 Appendix C NoDivider Boolean If true prevents a two pixel highlight from being drawn at the top of the control RegisterDrop Boolean If true the control generates notification messages when an object is dragged over a band in the control VarHeight Boolean If tr
65. in the application 1 They learn each window screen in an application and each object within that window 13 resources a user defined resource also called a custom resource can be used to attach any data in a convenient format required by a specific application These resource are defined in a resource script file rc This file is an ASCII text file It contains representations of the resources that can be expressed in text such as menus and dialog boxes It also contains references to binary files that contain non text resources such as icons and customized mouse cursors All resources in a resource script file are defined using identifiers that together with the type of the resource being referenced uniquely identify each resource in an application Once compiled the resources are binary data The binary compiled resource file res is then added to the executable file The resources appended to an executable can be extracted thanks to existing freeware utilities I propose in the next section those that I ve used Thanks to these tools image resources such as cursor icon bitmap gif avi and jpg files can be viewed audio resources such as wav and midi files can be played and the other type of resources such as accelerator table menu dialog string table and version information can be viewed as decompiled resource scripts Menus and dialog boxes can also be viewed as they would appear in a running application Thes
66. instead of vertical dashes and the selection range is highlighted FixedLenght Boolean If true allows the size of the slider to be changed NoThumb Boolean If true the track bar control does not display a slider NoTicks Boolean If true the control does not display any tick marks Orientation horizontal vertical The track bar control can be oriented horizontally this is the default orientation or vertically Reversed Boolean Normally it is assumed that zero 0 percent is at the top of a vertical slider and at the left of a horizontal slider This causes a problem when the slider s maximum 100 percent is at the top or left side If true switches the values for the minimum and maximum slider positions It has no effect on the control but is simply a label that can be checked to determine whether a track bar is normal or reversed TickMarks bottom top left right both The slider is configured with a set of values from a minimum to a maximum Therefore the user can specify a value included in that range Equipped with tick marks the slider can be used to control exact values that the user can select in the range bottom and top cause tick marks to be displayed below or above a horizontal track bar control left and right cause tick marks to be displayed to the left or to the right of a vertical track bar control both causes tick marks to be displayed on both sides of the control There are examp
67. is not already in the trie and we stop at an internal node v before reaching the end of s A new chain of nodes descendents of v is created to store the remaining characters of s the last contains val It still remains potential space inefficiency in this scheme the tree will often terminate with long branches of linearly arranged nodes because common prefix of the style flags are usually short Indeed there is no need to continue to access the character stored in the nodes to compare with those of the input string when we reach a certain level of the tree the matching flag can already be identified When each node except a leaf of a subtree has only one child only the top node the root of this subtree should be conserved and the existence of other nodes being connected below is a waste But care must be taken if a node between the root of this subtree and the leaf store a flag value different from zero all its ancestors must also be conserved If not a flag representation in the trie is lost and an erroneous value will be returned the value of the flag having same prefix when searching the lost flag To compress the trie we could use an iterative algorithm For each node starting from a leaf we suppress the node if its parent has just one child and store zero as flag value or else we set its flag value to the one stored by the initial leaf But this supposes to use for example a preorder traversal to access each external node We must a
68. lt style gt ES_NUMBER 0x00002000 WantReturn true lt style gt ES_WANTRETURN 0 00001000 OEMConvert true lt style gt ES_OEMCONVERT 0x00000400 Class RICHEDIT class RICHEDIT ou RichEdit20A reshack Attributes DisableNoScroll true lt style gt ES_DISABLENOSCROLL 0x00002000 NoCallOlelnitialize true ex style ES_EX_NOCALLOLEINIT 0x01000000 NoIME true lt style gt ES_NOIME 0x00080000 SelfIME true lt style gt ES_SELFIME 0x00040000 Sunken true lt style gt ES_SUNKEN 0x00004000 Vertical true lt style gt ES VERTICAL 0x00400000 Class PROGRESSBAR lt class gt msctls_progress32 Attributes Type marquee lt style gt PBS_MARQUEE 0x00000008 Type smooth lt style gt PBS_SMOOTH 0x00000001 Vertical true lt style gt PBS_VERTICAL 0x00000004 Class STATIC class STATIC 41 Attributes lt style gt SS_ENHMETAFILE 0x0000000F Type enhencedMetafile style 55 OWNERDRAW 0x0000000D Type ownerdraw style 55 SUNKEN 0x00001000 Sunken true style SS NOTIFY 0x00000100 Notify true style 55 LEFT 0x00000000 Type text amp TextStyle left style 55 RIGHT 0x00000002 Type text amp TextStyle right style 55 CENTER Type text amp TextStyle center lt style gt SS_SIMPLE 0x00000001 Type text amp TextStyle simple lt style gt SS_LEFTNOWORDWRAP 0x00
69. notation is treated as if it was defined with the generic notation the default flags are added in addition to those specified to the value storing the styles before the transmormation in GrafiXML is processed I call then a method to apply my derivation rules and to generate into GrafiXML the corresponding objects This method is in separated class which uses the package be ac ucl isys grafixml gui editor containing the methods needed to create and manage CIOs The entire interface with the GrafiXML s methods is confined in one specific class which will facilitate future modifications The resources of type menu are easier to parse and to generate See http www usixml org javadocs grafixml be ac ucl isys grafixml gui editor package summary html 82 7 Conclusion My thesis is focused to the reverse engineering of a given Windows resource file The scope of the analysis is then limited to Windows user interfaces I could have iterated the method used with other types of resource file as for example with Apple resource There is a possible loss of information between the original interface perceived by the user and the interface described only by a resource script file without looking at source code of the application The file used contains only text resources principally dialog boxes and menus The non text resources appended to an application are stored in separated binary files Icons are examples of loss at the pr
70. one It is uncommon to see menu items directly in a menu bar represented by the aggregation relationship but it s a valid composition 4 2 2 Dialog boxes class diagram Note that here I still include the relationships named Glue To and Regroup because they can be deduced from the positions and dimensions of controls specified in the file even if these relationships are not explicitly specified 26 WINDOW Text String GeneralStyle popup overlapped child Border Boolean Caption Boolean ClipChildren Boolean ClipSimblings Boolean Disabled Boolean DialogFrame Boolean Group Boolean TabStop Boolean HorizontalScrollBar Boolean MaximizeBox Boolean Maximized Boolean Boolean Boolean SystemMenu Boolean ThickFrame Boolean VerticalScrollBar Boolean Visible Boolean ClientEdge Boolean DialogModalFrame Boolean StaticEdge Boolean WindowEdge Boolean AcceptFiles Boolean AppWindow Boolean ControlParent Boolean ExContextHelp Boolean Layered Boolean LayoutRTL Boolean Left Boolean LeftScrollBar Boolean LTRReading Boolean MDIChild Boolean NoActive Boolean NolnheritLayout Boolean NoParentNotify Boolean Right Boolean RightScrollBar Boolean RTLReading Boolean ToolWindow Boolean TopMost Boolean Transparent Boolean DIALOG DigiD Extended Boolea
71. parent node 80 Algorithm match lt trie root lt 0 repeat success lt false for each child w of v do if w label then lt success lt true lt 1 break of the for loop until f length or not success return v flagValue Remark In the shortcut notation cBs 5 binary value 01 is a default flag for a control of type I suppose that this default can be automatically inhibited by the RC compiler if CBS_DROPDOWN binary value 10 or CBS_DROPDOWNLIST binary value 11 are specified the 3 flags are mutual exclusive and grouped in two first bits because I ve remarked in the rc files relative to my first example that Restorator specify only 5 should add the binary value 10 to the default that gives the value of CBS_DROPDOWNLIST while Resource Tuner specify NOT CBS 5 CBS DROPDOWN add 10 to the default and subtract 01 that gives 10 A corrective operation must substract 1 to the style if NOT CBS_SIMPLE is not specified in the control definition line For the others default flags see section 4 3 2 there is no problem because they are not mutually exclusive with other flags and the only way to cancel their effect is to use the Nor keyword that is one bit is reserved to them they are not part of group of bits But the simpler solution is to use the OR bitwise operation instead of an addition as probably the RC compiler does I
72. purchasing an application the executable is often supplied to an organisation without any source code Or the source code can also be lost If we want to get a version with an interface in a more adapted language correct errors and limitations in the existing interface or still transform or redesign an obsolete product into a useful one by adapting them to a new platform the only way to present the information in a language that a programmer can understand is to have recourse to the software decompilation translating binary code into source code But the interpretation is a tedious task since original comments and specifications are not present in the resulting code The general purpose of reverse engineer a UI which is the subject of my thesis is to examine an existing application s UI in order to extract an abstract representation The method will be able to provide an automated way to extract relevant information and in case of poor or non existent documentation of the code this also economizes efforts to generate an additional view more synthetic of the UI that will aid its review or modification and to facility reuse This contributes to the purpose of reengineer a UI which is the transformation of the UI for another platform I describe in this thesis an approach to reverse engineer the UI of applications designed for a desktop machine directly from the executable file A subsequent forward engineering process can be triggered Ins
73. steps to access a menu Typically the buttons in a toolbar correspond to items in the main menu providing an additional way for the user to activate an application s commands Each button can include a bitmapped image but also a string in addition to or instead of the image ALTDrag Boolean 158 In fact this does not hide the control Instead when the message is send to a header control to know its layout the control returns zero as height It is hide by setting its height to zero 128 Appendix C If true allows users to change a toolbar button s position by dragging it while holding down the ALT key Otherwise the user must hold down the SHIFT key while dragging a button The Adjustable attribute must be true to enable buttons to be dragged CustomErase Boolean If true the control notifies its parent window about drawing operations when the window background must be erased for example when a window is resized to prepare an invalidated portion of a window for painting Toolbar controls support a transparent look that allows the client area under the toolbar to show through There are two kinds of transparent toolbars ones with flat buttons and ones with three dimensional buttons Flat Boolean If true it s a flat toolbar In a flat toolbar both the toolbar and the buttons are transparent and hot tracking is enabled Button text appears under button bitmaps Transparent Boolean If true it s a non fat transpa
74. still used when a file copy is underway 2 AutoPlay Boolean a Ce 166 The control can also display more than one month if its width and height provide space 167 By sending MCN GETDAYSTATE notifications to know how individual days should be displayed 198 An AVI Audio Video Interleaved clip is a series of bitmap frames like a movie 133 Appendix C If true starts playing the animation as soon as the AVI clip is opened Center Boolean If true centers the animation in the animation control s window Transparent Boolean If true allows an animation s background color to match that of the underlying window creating a transparent background 9 CUSTOMCONTROL This class regroups any other controls that may appear in a dialog box So far introduced existing controls corresponding to predefined classes in Windows programming 79 but nothing prevents us from using a customized child window An example is the calendar used by Windows XP in the Date and Time Properties dialog box 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 26 27 28 29 30 31 This class may also include other existing Windows controls not listed here A custom control inherits the attributes specific to the WINDOW class because this is a child control has Style child and the CONTROL class defining its classes position and has one more attribute ClassName ClassName String Designates the name
75. style WS RIGHT 0x00001000 RightScrollBar true ex style WS RIGHTSCROLLBAR 0x00000000 RTLReading true ex style WS RTLREADING 0x00002000 ToolWindow true ex style WS_EX_TOOLWINDOW 120000095 TopMost true style WS_EX_TOPMOST 0x00000008 Transparent tie ex style WS_EX_TRANSPARENT 0200000020 9 For a dialog box the line CAPTION will place that string in the caption of the dialog only if the flag WS_CAPTION is present The value of this flag includes also the WS_BORDER style 37 Remarks When a flag is not specified the corresponding attribute of type Boolean is set to false The flags by default are also denoted in the table They correspond to a null value in bold in the flag value column When nothing else is specified the presence or not of these flags makes no difference since they involve any additionnal value to the style and in any case the associated attribute in the left column has to take the appropriate value Some flags in the table have synonyms WS_CHILD WS_CHILDWINDOW WS_OVERLAPPED WS_TILED WS_MINIMISE WS_ICONIC and WS_SIZEBOX WS_THICKFRAME The definition of WS_DLGFRAME was curiously enought a window with this flag with a thicker frame cannot have a title The problem was that this flag is sometimes specified for a dialog box having still a title bar as in the resource file given by Resource Tuner assoc
76. the dil files used by an application 23 TBSTYLE_WRAPABLE TBSTYLE_CUSTOMERASE and TBSTYLE_FLAT and the number 200 is equivalent to the extended style WS_EX_CLIENTEDGE For the extended combo box the number 50210042 is equivalent to WS_CHILD WS_VISIBLE WS_VSCROLL WS_TABSTOP CBS_DROPDOWN and CBS_AUTOHSCROLL This control superposes the edit control see the size numbers 4 1 6 Sixth example from TablEdit The last example is a dialog box that appears when clicking the New push button from the dialog Chord Manager called up from the Edit menu Chord Builder Chord Builder Fundamental Chord Chart Fundamental Chord Chart mu X fc a Chord Insert Chord Chord M M 9 s Edt Diagram 6 Ninth q ET 12334 Ninth Fora Inversions Inversions Root H X Close Basic Chord Position C1C 2C 3C 4 C 5 When pushing Edit Diagram the dialog box changes of look But all the new emerged controls and those that disappear belong to the same dialog box and are specified in sequence in the resource script file It makes it difficult to know what the dialog look like with only the information below The program determines if a child window is currently hidden and disabled it s not enough to be not visible it has to no longer respond to mouse or keyboard input for example by a call to t
77. the resource file specifying the font and the size to use for text in the dialog box and each of its controls and sometimes weight and italic informations If SetFont true the system selects if possible a font according to the specified font data If ShellFont true the system selects a font using the font data specified in the FontSize Weight and Italic attributes The system font can vary between different versions of Windows So having ShellFont true with FontName MS Shell Dlg for an extended dialog box the application can use the system font no matter which system it is running on The system maps this typeface such that the dialog box will use the Tahoma font on Windows XP and the MS Sans Serif font on earlier systems But ShellFont true has no effect if the typeface is not MS Shell Dlg and the dialog is not extended By default the system draws all text in a dialog box using the default font of the system The system always uses the system font for the dialog box title Most of constraints are already expressed with type declaration with enumerate values For example a menu item can be desabled and grayed in the same time There still exists other contraints between attributes like an attributes that can or not be combined with an other one For example a title bar cannot contain a question mark ContextHelp true with a maximine box or a minimize box MaximizeBox or MinimizeBox true or to make appear tabs at the left sid
78. use some window s frame as thin line border Border true You can see that the tool bar from the fifth uses a border with a Some dialogs do not allow even that the user can switch to another program while displayed the dialog must be ended before the user does anything else in Windows see SysModal 28 sunken edge ClientEdge true That is what the last check box should look like with such frame Wrap around Transform backslash expressions A control can use other window attributes For example it is displayed in gray rather than black when visible and disabled Disabled true Wrap around Transform backslash expressions To illustrate the use of the TAB key and the arrow keys in a dialog box let s go over the first example to see how they are used in a resource file from Resource Hacker CONTROL Fi amp nd what 1 STATIC SS_LEFT WS_CHILD WS_VISIBLE WS_GROUP 5 7 45 8 CONTROL 222 COMBOBOX CBS_DROPDOWN CBS_AUTOHSCROLL WS_CHILD WS_VISIBLE WS_TABSTOP 50 5 145 50 CONTROL Match amp whole word only 232 BUTTON BS_AUTOCHECKBOX WS_CHILD WS_VISIBLE WS_GROUP WS_TABSTOP 5 22 120 10 CONTROL Match amp case 233 BUTTON BS_AUTOCHECKBOX WS_CHILD WS_VISIBLE WS_GROUP WS_TABSTOP 5 34 130 10 CONTROL Regular amp expression 239 BUTTON BS_AUTOCHECKBOX WS_CHILD WS_VISIBLE WS_GROUP WS_TABSTOP 5 46 120 10 CONTROL Wrap aroun amp d 240 B
79. volatile A feedback of users during the development is needful to provide a pleasant interface statically the presentation as dynamically the dialog Traditional process models to lay out the different activities in the development life cycle are also not always appropriated especially for the conception of user interfaces For example the waterfall model is a simple sequential composition of the activities requirements specifications design implementation integration maintenance This model is too general and unrealistic to design user interfaces particularly because it not address early validation To reduce the risk of inappropriate user interface better models still make it possible the creation of interface prototypes and then more interactions with the users during the development For example exploratory models allow successive revisions of the software specifications based on prototypes quickly implemented from which we can obtain users feedback when the expectations are reached we then apply the other traditional software engineering phases Another example is the spiral model allowing an iterative and incremental development certainly the stronger process model to minimize risks The life duration of a product is an important aspect We wish that the code we write for big applications will run for a long time not that it becomes out dated after few years It s also needful to be able to produce a vast range of produc
80. 00 and upper it was MS Sans Serif for older versions The size of the font is always 8 when not specified It s the dimension of the dialog box client area that is specified in a resource file In the CUI model a dialog box or a window has always a caption bar and a border which are included in the dimension a border will be 5 pixels wide and a caption bar will be 30 pixels high Remember that the units of measure are not the same The dimension of a graphical container is expressed in pixels whereas a resource file expresses the measures in horizontal dialog units and vertical dialog units The dimensions in Windows are then defined in term of In reality in the implementation of GraphiXML still currently being implemented It s principally to restore in the composer the same layout that the original dialog box that I have adapted the dimension of the container 67 One horizontal vertical unit equals 1 4 1 8 of an average character width height of the font used 60 characters Three versions of a dialog box with the same specified dimensions but with different font used are illustrated in this paragraph Although it should be possible the system do it l ve not the necessary time and means my thesis to calculate the average character width and height of each existing font considering also the size of the font in order to get the exact dimension of a dialog box in pixels To estimate the values of xChar and yChar in t
81. 00000B Type text amp TextStyle leftNoWordWrap lt style gt SS_NOPREFIX 0x0000000C NoPrefix true lt style gt SS_ENDELLIPSIS 0x00000080 EndEllipsis true lt style gt SS_PATHELLIPSIS 0x00004000 PathEllispsis true style SS_WORDELLIPSIS 0x00008000 WordEllipsis true lt style gt SS BLACKFRAME 0x0000C000 Type frame amp Frame black lt style gt SS_GRAYFRAME 0x00000007 Type frame amp Frame gray lt style gt SS_WHITEFRAME 0x00000008 Type frame amp Frame white lt style gt SS_BLACKRECT 0x00000006 Type frame amp Rectangle black lt style gt SS_GRAYRECT 0x00000004 Type frame amp Rectangle gray lt style gt SS WHITERECT 0x00000005 Type frame amp Rectangle white lt style gt SS_ETCHEDHORZ 0x00000009 Type frame amp Etched frame lt style gt SS_ETCHEDVERT 0x00000010 Type frame amp Etched horizontal lt style gt SS_ETCHEDFRAME 0x0000001 1 Type frame amp Etched vertical lt style gt 55 ICON 0x00000012 Type image amp Icon true style 55 BITMAP 0x00000003 Type image amp Bitmap true lt style gt SS_CENTERIMAGE 0 0000000 Centerlmage true lt style gt SS_REALSIZEIMAGE 0x00000200 RealSizeImage true lt style gt SS_RIGHTJUST 0x00000800 RightJustify true 0x00000400 Class TRACKBAR lt class gt msctls_trackbar32 Attributes AutoTicks true lt style gt TBS_AUTOTICKS 0x00000001
82. 000010 OwnerDrawVariable true lt style gt LBS_OWNERDRAWVARIABLE 0x00000020 HasStrings true lt style gt LBS_HASSTRINGS 0 00000040 NolntegralHeight true lt style gt LBS NOINTEGRALHEIGHT 0x00000100 6 If fact the BS TEXT flag even though it exists is missing most of time So Content text when neither BS_BITMAP nor BS_ICON are present push buttons have this style by default 17 BS USERBUTTON is also possible but this flag obsolete It is provided for compatibility with 16 bit versions of Windows Applications should use BS_OWNEDRAWN instead The value of this flag is 0x00000008 40 UseTabstops true lt style gt LBS_USETABSTOPS 0x00000080 WantkeyboardInput true lt style gt LBS WANTKEYBOARDINPUT 0x00000400 NoData true lt style gt LBS NODATA 0 00002000 NoRedraw true lt style gt LBS_NOREDRAW 0x00000004 Class COMBOBOX Attributes Type Simple lt style gt CBS_SIMPLE 0x00000001 Type DropDown lt style gt CBS_DROPDOWN 0x00000002 Type DropDownList lt style gt CBS_DROPDOWNLIST 0 00000003 Extended false lt class gt COMBOBOX Extended true class ComboBoxEx32 CaseSensitive true ex style CBES EX CASESENSITIVE 0x00000010 NoEditImage true ex style CBES EX NOEDITIMAGE 0x00000001 NoSizeLimit true lt ex_style gt CBES_EX_NOSIZELIMIT 0x00000008 PathwordBreakProc true lt ex_style gt CBES_EX_PAT
83. 000040 Multiline true lt style gt TCS_MULTILINE 0x00000200 Multiline false style TCS_SINGLELINE 0x00000000 MultiSelection true style TCS_MULTISELECT 0x00000004 OwnerDrawFixed true style TCS_OWNERDRAWFIXED 0x00002000 RaggedRight true lt style gt TCS_RAGGEDRIGHT 0x00000800 Right true lt style gt TCS_RIGHT 0x00000002 RightJustify true lt style gt TCS_RIGHTJUSTIFY 0x00000000 ScrollOpposite true lt style gt TCS_SCROLLOPPOSITE 0x00000001 ToolTips true lt style gt TCS_TOOLTIPS 0x00004000 Vertical true lt style gt TCS_VERTICAL 0x00000080 Class DATETIMEPICKER lt class gt SysDateTimePick32 Attributes AppCanParse true lt style gt DTS_APPCANPARSE 0x00000010 Format longDate lt style gt DTS_LONGDATEFORMAT 0x00000004 Format shortDate lt style gt DTS_SHORTDATEFORMAT 0x00000000 Format shortDateCentury lt style gt DTS_SHORTDATECENTURYFORMAT 0x0000000C Format time lt style gt DTS_TIMEFORMAT 0x00000009 RightAlign true lt style gt DTS_RIGHTALIGN 0x00000020 ShowNone true lt style gt DTS_SHOWNONE 0x00000002 UpDown true style DTS_UPDOWN 0x00000001 Class LISTVIEW lt class gt SysListView32 Attributes View icon lt style gt LVS_ICON 0x00000000 View smallIcon lt style gt LVS_SMALLICON 0x00000002 View list lt style gt LVS_LIST 0x00000003 View report lt style gt LVS_REPORT
84. 05 41 65 14 400 DIALOG 30 73 275 84 STYLE DS SETFONT 05 MODALFRAME DS 3DLOOK WS POPUPWINDOW WS CAPTION CAPTION Find FONT 8 MS Shell Dig lt LTEXT Fi amp nd what 1 5 7 45 8 COMBOBOX 222 50 5 145 50 CBS_DROPDOWN CBS_AUTOHSCROLL AUTOCHECKBOX Match amp whole word only 232 5 22 120 10 WS_GROUP AUTOCHECKBOX Match amp case 233 5 34 130 10 WS_GROUP AUTOCHECKBOX Regular amp expression 239 5 46 120 10 WS_GROUP AUTOCHECKBOX Wrap aroun amp d 240 5 58 120 10 WS_GROUP AUTOCHECKBOX Transform amp backslash expressions 241 5 70 160 10 WS_GROUP GROUPBOX Direction 1 135 22 60 34 WS_GROUP AUTORADIOBUTTON amp Up 234 140 30 45 12 WS_GROUP NOT WS_TABSTOP AUTORADIOBUTTON amp Down 235 140 42 45 12 NOT WS_TABSTOP DEFPUSHBUTTON amp Find Next 1 205 5 65 14 WS GROUP PUSHBUTTON amp Mark All 245 205 23 65 14 PUSHBUTTON Cancel 2 205 41 65 14 91 Resource Builder 400 DIALOG 30 73 275 84 STYLE DS 3DLOOK 05 5 DS_MODALFRAME DS_CENTER 5 WS_SYSMENU WS_CAPTION CAPTION Find FONT 8 MS Shell Dig LANGUAGE LANG_ENGLISH 1 BEGIN Appendix B CONTROL Fi amp nd what 65535 STATIC SS_LEFT WS_CHILD WS_GROUP WS_VISIBLE 5 7 45 8 CONTROL 222 COMBOBOX CBS_DROPDOWN CBS_AUTOHSCROLL WS_CHILD WS TABSTOP WS VISIBLE 50 5 145 50 CONTROL Match amp whole word only 232 BUTTON BS AUTOCH
85. 1000 CONTROL H amp ighlight Rectangle 1202 BUTTON BS PUSHBUTTON WS CHILD WS VISIBLE WS TABSTOP 76 175 143 14 0x00001000 CONTROL Static 1219 STATIC 55 CENTER WS CHILD WS VISIBLE WS GROUP 339 7 32 8 CONTROL Static 1218 STATIC 55 CENTER WS CHILD WS VISIBLE WS GROUP 305 7 32 8 CONTROL Static 1217 STATIC 55 CENTER WS CHILD WS VISIBLE WS GROUP 271 7 32 8 CONTROL Static 1216 STATIC 55 CENTER WS CHILD WS VISIBLE WS GROUP 237 7 32 8 CONTROL Static 1215 STATIC SS LEFT WS CHILD WS VISIBLE WS GROUP 7 7 211 124 96 Appendix B Fifth example Resource Tuner 1552 DIALOGEX 0 0 370 237 0 STYLE DS_SETFONT DS_MODALFRAME DS_3DLOOK DS_CONTEXTHELP WS_POPUPWINDOW WS_VISIBLE WS_CLIPCHILDREN WS_DLGFRAME CAPTION Open LANGUAGE LANG_ENGLISH SUBLANG_ENGLISH_US FONT 8 MS Shell Dig LTEXT Look amp in 1091 4 7 57 8 SS_NOTIFY WS_EX_RIGHT COMBOBOX 1137 66 4 174 300 CBS_DROPDOWN CBS OWNERDRAWFIXED CBS_HASSTRINGS WS_VSCROLL LTEXT 1088 248 4 80 14 NOT WS_VISIBLE NOT WS_GROUP CONTROL 1184 ToolbarWindow32 WS_TABSTOP 0x00002B4C 4 22 58 208 WS_EX_CLIENTEDGE LISTBOX 1120 66 22 300 156 NOT WS_VISIBLE LBS_SORT LBS_NOINTEGRALHEIGHT LBS_MULTICOLUMN WS_HSCROLL LTEXT File amp name 1090 67 187 71 8 SS_NOTIFY EDITTEXT 1152 144 184 164 12 ES AUTOHSCROLL CONTROL 1148 ComboBoxEx32
86. 1136 144 201 164 100 CBS_DROPDOWNLIST WS_VSCROLL AUTOCHECKBOX Open as amp read only 1040 144 217 160 8 DEFPUSHBUTTON amp 1 316 184 50 14 WS GROUP PUSHBUTTON Cancel 2 316 200 50 14 WS GROUP gt Resource Builder 1552 DIALOGEX 28 85 370 237 0 EXSTYLE 0 STYLE DS_3DLOOK DS SETFONT DS_MODALFRAME DS_CONTEXTHELP 5 WS_VISIBLE WS_CLIPCHILDREN WS_SYSMENU WS_CAPTION CAPTION Open FONT 8 MS Shell Dig 400 0 0 LANGUAGE LANG_ENGLISH SUBLANG_ENGLISH_US BEGIN CONTROL Look amp in 1091 STATIC SS NOTIFY 55 LEFT WS_CHILD WS GROUP WS_VISIBLE 4 7 57 8 WS EX RIGHT 0 CONTROL 1137 5 OWNERDRAWFIXED CBS HASSTRINGS CBS DROPDOWNLIST WS CHILD WS VSCROLL WS TABSTOP WS VISIBLE CONTROL 1088 STATIC SS LEFT WS CHILD 248 4 80 14 0x0 0 66 4 174 300 0x0 0 CONTROL 1184 ToolbarWindow32 WS CHILD WS TABSTOP WS VISIBLE 0 2 4 4 22 58 208 0 0 0 CONTROL 1120 LISTBOX LBS MULTICOLUMN LBS NOINTEGRALHEIGHT LBS SORT LBS NOTIFY WS CHILD WS BORDER WS HSCROLL 66 22 300 156 0x0 0 CONTROL File amp name 1090 STATIC SS NOTIFY 55 LEFT WS CHILD WS GROUP WS VISIBLE 67 187 71 8 0x0 0 CONTROL 1152 EDIT ES_AUTOHSCROLL ES LEFT 5 CHILD 5 BORDER WS TABSTOP WS VISIBLE 144 184 164 12 0 0 0 CONTROL 1148 ComboBoxEx32 WS CHILD WS VSCROLL WS TABSTOP WS VISIBLE 0 42 144 184 164 150 0 0 0 CONTROL Files of amp type 1089
87. 153 81 Specify the Color Swatch Size for Clipboard Copies Width 32 EX Height 32 EI Camera Shutter Sound when Copying Sounds with Warning Dialog Boxes 1000 DIALOG 0 0 320 172 STYLE DS SETFONT DS_MODALFRAME WS CAPTION WS POPUP CAPTION General LANGUAGE LANG ENGLISH SUBLANG ENGLISH US FONT 8 MS Sans Serif CONTROL 1999 1 STATIC 55 BITMAP 55 REALSIZEIMAGE 55 SUNKEN 7 7 18 20 ICON 2655 1 132 7 18 20 AUTOCHECKBOX amp Launch Multiple Instances 108 167 5 99 8 AUTOCHECKBOX amp Place Icon in Taskbar Tray 111 167 17 99 8 AUTOCHECKBOX Confirm Program amp Exit 112 167 29 79 8 LTEXT 1 118 40 195 1 NOT WS GROUP 55 ETCHEDHORZ LTEXT Select the Type of Macro to be Copied to Clipboard 1 125 43 165 8 ICON 2535 1 130 55 18 20 AUTORADIOBUTTON amp RGB Macro 101 167 55 52 8 WS GROUP AUTORADIOBUTTON He amp xadecimal 102 167 65 56 8 AUTORADIOBUTTON HTML amp Macro 103 167 75 56 8 LTEXT 1 118 86 195 1 SS_ETCHEDHORZ LTEXT Specify the Color Swatch Size for Clipboard Copies 1 125 90 165 8 ICON 2000 1 130 103 18 20 LTEXT amp Width 1 167 103 22 8 EDITTEXT 104 193 100 30 12 ES AUTOHSCROLL ES NUMBER CONTROL Spini 106 msctls updown32 0x000000B7 222 100 10 12 LTEXT amp Height 1 167 115 22 8 EDITTEXT 105 193 114 30 12 ES AUTOHSCROLL ES NUMBER CONTROL Spin2 107 m
88. 19ur jo MALINNIN 8 yIuS ino yeo sdsoyuwe WILINNIW HOLVYVAIS WILINNIW Tr 5714159 WILINNIW OT 2899 981 MALINNIW 10019 WILINNIW 196 99925 WILINNIW HOLVYVAIS WILINNIW 92 spio 99 216691 MALINNIW SEZ 916601 WILINNIW gt PTZ 289129 WALINNIW 222 916601 WELINNAN EZZ iz4 Wusiopeun poog SMOGU WILINNIW PON WILINNIW 01 099 WILINNIW 752 URSS pgeyusurs ut WILINNIW STZ H HOI SORRY WILINNIW STZ ur pure PUL MALINNIN PULL MALINNIN AAHON PULS 42905 40404 lt lt 45 NALINNIW udesgeied SAN NALINNIN OPT n uns nowesssasddn uonsejes s NALINNINW jDeuns sup ugeumgo5 WEES WNALINNIW OT NALINNIN Ez JUBWILPgCD 42019 NALINNIW LvZ 1 puedx3e PET s19 dui05
89. 33 8 CONTROL 2525 65535 5 55 ICON WS CHILD WS VISIBLE 131 149 18 20 CONTROL amp Sounds with Warning Dialog Boxes 110 BUTTON BS AUTOCHECKBOX WS CHILD WS TABSTOP WS VISIBLE 167 154 126 8 END Resource Hacker 1000 DIALOG 0 0 320 172 STYLE DS MODALFRAME WS POPUP WS CAPTION CAPTION General LANGUAGE LANG ENGLISH SUBLANG ENGLISH US FONT 8 MS Sans Serif lt CONTROL 1999 1 STATIC SS_BITMAP SS_REALSIZEIMAGE SS_SUNKEN WS_CHILD WS_VISIBLE 7 7 18 20 CONTROL 2655 1 STATIC 55 WS_CHILD WS_VISIBLE 132 7 18 20 CONTROL amp Launch Multiple Instances 108 BUTTON BS_AUTOCHECKBOX WS CHILD WS VISIBLE WS TABSTOP 167 5 99 8 CONTROL amp Place Icon in Taskbar Tray 111 BUTTON BS AUTOCHECKBOX WS CHILD WS VISIBLE WS TABSTOP 167 17 99 8 CONTROL Confirm Program amp Exit 112 BUTTON BS AUTOCHECKBOX WS CHILD WS VISIBLE WS TABSTOP 167 29 79 8 CONTROL 1 STATIC 55 ETCHEDHORZ WS CHILD WS VISIBLE 118 40 195 1 CONTROL Select the Type of Macro to be Copied to Clipboard 1 STATIC SS LEFT WS CHILD WS VISIBLE WS GROUP 125 43 165 8 CONTROL 2535 1 STATIC SS ICON WS CHILD WS VISIBLE 130 55 18 20 CONTROL amp RGB Macro 101 BUTTON BS AUTORADIOBUTTON WS CHILD WS VISIBLE WS GROUP WS TABSTOP 167 55 52 8 CONTROL He amp xadecimal 102 BUTTON BS AUTORADIOBUTTON WS CHILD WS VISIBLE WS TABSTOP 167 65 56
90. 4 1 1 First example from SOLDE am 19 4 1 2 Second example from 7 Zip File Manager sn nent 20 4 1 3 Tibnrd example from RGB Editt a de 21 4 1 4 Fourth example from WinDirStat ao 22 4 1 5 Fifth example from the Common Dialog Library ssh 23 41 6 example from 24 42 Resource Tiles aUa MPs SE 26 4 2 1 dns 26 4 2 2 Dialog boxes Glass OO CA di ue 26 4 2 3 Documentation E 28 4 2 4 ioni pe 33 4 3 Rs TN SEU ONT 35 4 3 1 Resources of type dialog 35 ADAM template eese et asie 35 Controls definition 39 4 3 2 Shortcut notations in the dialog box template eere tete 45 4 3 3 Resource OL E a tn 46 4 3 4 Other types of seo 47 4 4 About decompilation tools asta tin Pneus aa oa Odit 48 UsiXM 50 5 1 Structure USDA 50 3 2 Concrete User Interface model ts 55 Importing resource files in 59 6 1 Transformation of resources nto CUT
91. AUI can be determined from the task model if a task is decomposed in sub tasks then the parent task is put in a container A set of model to model transformation functions transforming a UsiXML specification into another UsiXML specification is automated in TransformiXML A first arborescence of widgets is then elaborate for each container The CUI is created with graph transformations after choosing the modality A platform and a language are finally chosen to have a FUI by rendering interpretation or code generation In this manner the UI is derived from the task model We reuse what it is made at the previous levels All these tools can be combined and automatism is privileged to keep the model consistent as modifications occur when the requirements change Other path can be followed as well We can use the fact that UsiXML supports a mutli path development of UI The development process can be initiated from any level of abstraction and proceed towards obtaining one or many FUI for various context of use 9 See http www usixml org for the list of these available tools Model to model transformations support any change between models while model to code transformations are associate with code production automated or not 54 InterpiXML TransformiXML QtkXML FlashiXML D 7 UsiXML models UsiXML model Grapl transformations Generative programming NJ UsiXML model Graph transforma
92. AUTO3STATE 0x00000006 RightButton true lt style gt BS_RIGHTBUTTON 0x00000020 PushLike true lt style gt BS_PUSHLIKE 0x00001000 Class PUSHBOX lt style gt BS_PUSHBOX Class CUSTOMBUTTON lt style gt BS_OWNERDRAWN 0x0000000B Class SCROLLBAR class SCROLLBAR Attributes Type horizontal lt style gt SBS_HORZ 0x00000000 Type vertical lt style gt SBS_VERT 0x00000001 Type sizeBox lt style gt SBS SIZEBOX 0x00000008 Type sizeGrip lt style gt SBS_SIZEGRIP 0x00000010 Alignment left lt style gt SBS_LEFTALIGN 0x00000002 Alignment right lt style gt SBS_RIGHTALIGN 0 00000004 Alignment top lt style gt SBS_TOPALIGN 0x00000002 Alignment bottom lt style gt SBS_BOTTOMALIGN 0x00000004 Alignment bottomRight lt style gt SBS_SIZEBOXBOTTOMRIGHTALIGN 0x00000004 Alignment topLeft lt style gt SBS_SIZEBOXTOPLEFTALIGN 0x00000002 Class LISTBOX class LISTBOX Attributes Sorted true lt style gt LBS_SORT 0x00000002 MultipleSelection true lt style gt LBS_MULTIPLESEL 0x00000008 DisableNoScroll true lt style gt LBS_DISABLENOSCROLL 0x00001000 ExtendedSelection true lt style gt LBS_EXTENDEDSEL 0x00000800 Multicolumn true lt style gt LBS_MULTICOLOMN 0x00000200 NoSelection true lt style gt LBS_NOSEL 0 00004000 Notify true lt style gt LBS_NOTIFY 0x00000001 OwnerDrawFixed true lt style gt LBS_OWNERDRAWFIXED 0 00
93. CONTROL 9 402 BUTTON BS AUTOCHECKBOX 5 CHILD WS TABSTOP WS VISIBLE 69 73 21 10 CONTROL amp Inversions 28 STATIC SS LEFT 5 CHILD WS VISIBLE 8 90 63 10 CONTROL 103 5 DROPDOWNLIST WS CHILD WS VSCROLL WS TABSTOP WS VISIBLE 8 101 76 55 CONTROL amp 1 700 BUTTON BS AUTORADIOBUTTON 5 CHILD WS GROUP WS TABSTOP WS VISIBLE 98 149 17 10 CONTROL 2 701 5 AUTORADIOBUTTON WS CHILD WS VISIBLE 116 149 17 10 CONTROL amp 3 702 BUTTON BS AUTORADIOBUTTON WS CHILD WS VISIBLE 135 149 17 10 CONTROL 4 703 5 AUTORADIOBUTTON 5 CHILD WS VISIBLE 154 149 17 10 CONTROL amp 5 704 BUTTON BS AUTORADIOBUTTON 5 CHILD WS VISIBLE 176 149 17 10 CONTROL 106 BUTTON BS GROUPBOX WS CHILD 5 GROUP WS VISIBLE 92 138 116 29 CONTROL 600 SCROLLBAR SBS HORZ WS CHILD WS TABSTOP WS VISIBLE 93 107 81 9 CONTROL 601 SCROLLBAR SBS VERT WS CHILD WS TABSTOP WS VISIBLE 155 56 9 64 CONTROL amp Omit 799 BUTTON BS GROUPBOX WS CHILD WS GROUP WS VISIBLE 8 118 76 49 CONTROL 800 BUTTON BS CHECKBOX 5 CHILD WS TABSTOP WS VISIBLE 14 128 30 10 CONTROL 801 BUTTON BS CHECKBOX WS CHILD WS TABSTOP 5 VISIBLE 50 128 30 10 CONTROL 802 BUTTON BS_CHECKBOX WS CHILD WS TABSTOP WS VISIBLE 14 140 30 10 CONTROL 803 BUTTON BS_CHECKBOX WS CHILD WS TABSTOP WS VISIBLE 50 140 30 10 CONTROL 804 BUTTON BS_CHECKBOX WS CHILD W
94. D n cio name n Width w graphicalContainer width w 4 xChar 2 border width where xChar is the average width of the dialog box font character in pixel box width w 4 xChar Height h graphicalContainer height h 8 yChar title bar height bottom border width where yChar is the average height of the dialog box font character in pixel box height h 8 yChar Text t and Caption true and t null cio defaultContent t FontName n and SetFont true graphicalIndividualConponent textFont n ShellFont true and FontName MS Shell DLG graphicalIndividualConponent textFont Tahoma ShellFont true and FontName MS Shell DLG graphicalIndividualConponent textFont Tahoma FontSize s and SetFont true or ShellFont true graphicalIndividualConponent fextSize s SetFont false and ShellFont false graphicalIndividualConponent textSize 8 textFont Tahoma Extended true and SetFont true or ShellFont true and Weight gt 550 graphicalIndividualConponent isBold true Extended true and SetFon true t or ShellFont true and Italic true graphicalIndividualConponent is talic true Disabled true graphicalCio isEnabled false ThirckFrame true window isResizable true TopMost true graphicalContainer isAlwaysOnTop true I choose Tahoma as default font which is the default system font of Windows 20
95. E WS_TABSTOP 167 137 133 8 CONTROL 2525 1 STATIC 55 ICON WS CHILD WS VISIBLE 131 149 18 20 CONTROL amp Sounds with Warning Dialog Boxes 110 BUTTON BS AUTOCHECKBOX WS CHILD WS VISIBLE WS TABSTOP 167 154 126 8 94 Appendix B Fourth example WinDirStat Edit CleanUp Treemap Report Options Help BABL OAR Subtree Percentage Percentage gt Size Items Last Change M1395 202005585 74 769 11 10 2005 8 12 06 PM E e Documents and Settings 78 5 23 5 GB 25 746 11 10 2005 8 12 06 PM Program Files 10 6 3208 23 73 21 154 11 10 2005 7 56 47PM El WINDOWS 6 8 2 0 GB 13 221 11 10 2005 8 11 14PM lt Files gt 2 9 896 2 44 11 10 2005 10 13 20 E c3 5 8 7 2005 8 17 17 PM ae WinDirStat Settings 11 10 2005 7 46 38 PM e General Directory List Treemap Cleanups Report 10 30 2005 10 49 23 AM 2 25 2005 9 54 48 AM 2 25 2005 9 58 11 AM 10 7 2005 12 55 28 PM Bright Cushion Height Scale ness Shading Factor Style KDirStat Reset to SequoiaView Highlight Rectangle Defaults show Grid Grid Color Resource Tuner 143 DIALOGEX 0 0 380 202 0 STYLE DS_SETFONT DS_FIXEDSYS WS_CAPTION WS_CHILD WS_DISABLED WS_SYSMENU CAPTION Treemap LANGUAGE LANG_ENGLISH SUBLANG_ENGLISH_US FONT 8 MS Shell Dig amp Bright r nness 1 237 122 32 18 CONTROL 1212 msc
96. ECKBOX 5 CHILD 5 GROUP WS TABSTOP WS VISIBLE 5 22 120 10 CONTROL Match amp case 233 BUTTON BS_AUTOCHECKBOX WS CHILD WS GROUP WS TABSTOP WS VISIBLE 5 34 130 10 CONTROL Regular amp expression 239 BUTTON BS AUTOCHECKBOX WS CHILD 5 GROUP WS TABSTOP WS VISIBLE 5 46 120 10 CONTROL Wrap aroun amp d 240 BUTTON BS AUTOCHECKBOX 5 CHILD WS GROUP WS TABSTOP WS VISIBLE 5 58 120 10 CONTROL Transform amp backslash expressions 241 BUTTON BS AUTOCHECKBOX WS CHILD WS GROUP WS TABSTOP WS VISIBLE 5 70 160 10 CONTROL Direction 65535 BUTTON BS GROUPBOX WS CHILD WS GROUP 5 VISIBLE 135 22 60 34 CONTROL amp Up 234 BUTTON BS AUTORADIOBUTTON WS CHILD 5 GROUP WS VISIBLE 140 30 45 12 CONTROL amp Down 235 BUTTON BS AUTORADIOBUTTON WS CHILD WS VISIBLE 140 42 45 12 CONTROL amp Find Next 1 BUTTON BS DEFPUSHBUTTON WS CHILD WS GROUP WS TABSTOP WS VISIBLE 205 5 65 14 CONTROL amp Mark All 245 BUTTON BS_PUSHBUTTON WS CHILD WS WS VISIBLE 205 23 65 14 CONTROL Cancel 2 BUTTON BS PUSHBUTTON WS CHILD WS TABSTOP WS VISIBLE 205 41 65 14 END Resource Hacker 400 DIALOG 30 73 275 84 STYLE DS MODALFRAME 05 CENTER WS POPUP WS CAPTION WS SYSMENU CAPTION Find LANGUAGE LANG ENGLISH SUBLANG ENGLISH US FONT 8 MS Shell Dig CONTROL Fi amp nd what 1 STATIC SS_LEFT WS_CHILD WS_VISIBLE WS_GROUP 5 7 45 8 CONTROL 222 COMBOB
97. HWORDBREAKPROC 0x00000004 Inherited attributes from LISTBOX and EDIT Sorted true lt style gt CBS SORT 0 00000100 AutoHorizontalScroll true lt style gt CBS_AUTOHSCROLL 0x00000040 LowerCase true lt style gt CBS_LOWERCASE 0x00004000 OEMConvert true lt style gt CBS_OEMCONVERT 0x00000080 UpperCase true lt style gt CBS_UPPERCASE 0x00002000 DisabledNoScroll true lt style gt CBS_DISABLENOSCROLL 0 00000800 HasStrings true lt style gt CBS_HASSTRINGS 0x00000200 NolntegralHeight true lt style gt CBS_NOINTEGRALHEIGHT 0x00000400 OwnerDrawFixed true lt style gt CBS_OWNERDRAWFIXED 0 00000010 OwnerDrawVariable true lt style gt CBS_OWNERDRAWVARIABLE 0 00000020 Class EDIT true lt class gt EDIT Attributes Alignment Left lt style gt ES_LEFT 0x00000000 Alignment Right lt style gt ES_RIGHT 0x00000002 Alignment Center lt style gt ES_CENTER 0x00000001 Multiline true lt style gt ES_MULTILINE 0x00000004 AutoHorizontalScroll true lt style gt ES_AUTOHSCROLL 0x00000080 AutoVerticalScroll true lt style gt ES_AUTOVSCROLL 0x00000040 PasswordFile true lt style gt ES_PASSWORD 0x00000020 LowerCase true lt style gt ES_LOWERCASE 0x00000010 UpperCase true lt style gt ES_UPPERCASE 0x00000008 NoHideSelection true lt style gt ES_NOHIDESEL 0x00000100 ReadOnly true lt style gt ES_READONLY 0x00000800 Number true
98. ISIBLE 12 176 53 10 0x0 0 CONTROL Show amp Grid 1022 BUTTON BS AUTOCHECKBOX WS CHILD WS TABSTOP WS VISIBLE 76 150 54 10 0x0 0 CONTROL Grid amp Color 1030 BUTTON BS PUSHBUTTON WS CHILD WS TABSTOP WS VISIBLE 134 150 85 14 WS EX RIGHT 0 CONTROL H amp ighlight Rectangle 1202 BUTTON BS PUSHBUTTON WS CHILD WS 5 5 VISIBLE 76 175 143 14 WS EX RIGHT 0 CONTROL Static 1219 STATIC 55 CENTER WS CHILD WS GROUP WS VISIBLE 339 7 32 8 0x0 0 CONTROL Static 1218 STATIC 55 CENTER WS CHILD WS GROUP WS VISIBLE 305 7 32 8 0x0 0 CONTROL Static 1217 STATIC 55 CENTER WS CHILD WS GROUP WS VISIBLE 271 7 32 8 0x0 0 CONTROL Static 1216 STATIC 55 CENTER WS CHILD WS GROUP WS VISIBLE 237 7 32 8 0x0 0 CONTROL Static 1215 STATIC 55 LEFT WS CHILD WS GROUP WS VISIBLE 7 7 211 124 0x0 0 END Resource Hacker 143 DIALOGEX 0 0 380 202 STYLE DS FIXEDSYS WS CHILD WS DISABLED WS CAPTION WS SYSMENU CAPTION Treemap LANGUAGE LANG ENGLISH SUBLANG ENGLISH US FONT 8 MS Shell Dig FW NORMAL FALSE 1 lt CONTROL amp Bright nness 1 STATIC SS_CENTER WS_CHILD WS_VISIBLE WS_GROUP 237 122 32 18 CONTROL 1212 msctls trackbar32 TBS_VERT 5 BOTH TBS_NOTICKS WS CHILD WS VISIBLE WS_TABSTOP 245 17 16 104 CONTROL amp Cushion nShading 1 STATIC 55 CENTER WS CHILD WS VISIBLE WS GROU
99. InputStream in create an InputStreamReader that uses the default char set The FileReader class represents an input file that contains character data It is convenient for reading character files Its constructors set up the relationship between the program and the file opening a stream from which data can be read FileReader File f creates a new FileReader given the File f to read from The RandomAccessFile class has a file pointer that can be read by the getFilePointer method and set by the seek method It can also read an entire line and then be combined with a StringTokenizer By combining these classes I can have the kind of interaction and character manipulation needed for my situation Let s see some possibilities A RandomAccessFile allowing reading any byte at any location The file pointer position associated with each resource can be recorded in the scan phase so the selected resources will be localised in the process phase Several instances of BufferedReader and FileReader on the same file A reference to a stream object is stored each time a resource location has to be memorized in the scan phase We continue to read the file with a specific BufferedReader in the process phase But when a resource is found we have to search the next one from the start of the file 74 A FileReader and a BufferedReader combined with a StringTokenizer All resources found are stored in a string after the first scan We coul
100. L 103 COMBOBOX CBS DROPDOWNLIST WS CHILD WS VSCROLL WS TABSTOP WS VISIBLE 8 101 76 55 CONTROL amp 1 700 BUTTON BS AUTORADIOBUTTON WS CHILD WS GROUP WS TABSTOP WS VISIBLE 98 149 17 10 don t see the reason because a drop down combo box has also an edition field 24 CONTROL 82 701 BUTTON BS AUTORADIOBUTTON WS CHILD WS VISIBLE 116 149 17 10 CONTROL amp 3 702 BUTTON BS AUTORADIOBUTTON WS CHILD WS VISIBLE 135 149 17 10 CONTROL amp 4 703 BUTTON BS AUTORADIOBUTTON WS CHILD WS VISIBLE 154 149 17 10 CONTROL 85 704 BUTTON BS_AUTORADIOBUTTON WS CHILD 5 VISIBLE 176 149 17 10 CONTROL 106 BUTTON BS GROUPBOX WS CHILD WS GROUP WS VISIBLE 92 138 116 29 CONTROL 600 SCROLLBAR 585 HORZ WS CHILD WS TABSTOP WS VISIBLE 93 107 81 9 CONTROL 601 SCROLLBAR 585 VERT WS CHILD WS TABSTOP WS VISIBLE 155 56 9 64 CONTROL amp Omit 799 BUTTON BS GROUPBOX WS CHILD WS GROUP WS VISIBLE 8 118 76 49 CONTROL 800 BUTTON BS CHECKBOX WS CHILD WS TABSTOP WS VISIBLE 14 128 30 10 CONTROL 801 BUTTON BS CHECKBOX WS CHILD WS TABSTOP WS VISIBLE 50 128 30 10 CONTROL 802 BUTTON BS CHECKBOX WS CHILD WS TABSTOP WS VISIBLE 14 140 30 10 CONTROL 803 BUTTON BS CHECKBOX WS CHILD WS TABSTOP WS VISIBLE 50 140 30 10 CONTROL
101. LLBAR WS_EX_RIGHT and WS_EX_RIGHTSCROLLBAR BS_LEFT and BS_LEFTTEXT BS_RIGHT and BS_RIGHTBUTTON CBS_DROPDOWN and CBS_DROPDOWNLIST MCS_NOTODAY and MCS_NOTODAYCIRCLE SBS_SIZEBOX and SBS_SIZEBOXBOTTOMRIGHTALIGN SBS_SIZEBOX and SBS_SIZEBOXTOPLEFTALIGN SS_CENTER and SS_CENTERIMAGE SS_LEFT and SS_LEFTNOWORDWRAP SS_RIGHT and SS_RIGHTJUST TCS_RIGHT and TCS_RIGHTJUSTIFY I can then satisfy this assumption by adding a special character that is not in the original alphabet for example at the end of each flag string An internal node can then have in theory between 1 and 29 children the size of the alphabet and the height of T is equals to the length of the longest string in S 1 73 lt lt 7 lt _ 884 3 78 I can implement such trie with an ordered tree storing characters at its nodes The same fixed tree will be create once and only if a resource of type dialog box exists in the file or has been selected by the user before processing the resources and will be used for each resource of type dialog to process To the right is a trie for S CBS_DROPDOWN CBS DROPDOWNLIST CBS SIMPLE SS LEFT BS AUTOCHECKBOX BS AUTORADIOBUTTON WS BORDER WS CAPTION WS CHILD E C0 C9 09 O0 09 0 20 OOOD ONMO In this implementation single characters are compared instead of the entire read string the length of the longest SBS_SIZEBOXBOTTOMRIGHTALIGN is 27 The running time
102. MBOBOX 102 8 42 76 100 CBS DROPDOWNLIST WS VSCROLL LTEXT amp Fifth 26 8 62 32 10 NOT WS GROUP AUTOCHECKBOX 5 301 47 61 21 10 AUTOCHECKBOX 5 302 69 61 21 10 LTEXT amp Ninth 27 8 74 38 10 NOT WS GROUP AUTOCHECKBOX 9 401 47 73 21 10 AUTOCHECKBOX 9 402 69 73 21 10 LTEXT amp Inversions 28 8 90 63 10 NOT 5 GROUP COMBOBOX 103 8 101 76 55 CBS DROPDOWNLIST WS VSCROLL AUTORADIOBUTTON amp 1 700 98 149 17 10 WS GROUP AUTORADIOBUTTON 82 701 116 149 17 10 NOT WS TABSTOP AUTORADIOBUTTON 83 702 135 149 17 10 NOT WS TABSTOP AUTORADIOBUTTON 84 703 154 149 17 10 NOT WS TABSTOP AUTORADIOBUTTON amp 5 704 176 149 17 10 NOT WS TABSTOP GROUPBOX 106 92 138 116 29 WS GROUP SCROLLBAR 600 93 107 81 9 WS TABSTOP SCROLLBAR 601 155 56 9 64 585 VERT WS TABSTOP GROUPBOX amp Omit 799 8 118 76 49 WS GROUP CHECKBOX 800 14 128 30 10 CHECKBOX 801 50 128 30 10 CHECKBOX 802 14 140 30 10 CHECKBOX 803 50 140 30 10 CHECKBOX 804 14 152 30 10 CHECKBOX 805 50 152 30 10 CTEXT Chord Chart 30 108 2 68 10 NOT WS GROUP CONTROL 999 STATIC 55 SIMPLE NOT WS VISIBLE 92 12 116 108 CONTROL amp Close 2 BUTTON OWNERDRAW WS TABSTOP 222 135 56 14 CONTROL amp Add 1 BUTTON BS OWNERDRAW WS TABSTOP 222 153 56 14 CONTROL amp Play
103. MM C Transform backslash expressions to the first At first sight it is not the case with the Down radio button but in practice is is attainable The style is probably added to the default checked radio when the window control is created When the input focus is changed from a radio button to the another within a group the system automatically assign the style to the newly checked control This ensures that the input focus will always be on the most recently selected control when the user moves to the group using the TAB key From this it may be deduced that flags can be added and removed for convenience in the run time by the program see also the LISTVIEW class and think of a user arranging items in other views We have here again the feeling that resource files don t always give full desciption of a dialog box 26 And that is visible and not disabled If no such control exists the system sets the default input focus to the first control in the template 27 The order of definition in a dialog resource is represented by the Position attribute 28 Note that in the fifth example Windows use a list box control instead of a list view control 29 The user can use the arrow keys to shift the input focus between the two radio buttons that is from the first radio button that has the WS_GROUP flag Group true up to but not including the next control thas has this flag the default push button The tree push buttons are
104. OBUTTON 84 703 154 149 17 10 NOT WS TABSTOP AUTORADIOBUTTON 8 5 704 176 149 17 10 NOT WS TABSTOP GROUPBOX 106 92 138 116 29 WS GROUP SCROLLBAR 600 93 107 81 9 WS TABSTOP SCROLLBAR 601 155 56 9 64 SBS VERT WS TABSTOP GROUPBOX amp Omit 799 8 118 76 49 WS GROUP CHECKBOX 800 14 128 30 10 CHECKBOX 801 50 128 30 10 CHECKBOX 802 14 140 30 10 CHECKBOX 803 50 140 30 10 CHECKBOX 804 14 152 30 10 CHECKBOX 805 50 152 30 10 CTEXT Chord Chart 30 108 2 68 10 NOT WS_GROUP 4 AUTORADIOBUTTON ose 2 222 135 56 14 Ox AUTORADIOBUTTON amp Add 1 222 153 56 14 0x00000002 AUTORADIOBUTTON amp Play 131 222 11 56 14 0x00000002 PUSHBUTTON amp insert Chord 105 222 30 56 14 EDITTEXT 107 97 149 88 12 AUTOCHECKBOX 2 109 189 149 13 12 BS PUSHLIKE CHECKBOX amp Edit Diagram 108 222 55 56 14 5 PUSHLIKE LISTBOX 110 221 73 58 11 NOT LBS NOTIFY LBS NOINTEGRALHEIGHT 185 MULTICOLUMN WS TABSTOP Restorator 22 DIALOG 76 29 284 174 STYLE DS SETFONT 05 MODALFRAME DS NOIDLEMSG DS 3DLOOK DS CONTEXTHELP WS POPUPWINDOW WS CAPTION EXSTYLE WS EX DLGMODALFRAME WS EX CONTEXTHELP CAPTION Chord Builder FONT 8 MS Sans Serif 1 LTEXT amp Fundamental 24 8 4 60 10 NOT WS GROUP COMBOBOX 101 8 15 76 115 CBS DROPDOWNLIST WS VSCROLL LTEXT amp Chord 25 8 31 54 10 CO
105. OLLNG syz VEN 1044405 ve 54 SET dNOUD os 5 58 T OULNOD 01709170475 dOLSEVL SM l nous swIzarsiA SMITHI SMIXOBHIIHIOLNV Sa NOLLQS ryz suoisssidxo 2954248 1044409 oct ss 5 2015891 5 4 SMITISISIA SMITHI sMwIxogxosuooinv 58 NOLLLNG 092 desm TOMLNOD 02195 ao1sgvi swlanowo SMIQUHI SMIXOGHITHIOLAW SS NOLLOS SECZ uorsssdxog TOWLNOD Ot OCT pe 5 40158175 Lanoss sMwIaarsi SMIQNHI SMIXOSX23H201nY SA NOLLNG EET se g MM JOULNOD Or ozi ecc 15 1 sMIanowuo SM Ix18ISIA SMIQUHI 6 1 sa NOLLnS zcz Ajuo sjouws que TOMLNOD OS Spt 05 ao1savi SMITISISIA SMIQUHI SMITIOLISHOLNV 582 S82 XOSOSNOO ZZZ 1OWLNOD 8 Sp 5 nouo SMIXYSISIA SMIQUHD SMILIIT SS OILVAS 1 PUBL TOMLNOD 3 5 g 8 5 E 5 5 ES E E i uos sues SW 3 LNOd Sn HSNIONT 9Nv38ns HSMONS ONVI 91 59 NOLLAVI ANAWSAS SM NOLLSVI SM dndOd SM INVASION 50 TIALS 92 3Nr105 OZ zzE zzz oz a01S8v1 SM TIBISL SM QUHD SM NOLLnGHSDd43O 58 NOLANG HO TOWLNOD ZE tcc t SM QUHD SM NOOT SS SILVAS 11PS TOULNOD 154 why 000005 0 722
106. ON WS_SYSMENU CAPTION Treemap LANGUAGE LANG_ENGLISH SUBLANG_ENGLISH_US FONT 8 MS Shell Dlg FW NORMAL FALSE 1 CONTROL amp Bright nness 1 STATIC 55 CENTER WS CHILD WS VISIBLE WS_GROUP 237 122 32 18 CONTROL 1212 msctls trackbar32 TBS_VERT TBS BOTH TBS NOTICKS WS CHILD WS VISIBLE WS TABSTOP 245 17 16 104 CONTROL amp Cushion nShading 1 STATIC 55 CENTER WS CHILD WS VISIBLE WS GROUP 271 122 32 18 CONTROL 1211 msctls trackbar32 TBS_VERT TBS BOTH 5 NOTICKS WS CHILD WS VISIBLE WS TABSTOP 279 17 16 104 CONTROL amp Height 1 STATIC 55 CENTER WS CHILD WS VISIBLE WS GROUP 305 122 32 18 CONTROL 1210 msctls trackbar32 TBS_VERT TBS BOTH TBS NOTICKS WS CHILD WS VISIBLE WS TABSTOP 313 17 16 104 CONTROL amp Scale nFactor 1 STATIC 55 CENTER WS CHILD WS VISIBLE WS GROUP 339 122 32 18 CONTROL 1209 msctls trackbar32 TBS_VERT TBS BOTH TBS NOTICKS WS CHILD WS VISIBLE WS TABSTOP 347 17 16 104 CONTROL amp Light Incidence 1 STATIC 55 RIGHT WS CHILD WS VISIBLE WS GROUP 246 147 59 8 CONTROL Static 1220 STATIC SS LEFT WS CHILD WS VISIBLE WS GROUP WS TABSTOP 313 146 58 48 CONTROL 1034 BUTTON BS PUSHBUTTON BS MULTILINE WS CHILD 5 VISIBLE WS TABSTOP 242 167 55 22 CONTROL St amp yle 1 BUTTON BS GROUPBOX WS CHILD WS VISIBLE 7 146 63
107. ON implies the flags BS DEFPUSHBUTTON and WS TABSTOP ctrlClass button styles 0x10001 break case E EDITTEXT implies the flags ES LEFT value 0 WS BORDER and WS TABSTOP ctrlClass edit styles 0x810000 textField false break case G GROUPBOX implies the flag BS_GROUPBOX ctrlClass button styles 7 break case I ICON implies the flags BS ICON and WS GROUP ctrlClass static styles 0x20003 break case L if word charAt 1 T LTEXT implies the flags SS_LEFT value 0 and WS_GROUP ctrlClass static styles 0x20000 else LISTBOX implies the flags LBS_NOTIFY WS_BORDER and WS_VSCROLL ctrlClass listbox styles 0xA00001 textField false break case R if word charAt 1 A ctrlClass button styles 4 RADIOBUTTON implies the flag BS_RADIOBUTTON else ctrlClass static styles 0x20002 RTEXT implies the flags 55 RIGHT and WS GROUP break case P PUSHBUTTON implies the flags BS PUSHBUTTON value 0 and WS TABSTOP ctrlClass button styles 0x10000 break default word charAt 0 S ctrlClass scrollbar textField false SCROLLBAR implies the flag 585 HORZ value 0 System out print class ctrlClass Parse the line defining the control st nextToken if textField text st sval st nextToken skip st nextToken System out print text text if st
108. ONTROL 1120 LISTBOX LBS_NOTIFY LBS_NOINTEGRALHEIGHT LBS_MULTICOLUMN WS_CHILD WS_BORDER WS_HSCROLL 66 22 300 156 CONTROL File amp name 1090 STATIC SS_LEFT SS_NOTIFY WS_CHILD WS_VISIBLE WS_GROUP 67 187 71 8 CONTROL 1152 EDIT ES_LEFT ES_AUTOHSCROLL WS_CHILD WS_VISIBLE WS_BORDER WS_TABSTOP 144 184 164 12 CONTROL 1148 ComboBoxEx32 0x50210042 144 184 164 150 CONTROL Files of amp type 1089 STATIC SS_LEFT SS_NOTIFY WS_CHILD WS_VISIBLE WS_GROUP 67 203 71 8 CONTROL 1136 COMBOBOX CBS_DROPDOWNLIST WS_CHILD WS_VISIBLE WS_VSCROLL WS_TABSTOP 144 201 164 100 CONTROL Open as amp read only 1040 BUTTON BS_AUTOCHECKBOX WS_CHILD WS_VISIBLE WS_TABSTOP 144 217 160 8 CONTROL amp Open 1 BUTTON BS_DEFPUSHBUTTON WS_CHILD WS_VISIBLE WS_GROUP WS_TABSTOP 316 184 50 14 CONTROL Cancel 2 BUTTON BS_PUSHBUTTON WS_CHILD WS_VISIBLE WS_GROUP WS_TABSTOP 316 200 50 14 The first static control has also the number 1000 as extended style corresponding to WS_EX_RIGHT which for static controls has the same effect as using SS_RIGHT For the tool bar control the number 50012B4C is equivalent to the styles WS_CHILD WS_VISIBLE WS_TABSTOP CCS_NORESIZE CCS_NOPARENTALIGN CCS_NODIVIDER TBSTYLE_TOOLTIPS The number 1000 in hexadecimal is equivallent to 1000000000000 in binary 23 found another decompiler eXeScope which lists in addition
109. OX CBS_DROPDOWN CBS_AUTOHSCROLL WS_CHILD WS_VISIBLE WS_TABSTOP 50 5 145 50 CONTROL Match amp whole word only 232 BUTTON BS_AUTOCHECKBOX WS_CHILD WS_VISIBLE WS_GROUP WS_TABSTOP 5 22 120 10 CONTROL Match amp case 233 BUTTON BS_AUTOCHECKBOX WS_CHILD WS_VISIBLE WS_GROUP WS_TABSTOP 5 34 130 10 CONTROL Regular amp expression 239 BUTTON BS_AUTOCHECKBOX WS CHILD WS VISIBLE WS GROUP WS TABSTOP 5 46 120 10 CONTROL Wrap aroun amp d 240 BUTTON BS AUTOCHECKBOX WS CHILD WS VISIBLE WS GROUP WS TABSTOP 5 58 120 10 CONTROL Transform amp backslash expressions 241 BUTTON BS AUTOCHECKBOX WS CHILD WS VISIBLE WS GROUP WS TABSTOP 5 70 160 10 CONTROL Direction 1 BUTTON BS GROUPBOX WS CHILD WS VISIBLE WS GROUP 135 22 60 34 CONTROL amp Up 234 BUTTON BS AUTORADIOBUTTON WS CHILD WS VISIBLE WS GROUP 140 30 45 12 CONTROL amp Down 235 BUTTON BS AUTORADIOBUTTON WS CHILD WS VISIBLE 140 42 45 12 CONTROL amp Find Next 1 BUTTON BS DEFPUSHBUTTON WS CHILD WS VISIBLE WS GROUP WS TABSTOP 205 5 65 14 CONTROL amp Mark All 245 BUTTON BS PUSHBUTTON WS CHILD WS VISIBLE WS TABSTOP 205 23 65 14 CONTROL Cancel 2 BUTTON BS PUSHBUTTON WS CHILD WS VISIBLE WS TABSTOP 205 41 65 14 Second example 7 7 File Manager Favorites Tools Help DER 1 Ctrl 1 Ctri 2 x Large Icons Sm
110. P 271 122 32 18 CONTROL 1211 msctls trackbar32 TBS_VERT TBS BOTH TBS_NOTICKS WS CHILD WS VISIBLE WS TABSTOP 279 17 16 104 CONTROL amp Height 1 STATIC SS CENTER WS CHILD WS VISIBLE WS GROUP 305 122 32 18 CONTROL 1210 msctls trackbar32 5 VERT 5 BOTH TBS_NOTICKS WS CHILD WS VISIBLE WS TABSTOP 313 17 16 104 CONTROL amp Scale nFactor 1 STATIC 55 CENTER WS CHILD WS VISIBLE 5 GROUP 339 122 32 18 CONTROL 1209 msctls trackbar32 TBS_VERT TBS BOTH TBS_NOTICKS WS CHILD WS VISIBLE WS TABSTOP 347 17 16 104 CONTROL amp Light Incidence 1 STATIC 55 RIGHT WS CHILD WS VISIBLE WS GROUP 246 147 59 8 CONTROL Static 1220 STATIC SS LEFT WS CHILD WS VISIBLE WS GROUP WS TABSTOP 313 146 58 48 CONTROL 1034 BUTTON BS PUSHBUTTON BS MULTILINE WS CHILD WS VISIBLE WS TABSTOP 242 167 55 22 CONTROL St amp yle 1 BUTTON BS GROUPBOX WS CHILD WS VISIBLE 7 146 63 49 CONTROL amp KDirStat 1213 BUTTON BS AUTORADIOBUTTON WS CHILD WS VISIBLE WS GROUP WS TABSTOP 12 159 42 10 CONTROL Se amp quoiaView 1214 BUTTON BS AUTORADIOBUTTON WS CHILD WS VISIBLE 12 176 53 10 CONTROL Show amp Grid 1022 BUTTON BS AUTOCHECKBOX WS CHILD WS VISIBLE 5 TABSTOP 76 150 54 10 CONTROL Grid amp Color 1030 BUTTON BS PUSHBUTTON WS CHILD WS VISIBLE WS TABSTOP 134 150 85 14 0x0000
111. RDRAGDROP 0x00000010 SubltemImages true ex style LVS_EX_SUBITEMIMAGES 0x00000002 Class MONTHCALENDAR lt class gt SysMonthCal32 Attributes DayState true lt style gt MCS_DAYSTATE 0x00000001 Multiselection true lt style gt MCS_MULTISELECT 0x00000002 NoToday true style MCS_NOTODAY 0x00000008 NoTodayCircle true lt style gt MCS_NOTODAYCIRCLE 0x00000010 WeekNumbers true lt style gt MCS_WEEKNUMBERS 0x00000004 Class ANIMATION lt class gt SysAnimate32 44 Attributes lt style gt ACS_AUTOPLAY 0x00000004 AutoPlay true lt style gt ACS_CENTER 0x00000001 Center true lt style gt ACS_TRANSPARENT 0x00000002 Transparent true Class PAGER lt class gt SysPager Attributes AutoScroll true lt style gt PGS_AUTOSCROLL 0x00000002 DragAndDrop true lt style gt PGS_DRAGNDROP 0x00000004 Direction horizontal lt style gt PGS_HORZ 0x00000001 Direction vertical lt style gt PGS_VERT 0x00000000 Class STATUTBAR lt class gt msctls_statusbar32 Attributes SizeGrip true lt style gt SBARS_SIZEGRIP 0 00000100 Tooltips true lt style gt SBT_TOOLTIPS 0x00000800 Top true lt style gt CCS TOP 0x00000001 Class CUSTOMCONTROL Attribute ClassName class val ClassName Note the button style flag BS_RIGHTBUTTON is synonymous with BS_LEFTTEXT 4 3 2 Shortcu
112. S TABSTOP WS VISIBLE 14 152 30 10 CONTROL 805 BUTTON BS 5 CHILD WS TABSTOP WS VISIBLE 50 152 30 10 CONTROL Chord Chart 30 STATIC SS CENTER 5 CHILD WS VISIBLE 108 2 68 10 CONTROL 999 STATIC SS SIMPLE 5 CHILD 92 12 116 108 CONTROL amp Close 2 BUTTON BS OWNERDRAW WS CHILD WS TABSTOP WS VISIBLE 222 135 56 14 CONTROL amp Add 1 BUTTON BS OWNERDRAW WS CHILD WS TABSTOP WS VISIBLE 222 153 56 14 CONTROL amp Play 131 BUTTON BS OWNERDRAW WS CHILD WS TABSTOP 5 VISIBLE 222 11 56 14 CONTROL amp Insert Chord 105 BUTTON BS PUSHBUTTON WS CHILD WS TABSTOP WS VISIBLE 222 30 56 14 CONTROL 107 EDIT ES LEFT WS CHILD WS BORDER WS TABSTOP WS VISIBLE 97 149 88 12 CONTROL 109 BUTTON BS AUTOCHECKBOX BS_PUSHLIKE WS CHILD WS TABSTOP WS VISIBLE 189 149 13 12 CONTROL amp Edit Diagram 108 BUTTON BS CHECKBOX 5 PUSHLIKE 5 CHILD WS TABSTOP WS VISIBLE 222 55 56 14 CONTROL 110 LISTBOX LBS MULTICOLUMN LBS NOINTEGRALHEIGHT WS CHILD WS BORDER WS TABSTOP WS VISIBLE 221 73 58 11 END Resource Hacker 22 DIALOG 76 29 284 174 STYLE DS MODALFRAME 05 NOIDLEMSG 05 CONTEXTHELP WS POPUP WS CAPTION WS SYSMENU EXSTYLE WS DLGMODALFRAME WS CONTEXTHELP CAPTION Chord Builder LANGUAGE LANG NEUTRAL SUBLANG NEUTRAL FONT 8 MS Sans Serif CONTROL amp Fundamental 24 STATIC SS_LEFT WS_CHILD WS_VISIBLE 8 4 60 10
113. SM NOLINGHSNd S8 NOLEN 104440 SM 58 502 1084402 pt Ez TOE dOLSAVL SM 319151 SM SM NOLLNGHSNd 58 NOLING 7 192080 1041402 10 01581 SM 318ISIA SM 1 SM NOLIMGHSNd330 58 NOLING t PUR TOULNOD ocz rv os ao159v1 SM SM SM TOYOSHOLNY 582 582 XOSOSWOO 1044402 870 ew s nouo SM 338ISIA SM SM 1431 SS JILVAS TOULNOD ez os do158v1 SM 3ISISIA SM TUK SM TOYOSHOLNY 582 NMOOdOBG 582 XOSOSHO2 8 ov sc s anouo SM 318151 SM CHD SM 1431 SS SILVAS 59 84 1044402 Os sez s os 40158v1 SM 318ISIA SM SM 1 S82 NMOG4ONG 582 XOSOSWOO ZZZ JOULNOD 8 gt s anowo SM 318ISIA SM SM 1 1437 55 OLLWAS T PT os Te TOE 4O1S8vI SM 3 HISIA SM om sues SH 1NO4 SN HSTIONS ONVISNS HSTIONT ONY 39vn9NY1 PUIS 4 nN3WSAS SM 1 NOLLAVI SM 1 40404 SM INVHIIWOOW SO TIALS 19 97 501VIG 2359 v 59 502 158 1 SMISZISISIA SMIQUHO 58 192087 2 s9 ez 1502 2015971 SM S 8ISIA SMITH SMINO1Ln8HSnd sa N
114. STATIC SS NOTIFY 55 LEFT WS CHILD WS GROUP WS VISIBLE 67 203 71 8 0x0 0 CONTROL 1136 COMBOBOX CBS DROPDOWNLIST WS CHILD WS_VSCROLL WS TABSTOP WS VISIBLE 144 201 164 100 0x0 0 CONTROL Open as amp read only 1040 BUTTON BS AUTOCHECKBOX 5 LEFT 5 CHILD WS_TABSTOP WS VISIBLE 144 217 160 8 0 0 0 CONTROL amp Open 1 BUTTON BS DEFPUSHBUTTON 5 VCENTER 5 CENTER 5 CHILD 5 GROUP WS TABSTOP WS VISIBLE 316 184 50 14 0x0 0 CONTROL Cancel 2 BUTTON BS PUSHBUTTON 5 VCENTER 5 CENTER WS CHILD WS GROUP WS WS VISIBLE 316 200 50 14 0x0 0 END Resource Hacker 1552 DIALOGEX 0 0 370 237 97 Appendix B STYLE DS MODALFRAME DS_CONTEXTHELP WS_POPUP WS VISIBLE WS CLIPCHILDREN WS CAPTION WS_SYSMENU CAPTION Open LANGUAGE LANG ENGLISH SUBLANG ENGLISH US FONT 8 MS Shell Dig x CONTROL Look 1091 STATIC SS LEFT 55 NOTIFY WS CHILD WS VISIBLE WS GROUP 4 7 57 8 0x00001000 CONTROL 1137 COMBOBOX CBS DROPDOWNLIST CBS OWNERDRAWFIXED CBS HASSTRINGS WS CHILD WS VISIBLE WS VSCROLL WS TABSTOP 66 4 174 300 CONTROL 1088 STATIC SS LEFT WS CHILD 248 4 80 14 CONTROL 1184 ToolbarWindow32 0 50012 4 4 22 58 208 0x00000200 CONTROL 1120 LISTBOX LBS NOTIFY LBS NOINTEGRALHEIGHT LBS MULTICOLUMN WS CHILD WS BORDER WS HSCROLL 66 22 300 156 CONTROL File amp name 1090 STATIC SS LEFT 55 NOTIFY WS
115. Setup file during the installation process or when customizing a local system by double clicking Control Panel s Regional Options icon Because the font generated using MS Shell Dlg is different on different versions of Windows the dialog box can look different depending on the version This allows using coordinates and sizes that will retain the general dimensions and look of the dialog box regardless of the resolution of the video display Because the text control does not send messages back to its parent this value is set to 1 20 EX Menu File Edit 103 Favorites Tools Help Large Icons Ctri 1 Small Icons Ctri 2 List Ctrl 3 v Details Ctrl 4 Name Ctri F3 Type Ctri F4 Date Ctri4F5 Size Ctri4F6 Unsorted Ctrl F7 2Panels FS Toolbars Archive Toolbar Standard Toolbar Open Root Folder Up One Level Backspace Large Buttons Folders History Alt F12 Show Buttons Text Refresh Ctrl4R 4 1 3 Third example from RGB Editor 103 MENU LANGUAGE LANG ENGLISH SUBLANG ENGLISH US POPUP amp File POPUP amp Edit POPUP amp View MENUITEM SEPARATOR MENUITEM Name tCtrl MENUITEM Lar amp ge Icons tCtrl 1 410 MENUITEM S amp mall Icons tCtrl 2 411 MENUITEM amp List tCtrl 3 412 MENUITEM amp Details tCtrl 4 413 CHECKED F3 420 MENUITEM Type tCtri F4 421 MENUITEM Date tCtri F5 422 MENUITEM Size tCtril F6 423 MENUITEM
116. TIC 55 CENTER WS CHILD WS GROUP WS VISIBLE 237 122 32 18 0 0 0 CONTROL 1212 msctls trackbar32 WS CHILD WS TABSTOP WS VISIBLE 1 245 17 16 104 0x0 0 CONTROL amp Cushion x0D x0AShading 65535 STATIC 55 CENTER WS CHILD WS GROUP WS VISIBLE 271 122 32 18 0 0 0 CONTROL 1211 msctls trackbar32 WS CHILD WS TABSTOP WS VISIBLE 0x14 279 17 16 104 0x0 0 CONTROL amp Height 65535 STATIC 55 CENTER WS CHILD WS GROUP WS VISIBLE 305 122 32 18 0x0 0 CONTROL 1210 msctls trackbar32 WS CHILD WS TABSTOP WS VISIBLE 1 313 17 16 104 0x0 0 CONTROL amp Scale x0D x0AFactor 65535 STATIC 55 CENTER WS CHILD WS GROUP WS VISIBLE 339 122 32 18 0x0 0 CONTROL 1209 msctls trackbar32 WS CHILD WS TABSTOP WS VISIBLE 0x1A 347 17 16 104 0x0 0 CONTROL amp Light Incidence 65535 STATIC 55 RIGHT WS CHILD WS GROUP WS VISIBLE 246 147 59 8 0x0 0 CONTROL Static 1220 STATIC 55 LEFT WS CHILD WS GROUP WS TABSTOP WS VISIBLE 313 146 58 48 0x0 0 CONTROL 1034 BUTTON BS PUSHBUTTON BS MULTILINE WS CHILD WS TABSTOP WS VISIBLE 242 167 55 22 0x0 0 CONTROL St amp yle 65535 BUTTON BS GROUPBOX WS CHILD WS VISIBLE 7 146 63 49 0x0 0 CONTROL amp KbDirStat 1213 BUTTON BS AUTORADIOBUTTON WS CHILD WS GROUP WS 5 5 VISIBLE 12 159 42 10 0x00 CONTROL Se amp quoiaView 1214 BUTTON BS AUTORADIOBUTTON WS CHILD WS V
117. The pager control allows the user to scroll to the area of the window that is not currently in view For example if an application has a toolbar that is not wide enough to show all of its items the toolbar can be assigned to a pager control and the user will be able to scroll to the left or right to access all of the items XS AutoScroll Boolean 162 The RBN_GETOBJECT notification message 131 Appendix C If true the pager control will scroll when the user hovers the mouse over one of the scroll buttons DragAndDrop Boolean The contained window can be a drag and drop target The pager control will automatically scroll if an item is dragged from outside the pager over one of the scroll buttons Direction horizontal vertical Indicates if the pager control scrolls horizontally or vertically DATETIMEPICKER A date and time picker DTP control provides a simple and intuitive interface through which to exchange date and time information with a user the user can select a value instead of typing it The control relies on a format string to determine how it will display fields of information For example to display the current time with the format 07 50 23 PM and the current date with the format Monday June 20 2005 format strings can be hh m s tt and dddd MMM 163 Date and time format elements will be replaced by the actual date and time Shown thereafter are two separate DTP controls 7
118. USERBUTTON OxB addFlag LBS EXTENDEDSEL 0x800 addFlag ES RIGHT 0x2 addFlag ES CENTER 0x1 addFlag ES_MULTILINE 0x4 H addFlag ES AUTOHSCROLL 0x80 addFlag ES PASSWORD 0x20 addFlag ES NUMBER 0x2000 addFlag WS HSCROLL 0x100000 addFlag ES AUTOVSCROLL 0x40 addFlag PBS MARQUEE 0 8 addFlag PBS VERTICAL 0x8 addFlag SS ENHMETAFILE OxF addFlag SS OWNERDRAW 55 USERBUTTON addFlag SS SIMPLE 0xB addFlag SS LEFTNOWORDWRAP OxC addFlag SS NOPREFIX 0x80 addFlag SS BITMAP OxB addFlag SS REALSIZEIMAGE 0x800 addFlag SS SUNKEN 0x1000 addFlag SS BLACKFRAME 0x7 addFlag SS GRAYFRAME 0x8 addFlag SS WHITEFRAME 0x6 addFlag SS BLACKRECT 0x4 addFlag SS GRAYRECT 0x5 addFlag SS WHITERECT 0x9 addFlag SS_ETCHEDHORZ 0x10 addFlag SS_ETCHEDVERT 0 11 addFlag SS ETCHEDFRAME 0x12 addFlag TBS_VERT 0x2 addFlag UDS AUTOBUDDY 0x10 addFlag DTS_TIMEFORMAT 0x9 addFlag WS PALETTEWINDOW 0x108 addFlag LBS STANDART 0x800003 addFlag WS POPUPWINDOW 0x80880000 Add flags not in my correspondance rules but that have a common prefix with one of the flag above addFlag CBS SORT 0x100 addFlag DS SETFOREGROUND 0x200 addFlag BS RIGHTBUTTON 0x20 Compress the trie 148 Appendix D compress root public TNode
119. UTTON BS_AUTOCHECKBOX WS_CHILD WS_VISIBLE WS_GROUP WS_TABSTOP 5 58 120 10 CONTROL Transform amp backslash expressions 241 BUTTON BS_AUTOCHECKBOX WS CHILD WS VISIBLE WS GROUP WS TABSTOP 5 70 160 10 CONTROL Direction 1 BUTTON BS GROUPBOX WS CHILD WS VISIBLE WS GROUP 135 22 60 34 CONTROL amp Up 234 BUTTON BS AUTORADIOBUTTON WS CHILD WS VISIBLE WS GROUP 140 30 45 12 CONTROL amp Down 235 BUTTON BS AUTORADIOBUTTON WS CHILD WS VISIBLE 140 42 45 12 CONTROL amp Find Next 1 BUTTON BS DEFPUSHBUTTON WS CHILD WS VISIBLE WS GROUP WS TABSTOP 205 5 65 14 CONTROL amp Mark All 245 BUTTON BS PUSHBUTTON WS CHILD WS VISIBLE WS TABSTOP 205 23 65 14 CONTROL Cancel 2 BUTTON BS PUSHBUTTON WS CHILD WS VISIBLE WS TABSTOP 205 41 65 14 When the Find dialog box is first invoked the default input focus is set to the first control specified in the resource that has the WS TABSPTOP flag TabStop true that is the 126 combobox control The other controls will usually receive their input focus when they are m wa 7 Match whole word only 6 Direction clicked with the mouse but the user can also move among the controls having this flag F match cose using the TAB key in the order they figure C Regular expression 6 Down EE the file and with a cycle from the last control Ez Wrap
120. Universit Catholique de Louvain Facult des Sciences Appliqu es D partement Ing nierie Informatique Reverse engineering of Graphical User Interfaces based on Resource Files Promoteur M moire pr sent en vue de l obtention du grade de Pr J Vanderdonckt licenci en informatique par Julien Marion Louvain la Neuve Ann e acad mique 2005 2006 Parmi les personnes qui m ont permis de r aliser ce m moire je tiens tout particuli rement a remercier M Jean Vanderdonckt et M Laurent Bouillon pour leurs conseils leur disponibilit et leur gentillesse d avoir accept de m encadrer dans ce travail Je tiens remercier ma famille et en particulier mes parents pour leur soutien tout au long de mes tudes Contents 1 2 3 DUNG TO CU T 5 State Ar 7 Reverse engineering method 2 10 00100000000 9 341 Gener l method MP 9 2 4 Meth d logical 1 8 eese du a 13 3 3 Examples used and 8 find 16 3 4 Selected Methods nn 17 Windows TUES e 19 4 1 Examples of 8 none 19
121. Vanderdonckt J Limbourg Q Michotte B Bouillon L Trevisan D Florins M UsiXML a User Interface Description Language for Specifying Multimodal User Interfaces in Proc of W3C Workshop on Multimodal Interaction WMI 2004 Sophia Antipolis 19 20 July 2004 L Bouillon Q Limbourg J Vanderdonckt B Michotte Reverse Engineering of Web Pages based on Derivations and Transformations in Proceedings of LAWEB 2005 Buenos Aires 31 Oct 2 Nov 2005 IEEE Computer Society Press Los Alamitos 2005 pp 3 13 Limbourg Q Vanderdonckt J Michotte B Bouillon L Florins M Trevisan D UsiXML A User Interface Description Language for Context Sensitive User Interfaces in Proceedings of the ACM AVI 2004 Workshop Developing User Interfaces with XML Advances on User Interface Description Languages Gallipoli 25 2004 Luyten Abrams Limbourg Q Vanderdonckt J Eds Gallipoli 2004 pp 55 62 85 13 14 15 16 17 18 19 20 21 22 23 24 26 27 Limbourg Q Vanderdonckt J UsiXML A User Interface Description Language Supporting Multiple Levels of Independence in Matera M Comai S Eds Engineering Advanced Web Applications Rinton Press Paramus 2004 Vanderdonckt J A MDA Compliant Environment for Developing User Interfaces of Information Systems Proc of 17th Conf on Advanced Information Systems Engineering 15 05 Porto 13 17 June 2005
122. WS_GROUP EDITTEXT EDIT WS_CHILD WS_VISIBLE ES_LEFT WS_BORDER WS_TABSTOP LISTBOX LISTBOX WS_CHILD WS_VISIBLE LBS_NOTIFY WS_BORDER WS_VSCROLL COMBOBOX COMBOBOX WS_CHILD WS_VISIBLE CBS_SIMPLE WS_TABSTOP SCROLLBAR SCROLLBAR WS_CHILD WS_VISIBLE SBS_HORZ gt ex CONTROL amp Find Next 1 ellipticalPushButton WS CHILD WS VISIBLE JWS GROUP WS TABSTOP 205 5 65 14 45 Notice that many of the controls that interact with the user include WS_TABSTOP as a default However radio buttons other than the first of each radio group lack WS_TABSTOP by default The static controls include WS_GROUP by default which conveniently mark the end of a group For all these control types the format to define the control is control type lt text gt lt id gt lt x gt lt y gt lt width gt lt height gt lt style gt lt ex_style gt lt helpID gt except for the EDITTEXT SCROLLBAR LISTBOX and COMBOBOX styles where the text field is excluded The RC resource compiler understands the two notations So the line from my first example DEFPUSHBUTTON amp Find Next 1 205 5 65 14 WS_GROUP 15 equivalent tO CONTROL amp Find Next 1 BUTTON BS DEFPUSHBUTTON WS CHILD WS VISIBLE WS GROUP WS TABSTOP 205 5 65 14 These two syntaxes are encoded identically in the res file and the exe file The second syntax is less convenient but more complete with the identifiers a push button can always be accessed with the TAB key for instance The NOT keyw
123. Zp Opt NAISIA SM QUO SM NOLLNBOIQYVEOLNY S8 NOLLNG SEZ 1044409 ZT Sp OE anowo SA 1 SM 1 2 SM NOLLaSOIOYHOLOY 59 NOLLNG vez dris TOMINOO ve 09 zz Set anowo SM SM QUHI SM 58 NOLING T uon2 d 1044409 091 oz 5 ao1s8v1 SM 1 nous sm 1 318ISIA SM 1 SM xosxo3Hoo1nv 58 NOLLNG THz suomssidxo 70u1NO2 401S8vL SM dnouo S 318ISIA SM SM 58 a doisavi swIdnous SMITISISIA SMIQUHI SMIXOBDIHOOLNY Sa8 NOLLOS ecz uossssidxeg enb y TOMLNOD 0158 1 SMIGNOYD SM 3ISISIA SM SM 58 NOLLNG s979 ux TOULNOD OT OCT zc s 40158 SM sm AISIA SM Guo SM XO ADIHIOLAW 58 ZEZ piov sous uie 1044409 05 syT s 05 20158 1 SM 3181512 5 4 SM TOUISHOLNY S82 NMAOGdO T 582 XOSOSNOO ZZZ 7 10 8 Sv S dnoW9 SM SM SM 1437 SS 1 16 1 380 puni 2251 SW 2 ANOd Sn HSTIONS 5 HSMONT SNv139vn9NvY1 NOLLdV2 NNAWSAS SM 1 NOLLdv2 SM 404 SM 43143254 INVASION 50 TIALS v8 szz c Of 901VIG 00 lt pt oT 0 Ezz 015 1 SM 378151 SM QUHI SM NoLLnSHSndd3d SS YSZ lt WOMLNOD 00002000
124. a push button will be wrapped to multiple lines lines if it is too long to fit on a single line in the rectangle Multiline true There are other button controls that provides input to an application by notifying the parent window when the user clicks on the control with a mouse like radio buttons RADIOBUTTON class When they have RightButton true they look like that one labelled Down below When they have PushLike true they look like that one labelled Up Direction Direction Ow The check box CHECKBOX class Edit diagram from the sixth example has also this last property Other buttons can be owner drawn buttons CUSTOMBUTTON class This type allows complete freedom in the button s appearance Buttons from the sixth example have this style to have i d text together is style to have image and text together dk Play X OK A scroll bar control SCROLLBAR class is not a scroll bar added at the right or the bottom of a window by setting to true the window attribute VerticalScrollBar or HorizontalScrollBar but a child window control that can appears anywhere in the parent window vertically Type vertical or horizontally Type horizontal There is such controls in the sixth example The list box LISTBOX class from the sixth example as from the fifth example has two specific properties Items are arraged arranged in multiple columns and the list box scrolls horizontally instead of vertically Mu
125. a separate file and is bound into the executable file during the build process All the resources are usually defined in a main file which is added once compiled to the application s executable file The following illustrates the general method that used to reverse engineer the UI The process starts from an executable file a binary file containing a program in machine language which is ready to be executed n Reverse Engineering Executable binary file Resource file extraction Resource file Reverse Engineering Tool Forward Engineering The input of the tool to develop is a text based resource file containing user interface information extracted from an executable The extraction can be made by some decompilation tool that is a program that converts the resource definition from machine language to some text programming language Decompilation can be reverse engineering since it is increasing the level of abstraction It s just that it starts lower and ends lower with the implementation i e the source code than most reverse engineering Then decompilation would be part of my reverse engineering although compilation is not considered part of forward engineering since it is an automatic step The given UI has to be described at a level of abstraction that is higher than the level where code is manipulated The output will be the UI expressed in a User Interface Description Language UIDL
126. ab of the control placing the icon to the left of the label The icon can be aligned with the left edge of each fixed width tab leaving the label centered when the attribute takes the value icon Both the icon and label can be left aligned within each fixed width tab by the value label The two last values are used only when FixedWidth true HotTrack Boolean 119 Appendix C If true causes the control to exhibit hot tracking behaviour that is an item is automatically highlighted as the mouse pointer moves over it Multiline Boolean By default a tab control displays only one row of tabs and the user can scroll to see more tabs if necessary If true multiple rows of tabs are displayed if necessary so all tabs are visible at once The tabs are left aligned within each row unless RightJustify true Multiselection Boolean If true multiple tabs can be selected by holding down when clicking This style is used only with button tab controls OwnerDrawFixed Boolean If true the parent window is responsible for drawing tabs in the control RaggedRight Boolean If true rows of tabs will not be stretched to fill the entire width of the control This style is the default Right Boolean If true tabs appear vertically on the right side of the control This style is used only when Vertical true RightJustify Boolean If true the width of each tab is increased if necessary so that each row of tabs fills th
127. age Multiline Boolean If true wraps the button text to multiple lines if the text string is too long to fit on a single line in the button rectangle Notify Boolean If true enables a button to send notification messages to its parent window which tells that the button has been double clicked lost the keyboard focus or gained the keyboard focus A 108 Notification messages are submessage codes that the child use to tell the parent in more detail what the message means like the control has been clicked double clicked etc Here the control can use the BN DBLCLK BN KILLFOCUS and BN SETFOCUS codes 109 Appendix C button sends always a notification message which tells the parent that the button has been clicked regardless of whether it has this style The next six classes define various types of button PUSHBUTTON A push button is a rectangle with rounded corners enclosing text that the user can click with a mouse The rounded rectangle takes up the full height and width of the dimensions given The text is centered within the rectangle This control is used to trigger an immediate action Default Boolean If true it is the default push button and has a heavier outline Pressing the Enter key has the same effect that clicking on it with the mouse That enables the user to quickly select the most likely option the default option Content text bitmap icon The push button can displays text which for nor
128. all Icons Add C D Details Ctri 3 Ctri 4 ete Info M moire C D compilateurs 4_ResHacker v Ctri4F3 Ctri4F4 5 Ctrl F6 Ctrl F7 Size FPiResHac Unsorted ResHac ResHac ib ResHac E Version 2 Panels F9 Toolbars Open Root Folder Up One Level Refresh Ctri R Backspace Folders History Alt F12 Size 14K 4910B 267B 861K 10K LLL anat 4 v Archive Toolbar Standard Toolbar Large Buttons Modified 2002 01 26 22 46 2002 03 24 23 44 2001 01 27 22 37 2002 03 24 20 23 2005 11 07 13 06 2002 73 24 23 45 10 14 35 ___ 2423 42 v Show Buttons Text Created 2004 12 15 22 13 2004 12 15 22 13 2004 12 15 22 13 2004 12 15 22 13 2005 05 08 17 00 2004 12 15 22 13 2004 12 15 22 14 2004 12 15 22 13 Accessed 2005 11 10 14 15 2005 10 27 12 47 2005 11 07 13 05 2005 11 10 14 41 2005 11 07 13 06 2005 11 08 17 51 2005 11 10 14 35 2005 05 08 16 59 All the tools give the same information about the menu except that Resource Builder use BEGIN END instead od 4 92 Third example RGB Editor Appendix B RGB Editor Options Ox009FA151 um B 161 EH 159 Resource Tuner Restorator Launch Multiple Instances Place Icon in Taskbar Tray Confirm Program Exit Select the Type of Macro to be Copied to Clipboard B RGB Macro Hexadecimal C HTML Macro RGB 81 151
129. ar object into GrafiXML to represent the overlapped window the program s main application window which is not specified in a resource file 6 1 2 Derivation rules 66 This section gathers some mapping rules specifying the correspondence between the two models that one modeling a Windows resource of type menu or dialog box and the CUI model The list is not exhaustive but is shown to see the nature of such rules and show that they can be elaborated with a Windows resource file as source of the mapping Only rules concerning a dialog box will be developed I will first explain a specific notation for reverse engineering derivation rules and I will then define precisely in this notation a subset of the rules appearing in tables of the previous section A standard notation 11 can be used to express formally reverse engineering derivation rules for a UI specified in any language or source model The rules are applied on trees representing a UI is the source tree an instance of the diagram modeling a Windows dialog box resource and is the target tree an instance of the CUI model The nodes of a tree T store hierarchically the elements composing the UI Each connection or arc represents a containment relationship between the parent and the child Each node of the tree represents the different elements composing the UI Each node can possess zero or more attributes To construct 7 I will use the following predefined bas
130. are building blocks of the graphical UI each performing a specific function e g text fields buttons or check boxes The interface is then composed of existing UI widgets with a set of properties e g background colour size font and a set of values associated with the properties e g black Tahoma 8pt but these widgets are independent of any particular toolkit dialogBox inputText The AUI level is assumed to abstract the CUI independently of any modality of interaction In the example it s a graphical interaction But we could have also video based interaction vocal interaction with eventually speech recognition tactile interaction haptic interaction as vibrations in a joystick or even soon olfactory interaction In the other direction an AUI gt For example supposing a distributed application in a hospital which manages information about patients a doctor in an ambulance using a pocket PC when detecting an urgent situation has a complex experience of analyse The emergency ward can then be prepared to receive the patient In the example say an IPAQ with a large tactile screen usable with the fingers 55 In the example the doctor is in a stressful environment A widget evokes window gadget 51 express the rendering of the domain concepts and tasks independently of a modality An element used in this level be then the abstraction of an existing widget while representing a subtask defined
131. as they are wide the units on both the x and y axes are about the same The second line defines some style for the dialog box a combination of window style and dialog style Within the left and right brackets are defined the child window controls that will appear in the dialog box This dialog box uses six types of child window controls a left justified text a combo box a group box radio buttons and push buttons The first number is a value that the child window uses to identify itself when communicating to its parent the dialog box window The next four numbers set the position of the child window control relative to the upper left corner of the dialog box s client area and the size Some style flag can also follow to define more precisely the appearance and functionality of the control 4 1 2 Second example from 7 Zip File Manager I take an interest here to the menu bar of an application With a resource editor here Resource Hacker menus and Dialogs can also be viewed as they would appear in a running application The following is the extracted menu resource 18 Notice that if the dialog boxe has a caption bar which is the case here these measurements concern the dialog box s client area and the caption bar will be shown above the y coordinate P In fact MS Shell Dlg is not a physical font rather a face name of a nonexistant font It ensure the previous Windows operating system compatibility It can be specified in either the
132. at the upper level There is how my simple example is in turn abstracted at the AUI level activator activator The T amp C level describes the interactive tasks to be carried out by the end user here searching for a word in a text and the domain concepts as they are required by these tasks to be performed A task is typically hierarchically decomposed into sub tasks to end up with actions the leaves which can be no longer decomposed and are carried out The tasks are also ordered with temporal relationship The same example is graphically represented below where the gt gt operator indicates that sequence is needed and information is passed and the operator expresses the constraint of a choice between two tasks search word launch search to find next occurrence The framework exhibits three types of relationships launch search to find all occurrences abstraction transforms any specifications into specifications at a higher level of abstraction Reification transforms any specifications into specifications at a lower level of abstraction A translation is about transformation of the interface from one type of platform to another or more generally from one context to another The term adaptation is also often used an existing system is adapted to a new context of use If the adaptation is performed at a high level of abstraction the resulting process will be more flexible These relationships a
133. ate boolean isInternal TNode v return v getChildren isEmpty a Override the toString method to produce a parenthetic string representation of the created trie for verification public String toString return print root if SS Se i SS ee ee ne Perform a printing of the elements in the subtree rooted at node v of this trie a ae CL private String print String s v toString if isInternal v Vector children v getChildren Open parenthesis and recursively print the first subtree char open close if children size gt 1 open close else open close 5 open print TNode children elementAt 0 for int i lt children size i size gt 0 because v is internal Recursively print the remaining subtrees S print children elementAt i S close return s J RRR RRR RRR KR KKK KR KK KR KK KK oko kk AA ARIA A Ae e e e e e e e e AR e e e e ke e k k kk e ek Kk OK TNode java Author Julien Marion Represent a node of the trie labelled with a character BRR KKK KK KK I III III package importresources import java util Vector public class TNode private int flagValue 0 Numeric value of a flag if the node is associated with a string of the trie else 0 private char label Each node is labelled with a character from A Z U 3 _
134. ating system on the device Another well known language is UIML which is a relatively simple markup language a little over two dozen tags Various other related languages exist today such as XUL Xml based User interface Language XIML eXtensible Interface Markup Language AUIML Abstract User Interface Markup Language useML Useware Markup Language or XICL eXtensible user Interface and user interface Components Language 14 To accomplish the transformation of a UI specification from one format to another I ve decided to implement a new plug in into the GrafiXML tool In order to facilitate the edition of a new UI in UsiXML at the CUI level GrafiXML has been developed as a graphical tool to draw UIs It s an editor based on UsiXML a Classical element based approach that is all the elements are directly described by a physical form we can identify and assign a meaning The user can draw in direct manipulation a UI by placing elements and editing their properties in the composer which are instantly reflected in the XML editor At any time the user can see the corresponding UsiXML specifications and edit it and if a tag or the elements are modified the changes are propaged to the graphical representation The user can then then save the UI in the UsiXML format I will use this tool in order to reverse engineers a resource script file and obtain a CUI model By importing a resource script file into GrafiXML the la
135. ation message 160 The attribute must be true to display a vertical toolbar control when the toolbar is part of a vertical rebar control see after 161 This is the case for toolbar controls that are hosted by rebar controls see after because the rebar control sizes and positions the toolbar 129 Appendix C If true prevents the control from using the default width and height when setting its initial size or a new size Instead the control uses its specified width and height NoParentAlign Boolean If true prevents the control from automatically moving to the top or bottom of the parent window Instead the control keeps its position within the parent window despite changes to the size of the parent Bottom Boolean By default the toolbar appears at the top of the parent window s client area The toolbar control can also be positioned along the bottom of the parent window s client area if true NoDivider Boolean If true prevents a two pixel highlight from being drawn at the top of the control Adjustable Boolean If true the toolbar is customizable The user can drag a button to a new position or remove a button by dragging it off the toolbar In addition the user can double click the toolbar to display the Customize Toolbar dialog box which enables the user to add delete and rearrange tools to select only the ones they need and organize them in a convenient way REBAR Rebar controls act as containers
136. awt event ActionEvent import java awt event ActionListener import java awt event WindowAdapter import java awt event WindowEvent import java util Vector import javax swing Box import javax swing BoxLayout import javax swing JButton import javax swing JDialog import javax swing JFrame import javax swing JLabel import javax swing JList import javax swing JPanel import javax swing JScrollPane import javax swing ListSelectionModel import javax swing event ListSelectionEvent import javax swing event ListSelectionListener public class ResourcesSelection extends JDialog implements ActionListener private JLabel label private JList list private JButton ok cancel private JPanel 10 11 panel2 panel3 panel4 private Vector v public ResourcesSelection Vector resources super JFrame null Import Resources true v 7 resources setSize 410 295 setFont new Font SansSerif 0 8 setDefaultLookAndFeelDecorated true WindowListener wlistener new WindowListener addWindowListener wlistener Color gray new Color 236 233 216 Creates the components label new JLabel Select resources to import label setAlignmentX Component CENTER ALIGNMENT label setDisplayedMnemonic S label setBackground gray list new JList resources list setSelectionMode ListSelectionModel MULTIPLE INTERVAL SELECTION list setLayoutOrientation JList VERTICAL list
137. cal scroll bar if present is to the left of the client area For other languages the style is ignored LTRReading Boolean If true the window text is displayed using left to right reading order properties This is the default MDIChild Boolean If true it s a MDI child window The multiple document interface MDI technique uses a single primary window called a parent window to visually contain a set of related document or child windows as shown in the figure below Each child window is essentially a primary window but it is constrained to appear only within the parent window instead of on the desktop These applications allow to display multiple documents at the same time with each document displayed in its own window NoActivate Boolean If true the top level window does not become the foreground window and activated when the user clicks it The system does not bring this window to the foreground when the user minimizes or closes the foreground window The window does not appear on the taskbar by default To force the window to appear on the taskbar App Window has to be true NolnheritLayout Boolean If true the window does not pass its window layout to its child windows NoParentNotify Boolean If true a child window does not send a message to its parent window when it is created or destroyed All child windows except those that have this attribute to true send this message to their parent windows By default
138. ck if the node reached is an internal one or a leaf one of its attribute containing a numeric value has just to be returned While a new flag string is inserted in the tree each new node object is created and added with this attribute set to zero except if it correspond to the last character of the string that is it will be a leaf In the last case this attribute takes to the numeric representation of the flag inserted So it is no longer required to add a special character at the end of each flag Whatever the current node when the searching stops its flag value is returned not only leaves can store a value different from zero To construct the trie for a set S of strings we insert the strings one at time in the constructor We insert a flag s having the numeric value val by calling addFlag s val The path associated with s is first traced Three situations can then occur s is already in the trie because it is a prefix of a string already inserted We stop at an internal node v and the end of s is reached val is then stored in v Supposing also that the flag read in a generated rc file has a valid syntax and has not been modified in the text by the user 79 5 15 not in the trie but a prefix of s corresponds to a flag already inserted in the trie We stop at an external node v before reaching the end of s The chain of nodes is continued after v to store the remaining characters of s the last contains val s
139. column header 15 Tn other words rows in list and report view will be sorted in that way For each of its items a list view control typically stores the image list index of the item s icons Because in list and report views items are displayed in the same order as their indexes the results of sorting are immediately visible to the user In icon and small icon views item indexes are not use to determine the position of icons and then the results of sorting are not visible 152 idem The control then creates and sets a state image list with two images State image 1 is the unchecked box and state image 2 is the checked box 154 An item may be selected when it is state in which a single click will select it 126 Appendix C TwoClickActivate Boolean If true hot tracking is enabled and the user must still click the item twice to select it the item may be selected only after it has been clicked once The next tree attributes apply to list view controls in icon or small icon view AutoArrange Boolean If true icons are automatically kept arranged in icon and small icon view NoLabelWrap Boolean By default item text may wrap in icon view If true item text is displayed on a single line in icon view NoScroll Boolean If true scrolling is disabled All items must be within the client area in icon and small icon view The remaining attributes apply to list view controls in report view NoColumnHeader Boolean By
140. combine several styles e val A value of the attribute A e upper A converts the text A in upper case e A A may occur only in a exended dialog box template that is a DIALOGEX resource and not a DIALOG resource e control def may contain any combination of control definitions one by line As noticed in the examples a numeric value can be specified in a resource script file instead of style flag identifiers When two or more style flags are numerically represented in the same group the values are added to form only one number The table show also the hexadecimal number associated with each flag class diagram logic name resource script file physic name dialog box template id DIALOG EX x width height lt helpId gt STYLE lt style gt CAPTION lt text gt EXSTYLE ex style LANGUAGE language lt sublanguage gt LE FONT lt pointsize gt weight lt italic gt man 1 lt control_def gt SF Class Flag value DIALOG DIALOG Aggregation relationship gt 1 15 the number of relationship instances and gt 1 is the number of lines in lt control_def gt in which the instance of DIALOG participates Attibutes DIgID id val DIgID Extended true DIALOGEX X x val X Y val Y Width lt width gt val Width
141. ctls_trackbar32 WS_TABSTOP 0x0000001A 245 17 16 104 CTEXT amp Cushion r nShading 1 271 122 32 18 CONTROL 1211 msctls_trackbar32 WS_TABSTOP 0x0000001A 279 17 16 104 CTEXT amp Height 1 305 122 32 18 CONTROL 1210 msctls trackbar32 WS TABSTOP 0x0000001A 313 17 16 104 CTEXT amp Scale r nFactor 1 339 122 32 18 CONTROL 1209 msctls trackbar32 WS TABSTOP 0x0000001A 347 17 16 104 RTEXT amp Light Incidence 1 246 147 59 8 LTEXT Static 1220 313 146 58 48 WS TABSTOP PUSHBUTTON 1034 242 167 55 22 BS_MULTILINE GROUPBOX St amp yle 1 7 146 63 49 AUTORADIOBUTTON amp KDirStat 1213 12 159 42 10 WS GROUP AUTORADIOBUTTON Se amp quoiaView 1214 12 176 53 10 NOT WS TABSTOP AUTOCHECKBOX Show amp Grid 1022 76 150 54 10 PUSHBUTTON Grid amp Color 1030 134 150 85 14 0 WS EX RIGHT PUSHBUTTON H amp ighlight Rectangle 1202 76 175 143 14 0 WS RIGHT Static 1219 339 7 32 8 CTEXT Static 1218 305 7 32 8 CTEXT Static 1217 2717 7 32 8 CTEXT Static 1216 237 7 32 8 LTEXT Static 1215 7 7 211 124 Resource Builder 143 DIALOGEX 0 0 380 202 0 EXSTYLE 0 STYLE DS_FIXEDSYS DS_SETFONT WS_CHILD WS_CAPTION WS_SYSMENU WS_DISABLED CAPTION Treemap FONT 8 MS Shell Dig 400 0 1 LANGUAGE LANG_ENGLISH 1 BEGIN CONTROL 8 amp Bright x0D x0Aness 65535 STA
142. d Restorator put a comma after the keyword EXSTYLE I ve used the regular BNF notations as meta language to define the syntax In this way it will be easier show the correspondence between a class or an attribute of the class diagram and a token of the language at a specific place in the template The next table lists these correspondences Before I give the notation used to express the rules in the table The keywords in bold appear as it stand in the resource file Except for the first line which is always specified these keywords are missing in the template when nothing follows that is the entire line is missing Meta laguage used to describe the syntax e lt S gt any entity of syntaxical category S e S suite of 0 1 or more entity of category S separated by the token e text typeface a character string text may contain escape caracters e g quote V new line n tab t backslash e id entire number or a character string e x y width height helpld pointsize entire numbers e style window flag begining with WS or a dialog box flag begining with DS_ 35 e ex style extended window style flag begining with WS language primary language identifier flag begining with LANG e sublanguage sublanguage identifier flag begining with SUBLANG_ e A B A is defined by B e ab a followed by b e a amp b aand b note that this meta language symbol is different from the language token used to
143. d also make an easy preview of each resource to give more information to the user in the dialog box Import Resources Select resources For import Importing resources MENU MENU 400 DIALOG 30 73 275 84 DIALOG BOX DIALOG BOX STYLE DS 3DLOOK DS SETFONT DS MOD ABOUT CAPTION Find GOLINE FONT 8 MS Shell Dlg GREP LANGUAGE LANG ENGLISH 1 INSABBREV t PARAMETERS CONTROL Fiend what 65535 STAT _ PARAMETERSNONMODAL CONTROL 222 COMBOBOX CBS_DRO TABSIZE lt CONTROL Match ewhole word only 255 CONTROL Match case 233 BUTTON 401 CONTROL Regular amp expression 239 CONTROL Wrap aroun amp d 240 BUTTOI CONTROL Transform amp backslash exp CONTROL Direction 65535 BUTTON CONTROL amp Up 234 BUTTON BS AUT CONTROL amp Down 235 BUTTON BS CONTROL amp Find Next 1 BUTTON B gt E But for space usage raison it is not effective to have an array of many references to long String objects when a large file is processed even if the garbage collector will deallocate the memory for some objects set to null when not selected by the user It s better to leave the information on disk and to extract them as and when we need required Moreover a preview is not very needful since the user has not to know this syntax to use this functionality and the decompiler used by the user to obtain the imported file displays already this information and an id is already associa
144. dialog box are important with radio buttons After using the TAB key to move to the currently checked radio button within the group the arrow keys can be used to change the input focus from that radio button to another within this group The system automatically assigns the style to the newly checked control when the user moves between controls in the group This ensures that the input focus will always be on the most recently selected control when the user moves to the group using the TAB key HorizontalScrollBar Boolean If true a horizontal scroll bar is added at the bottom of the window Also valid for child windows when the multiline edit controls have the automatic scrolling style it s sometimes useful to add window scroll bars to the edit control MaximizeBox Boolean If true although unusual an icon is displayed in the upper left corner that allow the user to maximize the dialog box and the maximize option in the system menu is enabled Maximized Boolean Specifies the initial state of the dialog box If true it is initially maximized Without specific initial state it appears as specified by its coordinate and dimension MinimizeBox Boolean If true an icon is displayed in the upper left corner that allow the user to minimize the dialog box and the minimize option in the system menu is enabled 97 The WM PAINT message 102 Appendix C Minimized Boolean Specifies the initial state of the dialog box If true
145. direct because the two models are expressed in the same formalism UML diagrams 78 Remark that the maximum height of T is one the only container in a Windows dialog box is a window which can contains child windows 67 The function ConstrBox id type is defined as AddNode box id AddAttribute id type type AddAttribute id isEnabled true AddAttribute id is Visible true A AddAttribute id id id The next group identify group boxes not containers in Windows x Ts x GROUPBOX ConstrBox boxld vertical AddAttribute boxId borderWidth 1 AddAttribute boxId borderType line AddAttribute boxId name x CtrlId where boxId nodee T x GROUPBOX ParentNode x SetFont true v ParentNode x ShellFont true gt AddAttribute boxId width 3304x x Weight 275 x ParentNode x FontSize AddAttribute boxId height 274x x Height 21 ParentNode x FontSize x Ts x GROUPBOX ParentNode x SetFont false ParentNode x ShellFont false gt AddAttribute boxId width 413x x Weight 275 AddAttribute boxId height 137 x x Height 84 x x GROUPBOX Size x Text 4 0 x HorizontalAlignment center gt AddAtribute boxId defaultBorderTitle x Text AddAttribute boxId borderTitleAlign x HorizontalAlignment x T x GROUPBOX ASize x Text 0 x HorizontalAlignment center gt AddAttribute b
146. dustry for example a manufacturer may purchase a competitor s vehicle disassemble it and examine the components to enhance their vehicles with similar components Reverse engineering as a method can also be used in the development of software including the user interface UI part giving access to its core functionalities Such method does not involve changing the existing source UI or creating a new UI based on the reverse engineered source It is a process of examination not change or replication To give a simple definition reverse engineering is the process of analysing an existing system to identify its components and their interrelationships and create representations of the system in another form or at a higher level of abstraction Reverse engineering is usually undertaken in order to redesign the system for better maintainability or to produce a copy of a system without access to the design from which it was originally produced In black box reverse engineering systems are observed without examining internal structure For example one might take the executable code of a program run it to study how it behaved with different input and then attempt to write a program which behaved identically or better In white box reverse engineering the inner workings of the system are inspected We could think that reverse engineer a program is reversing a program s machine code back into the source code that it was written in But it s
147. e Match whgle word only Direction C Up C Down Match case Regular expression Wrap around Transform backslash expressions The problem is that the drop down list is counted in the height of the control The height must be revised when creating boxes by considering only the field of the current selection 14 horizontal dialog units when the font size is 8 then 14 s 8 when the font is s Note that the dimensions of graphical individual components are not explicitly specified in the CUI model This will pose a problem for a button The dimension of this CIO as the dimension of a radioButton checkbox or toogleButton is defined by the length of the text put in it and then it cannot have a larger size and be aligned with other as illustrated above In addition if an image is put in the button instead of text its size is undefined since this resource and then the size of the image is not available The width of a listBox depends also of the length of its items The problem is the same the strings contained in a list box are not specified in a resource file PROGRESSBAR progressionBar Type marquee indeterminate true Type marquee indeterminate false Vertical true false orientation vertical horizontal STATIC Type ownerDraw Width w Height h outputText numberOfColumns w 4 numberOfLines h 8 STATIC Type text Width Height h outpu
148. e 163 h acts for one or two digit hour in 12 hour format m for one or two digit minute s for one or two digit second tt for two letter AM PM abbreviation dd for two digit day single digit day values are preceded by a zero and dddd MMMM and yyyy for full weekday full month name and full year respectively 164 For example the user cannot type the name of month only a number and the control would display the corresponding name of the month 165 Tf the preset formats not sufficient a custom format be created 132 Appendix C UpDown Boolean If true displays an up down control to the right of the control which is divided in different sections that can each be changed individually in place of the drop down month calendar as shown here MONTHCALENDAR 07 24 2005 E 07 24 2005 v A month calendar control implements a calendar like user interface This provides the user with a very intuitive and recognizable method of entering or selecting a date The title bar of the control provided by the Win32 API displays two buttons and two labels The left right button allows the user to select the previous next month 99 The left right label displays the currently selected month year To select any month of the current year the user can click the name of the month This displays the list of months and allows the user to choose one 2 2 D I select a year the user clicks the year nu
149. e position relative to their parent when the user moves the parent Dialog boxes can be modal or modeless with frame often encountered A modal dialog box ModalFrame true demands the user s attention before anything else can be done when displayed the user cannot switch between the dialog box and the window that created it the user must explicitly end the dialog box for instance by clicking a the Cancel button The user can however switch to another program while displayed It is usualy a pop up window having a thick border but a double border with DialogFrame true is also common for modal dialog box Some can also have a title bar Caption true that identifies the dialog s purpose with the text put in it value of Text with sometimes a question mark as in the fifth and sixth example ContextHelp true A modeless dialog box allows the user to switch between the dialog box and the parent window prefered when the user would find it convenient to keep the dialog box displayed for a while It is often a pop up window having a thin border Border true and a caption bar to let the user move the dialog box to another area of the display using the mouse The dialog box can also have a system menu box SystemMenu true to allows the user to select Move or Close from the system menu The controls CONTROL class contained in a dialog box to perform input and output tasks are child windows GeneralStyle child They can
150. e proposes many ways to create streams We couldn t make head or tail of the classes that can be used to create and manage streams in the Java Standard library To make a good choice and have a suitable solution to my problem things can be clarified by subdividing all these classes in two primary ways Firstly a program treats a stream as either an input stream an output stream In my case use an input stream object from which we read information Secondly some classes deal with character data and other with byte data of binary information naturally use a character stream that are designed to manage 16 bit Unicode characters resources information are stored in a file as character data and not 8 bit bytes of row binary data that are not interpreted These classes are cleanly divided in the class inheritance hierarchy The InputStream and OutPutStream classes and all their descendants represent a byte stream and the Reader and Writer classes and all their descendants represent a character stream FilterReader There is another way to divide the classes in the java io package A class can acts as either a source or destination called a data stream or can provide the means to perform some sort of manipulation on the data in the stream called a processing stream or also a filtering stream This is the same classes but categorized in another way The four mentioned primary class in the hierarchy can be f
151. e area of a dialog box Each page consists of a certain type of information or a group of controls that the application displays when the user selects the corresponding tab tab control can have specific characteristics like the alignment and general appearance of the control s tabs Tabl Tab2 Tab3 Type tabs buttons Tabs can appear either as tabs this is the default or as buttons Tabs in the second type of tab control should serve the same function as button controls that is clicking a tab should carry out a command instead of displaying a page Because the display area in a button tab control is typically not used no border is drawn around it Bottom Boolean If true tabs appear at the bottom of the control FixedWidth Boolean By default tab control automatically sizes each tab to fit its icon if any and its label If true all tabs are the same width FlatButtons Boolean If true selected tabs appear as being indented into the background while other tabs appear as being on the same plane as the background This style is used only with button tab controls FocusNever Boolean If true specifies that the tab control does not receive the input focus when clicked FocusOnButtonDown Boolean If true the tab control receives the input focus when clicked This attribute is typically used only with button tab controls ForceLeft none icon label none centers the icon and label within each t
152. e entire width of the tab control This style is used only with multiline tab controls ScrollOpposite Boolean If true unneeded tabs scroll to the opposite side of the control when a tab is selected ToolTips Boolean If true the tab control has a tool tip control associated with it to provide a brief description of each tab Vertical Boolean If true tabs appear at the left side of the control with tab text displayed vertically This style is valid only when Multiline true UPDOWN An up down control is a pair of arrow buttons that the user can click to increment or decrement an associated value called its current position such as a scroll position or a number displayed with a companion control called a buddy window To the user an up down control and its buddy window often look like a single control It can be specified that an up down control automatically position itself next to its buddy window For example you can 136 An item becomes hot when the mouse passes over it If hot tracking is enabled the appearance of hot items changes 137 A tool tip is short descriptive phrases that appear when the user holds the mouse pointer briefly over control or another part of the user interface 120 Appendix C use an up down control with an edit control as its buddy window to prompt the user for numeric input An up down control without a buddy window functions as a sort of simplified scroll bar For exam
153. e exploited Anyway this information should be in the text string of a menu item if not this lost of information is not really important since the user will not know the existence of the key combinations 47 4 4 About the decompilation tools I ve not here to motivate the choice of a particularly tool by saying which one is the better to use or the more developed to edit resources for example It s the produce rc resource file which interests me We can see in appendix B fragments of resource files given by the different decompilers and extracted from the same executable The tools decompiling a binary file give in general the same information I can see that they cover all the existing style flags since a numeric value is still specified if a tool doesn t recognize a flag identifier in its implementation It s the remaining value from a word of 32 bits stored in the binary file after extracting all the other recognized flags The first difference in the generated files is the use of the generic or shortcut notation to define the controls From those that use the generic notation Resource Hacker seems more reliable than Resource Builder Between the two other tools I prefer Restorator than Resource Tuner In the tests that l ve made the last gives sometimes oddities in the specification of the resources see for example the frame that I ve drawn in the specification of the sixth example The difference rests principally in the complete r
154. e of a tab control multiple rows of tabs have to be able to be displayed when necessary Vertical true is valid only when Multiline true But this is the concern of graphical user interface programming I wil have an input file which is supposed to be correct and even if it isn t I have not to correct it my task is to restore the dialog box in another language like it is specified Moroever the reason for these contrains can guarantee that a resource file respects them The constraints that we can found in Windows documentation express in fact incompabilities for flag identifiers As yet mentioned it the style flag is represented in memory by one bit at a specific position in a word or by n bits if it is mutually exclusive with others where n is the minimum number of bits to represent the set S of exclusive flag that is 27 lt cardinal number 5 lt 2 For example the 19 different types of static controls are grouped in the five first bits which can represent 2 36 flags 43210 43210 ss_LEFT 55 USERITEM SS SS SIMPLE SS SS LEFTNOWORDWRAPT ss 55 OWNERDRAW SS 55 SS SS 55 SS ETCHEDHORZ
155. e of the class that has been registered and defining the control The name will be for example ellipticalPushButton if we suppose that a customized class with this name exist to use a personalized button 4 2 4 Constraints I talk here over some contraints that are not expessed in the class diagrams The inheritance from the WINDOW class is attribute defined controls are child window and dalog boxes are pop up window A dialog can inherit from extended window attributes from ClientEdge to Transparent only if it is also an extended dialog that is if Extended true A control can inherit of an extended window attribute only if the dialog box that contain it is an extended one But we can see that some window attributes extended or not are not relevant for controls and also for diolog boxes Attributs that are usually used by controls are Child Disabled Visible Border TabStop Group VerticalScrollBar HorizontalScrollBar Note also that a combo box cannot used all the specific attributes of a list box and edit controls it can use only the AutoHScroll LowerCase OEMConvert UpperCase Sort DisableNoScroll HasStrings NoIntegralHeight OwnerDrawFixed and OwnerDraw Variable attributes Some attributes specific to the COMBOBOX and RICHEDIT classes can also be used in this condition 33 A remark has to be made with the font in a dialog box If one of the SetFont and ShellFont attributes is set to true there is additional data in
156. e owner of the list box receives messages 22 whenever the user presses key and the list box has the input focus This enables an application to perform special processing on the keyboard input NoData Boolean If true it s a no data list box Useful when the count of items in the list box will exceed one thousand A no data list box resembles an owner drawn list box except that it contains no string or bitmap data for an item NoRedraw Boolean If true the list box s appearance is not updated when changes are made EDIT This class defines an edit child window It s a rectangle containing editable text based on dimension of the child window An edit box typically allows the user to enter and edit text by typing on the keyboard Alignment left right center Specifies if the text in a single line or multiline edit control is left justified right justified or centered in the rectangle Multiline Boolean If true it s a multiline edit control By default the control has a single line entry field AutoHorizontalScroll Boolean If true the control automatically scrolls text to the right when the user types a character at the end of the line When the user presses the ENTER key the control scrolls all text back to position zero Otherwise only text that fits within the visible area is allowed for single line edit controls For multiline edit controls if false the text is wrapped to the beginning of the next line wh
157. e programs are usually used to edit the resources modify add and delete resources The resources can also be saved as image files ico bmp etc as binary resource files res or as resource script files rc This last functionality giving a text representation of the UI is integrated in my reverse engineering process An example of resource script file generated by one of these tools is given in appendix A The reverse engineering tool will provide as output a UsiXML User Interface eXtensible Markup Language description of the given resource script file This language gives an XML UI description It has been chosen to express the abstract representation of the UI because it s a UIDL that can be used to specify a platform independent UI and enabling multi path UI development UsiXML can express various models depending on the level of abstraction In my case the UI will be reverse engineered at a level of abstraction dependent of the modality of interaction since it s a graphical UI The model produced at this level is the Concrete User Interface CUI model It can represent in a sufficient degree of expressiveness the elements perceived in a UI code in any specific language A set of forward engineering tools using this language are also today available The UsiXML language and its level of details and abstractions are introduced in chapter 5 XML is frequently used to describe and design UI for any device any target language and any oper
158. each column As example this header has labelled columns giving detailed information about files in a directory Name Modified Buttons Boolean Each item in the control looks and behaves like a push button This style is useful if an application carries out a task when the user clicks an item in the header control For example an application could sort information in the columns differently depending on which item the user clicks DragDrop Boolean If true allows drag and drop reordering of header items FilterBar Boolean If true include a filter bar as part of the standard header control this bar allows users to conveniently apply a filter to the display Flat Boolean If true the header control is drawn flat when Microsoft Windows XP is running in classic mode FullDrag Boolean If true the header control displays column contents even while the user resizes a column Hidden Boolean If true indicates a header control that is intended to be hidden it s sometimes useful to use the control as an information container instead of a visual control Horizontal Boolean If true the header control is oriented horizontal HotTrack Boolean If true enables hot tracking TOOLBAR A toolbar control is a window that contains a group of buttons that bring the key functionality of an application closer to the user we can perform common tasks with a simple click rather than performing various
159. each other That is when a particular child window receives a paint message all other overlapping child windows are clipped out of the region of the child window to be updated If false and child windows overlap it is possible when drawing within the client area of a child window to draw within the client area of a neighbouring child window Disabled Boolean Specifies the initial state of the window dialog box or control If true it is initially disabled To receive mouse and keyboard input a control must be both visible and enabled by default DialogFrame Boolean Specifies the frame around the dialog box If true it has a thicker frame double border typically used with dialog boxes A window with this style cannot have a title bar Group Boolean If true it s the first control of a group of controls in which the user can move from one control to the next with the arrow keys In a resource file all controls without this style Group false in the class diagram after such control belong to the same group The next control with this style starts the next group that is one group ends where the next begins TabStop Boolean If true the user can move by using the TAB key through the controls The TAB key moves the user to the next control having this style The first control in each group usually has this attribute set to true so that the user can move from group to group These key interfaces that Windows adds to a
160. ed Edit Diadram the control cannot have the desired appearence in the final result In chapter 6 see this other potential loss of information 25 4 2 Resource files modelization The purpose of this section is to structure informations that can be found in a resource script file To modelize the problem in a standart way I ve used the UML Unified Modeling Language notation This will also enable to have a direct model to model mapping Indeed the CUI model is represented with the UML notations so the source and target meta models use the same formalism Only the resources of type menu and dialog box will reveal important The two first sections give the related class diagrams 4 2 1 Menus class diagram MENUBAR MenulD Language String Sublanguage String POPUPMENU Text String State enabled disabled grayed 0 1 Position Integer p Q 1 0 7 SEPARATOR aa Text String Position Integer Checked Boolean State enabled disabled grayed Position Integer The class diagram modeling a resource of type menu is simple Note that it s a modelization of a resource file and not of the real user interface specified by the file The link between a menu item and a dialog box cannot be represented because this relation is not specified in the file This class diagram is then separated from the next
161. ed item will collapse automatically when a new item is expanded If the user holds the CTRL key down while clicking an item the item being unselected will not be collapsed TrackSelect Boolean If true enables hot tracking in a tree view control Each tree node label takes on the appearance of a hyperlink underlined with a blue color as the mouse pointer passes over it LISTVIEW A list view control is a specialized window that displays a set of items Each item consists of an icon and a label This window allows the user to arrange and display items such as files in four ways using their large icons using their small icons as a list or as a report Note that a resource file describing a control when the dialog box is first invoked only one particular view can be specified but I suppose that specific properties of other future views can still be specified View icon smalllcon list report A list view control can display items in four different views This attribute specifies the current view In icon view each item appears as a standard icon with a label below it In small icon view each item appears as a small icon with a label to the right of it In list view each item appears as a small icon with a label to the right of it and is displayed in a single column list on the screen In report view additional information about each item is displayed in columns to the right of the small icon and label The user can drag the it
162. ed styles extendedStyles st sval equals LANGUAGE Extract the language used in the dialog box st nextToken languagez st sval substring st sval indexOf 41 st sval length toLowerCase System out println language language Go to the the next line while st nextToken StreamTokenizer TT EOL st sval equals FONT Extract the font that is used for controls in the dialog st nextToken fontSize byte st nval st nextToken st nextToken fontName st sval if st nextToken There is information about weight and italic st nextToken if st ttype StreamTokenizer TT WORD FW SEMIBOLD FW DEMIBOLD FW BOLD FW EXTRABOLD FW UTRABOLD FW HEAVY or FW BLACK if st sval indexOf B 1 st sval equals FW HEAVY bold true else st ttype StreamTokenizer TT NUMBER if st nval gt 550 0 bold true st nextToken st nextToken if st sval equals TRUE italic true Go to the the next line while st nextToken StreamTokenizer TT EOL Else it was an end of line token System out println font fontSize fontName bold italic st sval equals BEGIN Begin END is sometimes used by Resource Builder instead of st ttype Causes the next call to the nextToken method to reread the token but return the current value in the ttype field and not to modify t
163. egining of a paragraph after evantual skiped comments if st hasMoreTokens secondToken st nextToken there is matching strore the resource with the current line if secondToken equals DIALOG secondToken equals DIALOGEX secondToken equals MENU The current line is normally r getLineNumber 1 because after reading a line the position in the file is set at the begining of the following line But this value has to be considered for consistency with the streamTokenizer which counts the lines starting from 1 and not 0 used to process resources v add new Resource r getLineNumber firstToken secondToken charAt 0 Skip lines of the same paragraph do line r readLine while line null amp amp line length 0 ee Create a dialog box to get user choices For each object in the vector resources an item is created in a list If the user pushes on the Ok button the vector is updated suppress not selected objects If the user pushes on the Cancel button the vector becomes empty private static void displayDialog Vector v ResourcesSelection frame new ResourcesSelection v frame show public static void process int p throws IOException Create the tokenizer to read from the supplied filename note that a StreamTokenizer can return the line number LineNumberReader lnr new LineNumberReader new FileReader fileName StreamT
164. ems to an arbitrary location in the window only in icon or small icon view Additional attributes provide other options such as whether a user can edit labels or select more than one item at a time whatever the view type Align left top Specifies the way items are arranged in icon and small icon view Items are either aligned with the left or with the top by default of the control EditLabels Boolean If true the item text can be edited in place Otherwise the user can read only OwnerData Boolean 19 Only the first field of each row in the report view 125 Appendix C If true the control is a virtual list view control being able to handle millions of items because the owner receives the burden of managing item data This allows using a list view control with large databases of information where specific methods of data access are already in place The control does not store any item information itself Except for the item selection and focus information the owner of the control must manage all item information ShareImageLists Boolean If true an image list will not be deleted when the control is destroyed This style enables the use of the same image lists with multiple list view controls ShowSelectionAlways Boolean If true the selection if any is always shown even if the control does not have the focus SingleSel Boolean By default multiple items may be selected If true only one item at a t
165. en necessary If an edit control has HorizontalScrollBar set to true this property is applied automatically 121 The LB_GETTEXT message 122 WM_VKEYTOITEM messages 123 Tf true the user must press the ENTER key to start a new line 113 Appendix C AutoVerticalScroll Boolean If true the edit control automatically scrolls text up when there is more text than can be displayed within the control This style is applicable to multiline edit controls only With this style off the edit control ignores input that cannot be displayed If an edit control has VerticalScrollBar set to true this property is applied automatically PasswordField Boolean If true displays all characters as an asterisk as they are typed into the edit control valid only for single line edit controls LowerCase Boolean If true converts all characters to lowercase as they are typed into the edit control 2 UpperCase Boolean If true converts all characters to uppercase as they are typed into the edit control NoHideSelection Boolean Normally an edit control hides the selection when the control loses the input focus and inverts the selection when the control receives the input focus If true delete this default action the selected text is inverted even if the control does not have the focus ReadOnly Boolean If true prevents the user from entering or editing text in the edit control Number Boolean If true allows onl
166. ental Chord Chart Play Chord Insert Chord Chord Insert Chord Play Fifth 5 5 Edit Diagram ith rsrs Edit Diagram Chord Builder a Insert Chord Fifth 5 15 Edit Diagram Ninth 9 19 z Inversions Ninth 9 9 Ninth rers Inversions Inversions Close Add Resource Tuner Resource Builder Resource Hacker The objective of my thesis will be to attempt to faithfully reproduce in GrafiXML the graphical interface described by a given resource file not what we really see on the screen when we use the application A resource file gives us only a point of view things can be managed internally in the program a control with WS_VISIBLE can be not visible Depending on the consistency of these input files the interface specified can be different from the actual interface The result described in UsiXML cannot naturally be better My task is still to utilize as much as possible the informations from a resource script file to restore the interface even though a first loss of informations can occur before the reverse engeneering process The content of this files is what I will see in the next sections In addition some elements not covered in UsiXML can be also lost If it hasn t the counterpart of the property that a chexk box can look like a push button for example this is what means the BS PUSHLIKE for the check box label
167. enuID either a unique name or a unique 16 bit unsigned integer value in the range 1 to 65 535 Is the name identifying the menu used to find menu data in program resources Language String Is a language identifier that specifies the language of the menu Sublanguage String Is a sublanguage identifier POPUPMENU A popup menu can contain menu items and other popup menus which are displayed when the user highlight it Items on the menu bar almost always invoke a popup menu also called drop down menus Text String This is what appears in the menu ampersand amp inside the value designates the letter that follows as the mnemonic State enabled disabled grayed A popup menu can be enabled by default disabled or grayed When an item is not available to the user it is grayed or disabled A disabled item looks just like an enabled item When the user clicks on a disabled item the item is not selected and nothing happens A grayed item is displayed in gray text P Position Integer Each popup menu is located in a specific position The leftmost item in the menu bar or the top item in a popup menu has Position 1 The position value is incremented for subsequent items MENUITEM This class define a command item which is checked or cleared to indicate whether an option is not in effect or which can invoke a dialog box to obtain input from the user that can t be easily managed through the menu ItemID
168. er bocioan inputText integer perLinkTarget uri lefaultKeyboardShortcut string string elativeMinWidth integer extMargin integer ext VerticalAlign string faultHyperL inkTarget uri E ultState boolean elativeMinHeight integer is Editable boolean lextHorizontalAlign string roupName string isFlow boolean isWordWrapped boolean crollStyle string oo isScrollable boolean rceWordWrapped boolean i ridWidth string raxLength integer ridHeight string umberOfColumns integer m Y umberOfLines integer crollHorizontalSpace integer 1 extVerticalAlign string crollVerticalSpace integer imageZone listBox extHorizontalAlign string uri faultFilter string isPassword boolean crollAmount integer crollDelay integer umberOfColumns integer umberOfLines integer perLinkTarget lefau
169. er selected resources of type dialog box or of type menu from f are transformed into CUI in GrafiXML or a message if f doesn t contain any exploitable resource that is it doesn t exist in f a dialog box or menu resource described in the expected syntax An error message will also be displayed if the file cannot be found pre specification not satisfied Notice that only Windows resource can currently be processed in the plug in nothing happens if a file with another format as an Apple resource file or a screen definition file is imported So the specification should change if a future expansion of my work is undertaken As yet mentioned the design can be logically decomposed into two modules The following is the tasks that each module should perform Module 1 the scan phase Input An existing Windows resource script file f of a valid structure that is each different resource must be separated by at least one empty line of text An empty line is a line containing only white space consists of blanks tabs and new line characters Output f is closed and unchanged An array a is returned containing the line numbers in f of all the dialog box and menu resources or a subset of them depending of the selection of the user a cannot be null and its length is 0 if there is no such resource in f this includes the case of an empty file f The first in f line starts at 1 The expected syntax of a resource of type dialog box and menu a
170. esearch vaquita htm State of the art on reverse engineering and transcoding of UIs available on http www isys ucl ac be bchi research soare htm 86 Appendix Example of complete resource file There is an example of file ALL_RESOURCES rc containing all the resources from my first example SciTE exe generated by Resource Hacker This is the ACSI resource script that can be saved by a decompiler not the binary compiled resource file res SIPULI eur 179 NALINNIW Tey NALINNIN 8 gt siepejeu SUITE dNdOd MOLVUVdIS WALINNIW MALINNIW ST andgejno Geum WILINNIW ORW WALINNAW PUIA PHO 50 4 usdO WILINNIW 096 do1 uo siema NALINNIW suondos 4 4 94 HI00 9URd MALINNIW 029 S4 yrqsTandyno MALINNIN LOE WILINNIW 90 INB WILINNIW 1 435 WILINNIW POE SARIHAN UNIXI 40159 WILINNIW EOE 54098 WILINNIW 20 WILINNIW 10 24 HIDI POWODR gt 480019 4neo4 ZI WILINNIW 60 g41andinom Soy MALINNIW Sov UNS WILINNIW 10 si9quinN SUITS WILINNIW saping WILINNIW 6yIS 1n2
171. esentation level since the images themselves are not available a binary file is just referenced in the definition of such resources and their size often defines the place taken in the dialog box Text information can also be missing such as items contained in a list box for example Concerning the dynamic aspects of the interaction the transition between a menu and a dialog box and the navigation among dialog boxes are not specified Moreover the input of my method relies on the specific implementation of a decompilation tool used to generate the file The UsiXML specification language has been chosen to express the abstract representation of a user interface This language can specify a set of models defining the user interface at multiple levels of abstraction This language support also a multi path user interface development the development process can be initiated from any level of abstraction The goal of my reverse engineering method was to recuperate an existing user interface and to produce directly a model specifying the user interface at a level of abstraction dependent of the modality of interaction but independent of the platform This model which allows capturing the appearance and behaviour of a graphical interface the Concrete User Interface can be reused by an ulterior forward engineering step to generate new code in another specific language There is a second loss of information in the reverse engineering process when going from
172. esource script file In appendix A we can see a file given by Resource Hacker Note that the resources specifying the accelerators and version information are detailed in this file Resource Builder includes in addition a text representation of binary files which are normally only referenced in the resource script file There is how are specified an icon or a bitmap image it s only a fragment the icon resource for example have 511 lines of hexadecimal numbers SCITE ICON MOVEABLE PURE LOADONCALL DISCARDABLE LANGUAGE LANG ENGLISH 1 BEGIN 100 00 01 00 04 00 30 30 00 01 00 00 00 00 8 OE 100 00 46 00 00 00 20 20 00 01 00 00 00 00 A8 08 100 00 EE OE 00 00 10 10 00 01 00 00 00 00 68 05 5 100 01 CO 00 00 03 00 00 03 EO 00 00 07 00 100 OF F8 00 00 1F FC 00 00 FE 00 00 7F FF 80 01 FF FF FO OF FF END 100 BITMAP MOVEABLE PURE LOADONCALL DISCARDABLE LANGUAGE LANG ENGLISH 1 BEGIN 42 4D EE 00 00 00 00 00 00 00 76 00 00 00 28 00 100 00 10 00 00 00 OF 00 00 00 01 00 04 00 00 00 00 00 78 00 00 00 12 00 00 12 OB 00 001000 FF FF FF FF FO 77 77 70 FF FF FF FF FO 77 77 70 FF FF FF 00 00 77 77 70 FF FF FF OF 07 77 77 70 FF FF FF 00 77 77 77 70 00 00 00 077777 END 48 These numbers should have perhaps been exploited to restore an image in my reverse engineering process Icon and bitmap image as cursors are in reality a collection of bits in an array of any number of rows and colum
173. f the bit is not already set to 1 it is positioned When a control is defined with the shortcut notation the algorithm that I used to identifying the control type is much simpler that with the style flags But if we look at it is not very different in the sense that as soon as the current checked character is different to the characters of the other words of the same set and at the same position we know which flag is in question token lt nextToken case token 0 is if token 4 C then type lt AurocHECKBOX else type lt AUTORADIOBUTTON is if token 1 H then type lt CHECKBOX elseif token 1 O then type lt else type lt is D type lt DEFPUSHBUTTON is E type lt EDITTEXT is G type lt GROUPBOX is T type lt ICON is L if token 1 T then type lt LTEXT else type lt LISTBOX is if token 1 then type lt RADIOBUTTON else type lt RTEXT is type lt PUSHBUTTON is S type lt SCROLLBAR 8l Such conditional statement becomes feasible seeing that only 15 different class names can match with the string read from the text Once the type identified I know the class of the control and the flags and the style flags to add to the style variable The is treated Each resource of type dialog box is then parsed and stored in variables even the style flags converted in numeric Each control expressed in the shortcut
174. f use It specifies multiple models structured according to the four layers of the Cameleon framework This approach is a model driven architecture MDA the interactive system to be build is described by a series of models and transformations between them all expressed in a unified notation The models produced can be listed and maintained in a model repository which is fed and accessed by a series of tools to be reused in an efficient way The basics models are the task domain AUI CUI and context models The language can also specify the relationship between these models with the mapping and transformation models The AUT and CUI models reflect the AUT and CUI levels The following presents UsiXLM in terms of a UML class diagram that is the meta model of the language The topmost superclass uiModel contains common features shared by all component models of a UI 78 Graceful degradation techniques may be applied in this case to take into account the constraints imposed by the target platform gt The domain model is a description of the classes of object manipulated by a user when interacting with a system The context model describes the tree aspects of the context of use 61 The mapping model expresses the correspondence between elements of the models following the reification abstraction and translation relationships 62 The transformation model formalizes explicitly the transformation between two models with t
175. faces are used could not be transformed into the CUI model This concerns the FUI model CONTROL Position n cio name control n X Y Width Height serve to the creation of boxes with eventually some graphicalAlignment between two components inside a box Disabled true graphicalCio isEnabled false Visible false graphicalCio isVisible false Text t and amp is a character of t and the graphicalIndividualComponent defaultMnemonic the control is a radio button a push button a character following amp int customized button or a check box In my transformation the identifier of a resource corresponds in general to the name of a CIO The user can then still connect the produced object with the resource in the file after the reverse engineering process However for child window controls I use the line number of their definition in the template for the name They can be then easier localised and most of all in a unique way the controls who not receive user input as static controls have all 1 as identifier For a component the concept of position and dimension inside a window is absent from the CUI model To place each component horizontal and vertical boxes will have to be defined using the position and dimension values of all controls specified in the resource file Alignment properties can also be defined between two components inside a box Look at the measures in the dialog bo
176. g type name get ExtensionName return resources files plugin name get PluginName return Import Resources plugin author get PluginAuthor return Julien Marion plugin version get PluginVersion return 0 1 plugin description get ver get PluginDesc return This plugin is used to import resources files sions of GrafiXML which can use the plug in PluginDepend return lt 1 1 99 138 Appendix D J FCKCKCKCOKCKCKCKCKCKCKCKCKCKCKCKCICKCKCKCICKCKCKCICKCKCKCICKCKCKCKCKCkCkCkCk CkCkCkCkCkCkCkCkCkCkCkCkCkCkCk RcFile java Author Julien Marion This class contains methods to read a Windows rc file and to process it in CUI into GrafiXML J RR RRR kk RK KR KKK kk koe kk ko kk Ck ok kk oko KK package importresources import java io File import java io FileReader import java io LineNumberReader import java io IOException import java io StreamTokenizer import java util StringTokenizer import java util Vector public class RcFile private static File fileName private static boolean dialogSelected false private static FlagTrie T null Scan a specified file for resources and return an array of line numbers that locate resources the user has chosen to import in GrafiXML public static int scan File f throws IOException fileName f Create t
177. g The recorder localizes aspects of the legacy system relevant to a specific task In this approach an interface is viewed as a collection of screens each allowing a set of transition actions to other screens The screens are captured by the recorder that records each session visited screens actions in order to achieve specific tasks The pilot translates the transition actions in functionally equivalent actions in a new graphical user interface The code is not needed in this approach and the necessary information is extracted to complete the tasks on the old system The model produced is used to construct models of the tasks performed in the system These models are then used to develop a new web accessible interface for executing these tasks in a forward engineering phase The reverse engineering step is not only used for the reengineering of a UI For example I could still mension a process named GUI Ripping 4 which creates a model from a graphical UI for testing To detect defects in UIs test cases can then be automatically generated 3 Reverse engineering method I present in this chapter the reverse engineering method that will be used to obtain the specifications of an existing graphical user interface 3 1 General method Reverse engineering is the general process of analyzing a technology to see how it works Originally it s a practice taken from industries that is now frequently used on computer software In the automobile in
178. g box in dialog box units Height Integer Specifies the height of the dialog box in dialog box units HelpID Integer Specifies a numeric expression that indicates the identifier of the dialog box during help messages processing The value is 1 if 3DLook Boolean If true gives three dimensional borders to child controls in the dialog box and draws the entire dialog box using the three dimensional colour scheme AbsoluteAlignment Boolean If true indicates that the coordinates of the dialog box are screen coordinates If not the system assumes they are client coordinates Center Boolean If true centers the dialog box in the working area CenterMouse Boolean If true places the dialog box so that the mouse cursor is centered in the dialog box ContextHelp Boolean If true includes a question mark in the title bar of the dialog box ContextHelp designates only a placeholder When the dialog box is created the system checks for this style and if it is there adds the extended style see ExContextHelp in the WINDOW class to the dialog box DialogIsControl Boolean If true the dialog appears like a control not child with no frame FixedSys Boolean By default the system draws all text in a dialog box using the SYSTEM 92 font If true causes the dialog box to use the SYSTEM FIXED FONT instead of the default SYSTEM FONT 190 One horizontal dialog unit is equal to 1 4 of the average
179. he LinenumberReader to read from the supplied filename Converts the original input stream into a character input stream FileReader new FileReader fileName Transform it into a LineNumberReader which allows to use the readline method to get an entire line of character input in one operation and keeps track of line numbers LineNumberReader lnr new LineNumberReader This vector contains Resource objects It will dynamically grow as a new resource of type menu or dialog is found in the file It will dynamically shrink as the user decide to import less resources than those found Vector resources new Vector 25 Scan the file for resources fill vector readLines lnr resources r close test for int i 0 i lt resources size 1 System out println Resource resources elementAt i toString System out printin n n x Call the method which create the dialog box for resources selections displayDialog resources tests for int i 0 i lt resources size 1 System out println Resource resources elementAt i toString System Out print In ses yr System out println n n Return the line numbers where are the selected resources to process int pointers int n resources size pointers new int n If resources is empty pointers length equals zero for int index 0 index
180. he Windows functions ShowWindow with SW HIDE as one of the parameter and Enable Window with FALSE as one of the parameter There is the resource with Resource Builder 22 DIALOG 76 29 284 174 STYLE DS 3DLOOK 05 SETFONT 05 MODALFRAME DS NOIDLEMSG 05 CONTEXTHELP WS POPUP WS SYSMENU WS CAPTION CAPTION Chord Builder FONT 8 MS Sans Serif LANGUAGE LANG NEUTRAL 0 BEGIN CONTROL amp Fundamental 24 STATIC SS LEFT WS CHILD WS VISIBLE 8 4 60 10 CONTROL 101 COMBOBOX CBS DROPDOWNLIST WS CHILD WS VSCROLL WS TABSTOP WS VISIBLE 8 15 76 115 CONTROL amp Chord 25 STATIC SS LEFT WS CHILD WS GROUP WS VISIBLE 8 31 54 10 CONTROL 102 COMBOBOX CBS DROPDOWNLIST WS CHILD WS VSCROLL WS TABSTOP WS VISIBLE 8 42 76 100 CONTROL amp Fifth 26 STATIC SS LEFT WS CHILD WS VISIBLE 8 62 32 10 CONTROL 5 301 BUTTON BS AUTOCHECKBOX WS CHILD WS TABSTOP WS VISIBLE 47 61 21 10 CONTROL 5 302 BUTTON BS AUTOCHECKBOX WS CHILD WS TABSTOP WS VISIBLE 69 61 21 10 CONTROL amp Ninth 27 STATIC SS LEFT WS CHILD WS VISIBLE 8 74 38 10 CONTROL 9 401 BUTTON BS AUTOCHECKBOX WS CHILD WS TABSTOP WS VISIBLE 47 73 21 10 CONTROL 9 402 BUTTON BS AUTOCHECKBOX WS CHILD WS TABSTOP WS VISIBLE 69 73 21 10 CONTROL amp Inversions 28 STATIC SS LEFT WS CHILD WS VISIBLE 8 90 63 10 CONTRO
181. he graph transformation techniques in conformity with the transformation definition generated from a mapping specification 53 uiModel comment 5 reationDate string 0 0 authorName 0 1 chemaVersion string version modifDate string E 2 bw LE 0 1 7 0 1 0 1 0 1 0 1 BN transformationModel domainModel taskModel auiModel cuiModel mappingModel contextModel ResourceModel A unified language specifying these models allows designers to exchange and share fragment of specifications and enables tools to operate on these specifications UsiXML is currently supported by several tools as IdealXML which specifies the task domain AUI and mapping models GrafiXML which is a CUI editor or ReversiXML which enables FUI reverse engineering of HTML files To design a user interface the techniques proposed can follow a forward engineering The designer uses first IdealXML to build a task and a domain model which is a UML class diagram an entity relation model or an object oriented model and establish different types of mappings between the two models as in my simple example mapping the task enter word with an attribute or the task launch search with an operation The abstract UI can be then obtained using several rules for example the structure of the
182. he table above I ve used an empiric method I ve choose a dialog box using the default 8 point Tahoma font or an 8 point MS Sans Serif font which seems to have the same character width and height because the resulting dimension is the same and I ve watched its dimension in pixels For that one from my first example I observe that the client area is 413 pixels wide and 137 pixels high So we have for the relations from the table Find Mark All Cancel C Up C Down Match case Regular expression Wrap around Transform backslash expressions 137 Match whole word only B Find x Match whole word only Direction Mark All Match case Regular expression Wrap around Transform backslash expressions ao 1e xChar yChar Where the width w is 275 and the height h is 84 in dialog units We have then the estimations xChar 0 and yChar oe 413 137 Seeing that another font size s be employed these values must still be multiplied by s 8 If another type of font is used as Courier New I decide that the dimensions in the dialog box will not be adapted and some texts may be clipped It s not frequent to see another font used in a dialog box of a Windows application After all when the user changes the font in a GrafiXML Find Next Mark All Find what project this not affects the size values firstly Match whole word onl
183. he value in the nval or sval field st pushBack st sval equals MENU st sval equals CLASS Other unfrequent but possible keywords in the dialog template not implemented the line is skiped Example of scenario 2s 400 DIALOG 30 73 275 84 STYLE DS_SETFONT DS_MODALFRAME DS_3DLOOK WS_POPUPWINDOW WS_CAPTION CAPTION Find FONT 8 MS Shell Dlg MENU 403 include a menu in the dialog box it has to be defined in the menu resource dE r readLine else It is an id Another resource has been reached because an empty line resources separator has not been respected and will not be processed because not referenced in the pointers array Example of scenario 400 DIALOG 30 73 275 84 STYLE DS SETFONT DS MODALFRAME DS 3DLOOK WS POPUPWINDOW WS CAPTION CAPTION Find FONT 8 MS Shell Dlg ABOUT DIALOG 26 41 350 242 fr hasControls false st ttype st pushBack break case StreamTokenizer TT_EOF Dialog box without child controls definitions end of file has been reached hasControls false st ttype st pushBack break case StreamTokenizer TT EOL Skip an empty line that has been reached not normally occurs in a valid syntax dialog box template Example of scenario FF es 400 DIALOG 30 73 275 84 STYLE DS SETFONT DS MODALFRAME DS 3DLOOK WS POPUPWINDOW WS CAPTION CAPTION Find
184. he word retrieval One primary application for tries is to determine if a given pattern matches one of the words of a text exactly that is word matching but with a simple extension prefix matching queries can be performed My problem can be saw as a string searching the flag just read in the file in a text composed of the set S of all the flag identifiers listed in section 4 3 When the word matching occurs the numeric value of the flag is returned I use a standard tries which is an ordered tree T with the following properties Each node of T except the root is labelled with a character of the alphabet A Z U 3 _ The ordering of the children of an internal node of is determined using the lexicographical convention T has s external nodes leaf each uniquely associates with a string of S the concatenation of the labels of the nodes on the path from the root to an external node yields a string of S T has then s external nodes Note that the trie stores the common prefixes that exist among the set of the flag string This assumes that in S no string is a prefix of another string This is not the case for the following flag DS_CENTER and DS_CENTERMOUSE WS_CHILD and WS_CHILDWINDOW here not important because these flags are synonyms WS_MAXIMIZEBOX and WS_MAXIMIZE WS_MINIMIZEBOX and WS_MINIMIZE WS_OVERLAPPED and WS_OVERLAPPEDWINDOW WS POPUP and WS_POPUPWINDOW WS_TILED and WS_TILEDWINDOW WS_EX_LEFT and WS_EX_LEFTSCRO
185. iated to my first example the Find dialog box STYLE DS_SETFONT DS_MODALFRAME DS_3DLOOK WS_POPUPWINDOW WS_DLGFRAME As we will see in the shortcut notations section 4 3 2 the flag WS_POPUPWINDOW includes WS_BORDER With the numerical values we can see that WS_CAPTION set the bits at positions 23 and 24 of to 1 whereas WS_DLGFRAME and WS_BORDER set only the bit at position 23 and 24 respectively to 1 the three flags are grouped in two bits So if the two last flag are specified for a dialog box it s as if the first flag was specified In fact WS_DLGFRAME implies no title bar The numerical value of DS SHELLFONT is equal to DS FIXEDSYS DS SETFONT The value of DS_SHELLFONT was surely chosen so that older operating systems would accept the flag while nevertheless ignoring it This allowed people to write a single program that got the Windows XP look when running on Windows XP and got a classic look when running on older systems Older systems accepted the flag since it was indeed a valid flag but they also ignored it because the DS_SETFONT flag takes precedence For the font identifiers are generally specified in the resource script file instead of particular numeric values Value of Weight Windows identifiers 0 FW_DONTCARE 100 FW_THIN 200 FW_EXTRALIGHT or FW_ULTRALIGHT This flag is not required for a modal dialog box If not present the system will set it even so visible For a control if this flag
186. ic update operations AddNode class id add a new node with the identifier id storing an element which is an instance of class AddAttribute id name value add to the node id the attribute name initialised to value ModifyAttribute id name newname newvalue suppress the attribute name of the node id and add the attribute newname with the value newvalue AddArc idSource idTarget connect the parent node idSource with its child node idTarget Rules identifying containers This first group of rules is applied first and the two new nodes are linked once created The first rule of each group corresponds to the detection of a node in the source tree that causes the creation of a node in the target tree x Ts x DIALOG AddNode dialogBox rootId AddAttribute rootlId id rootId AddAttribute rootId x Dlgld AddAttribute rootId is Visible true AddAttribute rootId isEnabled NOT x Disabled AddAttribute width 3304 x x Weight 275 x x FontSize 10 AddAttribute rootId height 274 x Height 21x x FontSize 35 where rootId nodee x Ts x DIALOG x Caption true AddAttribute rootId defaultContent x Text Ts x DIALOG x TopMost true AddAttribute rootId isAlwaysOnTop true V x Ts x DIALOG gt ConstrBox boxId vertical AddArc rootId boxId where boxId gt nodee T 7 The mapping is
187. ication 123 Appendix C If true makes it possible for the user to edit the labels of tree view items FullRowSelect Boolean If true enables full row selection in the tree view The entire row of the selected item is highlighted and clicking anywhere on an item s row causes it to be selected HasButtons Boolean With a tree view control the user can expand or collapse a parent item s list of child items by double clicking the parent item If true adds plus and minus buttons to the left side of parent items showing the user whether the item is expanded or collapsed The user can click the button once instead of double clicking the parent item to expand or collapse a parent item s list of child items HasLines Boolean If true enhances the graphic representation of a tree view control s hierarchy by drawing lines that link child items to their corresponding parent item that is displays lines connecting items within a branch 146 InfoTips Boolean If true the control sends a notification when it is requesting additional text information to be displayed in a tool tip LinesAtRoot Boolean If true displays lines connecting items at the root level showing which items play the roles of 148 roots NoHorizontalScroll Boolean If true disables horizontal scrolling in the control The control will not display any horizontal scroll bars NonevenHeight Boolean If true sets the height of the tree vie
188. ifications enable applications to access the functionality unique to rich edit controls The following attributes are unique to rich edit controls DisableNoScroll Boolean If true the scroll bar is disabled instead of hide when it is not needed NoCallOleInitialize Boolean If true prevents the control from calling the OleInitialize function when created this function initializes global data for the session and prepares the OLE libraries to accept calls NoIME Boolean If true disables the Input Method Editor IME operation available for Asian language support only SelfIME Boolean If true directs the rich edit control to allow the application to handle all IME operations available for Asian language support only Sunken Boolean If true displays the control with a sunken border style so that the rich edit control appears recessed into its parent window Vertical Boolean If true draws text and objects in a vertical direction available for Asian language support only COMBOBOX A combo box is a combination of an edit box and a list box It can use the AutoHorizontalScroll LowerCase OEMConvert and UpperCase attributes from the EDIT class and the Sort DisableNoScroll HasStrings NoIntegralHeight OwnerDrawFixed and OwnerDrawVariable attributes from the LISTBOX class For example if HorizontalScroll is true and if the combo box s edit control is completely filled with text and the user enters more
189. ified width and height and NoParentAlign is true the control keeps its specified position within the parent window Such controls are controls that exist in Windows corresponding to predefined window classes in Windows programming But a custom made child window CUSTOMCONTROL class can also be used Sud 1 62 by defining its own window class For example some Oct 51 2004 17 5041 by Neil Hodgson may want to replace a normal rectangle push button December 1998 October 2004 are http www scintilla org with rouded corner with an elliptical push button Lua scripting language by TeCGraf PUC Rio http www lua org Contributors SciTE dialog box shown to the right and specified in a Atsuo Ishimoto Mark Hammond resource file as Francois Le Coguiec ABOUT DIALOG 26 41 350 242 Dale Nagata Another example is the first control from the About STYLE DS MODALFRAME WS POPUP WS CAPTION WS SYSMENU nun sir CAPTION About SciTE LANGUAGE LANG_ENGLISH SUBLANG_ENGLISH_US FONT 8 MS Sans Serif 1 CONTROL 221 Scintilla 0x50000000 1 1 346 218 CONTROL SciTE 1 STATIC SS_ICON WS_CHILD WS_VISIBLE 1 221 32 32 CONTROL OK 1 BUTTON BS_DEFPUSHBUTTON WS_CHILD WS_VISIBLE WS_TABSTOP 26 222 322 20 n This control has been created to display a text using a specific font and various colors Its only specific attribute ClassName set to designates the nam
190. ility and an adaptation due to different new or restricted requirements called a variation an extension and a contraction respectively Reengineering is important since maintenance takes a great place in software production Actually the distribution of efforts and then of costs is often inadequate and as consequence the cost to manage multiple versions for example is exorbitant According to observations 6 the average distribution of the total cost of production including development and maintenance costs of a typical project can be represented by this pie chart unit tests integration tests code 8 design requirements maintenance 67 10 The new version is a revision when the modification is a correction or an improvement and a variant when the modification is an adaptation 10 The UI is rarely perfectly designed at the first shot and the UI code has often to be rewritten completely when the software needs to be transformed for another platform A substantial part of the code written for interactive applications is devoted to the user interface This code has to be identified and replaced UI design is then time consuming and expensive in the development life cycle Techniques for reengineering are important since too few time and effort are usually put in the specification and the conception of UI reliable portable and maintenable Moreover the source code of the software may not always be available When
191. ill be proposed to the user with its id Only the lines corresponding to resources selected by the user will be conserved 55 The full file from the sixth example TablEdit contains 81 dialog boxes and Restorator gives 2756 lines It s for this same reason that just the id of a resource will be displayed in my dialog box without the caption as for example 400 Find It s not quite meaningful the user will still have to see in the decompiler to which resource the caption correspond or worste in the original application searching for the dialog box having this caption 19 Algorithm lt new FileReader f Inr new LineNumberReader 7 while line Inr readLine not null do st lt new StringTokenizer line tab and space are delimiters token lt read the second token if token DIALOG or MENU then strore the current line number skip the lines of the same paragraph I combine a FileReader a LineNumberReader and a StreamTokenizer in the module 2 process phase Note that this tokenizer can also know the number of the current line but it should be time consuming to break a useless part of the file f into a sequence of tokens Each line of f is read at once and skipped until reaching the next line specified The associated resource is then parsed to store all the necessary information into variables Each object will be then created with all its characteristics in GrafiXML by applying my deri
192. ime can be selected SortAscending Boolean If true item indexes are sorted based on item text in ascending order SortDescending Boolean If true item indexes are sorted based on item text in descending order Other attributes are sometimes used to provide enhanced options such as check boxes and hot tracking CheckBoxes Boolean If true displays a checkbox with each OneClickActivate Boolean If true hot tracking is enabled that is when the cursor moves over an item it is highlighted and the user must still click the item once to select it only one click is required to select any item so all items may be selected TrackSelect Boolean If true enables hot track selection in a list view control Hot track selection means that an item is automatically selected when the cursor remains over the item for a certain period of time 150 An image list is a collection of images of the same size stored in memory each of which can be referred to by its index Image lists are used to efficiently manage large sets of icons or bitmaps By default a list view control does not display item images To display icons image lists must be created and associated with the control Upon creation each image list is empty The program repeatedly adds icons to the list and each icon is assigned a sequential number starting at 1 This is the number to which the program refers to display a particular icon in a row or
193. ing the file a spin has already an editable field in the CUI model 6 1 1 2 Resources of type menu MENUBAR menuBar position up Memuld n cio name n POPUPMENU menuPopUp Text t cio defaultContent t without the amp character Sate enabled graphicalCio isEnabled true Sate enabled graphicalCio isEnabled false MENUITEM menultem cio name n Text t cio defaultContent t without the amp character Sate enabled graphicalCio isEnabled true Sate enabled graphicalCio isEnabled false Checked true menultem type toggle Text t and amp is a character oft graphicalIndividualComponent defaultMnemonic the character following amp int Text t and is a substring oft menultem type command Text t and t is a character of t menultem defaultKeyboardShortcut the key combination specified after C int SEPARATOR separator In Windows menus the programmer usually indicates that a menu item invokes a dialog box by adding an ellipsis to the text If I found such characters in the text of a menu item I make the assertion that it correspond to menu item of type command in the CUI model For a pop up menu the mnemonic cannot be exploited since this attribute is currently not present for a container in the CUI model Note that have to create a window graphical container before creating a menu b
194. ing user interface information My approach to reuse an existing application s graphical user interface especially for different platforms can be stated as the specification of this interface starting from the resource file of the application and describing it and at a higher level of abstraction allowing a subsequent reengineering process adapted to any platform The platform the user and its environment define together the context of use 2 State of the art I will mension here some related works to the reverse engineering of application s user interfaces to show that this method is commonly used today Many organizations for example are choosing to reengineer their critical applications to better fit their needs and to take advantage of the new technologies Most of these researches lead to reverse engineering of legacy systems user interfaces MORPH 1 is a process for reengineering the user interfaces of text based legacy systems to graphical user interfaces The resulting model is used to transform the abstractions in the model to a specific graphical widget toolkit The process is composed of three steps In the detection step the source code is analyzed to identify user interaction components in the legacy system thanks to a detection engine In the representation step an abstract model is build expressing the existing user interface as derived from the detection step The model is then stored in the knowledge base
195. is not present the child window will not be displayed until the function ShowWindow is called with SW_SHOWNORMAL as a parameter needless if present 1 The flag DS_SYSMODAL is also possible It is obsolete but included for compatibility with 16 bits versions of Windows When specified the system creates the dialog box with the WS_EX_TOPMOST style And also the definition of WS CAPTION giving a title bar this flag includes WS_BORDER a thin line border 4 Windows 2000 or later uses a different system font than Windows 4 0 and Windows 95 98 have an application that use the system font no matter which system it is running on DS_SHELLFONT can be specified The system then maps this typeface such that the dialog box uses the Tahoma font on Windows 2000 and the MS Sans Serif font on earlier systems 38 300 FW_LIGHT 400 FW_NORMAL or FW_REGULAR 500 FW_MEDIUM 600 FW_SEMIBOLD or FW_DEMIBOLD 700 FW_BOLD 800 FW_EXTRABOLD or FW_ULTRABOLD 900 FW_HEAVY or FW_BLACK When no style are specified for a dialog box the default style is WS_POPUP WS_BORDER WS_SYSMENU 4 3 1 2 Controls definition Inside the dialog box template the part between and defines a set of controls that a dialog box contains lt control_def gt is a suite of 0 1 or more text lines defining a child window control and having this syntax CONTROL lt text gt lt id gt lt class gt lt style gt lt x gt lt y gt lt width gt lt height gt
196. isDetachable boolean isUnderline boolean 0 Bis Migrateable boolean isStrikeThrough boolean m isSubScript boolean vocalPrompt isSuperScript boolean is Preformatted boolean BtextSize integer lextColor String toolBar dialogBox tabbedDialogBox boolean hdioButton loatable boolean faliitState boolean nr EE FEES t videoComponent roupName string ea Eorientalion string isEditable boolean inValue integer T statusBar axlineVisible ihteger ax Value integer eal t utoplay boolean colorPicker integer MenuPopUp TES isLoop integer hourPicker Stik tabbeditem iltinControl boolean rer re index integer subtitle boolean Y ubtitleContent uri menu 1 4 m UpMenu boolean datePick progressionBar button jatePicker Index integer mr 04 Es inValue integer ud box lowLeftMargin integer axValue integer string isHeader boolean lowTopMargin integer ocn 71 rientation string elativeWidth integer Eoster isResizable boolean outputText imageComponent 4 tn indeterminate boolean relativeHeight integer imageHeight integer 1 isSplitable boolean imageWidth integer BT menultem isBalanced booolean imageHorizSpace integer tn we string isResizableHorizontal boolean imageBorder integer ERES eyboardShortcut string filePick
197. ite It is based on a system color black drawn with the color used to draw window frames the default is black gray drawn with the color used to fill the screen background desktop the default is gray white filled with the color used to fill the window background the default is white Rectangle black gray white undefined Like Frame except that the rectangular outline is filled with the color used to draw window frames with the color used to fill the desktop or with the color used to fill the window background Etched frame horizontal vertical undefined 131 The control s parent window must not process the WM_CTLCOLOR message 132 And the control displays two ampersands amp amp as a single ampersand 117 Appendix C The frame the top and bottom edges or the left and right edges of the static control are drawn using the EDGE ETCHED edge style Static controls can also be used to display images Icon Boolean If true an icon is displayed in the dialog box The given text is the name of the icon not a filename The control is automatically sized to fit the icon when it is displayed the width and height values specified are ignored Bitmap Boolean If true a bitmap is displayed in the dialog box The given text is the name of the bitmap not a filename The control automatically sizes itself to accommodate the bitmap the width and height values specified are ignored CenterImage
198. ken skip st nextToken y short st nval System out println y coordinate y st nextToken skip st nextToken width short st nval System out println width width st nextToken skip st nextToken height short st nval System out println height height Go to the begining of the next line optional helpId is skiped while st nextToken StreamTokenizer TT EOL boolean hasControls true Read the first keyword of each line and extract related information until the control definition part is reached while st nextToken switch st ttype case StreamTokenizer TT WORD if st sval equals STYLE Extract the styles of the dialog box while st nextToken StreamTokenizer TT EOL styles T match st sval getFlagValue bitwise OR operation st nextToken System out println styles styles else if st sval equals CAPTION Extract the text that appears on the caption bar st nextToken text st sval System out println caption text Go to the the next line st nextToken End of line token else if st sval equals EXSTYLE Extract the extended styles of the dialog box while st nextToken StreamTokenizer TT_EOL extendedStyles T match st sval getFlagValue bitwise OR operation st nextToken 141 else if else if else if else if Appendix D System out println extend
199. ld to refer to databases vocabulary composing of a graphical user interface and which characteristics defining the appearance and functionality of an object are covered both by the two languages This corresponds to the crosshatched zone in the picture below For example a mnemonic of a menu item can be specified in a resource file as well in the CUI model From a simple combo box we have in part the information that the current selection is editable but the fact that its list box is displayed at all time is not covered in the CUI model _ gt graphicalCio toolTipDefaultContent Save the file to disk CUI COMBOBOX Type simple combobox isEditable true WINDOW Text amp Save graphicalIndividualComponent defaultMnemonic S gt LISTBOX Multicolumn true cio defaultcontent Save 59 The following list of tables will serve as guidelines for my implementation The Windows objects are placed in the left column and their corresponding objects of the CUI model CIOs in the right column An attribute name appears in italic and a class name in bold to dissociate them Note that there are some elements in the table that not really correspond but that I ve still decided to associate in my implementation as such an identifier in a resource file with a name of a CIO 6 1 1 1 Resources of type dialog box RC CUI DIALOG dialogBox or window graphicalCio isVisible true box type vertical dlgI
200. le used to have a preview of the given file public boolean loadFileContent File file public interface ImportExportPlugin extends Plugins return the extensions of the files that be imported public String getExtensions return the type name public String getExtensionName public interface Plugins return the plugin name public String getPluginName return the author name of the plug in public String getPluginAuthor return the versions of GrafiXML that supports the plug in public String getPluginDepend return the plugin version public String getPluginVersion return the plugin description resources jar public String getPluginDesc B plugin desc resources Resources class It s Resources java that implements the ImportPlugin interface gt Rcfile class also define seven other auxiliary classes to carry out my task Once P sdfFile class compiled all my classes are put in a jar file with the structure shown xibFile class to the right where plugin desc is a text file which contains the line P Resource class main class resources Resources which is the path to the main 8 FlagTrie class class of the plug in I put then this jar file in the Windows repertory TNode class Document Settings user_name grafixml plugins PD Grafi class My plug in can finally be run and tested by lau
201. le 4 1 5 Fifth example from the Common Dialog Library I ve noticed that the open file dialog box was not present in the resource of SciTE In fact the application uses one of the Windows dialog boxes stored in a specific file comdlg32 dll that many applications import in their interfaces This is precisely the dialog often displayed by selecting open from the file menu by pressing CTRL that serve as example here EX Dialog 1552 Look in Resource Builder 2 0 cn C DFM Delphis y Recent DFM Delphi7 Documents Fe di Resbldr2 exe 39 ResBuilder chm ls sicmplr dil sircc32 exe unins000 dat E unins000 exe My Computer My Computer File name Files of type All Files 2 My Network Open as read only 1552 DIALOGEX 0 0 370 237 STYLE DS MODALFRAME DS_CONTEXTHELP WS_POPUP WS VISIBLE WS CLIPCHILDREN WS CAPTION WS_SYSMENU CAPTION Open LANGUAGE LANG ENGLISH SUBLANG ENGLISH US FONT 8 MS Shell Dig CONTROL Look amp in 1091 STATIC SS_LEFT SS_NOTIFY WS_CHILD WS_VISIBLE WS_GROUP 4 7 57 8 0x00001000 CONTROL 1137 COMBOBOX CBS_DROPDOWNLIST CBS_OWNERDRAWFIXED CBS_HASSTRINGS WS_CHILD WS_VISIBLE WS_VSCROLL WS_TABSTOP 66 4 174 300 CONTROL 1088 STATIC SS_LEFT WS_CHILD 248 4 80 14 CONTROL 1184 ToolbarWindow32 0x50012B4C 4 22 58 208 0x00000200 C
202. les of track bar controls using the bottom and the both values respectively J LI This can be useful for example to select a certain portion of a sound or video file to use 1 With this values the thumb of the slider appears as a rectangular box with the others one of its borders appears as an arrow 122 Appendix C ToolTips Boolean If true the control has a default tool tip control that displays the slider s current position PROGRESSBAR A progress bar control is a window that an application can use to indicate the progress of a lengthy operation It consists of a rectangle that is gradually filled with the system highlight color as an operation progresses Type normal marquee smooth marquee causes the progress bar to move like a marquee usually used as an indefinite progress bar smooth causes the control to display a contiguous progress bar instead of the default segmented bar normal This illustrates the result of the values Vertical Boolean If true the progress bar displays progress information vertically from bottom to top TREEVIEW A tree view control is a window that displays a hierarchical list of items such as the headings in a document the entries in an index or the files and directories on a disk Each item consists of a label and an optional bitmapped image and each item can have a list of subitems associated with it By double clicking an item or by clicking its button if available
203. les relative to the font Vxe Tri dye Ts isRoot y true y SetFont true x inputText v x outputText x button v x radioButton v toggleButton v x checkBox v x spin v x comboBox v tree listBox v x box A itro x GROUPBOX AddAttribute x id textFont y FontName A AddAttribute x id textSize y FontSize VxeTt dye Ts isRoot y true y SetFont false x inputText v x outputText x button v x radioButton v toggleButton v x checkBox v x spin v x comboBox v x tree v x listBox v x box A itro x GROUPBOX gt AddAttribute x id textFont Tahoma AddAttribute x id textSize 8 itro x is the reification of returns a node of T which is the result of an reification of the node x from 69 6 2 Plug in development I see in this section how are implemented the set of derivation rules The programming language used to implement the plug in is Java seeing that GrafiXML is developed in Java The source code well documented is in appendix D 6 2 1 How to run it To integrate a plug in into GrafiXML the ImportPlugin interface has to be implemented This interface is in the be ac ucl isys grafixml plugins package which is the first import declaration of my program public interface ImportPlugin extends ImportExportPlugin load the file chosen by the user and do something with it public boolean load File fi
204. lete its action Common controls in a dialog box are push buttons check boxes radio buttons edit boxes list boxes combo boxes text stings and scroll bars Such controls are predefined in Windows When an overlapped window program s main application window is moved a popup window stay up This is not true for child windows witch follow their parent around the display and are never displayed outside the client area of their parent CtrlID either a unique name or a unique 16 bit unsigned integer value in the range 1 to 65 535 Is the value that the child uses to identify itself when sending messages to its parent when you click a button with the mouse for instance the child window control sends a message with notification code CLICKED to its parent window The value is set to 1 when the control does not send messages back to its parent like text and icon control witch do not accept mouse or keyboard input X Integer Specifies the X coordinate in dialog box units of the upper left corner of the child window relative to the upper left corner of the parent window s client area Y Integer Specifies the Y coordinate in dialog box units of the upper left corner of the child window relative to the upper left corner of the parent window s client area 107 The WM COMMAND message 108 parent window Width Integer ns Specifies the width of the child window in dialog box units x Height
205. line STATIC Type enhancedMetafile imageComponent width w 4 xChar height h 8 yC For a static control used to display an image the given text is the name of an icon or a bitmap not a filename defined elsewhere in the resource file For example if the text of such control is SCITE the file here from Restorator has somewhere the line 5 ICON SCITE ico But when we extract the resource and save it to the disk with a decompiler ico the name it gives to the file is not necessary the same as specified for example we have a file names Icon 1 ico So not exploited this information an image file name is normally put in the defaultContent attribute of an ImageComponent The user can insert the image in the GrafiXML project knowing the name of the image resource put in the name attribute for an ImageComponent overriding the name that I have defined for each control We can t know the real size of an image resource from a resource file The user should also put these values manually in the GrafiXML composer The width and height values specified in the resource file for a static control displaying an image are also ignored in Windows except if RealSizeImage false the control auto sizes itself to accommodate the image This will complicate the creation of boxes since these values can be not reliable information A static control can also represent frames corresponding to container in the CUI model The following ill
206. llow a multi path UI development The development can be started at any entry point of the framework Reverse engineering follows abstractions an existing system is recuperated My thesis is concerned with FUI reverse engineering Forward engineering follows reifications a new system is produced Lateral engineering follows translations for example when a UI in HTML is already designed for a desktop we may design a corresponding UI in Java for a mobile phone 57 An Abstraction Interaction Objects AIO 22 Other terms exist to define specific development paths Transcoding tools perform lateral engineering at the FUI level a FUI for a source platform is directly transformed into another FUI for a target platform The re engineering combines reverse engineering and forward engineering The retargeting is the re engineering for another computing platform for example through the CUI level as illustrated below a CUI for a source platform say that one that I have to generate from a Windows resource file is transformed into another CUI for a target platform as a pocket PC that I turn leads to a new FUI for that platform Personal Computer Pocket PC Concrete UI gt Concrete 1 Windows UI code Final UI UsiXML is based on XML which is a compliant specification language suitable for any interface This language describes a UI at any above mentioned levels of details and abstractions depending of the context o
207. lso add a new attribute to each node storing the reference to its parent I use preferably the following recursive algorithm performed on the trie after having added all the necessary flag strings by calling compress trie root Algorithm compress u for each child v of u do if isInternal v then W lt v while isInternal w and w has only one child and w flagValue 0 do w lt child w if isExternal w then wis a leaf and the chain of nodes after v consists of redundant nodes v flag Value lt w flagValue supress child v else w has several children or child w flagValue 0 recursively compress the subtree rooted at w by calling compress w When constructing the trie it is important to also insert flags which are not in my correspondence rules but that have as prefix a string in the compressed trie If we forget them some parsed flag in the resource file that should normally not be taken into consideration could give the value of another flag stored in the trie Below is the implemented trie for the same above mentioned set without ss LEFT because its numeric value is 0 and enlarged with CBS SORT to not get the value of cBs siMPLE when matching this flag The nodes augmented with indications of the stored numeric value The matching will be made when we reach the end of the input string f or when a leaf is reached 9 Tn the terminology an ancestor of a node is either the node itself or an ancestor of the
208. lt n index t There is at least one resource to process pointers index Resource resources elementAt index getLine if dialogSelected amp amp Resource resources elementAt index getType D dialogSelected true return pointers a a Scan the file for resources Paragraph are separeted by line without token comments at begining are not part of paragraph private static void readLines LineNumberReader Vector v throws IOException String delims Nt String line Contents of a line not including any line termination characters String firstToken secondToken StringTokenizer st while line r readLine null Line is not null the end of the stream has not been reached if line length 0 n part of paragraph separator not usefull because st hasMoreToken false 139 Appendix D st new StringTokenizer line delims if st hasMoreTokens line contains at least one token that is line is not part of a paragraph separator containing n and eventual withe space charachters firstToken st nextToken if firstToken startsWith Text after and that extends to the end of the line is discarded else if firstToken startsWith Text between successive occurrences of and and after until EOL is discarded while line null amp amp line indexOf 1 line r readLine else B
209. lt ex_style gt lt helpID gt Meta language continuation e style is now a window style flag begining with WS or a child window control style flag begening with ES BS_ SS_ LBS_ SBS or CBS e class a predefined window class is dialog box template continuation 1 CONTROL lt text gt id class lt style gt x y width height __ ALT lt ex_style gt lt helpID gt X d fF Class CONTROL CONTROL Value Attibutes CtrlID id val CtrlID X x val X y val Y Width width val Width Height height val Height HelpID Z 1 lt helpID gt val HelpID Position control specified at line val Position of lt control_body gt Class BUTTON lt class gt BUTTON Attributes VerticalAlignment top lt style gt BS TOP 0x00000400 VerticalAlignment center lt style gt BS_VCENTER 0 00000 00 VerticalAlignment bottom lt style gt BS BOTTOM 0x00000800 HorizontalAlignment left lt style gt BS LEFT 0 00000100 HorizontalAlignment center lt
210. ltHyperLinkTarget hape string oordinates coord axlineVisible integer isEditable boolean ultiple_selection boolean 6 Importing resource files in GrafiXML So far presented the specification languages used as input and output of my reverse engineering method This chapter covers the transformation process from a resource script file rc up to the generation of Concrete Interaction Objects widgets provided by a toolkit in the editor tool GrafiXML The first section studies this transformation and proposes derivation rules and the second section explains how it has been implemented as a plug in of GrafiXML 6 1 Transformation of resources into CUI I will explore here how the content of a resource file can be transformed into the CUI model 6 1 1 Correspondences table I have to detect the similarities between the two meta models on the one hand the class diagram modeling a resource file on the other hand the class diagram of the CUI model The objective will be to give a value to a maximum of attributes of the second diagram with the information found in a given resource file instance of the first diagram The question that guides this section is to determine which objects from the real wor
211. lticolumn true Br 1 2 3 4 The size of the control is exactly the size specified when created NoIntegralHeight true By default Windows resizes a list box to not display partial items We can see in the third example two edit controls EDIT class which scrolls text to the right when the user types a digit only allowed with Number true at the end of the line AutoHorizontalScroll true This controls are the buddy windows of up down controls UPDOWN class used to increment or decrement the value To the user they look like a single controls It can be specified that an up down control automatically selects the previous In my opinion the developer have made a mistake in their resource statement resolved after in the program it is true that when we read the flag name we could think to the opposite of what said the definition But it s surprising that the label doesn t in he resource file 33 Tn the sixth a horizontal scroll bar HorizontalScrollBar true is added but it is hidden because the list box is large enough to display all the items at once 31 window in the z order as its buddy window Let s look at the first up down control X 222 Y 100 Alignment right positions it to next to the right edge of its buddy window X 193 Y 100 the buddy window is then moved to the left and its width 30 is decreased to accommodate the width of the up down control 10 ArrowKeys true allows the user to p
212. mal window is the text that appears in the caption bar this is the default It can be also labelled with an icon or a bitmap instead of text PUSHBOX A push box is identical to a push button except that it does not display a button face or frame Only the text appears GROUPBOX A group box is an oddity in the button types because it can not be selected pus 5 Frame and neither process input nor sends a message to its parent This button is just a rectangular outline with its window text at the upper left corner Itis used to enclose other controls i CHECKBOX A check box is a square box usually aligned with the left edge and centered within the top and bottom dimensions of the child window s rectangle with text that appears to the Clicking the box once causes an X appear clicking again toggle the X off There are incorporated in an application to allow a user to select options Auto Boolean If true the check state automatically toggles between checked and cleared each time the user selects the check box 10 message withe the BN_CLICKED notification 10 The button posts a WM_COMMAND message to the owner window when the user selects the button Unless LeftText true 1 That is the control itself toggles the check mark on and off and WM_COMMAND messages are ignored by its parent Otherwise the program must control the checking and un checking of the box
213. match String flag TNode v root if flag null depth 0 Depth of the node we terminate tracing the path boolean success true while success amp amp depth lt flag length success false Vector children v getChildren for int 0 i lt children size amp amp success 1 TNode w TNode children elementAt i if w element flag charAt depth success true depth return v private void addFlag String flag int value If v is an external Node transform v into an internal node by creating a new chain with the characters of s starting from v If is an internal node create a new chain with the characters of s at the good place starting from v Return the last node composing the new chain The string s is composed by at least one character s length gt 0 depth 0 TNode v match flag if depth lt flag length The search stop at an internal or external node and it remains characters of flag to store in the trie Add a chain of node after v corresponding to the characters from flag depth through flag lenght 1 TNode w expand v flag substring depth Store the value in the last node of the chain w setFlagValue value else depth flag length The search stop at an internal node since flag is not already represented in the trie Since the trie is not yet compressed only leaves have a positive flag value
214. mber This changes the 4 5 6 7 8 9 10 year label into a spin button To select a date on the control the i A b a user clicks the desired date which changes from the previous 25 27 28 29 30 31 selection The user can still click the bottom label to return to 2 3 Ew 5 today s date if at one time the calendar is displaying a date other than today Sun Mon Tue Wed Thu Fr Today 07 24 2005 DayState Boolean If true the control requests information about which days should be highlighted by displaying them in bold Multiselection Boolean If true the control allows the user to select a range of days By default the user can select seven contiguous days maximum NoToday Boolean If true the control doesn t display the label at the bottom of the control the today date NoTodayCircle Boolean If true the control no longer circles the current day WeekNumbers Boolean If true the control displays week numbers 1 52 to the left side of each row of days ANIMATION 168 An animation control is a window that displays an AVI clip that does not contain audio One common use for an animation control is to indicate system activity during a lengthy operation This is possible because the operation thread continues executing while the AVI clip is displayed For example the Find dialog box of Explorer displays a moving magnifying glass as the system searches for a file This control is
215. n Integer Y Integer Width Integer Hight Integer HelplD Integer 3DLook Boolean AbsoluteAlignment Boolean Center Boolean 1 Boolean ContextHelp Boolean DialoglsControl Boolean FixedSys Boolean LocalEdit Boolean ModalFrame Boolean NoFailCreate Boolean NoldleMessage Boolean SetForeGround Boolean Language String SubLanguage String SetFont Boolean FontName String FontSize Integer CONTROL CtrllD Integer X Integer Y Integer Width Integer 7 Hight Integer HelpID Integer Position Integer is the buddy window of BUTTON VerticalAlignment top center bottom HorizontalAlignment left center right Flat Boolean Multiline Boolean LISTBOX EDIT Sorted Boolean MultipleSelection Boolean DisableNoScroll Boolean ExtendedSelection Boolean Multicolumn Boolean NoSelection Boolean Notify Boolean OwnerDrawFixed Boolean OwnerDrawVariable Boolean HasStrings Boolean NolntegralHeight Boolean UseTabstops Boolean WantKeyBoardinput Boolean NoData Boolean NoRedraw Boolean COMBOBOX Type simple dropDown dropDownList CaseSensitive Boolean NoEditimage Boolean NoSizeLimit Boolean Pathw
216. n rather they get loaded dynamically into the system memory at runtime that is they are linked to applications are loaded in memory Windows is operating system which uses dynamic linking This means that the same block of library code can be shared between several applications rather than each application containing copies of code Another exemple is not a resource from a particulary application but from the Windows Common Dialog Library comdlg32 dll that provide common dialog boxes used by Windows applications such as the open file and print dialog boxes A decompiler can be used to offer a thorough look at all of the resources in the compiled executable file To bring into relief eventual variances in the informations they produce I ve used four resource editors including a decomplilation tool Resource Tuner v1 95 Restorator v3 00 Resource Builder v2 3 0 8 and Resource Hacker v3 4 0 Sush utilities enable to view modify add or delete resources in executables but also to extract them in a file with a rc extention displaying readable information about the structure of the individual resource I discuss the differences in the files they generate at the end of the next chapter I can already see the link between the two text files describing a Windows UI a resource file generated by a decompilation tool and another file expressed in the UsiXML language by reproducing manually the UI in the GrafiXML editor I can obtain a first
217. n dialog box illustrated in the fourth example see the line with an asterisk The user can then acces directly some directories like My Computer when loking for a file Tool tips Tooltips true are descriptive text boxes that pop up when the user points to a tool bar button with the mouse cursor As Flat is true the tool bar has a transparent look both the tool bar and the buttons that allows the client area under the tool bar to show through and enables hot tracking a button is highlighted when the cursor moves over it WrapAble set to true means by definition that the tool bar can have multiple lines of buttons The buttons wrap to the next line when the tool bar becomes too narrow to include all buttons on the same line Normally the size and position of the tool bar window automatically set itself The height is based on The term z order refers to the order of objects along the Z axis In coordinate geometry X typically refers to the horizontal axis Y to the vertical axis and Z to the axis perpendicular to the plane representing the depth of the stack of windows The z order information thus specifies the front to back ordering of objects on the screen 32 the height of the buttons in the tool bar the width is the same as the width of the parent window s client area and the control is positioned along the top of the parent window s client area This behavior is turned off if NoResize is true the control uses its spec
218. n or off each time the user clicks a string in the list box Any number of strings can be selected at a time A list box is by default simple selection DisableNoScroll Boolean If true the list box shows a disabled scroll bar when the list box does not contain enough items to scroll Otherwise the scroll bar is hidden when the list box does not contain enough 118 items ExtendedSelection Boolean If true the user can select multiple items using the SHIFT key and the mouse or special key combinations Multicolumn Boolean If true it s a multi column list box that is scrolled horizontally A multi column list box places items into as many columns as are needed to make vertical scrolling unnecessary a vertical scroll bar is never displayed The user can use the keyboard to navigate to columns that are not currently visible To have a horizontal scroll bar displayed that allows the user to scroll to columns that are not currently shown in the visible region of the list box requires the addition of HorizontalScrollBar true from the WINDOW class NoSelection Boolean If true the list box contains items that can be viewed but not selected Notify Boolean If true the list box notifies its parent whenever the user clicks a string list boxes detect also double clicks List boxes almost always notify their parent window about action done by the user OwnerDrawFixed Boolean If true the owner of the list box is res
219. nching for example GrafiXML with Java Web Start A new submenu will appear when selecting the menu item import 79 See the wiki page http www usixml org index php view wiki amp title GrafiXMLImportPlugins Go on http Avww usixml org index php view page amp idpage 10 to download grafixml jnlp 70 6 2 2 How to use it I ve decided to divide my implementation into two phases When a resource file is imported the text is first scanned to find the available resources If the search fails the file is empty or the resources found are not exploitable that is are not of the type dialog box or menu a message is displayed to the user Else the set of available resources are shown is the Import Resources dialog box and the user can select those to import in a project The location in the file of the selected resources is then memorized if there is no selection when the user presses the OK button or if the Cancel button is pressed nothing happens and the plug in execution end This module is the scan phase In the second module the process phase the chosen resources are then each in turn analysed and transformed into GrafiXML by implementing my correspondence rules see section 6 1 The architecture of my plug in is pictured below Ouvrir Rechercher dans SciTE 255 400 rc es Pecan RE Bes i acces ALL_RESOURCES rc coune rc GREP
220. nd AutoHorizontalScroll false and HorizontalScrollBar false inputText wordWrapped true force WordWrapped true Width w and MultiLine true and AutoVerticalScroll false and VerticallScrollBar false inputText maxLength w 4 numberOfLines COMBOBOX Heigth h and Type simple listBox isEditable true mulipleSelection false maxLine Visible h 11 s 8 where s is the size of the font COMBOBOX Heigth and simple comboBox Visible h 11 s 8 1 where s is the size of the font COMBOBOX Type dropDown comboBox isEditable true COMBOBOX Type dropDownList comboBox isEditable false 73 In my implementation the text in the control definition will be never null contrary to a dialog box which have no title specified in the caption bar as in the syntax of the generic notation in any case the variable storing the text will be initialised to an empty sting before parsing the text That is an icon or bitmap 75 The fractional part of the result is truncated and discarded 63 I ve chosen to represent a simple combo box that is the list box is displayed at all times and the current selection is editable in Windows with an editable list box in the CUI model For drop down and drop down list combo boxes care must be taken when reading the height specified in the resource file as we can see in the same example illustrated abov
221. nd give a meta model describing them In the next chapter I present the target language which will be used to specify these file in a higher level of abstraction 4 1 Examples of resources In this section I show the examples that chosen and how they are described in the resource script file rc Each resource is extracted by one particular decompiler To compare the information generated the resources given by the other decompilers are in appendix B In the fourth section make a discussion over the different decompilers and suggest my favourite Each example come from one application mentioned in the chapter 3 the files that have been used in the decompilation tools to obtain these resources are SciTE exe 7ZFM exe windirstat exe rgb exe comdlg32 dll and tabledit exe 4 1 1 First example from SciTE The first graphical object is a dialog box called up by selecting Find from the Search menu and will serve as main illustration for this chapter Find what J C Match whole word only Direction C Match case O Up Regular expression 9 Down Wrap around _ Transform backslash expressions With a resource editor the resources can be saved in an ASCII resource script file This is what is generated by Restorator 19 400 DIALOG 30 73 275 84 STYLE DS_SETFONT DS_MODALFRAME DS_3DLOOK WS_POPUPWINDOW WS_CAPTION CAPTION Find FONT 8 MS Shell Dig M LTEXT Fi amp nd wha
222. ngle the text appears to the left PushLike Boolean Makes a radio button look and act like a push button The button looks raised when it isn t pushed or checked and sunken when it is pushed or checked CUSTOMBUTTON It s an owner drawn button that is a button that the program is responsible for drawing LISTBOX This class defines child window controls called list boxes A list box contains a collection of items displayed as a scrollable columnar list within a rectangle from which a user can chose such filenames in the current directory when the user select Open from the File menu The user can view and select an item by highlighting it with a left mouse 9 If the list box is not large enough to display all the list box items at once the list box can also provide a scroll 13 Unless RightButton true 14 The owner window receives the WM_DRAWITEM message 1 Ttems can be represented by text strings bitmaps or both 6 Selecting a list box item changes its visual appearance usually by changing the text and background colors 111 Appendix C bar if VerticalScrollBar from the WINDOW class is set to true By default the list box displays only the list of items without any border around it A border can be added with Border set to true from the WINDOW class Sorted Boolean If true strings in the list box are sorted alphabetically MultipleSelection Boolean If true turns string selection o
223. ns for a black and white icon for example each bit corresponds to one display pixel A deeper analysis to make the connection of an image and these numbers has not been undertaken in my thesis Restorator show how the resources appended to the executable are really structured Only the text resources of type menu and dialog box are stored in the main res file the rc file compiled The other resources are defined associated with an identifier in this file but are stored in separated files There is the resource file extracted from the same executable by Restorator without the specifications of the menu and the dialog boxes from file C Program Files wscite SciTE exe last modified 18 04 2005 15 40 52 resources of type Bitmap 100 Bitmap 100 bmp em 5 Jf e CMU _ resources of type Accelerator ACCELS Accelerators ACCELS txt as SCITE Icon SCITE ico emm resources of type Version 1 Version 1 res f em E 124 1 txt The resource 24 is a resource in the XML format This tool adds also some comments With Resource Tuner each text resource is saved in a separated rc file one for each menu and dialog box for example If we want save all the resources at once the tool creates a repertory for
224. of Text value of Text value of Text value of Text value of Text GeneralStyle child overlapped There are three general styles of window a popup window is a temporary subsidiary window a child window can divide a window in various regions and an overlapped window is a program s main application window Only the two first will be relevant here that is the inherited GeneralStyle will never take the value overlapped Border Boolean Specifies the frame around the the window If true it has a normal thin line window border Caption Boolean Specifies the frame around the dialog box If true it has a caption bar and a normal window border implies Border true A caption bar allows the user to move the dialog box to another area of the display often not provided with modal dialog box for example because the user can t do anything in the underlying window anyway Caption and DialogFrame cannot both be true see DialogModalFrame beyond ClipChildren Boolean If true excludes the area occupied by child windows when drawing occurs within the parent window style used when creating the parent window Unless otherwise specified by the NoPrefix attribute from the STATIC class For a static control the focus move to the first control having Tabstop true after the static control containing the specified mnemonic 101 Appendix C ClipSimblings Boolean If true clips child windows relative to
225. of the class defining the control example msctls_hotkey32 for a hot key control MENUBAR The next classes concern the menu of an application This one defines a window s menu bar also called the main menu or the top level menu A menu bar is displayed below the caption bar and shows a list of menus which in turn can shows submenus that lets a user select commands Items on the menu bar are almost always popup menus rarely command items 9 The control will send a message to its parent It interprets the upper left pixel of the first frame as the animation s default background color and will remap all pixels with that color to the value supplied in response of the message 70 These classes already exist within Windows The programmer does not first define and register its own window class to create a control based on one of these classes The programmer simply use the window class name like button or static and some style flags as parameters in the function to create a window 71 By registering your own window class called ClassName and using your own function to process messages for your customized control 7 The class name is CalWndMain 173 Like the IP address contol implemented in recent versions of Comctl32 dll and defined in Commctrl h or a hot key control a window that enables the user to enter a combination of keystrokes to perform an action quickly They have no specific style 134 Appendix C M
226. okenizer st new StreamTokenizer lnr Prepare the tokenizer for recource script style tokenizing rules specifies how tokens are recognized By default the tokenizer already remove quotes around strings when reading them denotes a quotes string by default and parse number End of lines are treated as tokens the nextToken method returns TT EOL and also sets the ttype field to this value when an end of line is read The default syntax table is configured to treat an end of lines character as white space not as a separate token st eolIsSignificant true Specifies a range of characters to be treated as part of words to Z and to z are already by default considered to be alphabetic st wordChars to recognize flags e g WS POPUP Specifies the range of characters that serve to delimit tokens space tab are by default delimiters st whitespaceChars st whitespaceChars Restorator use EXSTYLE lt ex_style gt Specifies the range of characters that are never part of tokens and should be returned as is st ordinaryChars st ordinaryChars st ordinaryChars Causes comments lt line gt and lt text gt to be ignored st slashSlashComments true st slashStarComments true lnr setLineNumber 1 the first line is 1 0 by default Process the resource
227. omponentProperty string Bisymbol string 5 transformationRuie ES string graphicalCio i B string vocalCio finalComponent string isEnabled boolean BBsinteruptible boolean uri _ lescription string tatusBarContent graphicalAlignment lefaultStatusBarContent string V is Vertical boolean ruleMapping Color string vocalTransition isHorizontal boolean graphicalEmphasis Color string vocalAdjacency ransitionType string isRightCentralLeft string 0 peti nna 0 rderWidth integer integer ransitionEffect string isUpDown string attributeCondition Ie DS eden expression string Srna TS eana L 1 wecalindividualComponent vocalContainment grahicalCointainment ign String order Color String toolTipDefaultContent string graphicalTransition Loo TipContent rransitionType string raphicalAdjacenc integer vocalForm vocalMenu vocalConfirmation ransitionEffect string EXIT vocalOutput vocalinput lume integer ees z integer graphicalindividualCompone eh teeing Bs IueVertical string graphicalContainer lueHorizontal string separator idth integer lefaultMnemonic String Duc eigth integer nemonic Stri Image uri isAlwaysOnTop boolean 0 2 isBold boolean vocalFeedback 004 epetition integer 1 ier neces vocalMenultem
228. on bar In my plug in implementation I will have to generate and manipulate such CIOs into GrafiXML The layout of a CUI is not defined with absolute coordinates as in the resource files presented in chapter 4 but with a box embedding mechanism Alignments between CIOs can be defined with some relationships There is the CUI from the first section edited in GrafiXML It s the simplified dialog box of my first example containing a text field and two push buttons and allowing the user to find a word in a text A CUI is like a blueprint from which a is created on a particular platform giving the final look 55 GrafiXML File Edit Tools Options Help GBUAAS X SciTE Find Composer XML Editor RTF Manager Context editor X Options Hierarchy View dialog component 0 dialog_box_component_0 width dialog box component 0 20 height 172 repetition o isAlwaysOnT op false At any time the user can see the corresponding UsiXML specifications in the XML editor Note that UsiXML cannot naturally be executed by its own but relies on an implementation in a third party rendering engine The following is the description of the CUI in UsiXML lt xml version 1 0 encoding UTF 8 gt lt cuiModel id SciTE_Find cui_23 name SciTE_Find cui gt dialogBox id dialog_box_component_0 name dialog box 400
229. or efficacity reasons but this detail can be easily modified if needed My tool has also been implemented in a perpective of reusability If my transformation rules are modified or if the implementation of GrafiXML and the UsiXML language envolve a new Windows style flag for instance can be easily considered by creating a new tree data structure storing flags used in my transformation rules The interface with the GrafiXML program is also encapsulated in a separated class enabling to implement a new rule using for example the new flag given in the parameters without having to anderstand my own code I think this work constitute a good basis if it is carried out This thesis provides also a good documentation of the source language This tool is still in work in progress 9 The plug in and its source code will be avalable on http www usixml org 84 Bibliography 10 11 12 Moore S Rugaber P Seaver Knowledge Based User Interface Migration in Proceedings of the 1994 International Conference on Software Maintenance Victoria British Columbia September 1994 Merlo E Gagn P Y Thibout t A Inference of Graphical AUIDL Specifications for the Reverse Engineering of User Interfaces Proc International Conference on Software Maintenance Victoria BC Canada Septembre 19 23 1994 pp 80 88Byrne E A Conceptual Foundation for Software Re Engineering The International Conference on Software Main
230. orces a top level window onto the taskbar when the window is visible ControlParent Boolean If true the dialog manager recurses into children of this window when performing navigation operations such as handling the TAB key an arrow key or a keyboard mnemonic ExContextHelp Boolean If true a question mark is included in the title bar of the window When the user clicks it the cursor changes to a question mark with a pointer If the user then clicks a child window the 103 Appendix C child receives a help message The control should pass the message to the dialog box procedure The help application displays a pop up window that typically contains help for the control ExContextHelp and MaximizeBox or MinimizeBox cannot be true together Layered Boolean If true it s a layered window Using a layered window can significantly improve performance and visual effects for a window that has a complex shape animates its shape or wishes to use alpha blending effects that is to be partially translucent LayoutRTL Boolean If true and for Arabic and Hebrew versions of Windows creates a window whose horizontal origin is on the right edge increasing horizontal values advance to the left Left Boolean If true the window has generic left aligned properties This is the default LeftScrollBar Boolean If true and if the shell language is Hebrew Arabic or another language that supports reading order alignment the verti
231. ord can occur in the template to precisely resolve this drawback DEFPUSHBUTTON amp Find Next 1 205 5 65 14 NOT WS TABSTOP WS GROUP The decompilers that use shortcut notations use naturally also the generic notation for the control of another class than those listed above However I ve remarked that WS CHILD and WS VISIBLE are also implicit in their generic notation these flags are never specified Some style flags can also be used as shortcut notations WS EX OVERLAPPEDWINDOW combines the WS EX CLIENTEDGE and WS WINDOWEDGE styles 5 EX PALETTEWINDOW combines the WS EX WINDOWEDGE and WS TOPMOST styles WS OVERLAPPEDWINDOW or WS TILEDEDWINDOW combines the WS OVERLAPPED WS CAPTION WS SYSMENU WS THICKFRAME WS MINIMIZEBOX and WS MAXIMIZEBOX styles LBS STANDARD combines the LBS NOTIFY LBS SORT and WS BORDER styles WS POPUPWINDOW combines the WS BORDER WS POPUP and WS SYSMENU styles 4 3 3 Resource of type menu The resource script file can also contain a menu resource which is a collection of information that defines the appearance and functions of an application menu As you can see in the second example the syntax is more intuitive id MENU LANGUAGE lt anguage gt lt sublanguage gt gt lt menu_body gt 46 menu_body may contain any combination of popup menu and menu item one by line A popup menu has the following syntax POPUP lt gt options popu
232. ordBreakProc Boolean Alignment left right center Multiline Boolean AutoHorizontalScroll Boolean AutoVerticalScroll Boolean PasswordField Boolean LowerCase Boolean UpperCase Boolean NoHideSelection Boolean ReadOnly Boolean Number Boolean WantReturn Boolean OEMConvert Boolean 7 RICHEDIT DisableNoScroll Boolean NoCallOlelnitialize Boolean NolME Boolean SelflME Boolean Sunken Boolean Vertical Boolean TRACKBAR UPDOWN AutoTicks Boolean DowlsLeft Boolean EnableSelectionRange Boolean FixedLenght Boolean NoThumb Boolean NoTicks Boolean Orientation horizontal vertical Reversed Boolean ToolTips Boolean Alignment left ArrowKeys Boolean AutoBuddy Boolean Horizontal Boolean HotTrack Boolean NoThousands Boolean SetBuddylnt Boolean Wrap Boolean TickMarks bottom top left right both HEADER Buttons Boolean DragDrop Boolean STATIC FilterBar Boolean Flat Boolean SCROLLBAR PROGRESSBAR Italic Boolean Notify Boolean Weight Integer A ShellFont Boolean 0 1 ROUPBOX PUSHBOX GROLRBO PUSHBUTTON Default Boolean Content bitmap icon GUSTOMBUTTON N I RADIOBUTTON Auto Boolean CHECKBOX RightButton Boolean Auto Boolean PushLike Boolean 3state Boolean RightButton Boolean PushLike
233. osition given in the window s attributes A size grip is like a size box but with a raised edge Alignment left right top bottom bottomRight topLeft none 133 Combination of two outer border flags BDR_RAISEDOUTER raised outer edge and BDR_SUNKENOUTER sunken outer edge Tf the static control contains a single line of text rather than image the text is centered vertically in the client area of the control 135 Unlike button edit and list box control it do not send WM COMMAND messages to the parent window but WM_HSCROLL and WM_VSCROLL messages 118 Appendix C left and right are used with a vertical scroll bar The left right edge of the scroll bar is aligned with the left right edge of the rectangle specified when created The scroll bar has the default width for system scroll bars top and bottom are used with a horizontal scroll bar The top bottom edge of the scroll bar is aligned with the top bottom edge of the rectangle specified when created The scroll bar has the default height for system scroll bars bottomRight and topLeft are used with size box The lower right upper left corner of the size box is aligned with the lower right upper left corner of the rectangle specified when created The size box has the default size for system size boxes TAB A tab control is analogous to the dividers in a notebook By using a tab control an application can define multiple pages for the sam
234. oup false RADIOBUTTON PushLike true toggleButton PUSHBUTTON button Text t and Content text cio defaultContent t without the amp character Text t and Content text cio defaultContent t Default true graphicalEmphasis CUSTOMBUTTON button CHECKBOX PushLike false checkBox Text cio defaultContent t without any amp characters PushLike true toggleButton Group true checkBox groupName a given group name for each check boxes following this check box in the template and having Group false LISTBOX listBox isEditable false heigth h listBox maxLine Visible h 11 s 8 where is an integer division and s is the size of the font use in the dialog box ExtendedSelection true listBox multipleSelection true EDIT Width w inputText isEditable true numberOfColumns w 4 Alignment left inputText textHorizontalAlign left Alignment center inputText textHorizontalAlign middel Alignment right inputText textHorizontalAlign right MultiLine false inputText numberOfLines 1 MultiLine false and AutoHorizontalScroll false inputText maxLength w 4 PasswordField true isPassword true Number true defaultFilter 0 9 Heigth h and MultiLine true inputText numberOfLines h 11 s 8 where s is the size of the font MultiLine true a
235. oxId borderTitleAlign middle x x GROUPBOX x Disabled true ModifyAttribute boxId isEnabled 15 false x x GROUPBOX x Visible false Modify Attribute boxld isVisible isVisible false Parentnode x returns the parent node of node x The rule is similar for a static control drawing a frame in a dialog box Rules identifying components I give as example two groups of rules relative to a combo box and radio buttons x COMBOBOX x Type simple AddNode comboBox combold AddAttribute combold name x CtrlId AddAttribute combold id combold where combold gt nodee T x Ts x COMBOBOX x Type simple ParentNode x SetFont true v ParentNode x ShellFont true gt AddAttribute combold maxLineVisible ParentNode x Height 1 1x ParentNode x FontSize 1 x Ts x x Type simple ParentNode x SetFont false A ParentNode x ShellFont false gt AddAttribute combold maxLineVisible ParentNode x Height 1 1 1 5 x COMBOBOX x Type dropDown AddAttribute combold isEditable true 5 x COMBOBOX dropDownList gt AddAttribute combold isEditable false x x COMBOBOX x Disabled true Modify Attribute boxld isEnabled isEnabled false x x COMBOBOX x Visible false Modify Attribute b
236. oxld isVisible isVisible false 68 Vxe Ts x RADIOBUTTON x PushLike false AddNode radioButton radioId AddAttribute radiold name AddAttribute radiold 14 radioId AddAtribute boxlId defaultContent WithoutAmper x Text where radiold nodee V x T x RADIOBUTTON x PushLike false A amp e x Text gt AddAtribute boxId defaultMnemonic CharAfterAmper x Text Vxe T x RADIOBUTTON x PushLike false x Disabled true gt Modify Attribute radiold isEnabled isEnabled false V x x RADIOBUTTON x PushLike false x Visible false gt Modify Attribute radiold is Visible 15 Visible false WhithoutAmp f gives returns the text 1 without any ampersand amp CharAfterAmp f returns the letter that follows the first ampersand of 1 Rules for the exclusion of radio button x zdye Ts dae x RADIOBUTTON x Group false y Position lt x Position y RADIOBUTTON y Group true z Position gt y Position z Position x Position 2 RADIOBUTTON z Group false a itao x AddAttribute a id groupName itao x 15 the abstraction of returns a node of which 15 the result of an abstraction of the node x from 7 A relation is automatically created for each creation of nodes in the target tree This relation can be of the type one to many or one to one Ru
237. p body options is an optional list of one or more identifiers such INACTIVE GRAYED or CHECKED separated by commas or spaces popup_body may contain any combination of menu item separator or popup menu one by line A menu item has the following syntax MENUITEM id options A separator has the following syntax MENUITEM SEPARATOR It s easy to link the attributes from the class diagram with this syntax Note that the Position attribute corresponds to the line where the item is defined in lt menu_body gt or lt popup_body gt 4 3 4 Other types of resources The other resources described in a resource script file are not helpful for the development of my plug in However the resource editors can habitually extract the icon and bitmap from the executable and save them anywhere Then the user will be able to manually put a missing image in its GrafiXML project When accelerators are defined for menu items key combinations they should be found in the resource of type Accelerators If I go back to my second example there is this resource from Resource Hacker 209 ACCELERATORS LANGUAGE LANG_ENGLISH SUBLANG_ENGLISH_US VK_N 251 NOINVERT CONTROL VIRTKEY VK_F1 610 NOINVERT VIRTKEY VK_F12 432 NOINVERT ALT VIRTKEY VK_F7 250 NOINVERT VIRTKEY Only one menu item is matching MENUITEM Folders History tAlt F12 432 And there are often some curiosities So this type of resource will not b
238. ple a tab control sometimes displays an up down control to enable the user to scroll additional tabs into view General Debug C C Link Resouci Alignment left right none Positions the up down control next to the left right edge of its buddy window the buddy window is then moved to the right left and its width is decreased to accommodate the width of the up down control The control can also be unattached none ArrowKeys Boolean If true provides a keyboard interface by causing the up down control to increment and decrement the position when the buddy window has the focus and the UP ARROW and DOWN ARROW keys are pressed AutoBuddy Boolean If true automatically selects the previous window in the z order as the up down control s buddy window Horizontal Boolean If true causes the up down control s arrows to point left and right instead of up and down for horizontal scrolling HotTrack Boolean If true the arrows on the control are highlighted as the pointer passes over them NoThousands Boolean If true a thousands separator is not inserted between every three decimal digits SetBuddyInt Boolean If true causes the up down control to set the text of the buddy window whenever the current position changes Wrap Boolean By default the current position does not change if the user attempts to increment it or decrement it beyond the maximum or minimum value If true causes the position to w
239. ponsible for drawing sorting and storing its contents and the items in the list box are all the same height The owner window receives a message when a visual aspect of the list box has changed OwnerDrawVariable Boolean If true the owner of the list box is responsible for drawing sorting and storing its contents and the items in the list box are variable in height The owner window receives a message when a visual aspect of the list box has changed 17 Note that a horizontal scrollbar can only be displayed with a multi column list box 18 And the vertical scrollbar is added when there are more items than will fit in the visible area of the listbox a They can sent LBN_DBLCLK notification code 120 WM_DRAWITEM message 112 Appendix C HasStrings Boolean If true the list box contains items consisting of strings The list box maintains the memory and pointers for the strings so the application can use a message to retrieve the text for a particular item By default all list boxes except owner drawn list boxes have this style NolntegralHeight Boolean If true the size of the list box is exactly the size specified by the application when it created the list box By default Windows sizes a list box so that the list box does not display partial items UseTabstops Boolean If true causes the list box to recognize and expand tab characters when drawing its strings WantKeyBoardInput Boolean If true th
240. pup menu has Position 1 The position value is incremented for subsequent items including separators 175 The WM_COMMAND message is not send to the owner window when the item is disabled or grayed 136 Appendix D Appendix Source code BRR KKK KK e KI I III II This class containing a main method can be used to test my implementation without launching GrafiXML It has not to be placed in the jar when integrating the plug in into GrafiXML Put before running it a valid resource file in C named fichier rc J RRR RRR RRR KR KKK kk oko kk ko kk Ck Ck kk oko oko ek kk oko kk oko A koe kk ko kk Ck E kk ok kk ko ko IARI import importresources RcFile import importresources SdfFile import importresources XibFile import java io FileNotFoundException import java io IOException import java io File public class plugin public static void main String args File resourceFile displayDialog if resourceFile getName endsWith rc a Windows rc file is imported int filePointers try scan the file to locate resources and mark thoses selected by the user filePointers RcFile scan resourceFile if filePointers length 0 one or more resource has been selected by the user try RcFile process filePointers catch FileNotFoundException e System out println File re
241. put is directed to the window and various visual cues are changed for the user The system assigns a slightly higher priority to the thread that created the foreground window than it does to other threads 107 Appendix C FontSize Integer Specifies the size in points of the font used for the text in the dialog box and its controls A point is 013837 of an inch roughly 1 72 inch or 2 54 of a centimetre The value is generally determined by measuring the distance from the bottom of a lowercase g to the top of an adjacent uppercase M as shown in the illustration Italic 1 false true gvi If true the font is italic The value is 1 if there is no information about this property default value Weight Integer Specifies the weight of the font in the range 0 through 1000 For example 400 is normal and 700 is bold If the value is zero a default weight is used The value 1 is the default value nothing specified ShellFont Boolean If true indicates that the dialog box should use the system font FontName must be set to MS Shell Dlg Otherwise this style has no effect The system selects a font using the font data specified in the Fontsize Weight and Italic attributes CONTROL This class defines controls Every control is a child window that an application uses in conjunction with another window to perform simple input and output I O tasks type text choose options and direct a dialog box to comp
242. putText and a button are from the second type The properties of each final element in the hierarchy that is their specific and inherited attributes are limited to describe characteristics of high common interest independently from the future rendering 5 FlashiXML which is currently being implemented can also opens a CUI UsiXML file and renders it in Flash QtkXML in the Tcl Tk environment and JaviXML for Java 56 The UML class diagram of the CUI model is given at the next page The full documentation of the diagram can be found on http www usixml org Each CUI model expressed in UsiXML will be an instance of this meta model I can then compare the meta model with that one given in the previous chapter and find correspondences between them This mapping is covered in the next chapter mappin UML model CUI model instance of RC HTML Once the resource file will be transformed in UsiXML at the CUI level code in another language can be generated even automatically with GrafiXML in HTML Java XHTML or XUL 57 uiModel
243. rap to the opposite extreme if it is incremented or decremented beyond the ending or beginning of the range TRACKBAR A track bar is a window that contains a slider also called a thumb and optional small indicators called tick marks Track bars are useful when you want the user to select a discrete value or a set of consecutive values in a range 138 combination that is sometimes referred to as a spinner control 13 Tf the buddy window is a list box an up down control sets its current selection instead of its caption 121 Appendix C AutoTicks Boolean A track bar displays tick marks at its beginning and end unless the NoTicks attribute take the true value If true the control displays additional tick marks at regular intervals along the track bar By default it displays a tick mark for each increment in its range of values but a different interval can be specified DowlsLeft Boolean By default the track bar control uses down equal to right and up equal to left If true reverses the default making down equal left and up equal right EnableSelectionRange Boolean If true allows the user to select a range on the track bar by holding the SHIFT key when dragging This selection restricts the user to a specified portion of the total range The logical units do not change but only a subset of them is available for use The tick marks at the starting and ending positions of a selection range are displayed as triangles
244. rd whose bits are set to 1 Once shifted to the left with 0 lt lt n its n right bits are set to 0 complement of this word 0 lt lt n gives a mask whose n right bits are set to 1 There are 42 different style flags for a dialog box that can appear after the STYLE keyword For a dialog box containing 10 controls each having 5 flag identifiers to define its style from a set of more than possible 200 there will be in the worst case more than 10x5x200 10000 strings comparisons needed to store the style of all the controls in a numeric form Even if I compare the flag string with a smaller set knowing to which class the control belong the numerous remaining comparisons in many nested if statements will be executed Another algorithm has to be used 55 That is when the flag WS_POPUP the style for a dialog box is present the highest bit T have listed in chapter four 15 style flags for a dialog box DS 27 25 style flags for a window WS_ and WS_EX and 258 style flags for a control 77 A 0x50012B4C 2 1 0 1 2 25 I use a trie for flag identifiers reading in order to support fast pattern matching When a flag is encountered e g WS_CAPTION a query is performed on a fixed memorised collection of possible flag A trie is a tree based data structure that store strings It is typically used to see if a word belongs or not to a set of words contained in a text the name trie come from t
245. re defined in sections 4 3 1 to 4 3 3 I suppose here that the user hasn t to modify the file given by a decompiler and that suppressing a separator of resource an empty line is as well serious that suppressing the identifier or the second keyword of a resource In the two cases a potential resource is lost Module 2 the process phase Input n array a of integers with a length 7 1 containing line numbers of an existing Windows resource script file f at least one resource has then been found in f and selected by the user The first line of f starts at 1 Output f is closed and unchanged The n resources defined at line afi 0 i n in f are transformed into CUI in GrafiXML The program is robust in the sense that it handles unexpected input in the second phase Some scenarios are inserted in the source code comments In the first phase some resources will be simply ignored if the structure of the resource script file is not valid 72 6 2 4 Description of my implementation I explain here briefly how my program accomplish its requirements the how and consider some design questions This regroups some concepts some choices I ve made during the development the data structures that used and the principal algorithms One programming requirement was to read information from an external source a rc file on disk A stream is the underlying mechanism for accomplishing any I O operation in Java The java io packag
246. rent toolbar In a transparent toolbar the toolbar is transparent but the buttons are not Button text appears under button bitmaps List Boolean If true it s a flat toolbar with button text to the right of the bitmap if no text is added to the image it is identical to Flat true RegisterDrop Boolean If true the control requests a drop target object when the pointer passes over one of its buttons 59 ToolTips Boolean If true adds tool tips to the toolbar control WrapAble Boolean If true it s a toolbar that can have multiple lines of buttons The buttons can wrap to the next line when the toolbar becomes too narrow to include all buttons on the same line When the toolbar is wrapped the break will occur on either the rightmost separator or the rightmost button if there are no separators on the bar The size and position of the toolbar window automatically set itself The height is based on the height of the buttons in the toolbar the width is the same as the width of the parent window s client area and the control is positioned along the top or bottom if specified of the parent window s client area Also the toolbar window procedure automatically adjusts the size of the toolbar whenever the size of the parent window changes The toolbar default sizing and positioning behaviours is turned off if the two next attributes are set to true NoResize Boolean 7 By sending a TBN_GETOBJECT notific
247. ress the arrow keys to increment and decrement the position when the buddy window has the focus The combo box COMBOBOX class from the first example is a drop down one those from the sixth example are drop down list combo boxes The simple dropDown dropDownList first has a list box which is displayed when the user selects an icon next to the edit control not all times as a 2 simple combo box and the current selection in the list is displayed in the edit control The second is similar except that the edit control is replaced by a Static text item displaying the current selection This table summarizes the three existing types drop down list edit control Type dropDown 4 J Type dropDownList X Type simple X V In the dialog of the fourth example the user can move a track bar using either the mouse or the direction keys when the control has focus to change the brightness of the treemap in a range of 1 through 100 This vertical trackbars TRACKBAR class and Orientation vertical have NoTiks true to not display any tick marks and TickMarks both causes tick marks to be displayed on both sides of the control The effect is that the thumb of the control appears as a rectangular box Because tool bars TOOLBAR class are especially used in an application s main window it is unfrequent to find them in a resource files We can still see this control in the Ope
248. rform the domain the context of use the presentation of information and the dialog between the user and the system are generally captured by means of models These specific models explicitly capture knowledge about the user interface with appropriate abstraction The importance of having user interface engineering models justifies the need of providing appropriate automated tools to create each of these models The design can be rapidly prototyped and implemented possibly even before the application code is written and it s easier to incorporate changes discovered through user testing The motivation is also to facilitate the creation of user interfaces that work on any platform available today The goal of this thesis is to develop a tool aimed to capture the essence of an application s graphical user interface and recreate a model at a more abstract level specifying the user interface without the multiple details linked to the implementation in a specific language It will serve principally as automated support for reengineering activities such as the redesign of existing interfaces for another platform A method which performs abstraction is reverse engineering The results can be then reused in a forward engineering phase to regenerate user interface code achieving a reengineering cycle The originality is that the model will not be extracted by the examination of the entire source code but from the resource file of an application stor
249. s 140 Appendix D if dialogSelected T new FlagTrie creer l arbre des flags String id For each stored line number for int i 0 i lt p length 1 Reach the resource begining at line i System out println Next stored line in the vector p i int In while Inr getLineNumber lt p i lnr readLine System out printin line ln System out print From line ln Read the identifier of the menu or of the dialog st nextToken if st ttype StreamTokenizer TT NUMBER id String valueOf int st nval else id st sval Read the type of the resource the token is a word st nextToken if st sval equals MENU System out println MENU id processMenu id lnr st else It s a resource of type dialog box System out println DIALOG id processDialog id st sval endsWith EX lnr st lnr close private static void processMenu String id LineNumberReader lnr StreamTokenizer st private static void processDialog String id boolean extended LineNumberReader r StreamTokenizer st throws IOException short x y width height int styles 0 extendedStyles 0 String text null language null fontName Tahoma byte fontSize 8 boolean bold false italic String ctrlClass null false Parse the position and dimention numbers st nextToken x short st nval System out println x coordinate x st nextTo
250. sctls updown32 0x000000B7 222 114 10 12 LTEXT 1 118 129 195 1 NOT WS GROUP 55 ETCHEDHORZ ICON 2815 1 130 131 18 20 AUTOCHECKBOX amp Camera Shutter Sound when Copying 109 167 137 133 8 ICON 2525 1 131 149 18 20 AUTOCHECKBOX 8 amp Sounds with Warning Dialog Boxes 110 167 154 126 8 1000 DIALOG 0 0 320 172 STYLE DS SETFONT 05 MODALFRAME WS WS CAPTION CAPTION General FONT 8 MS Sans Serif CONTROL 1999 1 STATIC 55 BITMAP 55 REALSIZEIMAGE SS SUNKEN 7 7 18 20 ICON 2655 1 132 7 18 20 AUTOCHECKBOX amp Launch Multiple Instances 108 167 5 99 8 AUTOCHECKBOX amp Place Icon in Taskbar Tray 111 167 17 99 8 AUTOCHECKBOX Confirm Program amp Exit 112 167 29 79 8 CONTROL 1 STATIC SS ETCHEDHORZ 118 40 195 1 LTEXT Select the Type of Macro to be Copied to Clipboard 1 125 43 165 8 ICON 2535 1 130 55 18 20 AUTORADIOBUTTON amp RGB Macro 101 167 55 52 8 WS GROUP AUTORADIOBUTTON He amp xadecimal 102 167 65 56 8 AUTORADIOBUTTON HTML amp Macro 103 167 75 56 8 93 Appendix B CONTROL 1 STATIC SS_ETCHEDHORZ WS_GROUP 118 86 195 1 LTEXT Specify the Color Swatch Size for Clipboard Copies 1 125 90 165 8 ICON 2000 1 130 103 18 20 LTEXT amp Width 1 167 103 22 8 EDITTEXT 104 193 100 30 12 ES_AUTOHSCROLL ES_NUMBER CONTROL Spini 106 msctls updown32 0 000000
251. setVisibleRowCount 10 JScrollPane listScroller new JScrollPane list listScroller setPreferredSize new Dimension 215 375 ok new JButton Ok Tyr ok setMnemonic O cancel new JButton Cancel cancel setMnemonic C ok setBackground gray cancel setBackground gray ok setEnabled false cancel setEnabled true Organize the components panell new JPanel panell setLayout new BoxLayout panell BoxLayout Y AXIS panell add Box createRigidArea new Dimension 0 12 panell add label panell add Box createRigidArea new Dimension 0 5 panell add listScroller panell setBackground gray panel2 new JPanel panel2 setLayout new BoxLayout panel2 BoxLayout X AXIS panel2 add Box createRigidArea new Dimension 12 0 panel2 add panell panel2 add Box createRigidArea new Dimension 12 0 panel2 setBackground gray 146 Appendix D panel3 new JPanel panel3 setLayout new BoxLayout panel3 BoxLayout X AXIS panel3 add ok panel3 add Box createRigidArea new Dimension 5 0 panel3 add cancel panel3 setBackground gray panel4 new JPanel panel4 setLayout new BoxLayout panel4 BoxLayout Y AXIS panel4 add panel2 panel4 add Box createRigidArea new Dimension 0 5 panel4 add panel3 panel4 add Box createRigidArea new Dimension 0 12 panel4 setBackground gray setContentPane panel4 ok addActionListener this
252. simplified defaultContent Find width 423 height 172 gt lt box id box_1 1 type horizontal relativeWidth 100 relativeHeight 100 gt box id box_1_1 name box_1_1 type vertical relativeWidth 70 relativeHeight 100 gt lt inputText id input_text_component_4 name edit control 222 isVisible true isEnabled true isEditable true textSize 8 textFont Microsoft Sans Serif maxLength 35 numberOfLines 1 numberOfColumns 35 glueHorizontal right gt lt box gt lt box id box_1_2 name box_1_2 type vertical relativeWidth 30 relativeHeight 100 gt button id button_component_2 name default push button 1 defaultContent Find Next isVisible true isEnabled true textSize 8 textFont Microsoft Sans Serif glueHorizontal middle gt button id button_component_3 name push button 245 defaultContent Mark All isVisible true isEnabled true textSize 8 textFont Microsoft Sans Serif glueHorizontal middle gt lt box gt lt dialogBox gt lt cuiModel gt A cio is characterized by various attributes sush as id name or defaultContent All the CIOs in this CUI model are graphicalCio which inherits from cio and has specific attributes such as isVisible isEnabled textFont or textSize A graphicalCio can belong to one of the two possible types graphicalContainer or graphicalIndividualComponent For example dialogBox and a box are from the first type and an in
253. sourceFile getName not found catch IOException System out println e catch FileNotFoundException e System out println File resourceFile getName not found catch IOException System out println e Other formats of resource files for future developement else Apple resource files if resourceFile getName endsWith nib NibFile process resourceFile Screan definition files else SdfFile process resourceFile public static File displayDialog fichier pour tests return new File C fichier rc 137 Appendix D BRR RRR RK RK IK RK AK ke kk kk kk KR RK IK IR RK RR ke k IR IR RK RK RI IO OR RR RR IR IO OR AK ORR k k k k k k k k k k ImportResources java This class implements the ImportPlugin interface used to add a plugin into GrafiXML Author Julien Marion RER kk ko kk kk kk ke Sk kk ke kk k IO package importresources import be ac ucl isys grafixml plugins ImportPlugin import be michotte util Utilities import java io FileNotFoundException import java io IOException impor
254. specification The two types of file obtained describing on its own manner the interface are always a textual representation of the resource They can be then compared 1 They can be found on the net The three first applications are sharewares from http www framasoft net and the two others are free for try 17 They can be downloaded on http www restuner com http www bome com Restorator a shareware version limited to a 30 day trial period http www resource builder com also limited to a 30 day trial period and http www angusj com resourcehacker respectively 16 3 4 Selected method The goal to achieve in this thesis can be reformulate as the development of a reverse engineering tool which will read any Windows resource script file and generate into GrafiXML the corresponding UsiXML specifications at the CUI level Here is an illustration of the selected method We have beforehand to extract the resource script file from an executable Windows uses the filename extension exe here for example with Restorator Note that these tools incorporate also an internal resource script compiler called a RC compiler Once a resource compiled the resources are modified in the application s executable file 17 18 4 Windows resource files In the previous chapter I ve stated my problem which is the reverse engineering of Windows resource script files I see in this chapter the content of these source files a
255. ssudxe ussiopequ 1034405 474 40158 1 5 SM 318ISIA SM UK SM 58 a bane 7034405 OT 99 40158 1 SM dnOuUu5 SM 1 318ISIA SM QUHI SM xogxo3H201nv 58 NOLLnS GEZ UoIsse2dxeg eny TOULNOD 01 0617 5 5740158 1 SM 4089 SMI 378151 SM SM 59 NOLLNG CET 95879 WIN TOULNOD fot tp s 40158 1 SM lanoso SM 318ISIA SM OUIHOTSM XOBOSHOOLN 58 NOLLNG 77252 5 PJOM TOYLNOD 05 SZT EZ 09 401581 SM 318ISIA SM SM TIOWSHOLNY 582 582 Xog0gW02 TET ue 1034409 8 ss sz 5 4NOYD SM 218151 SM GYIH2 SM 1441 SS 2 16 Ui TOMLNOD 05 sz1 s 09 d01s8v1 SM 318ISIA SM GTIHO SM TIOWSHOLNY 582 582 TET ue TOULNOD 8 ss 7 s anouo SM 318ISIA SM SM 1 1431 55 211 15 1 145 SW 8 1 Sn HSTISN3 ONVISNS HSTIONT ONVI 39vn9NY1 928 4 nN3WSAS SM 1 NOLLAVI SM 1 dndOd SM INVASWOOW 52 TIALS OTT sgz pr oc 10 t s9 soz 40158 1 SM SM auo SM NOLLNSHSNd 58 NOLLOS 7 12052 TOWLNOD Vt so ez 502 01Sgv1 SM 318ISIA SM er SM NOLINGHSNd se NOLLQS SPZ 42899 1031409 vt 019901 sm snows SM SM ON 5 Z1 Sp
256. style gt BS_CENTER 0x00000300 HorizontalAlignment right lt style gt BS_RIGHT 0x00000200 Flat true lt style gt BS_FLAT 0x00008000 Multiline true lt style gt BS_MULTILINE 0x00002000 15 Notice from the examples that class can occur between quotes like BUTTON in the resource script file this is the case with Resource Builder and also in lower case like button 39 Notify true lt style gt BS NOTIFY 0x00004000 Class GROUPBOX lt style gt BS_GROUPBOX 0x00000007 Class RADIOBUTTON Attributes Auto false lt style gt BS_RADIOBUTTON 0x00000004 Auto true lt style gt BS_AUTORADIOBUTTON 0x00000009 RightButton true lt style gt BS_RIGHTBUTTON 0x00000020 PushLike true lt style gt BS_PUSHLIKE 0x00001000 Class PUSHBUTTON Attributes Default false lt style gt BS_PUSHBUTTON 0x00000000 Default true lt style gt BS_DEFPUSHBUTTON 0x00000001 Content text lt style gt BS TEXT 46 0x00000000 Content bitmap lt style gt BS_BITMAP 0 00000080 Content icon lt style gt BS ICON 0x00000040 Class CHECKBOX Attributes Auto false amp 3State false style BS CHECKBOX 0x00000002 Auto true amp 3State false lt style gt BS_AUTOCHECKBOX 0x00000003 Auto false amp 3State true lt style gt BS_3STATE 0x00000005 Auto true amp 3State true lt style gt BS_
257. t WS_MINIMIZEBOX 0x00020000 Minimized true lt style gt WS MINIMIZE 0x20000000 SystemMenu true lt style gt WS SYSMENU 0x00080000 ThickFrame true style WS THICKFRAME 0x00040000 VerticalScrollBar true lt style gt WS VSCROLL 0x00200000 Visible true lt style gt WS VISIBLE 0x10000000 ClientEdge true ex style WS CLIENTEDGE 0x00000200 DialogModalFrame true ex style WS DLGMODALFRAME 0x00000001 StaticEdge ex style WS STATICEDGE 0x00020000 WindowEdge true ex style WS_EX_WINDOWEDGE 0x00000100 AcceptFiles true lt ex_style gt WS_EX_ACCEPTFILES 0 00000010 AppWindow true ex style WS_EX_APPWINDOW 0x00040000 ControlParent true ex style WS_EX_CONTROLPARENT 0x00010000 ExContextHelp true ex style WS_EX_CONTEXTHELP 0 00000400 Layered true ex style WS_EX_LAYERED 0 00080000 LayoutRTL true ex style WS_EX_LAYOUTRTL 0x00400000 Left true ex style WS EX LEFT 0x00000000 LeftScrollBar true style WS LEFTSCROLLBAR 0x00004000 LTRReading true ex style WS_EX_LTRREADING 0 00000000 MDIChild true ex style WS_EX_MDICHILD 0 00000040 NoActivate true ex style WS_EX_NOACTIVATE 0 08000000 NolnheritLayout true ex style WS_EX_NOINHERITLAYOUT 0x00100000 NoParentNotify true style WS_EX_NOPARENTNOTIFY 0x00000004 Right true ex
258. t 1 5 7 45 8 COMBOBOX 222 50 5 145 m CBS DROPDOWN CBS AUTOHSCROLL AUTOCHECKBOX Match amp whole word only 232 5 22 120 10 WS GROUP AUTOCHECKBOX Match amp case 233 5 34 130 10 WS GROUP AUTOCHECKBOX Regular amp expression 239 5 46 120 10 WS GROUP AUTOCHECKBOX Wrap aroun amp d 240 5 58 120 10 WS GROUP AUTOCHECKBOX Transform amp backslash expressions 241 5 70 160 10 WS GROUP GROUPBOX Direction 1 135 22 60 34 WS GROUP AUTORADIOBUTTON amp Up 234 140 30 45 12 WS GROUP NOT WS TABSTOP AUTORADIOBUTTON amp Down 235 140 42 45 12 NOT WS TABSTOP DEFPUSHBUTTON amp Find Next 1 205 5 65 14 WS GROUP PUSHBUTTON amp Mark All 245 205 23 65 14 PUSHBUTTON Cancel 2 205 41 65 14 The first line gives a name to the dialog box in this case 400 The name is followed by the keyword DIALOG and four numbers The first two numbers are the x and y coordinates of the dialog box when the dialog box is invoked by the program The second two numbers are the width and height of the dialog box These coordinates and sizes are not pixels but are based on the size of a system font character in this case an 8 point MS Shell Dlg font x coordinates and width are expressed in units of 1 4 of an average character width and y coordinates and height are expressed in units of 1 8 of a character height Because system font characters are often approximately twice as high
259. t java io File public class ImportResources implements ImportPlugin Load the given file public boolean load File file if Utilities getExtension file equals rc a Windows rc file is imported int filePointers try scan the file to locate resources and mark thoses selected by the user filePointers RcFile scan file if filePointers length 0 one or more resource has been selected by the user try RcFile process filePointers catch FileNotFoundException e System out println File file getName not found catch IOException System out println e catch FileNotFoundException e System out println File file getName not found catch IOException e System out println e Other formats of resource files for future developement else Apple resource files if Utilities getExtension file equals xib XibFile process file Screan definition files else SdfFile process file return true Used to load a preview of the file public boolean loadFileContent File file return false Return the extensions used by this type public String getExtensions return new String re nib sdf Return the public String Return the public String Return the public String Return the public String Return the public String Return the public Strin
260. t notations in the dialog box template Shortcut notations can be used to define child window controls in the dialog box template As we can see in the first exemple other identifiers than CONTROL are used in the dialog box template They imply a predefined window class and some style flags that do not have to be specified For example LTEXT indicates that the class of the child window control is STATIC and that the style is WS_CHILD SS_LEFT WS_VISIBLE WS_GROUP Resource Tuner and Restorator use shortcuts in the resource file they generate whereas Resource Builder and Resource Hacker use the full notation The following table links the control types which can be specified and their equivalent notation window class and style flags lt control_type gt lt class gt lt style gt PUSHBUTTON BUTTON WS_CHILD WS_VISIBLE BS_PUSHBUTTON WS_TABSTOP DEFPUSHBUTTON BUTTON WS_CHILD WS_VISIBLE BS_DEFPUSHBUTTON WS_TABSTOP CHECKBOX BUTTON WS_CHILD WS_VISIBLE BS_CHECKBOX WS_TABSTOP AUTOCHECKBOX BUTTON WS_CHILD WS_VISIBLE BS_AUTOCHECKBOX WS_TABSTOP RADIOBUTTON BUTTON WS_CHILD WS_VISIBLE BS_RADIOBUTTON WS_TABSTOP AUTORADIOBUTTON BUTTON WS_CHILD WS_VISIBLE BS_AUTORADIOBUTTON WS_TABSTOP GROUPBOX BUTTON WS_CHILD WS_VISIBLE BS_GROUPBOX LTEXT STATIC WS_CHILD WS_VISIBLE SS_LEFT WS_GROUP CTEXT STATIC WS_CHILD WS_VISIBLE SS_CENTER WS_GROUP RTEXT STATIC WS_CHILD WS_VISIBLE SS_RIGHT WS_GROUP ICON STATIC WS_CHILD WS_VISIBLE SS_ICON
261. t ttype StreamTokenizer TT_WORD the key word CONTROL or a control type String word st sval if word equals CONTROL System out println h hoooo bordel The line format is CONTROL text id ctrlClass styles x y width height extendedStyles helpId st nextToken text st sval st nextToken skip System out print text text st nextToken if st ttype StreamTokenizer TT NUMBER id String valueOf int st nval else id st sval System out print id id st nextToken skip st nextToken ctrlClass st sval toLowerCase System out print classe ctrlClass st nextToken skip st nextToken if st ttype StreamTokenizer TT NUMBER while st ttype if st sval equals NOT st nextToken be sure it is present else will add the flag styles T match st sval getFlagValue styles T match st sval getFlagValue else styles T match st sval getFlagValue st nextToken System out print styles styles st nextToken x short st nval System out print x coordinate x st nextToken skip st nextToken y short st nval System out print y coordinate y st nextToken skip st nextToken width short st nval System out print width width st nextToken skip st nextToken height short st nval System out print height height st nex
262. tText textVerticalAlign top numberOfColumns w 4 numberOfLines h 8 Text t NoPrefix false cio defaultContent t without any characters Text t NoPrefix false and amp is a character of t graphicalIndividualComponent defaultMnemonic the character following amp int Note here the attribute is set to the cio which is the abstraction of the first control having Tabstop true after this static control in the resource file Text t NoPrefix true cio defaultContent t TextStyle left or simple or leftNoWordWrap textHorizontalAlign left TextStyle center textHorizontalAlign middle TextStyle right textHorizontalAlign right STATIC Type image imageComponent Text t cio name t RealSizelmage true Width w Height h imageComponent width w 4 xChar height h 8 yChar Border true or Sunken true imageComponent imageBorder STATIC Type frame Width Height h Etched horizontal or vertical box width w 4 xChar height h 8 yChar containing each control that participates in the Group 64 relationship graphicalCio borderWidth 1 borderType line Etched horizontal Height 1 box width w 4 xChar height 1 graphicalCio borderWidth 1 borderType line Etched vertical Width 1 box width 1 height h 8 yChar graphicalCio borderWidth 1 borderType
263. tToken if st ttype st nextToken skip optional while st ttype StreamTokenizer TT EOL amp amp st ttype extendedStyles T match st sval getFlagValue bitwise OR operation st nextToken System out println extended styles extendedStyles Go to the begining of the next line optional helpId skiped while st ttype StreamTokenizer TT EOL st nextToken else Shortcut notation The line format is control type text id x y width height styles extendedStyles helpId styles 0x50000000 WS CHILD and WS VISIBLE for any type of control Text field in the line is excuded for EDITTEXT LISTBOX COMBOBOX and SCROLLBAR boolean textField true switch word charAt 0 case A etrlClass button if word charAt 4 AUTOCHECKBOX implies the flags BS_AUTOCHECKBOX and WS_TABSTOP 143 else id Appendix D styles 0x10003 else AUTORADIOBUTTON implies the flag BS_AUTORADIOBUTTON styles 9 break case if word charAt 1 CHECKBOX implies the flags BS_CHECKBOX and WS_TABSTOP ctrlClass button styles 0x10002 else if word charAt 1 0 COMBOBOX implies the flags CBS_SIMPLE and WS_TABSTOP ctrlClass combobox styles 0x10001 textField false else CTEXT implies the flags SS_CENTER and WS_GROUP ctrlClass static styles 0x20001 break case D DEFPUSHBUTT
264. tead of looking in the source code composed of the functional core and the UI expressed in some programming language for the part related to the UI it s sometime possible to explore resources used and extract them from the executable file In addition to source code most applications include resources used at runtime Resources can be composed of a wide range of elements including elements that are necessary for the UI but are not part of the application code itself and custom resources that contain data the application needs Resources are additional binary data stored in an executable file They do not reside in the executable program s data area that is the resources are not immediately addressable by variables in the program s data segment but are appended to the executable in a separate area When a program is loaded into memory for execution it usually leaves resources on disk A particular resource is loaded into memory when an application needs to use it for the first time Just as multiple instances of the same program share the same code multiple instances also usually share resources Without the concept of resources a binary file such as an icon for example would probably have to reside in a separate file that the executable would read into memory to use Or the icon would have to be defined in the 11 program as an array of bytes which make it difficult to visualize the actual icon image As a resource the icon is stored in
265. ted by a word in memory To illustrate let s look at the style of the tool bar from my fifth example WS_CHILD WS_VISIBLE WS_TABSTOP TBSTYLE_TOOLTIPS TBSTYLE_WRAPABLE TBSTYLE_FLAT TBSTYLE_CUSTOMERASE CCS_NORESIZE CCS_NOPARENTALIGN and CCS_NODIVIDER 76 The variable I use to store such number is of the signed Java data type int meaning that 32 bits are used to represent the value in two s complement binary form Note that beyond a certain threshold the resulting stored number will be not the same that the original hexadecimal number read in the file this type of primitive data can represent only 2 positive integers and not 2 as desired This is not a problem since it s the position of a bit that is significant which is not altered considering the linear logic of the two s complement representation of numbers if we add 1 to the highest value that can be represented overflow we get the lowest value if signed numbers were represented for example with a bit of sign we would get the second representation of the number 0 then 1 and so on iij 1111 1110 0001 1 My basic motivation to group all flags in a numeric value comes from the fact that a style resource file for a particular control is often specified with identifiers less often with a hexadecimal number but sometimes both And in the last case
266. ted with it even better with a graphical representation of the resource which helps more the user in its choice I ve opted for the simplicity of information given to the user and not the surcharge A FileReader and a LineNumberReader We scan through the entire text a first time to find resources and sore line numbers and we go through the text a second time after the user s selection to extract and process each resource at a specified line The file is then read sequentially twice My choice is to combine a FileReader a LineNumberReader and a StringTokenizer in the module 1 first scan to read the file f line by line keeping track of line numbers when an exploitable resource in encountered and to parse the first line of a paragraph A non empty sequence Li Li 4 1 Li of text lines from f forms a paragraph if there is no empty line and Lii if it s not the first line of f as Lj if it s not the last line of f are empty lines Paragraphs are separated by at least one empty line and comments at the beginning are not part of a paragraph The second word of each paragraph of f is checked A non empty sequence Ci Cj Cj of characters from f is a word if there is no white space character and Ci 1 if it s not the first character of f as Cj if it s not the last character of f are white space characters If the checked word is MENU or DIALOG then the line number is stored and the located resource w
267. tenance 1992 pp 226 235 E Stroulia M El Ramly P Iglinski P Sorenson User Interface Reverse Engineering in Support of Interface Migration to the Web Automated Software Engineering Journal 2003 Kluwer Academic PublishersBoehm B Software Engineering Economics Prentice Hall 1981 A Memon I Banerjee and A Nagarajan GUI Ripping Reverse Engineering of Graphical User Interface for Testing Proc of Working Conference on Reverse Engineering November 2003 Byrne E A Conceptual Foundation for Software Re Engineering The International Conference on Software Maintenance 1992 pp 226 235 Boehm B W 1981 Software Engineering Economics Englewood Cliffs Prentice Hall Inc Boehm B W E Horowitz R Madachy D Reifer B K Clark B Steece A W Brown S Chulani and C Abts 2000 Software Cost Estimation with COCOMO II NJ Prentice Hall Sneed H M 2004 A Cost Model for Software Maintenance and Evolution 20th IEEE International Conference on Software Maintenance ICSM 04 Chicago Illinois September 11 14 pp 264 273 Limbourg Q Vanderdonckt J Michotte B Bouillon L V ctor L pez Jaquero UsiXML a Language Supporting Multi Path Development of User Interfaces Proc of 9th IFIP Working Conference on Engineering for Human Computer Interaction jointly with 11th Int Workshop on Design Specification and Verification of Interactive Systems EHCI DSVIS 2004 Hamburg July 11 13 2004
268. text at the end of the edit control line the existing text is automatically scrolled Else if the edit control is completely filled with text no more text is allowed to be entered into the edit control Type simple dropDown dropDownList There are three types of combo boxes For a simple combo box the list box is displayed at all times The current selection in the list box is displayed in the edit control A drop down combo box is similar to simple one except that the list box is not displayed unless the user selects an icon next to the edit control A drop down list box is similar to drop down one except that the edit control is replaced by a static text item that displays the current selection in the list box edit control is set to read only 127 rich edit control inherits from EDIT class but can not have the LowerCase OEMConvert and UpperCase attributes set to true it does not support these styles 115 Appendix C Extended Boolean Additionally some combo box controls that display icons with items extended combo box controls can use the next attributes Note that for these controls the EDIT and LISTBOX specific attributes are not supported CaseSensitive Boolean If true searches in the list will be case sensitive This includes searches as a result of text being typed in the edit box NoEditImage Boolean If true the edit box and the dropdown list will not display item images NoSizeLimit Boolean
269. then also grouped the flag added to the static control marking the end of the group Nevertheless all the check box controls get the flag to prevent the arrow keys from doing anything when these controls have the input focus the group contain only one control so pressing a arrow key has no effect Should the combobox had this flag If the combobox control and the static control are in a group the interface should be not quite correct if the former got the focus because it can t do anything with it It s not important since the cursor change in the combobox edition field and move around when pressing the arrow keys There is a state shart describing the input focus in this dialog box PressingKey tab M PressingKey arrows FocusOnCombobox Match whole word only FocusOnButtons FocusOnCheckBoxes Opening FosusOnRadioButtons Regular expression 7 Mark all Wrap around FocusOnTheCurrentlySelected Transform backslash expressions FocusOnTheNewlySelected There is another keyboard interface which can be specified in the value of the Text attribute the mnemonic is the letter that follows an ampersand amp The user can then move the input focus to any controls by pressing the ALT key and the mnemonic However for static control the focus moves to the first control having Tabstop set to true defined in the file after the static control definition and containing the specified mnemonic see Fi amp nd wath
270. tions CUI ReverseXML KnowiXML GrafiXML VisiXML SketchiXML FormiXML Rendering FUI task domain AUI VisualiXML The task that my GrafiXML plug in should assume is to open a resource script file describing the UI of a Windows based application that is a FUI and generate the UI definition in UsiXML at the CUI level into GrafiXML The CUI model is presented in the next section 5 2 Concrete User Interface model My plug in is devoted to generate UsiXML specifications at the Concrete User Interface level from a resource file of Windows based application Therefore the model which interests me particularly is the CUI model This model describes in a certain degree of expressiveness the appearance and behaviour of a UI A UI represented by this model is dependent of the modality An instance of the model addresses then a single modality at a time In my case the interaction is graphical A CUI is however independent of the platform The elements populating a CUI realize an abstraction of common language used to develop UIs like Windows The CUI model is hierarchically decomposed in Concrete Interaction Objects CIOs A CIO is any entity that the user can perceive and manipulate used for the acquisition or restitution of information CIOs are grouped into two types graphical containers such as a window dialog box or a group box and graphical individual components such as an image a check box or a progressi
271. tls_trackbar32 WS_TABSTOP 0x0000001A 245 17 16 104 CTEXT amp Cushion r nShading 1 271 122 32 18 CONTROL 1211 msctls trackbar32 WS TABSTOP 0 0000001 279 17 16 104 CTEXT amp Height 1 305 122 32 18 CONTROL 1210 msctls trackbar32 WS TABSTOP 0 0000001 313 17 16 104 CTEXT amp Scale r nFactor 1 339 122 32 18 CONTROL 1209 msctls trackbar32 WS TABSTOP 0x0000001A 347 17 16 104 amp Light Incidence 1 246 147 59 8 LTEXT Static 1220 313 146 58 48 WS TABSTOP PUSHBUTTON 1034 242 167 55 22 BS MULTILINE GROUPBOX St amp yle 1 7 146 63 49 AUTORADIOBUTTON amp KDirStat 1213 12 159 42 10 WS GROUP AUTORADIOBUTTON Se amp quoiaView 1214 12 176 53 10 NOT WS TABSTOP AUTOCHECKBOX Show amp Grid 1022 76 150 54 10 PUSHBUTTON Grid amp Color 1030 134 150 85 14 0 WS EX RIGHT PUSHBUTTON H amp ighlight Rectangle 1202 76 175 143 14 0 WS EX RIGHT CTEXT Static 1219 339 7 32 8 CTEXT Static 1218 305 7 32 8 CTEXT Static 1217 271 7 32 8 CTEXT Static 1216 237 7 32 8 LTEXT Static 1215 7 7 211 124 Restorator 143 DIALOGEX 0 0 380 202 0 STYLE DS_SETFONT DS_FIXEDSYS WS_CHILD WS_DISABLED WS_CAPTION WS_SYSMENU CAPTION Treemap FONT 8 MS Shell Dig 400 TRUE 95 Appendix B CTEXT amp Bright r nness 1 237 122 32 18 CONTROL 1212 ms
272. to the begining of the next line optional helpId skiped while st ttype StreamTokenizer TT EOL st nextToken if st ttype StreamTokenizer TT EOL System out println end of line Generate into GrafiXML a control contained in this dialog box Grafi generateControl id ctrlClass x y width height text styles extendedStyles styles 0 extendedStyles 0 text Go to the begining of the next line eventual empty lines are skiped while st ttype StreamTokenizer TT EOL st nextToken BEGIN END is sometimes used by Resource Builder instead of if st ttype StreamTokenizer TT WORD 86 st sval equals END st ttypez System out println current line r getLineNumber System out println number of line read st lineno k H k e e k de e H He A A He e k de A k He K H He A A He e A de A k He e A e A A de e A e A k He e A ke A k de e A e A k de k k k A k de k k e k k k k k k k k ke k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k Resource java Author Julien Marion Represent a resource from the resource file which is proposed to the user in the import resources dialog box An instance stores the id of a resource a type dialog box or menu and the location line number in the file A resource object will be concerved if selected by the user else will be destroyed J RR RRR RR RK KR KKK KK e e KR KK
273. ts that is multiple versions and not only one product Software s are subject to continual changes in their life cycle and organizations devote significant resources to their maintenance and evolution The problem is to quickly adapt the user interface of interactive applications to these changes As the technologies evolve mobile devices e commerce the requirements evolve too additional versions interface migration to the web The today constant evolution of the variety of computing platform a specific software and hardware environment requires more efforts to cope with software portability The usability of a product is a factor of quality 2 For example the service has to be easily visible and the critical services easily accessible 3 For example a good scheduling of the actions to be performed has to be defined The portability of a product is another factor of quality Graphical user interfaces are important parts of today s interactive applications If we examine the code of interactive applications a large part is generally devoted to the user interface portion The development of user interface can then be strong component in the global cost engendered dominated by the maintenance It is then normal that software engineering also include well established methods to develop the user interface uncoupling it from the application The various aspects to take into consideration such as the interactive task to pe
274. ttype StreamTokenizer TT NUMBER id String valueOf int st nval st sval System out print id id st nextToken skip st nextToken x short st nval System out print x coordinate st nextToken skip st nextToken y short st nval System out print y coordinate y st nextToken skip st nextToken width short st nval System out print width width st nextToken skip st nextToken height short st nval System out print height height st nextToken if st ttype st nextToken skip optional int fvalue while st ttype StreamTokenizer TT EOL amp amp st ttype fvalue T match st sval getFlagValue styles fvalue bitwise OR operation corrective operation when CBS DROPDOWN is specified without NOT CBS SIMPLE as in Restorator if fvalue 2 if styles amp 0 lt lt 1 1 if the first bit is set to 1 144 Appendix D that is NOT CBS_SIMPLE has not yet been specified the first bit is inversed that is set to 0 styles styles 1 st nextToken System out print styles styles if st ttype st nextToken skip optional while st ttype StreamTokenizer TT EOL amp amp st ttype extendedStyles T match st sval getFlagValue bitwise OR operation st nextToken System out println extended styles extendedStyles Go
275. ue the control displays bands at the minimum required height when possible the control can then have variable band height Otherwise the rebar control displays all bands at the same height using the height of the tallest visible band to determine the height of other bands VerticalGripper Boolean If true the size grip will be displayed vertically instead of horizontally in a vertical rebar control Vertical Boolean If true the control is displayed vertically STATUTBAR A status bar is a horizontal window at the bottom of a parent window in which an application can display various kinds of status information The status bar can be divided into parts to display more than one type of information like help text and the current cursor position You can see such control in the main window of Rational Rose shown above SizeGrip Boolean If true the status bar control will include a sizing grip at the right end of the status bar A sizing grip is similar to a sizing border It is a rectangular area that the user can click and drag to resize the parent window ToolTips Boolean If true enables tool tips Top Boolean The default position of a status bar is along the bottom of the parent window s client area If true the control appears at the top of the parent window s client area PAGER A pager control is a window container that is used with a window that does not have enough display area to show all of its content
276. uent calls to reset will attempt to reposition the stream to this point readLimite is a limit on the number of characters that may be read while still preserving the mark void reset Reset the stream The BufferedReader class does not represent any particular data source but filter data on a given stream by buffering it into more accessible units In particular it introduces a new method that enables to read a line at time and returns a String or null when the end of file is encountered BufferedReader Reader in create a buffering character input stream that uses a default sized input buffer 2048 String readLine read line of text The string returned can then be processed if I use the StringTokenizer class in addition It allows to break a string into a sequence of tokens defined by delimiters e g space but the tokenization process is much simpler than that used by the StreamTokenizer The LineNumberReader class is also a buffered character input stream but that keeps track of line numbers LineNumberReader Reader in create a new line numbering reader using the default input buffer size int getLineNumber get the current line number void setLineNumber int 1n set the current line number to In The InputStreamReader class is an InputStreamReader is a bridge from byte streams to character streams it reads bytes and decodes them into characters using a specified char set InputStreamReader
277. undle which means they are really a directory structure not a single file I can mention also the screen definition files which are text files describing the layout of the display The method proposed could be generalized to these types of files A resource file associate to an executable MS Windows programs can include various types of resources such as principally accelerator table bitmap cursor menu dialog icon string table and version information An accelerator table is used to define key combinations that generate a command message often to duplicate the action of common menu options Some programs use customized mouse cursors to represent different operations of the program Programs usually use menus dialog boxes and customized icons such as the icon displayed in the upper left corner of the title bar of the application window or shown as a shortcut on the desktop The data in a resource can also describe character strings not defined as variables in the source code The text used in a UI is isolated in one file to make easier the translation of a program in other languages and to reduce memory space In addition to the standard An application can use several nib files with one of them designated as the main nib file containing the main menu and any windows appearing when the application starts up Other nib files can be loaded whenever needed A good rule for creating nib files is to use one nib for each separate kind of window
278. urther subdivided into those that represent data streams and those that represent processing streams The Java I O classes can be combined in many different ways to provide an input stream that behaves exactly as I wish These streams have a sequential access to the file that is the file is processed from the start to the end Other specific classes exist in the package The RandomaAccessFile class supporting both reading and writing to a random access file could be convenient It behaves like a large array of bytes with a kind of index called the file pointer Input operations read any bytes starting at the file pointer and advance the file pointer past the bytes read The StreamTokenizer class is useful for parsing a text file into a sequence of tokens and can recognize words numbers comments and quoted stings It s not actually an input stream as such A Reader must be used between the file and the tokenizer 52 See http java sun com j2se 1 4 2 docs api java io package summary html 73 Let s see some methods from the class that could be interesting for my problem The Reader class is an abstract class for reading information stored in text form Unicode character streams The only methods that a subclass must implement are the two first abstract void close Close the stream int read Read a single character in the file 1 if eof void mark int readLimite Mark the present position in the stream Subseq
279. ustration summarizes the different types of static controls used to draw frames Etched Frame Frame Frame Etched horizontal black gray white frame Rectangle white Etched vertical The values for the colour do not necessary mean that the colour are black gray or white but are based on a Windows system colour the colour used to draw window frame to fill the screen background or to fill the window background And the default values can be changed So this colour information in a resource file is in reality not present In Windows the flags SS ETCHEDHORZ and SS ETCHEDVERT are always used to have an etched looking vertical or horizontal line in a rectangle one unit high or wide as in my third example 76 In my implementation I ve still set these default values 636f71 for black 99a8ab for gray and ffffff for white to the bgColour and borderColor attributes for the corresponding box to visually identify the container in the GrafiXML editor 65 TRACKBAR slider Orientation horizontal Orientation orizontal Orientation vertical Orientation vertical UPDOWN AutoBuddy true spin EDIT participating to the relationship GlueTo TREEVIEW tree DATETIMEPICKER format 7 time datePicker DATETIMEPICKER format time hourPicker If the buddy window the previous window in the z order of an up down control is an edit control this last object should be ignored when pars
280. uter system or application program which has been in place for a long time and which continues to be used because an organization does not want to support the costs of replace or redesign it 7 The code of a UI is parsed to build a manipulable representation of it Interface fragments are then extracted from this representation and a pattern matcher identifies syntactic patterns in the fragments Using the code fragments as a basis details about modes of interaction and conditions of activation are identified with control flow analysis For example an object imports the x coordinate of another object to describe an alignment for these objects generation of screens for the IBM 3270 environment and the generated code is linked with application core Since there is an increased demand to make legacy systems accessible through the web in order to support e commerce activities the problem of these systems user interface migration to web accessible platforms is becoming important Instead of analysing the code to extract a model of its structure the Cellest 3 process analyse traces of the system user interaction to model the behaviour of the user interface This produces a state transition model which specifies the screens as state and the possible commands leading from one screen to another as transitions between the states To capture user interaction during the use of the legacy system Cellest is composed of a recorder and a pilot allowin
281. vation rules Algorithm lt new FileReader f Inr new LineNumberReader r st lt new StreamTokenizer nr prepare the tokenizer for recource script style tokenizing rules Inr setLineNumber 1 the default first line is O for Inr and 1 for st while there is still a stored line number do store the resource starting at the next line number generate the resourse into GrafiXML The two modules correspond to a physical partition into two main methods scan File f and process int a from the RcFile class So for each object in particular for each dialog box and controls defined inside a dialog box template I first read and store the information which concerns it into variables that hold a primitive value as a position or a dimension number or a reference to a String object as an id or a class name for a control It s only at the end of a loop of a nested loop for controls that a method charged to generate the object into GrafiXML is called not decided to make a transformation as soon as a data is read in the file To store the style flags each flag is first translated in its numeric representation and is then added to a single variable of type integer In fact as mentioned in the chapter 4 a flag corresponds to a reserved bit or to a group of bit for some mutually exclusive flags in a word of 32 bits Each set of style flags and extended style flags of a dialog box or a control from a particular class is represen
282. velop from two different points of view As usual GrafiXML can be used as an editor to specify UIs in UsiXML at the CUI level where Windows UIs can be imported Or it can be used as a reverse engineering tool This free and open source software is available on http Awww usixml org I will show an illustration in the chapter 5 15178 a reformulation of HTML in XML 15 3 3 Examples used and decompilation tools I list here the UIs that will guide my analysis throughout my thesis I will show in the next chapter how they are specified in a resource script file they are also illustrated in appendix I list after the tool that used to extract the resource script files I ve selected five 32bit Windows applications SciTE v1 62 a source code editor 7 Zip File Manager v4 15 an file archiver Windirstat v1 1 0 a disk usage statistics viewer and cleanup tool RBG Editor v3 9 a small utility for selecting and creating RGB Red Green and Blue colors and TablEdit v2 60d5 a program for creating editing printing and listening to tablature and sheet music For each of these applications pick up one resource to analyse Resources are additional data accompanying a Windows application They are usually stored with the executable They can also be stored in a separate file named Dynamic Link Libraries dll As the name suggests these libraries are not linked into the executable exe file during its creatio
283. vider true lt style gt CCS_NODIVIDER 0x00000040 RegisterDrop true lt style gt RBS_REGISTERDROP 0x00001000 VarHeight true lt style gt RBS VARHEIGHT 0x00000200 VerticalGripper true lt style gt RBS_VERTICALGRIPPER 0x00004000 Vertical true lt style gt CCS_VERT 0x00000080 Class TREEVIEW lt class gt SysTreeView32 Attributes CheckBoxes true lt style gt TVS_CHECKBOXES 0x00000100 DisableDragDrop true lt style gt TVS_DISABLEDRAGDROP 0x00000010 EditLabels true lt style gt TVS_EDITLABELS 0x00000008 FullRowSelect true lt style gt TVS_FULLROWSELECT 0x00001000 HasButtons true lt style gt TVS_HASBUTTONS 0x00000001 HasLines true lt style gt TVS_HASLINES 0x00000002 InfoType true lt style gt TVS_INFOTIP LinesAtRoot true lt style gt TVS_LINESATROOT 0x00000004 NoHorizontalScroll true lt style gt TVS_NOHSCROLL NonevenHeight true lt style gt TVS_NONEVENHEIGHT 0x00004000 NoScroll true lt style gt TVS_NOSCROLL 0x00002000 NoTootips true lt style gt TVS_NOTOOLTIPS 0 00000080 RightToLeftReading true lt style gt TVS_RTLREADING 0 00000040 ShowSelectionAlways true lt style gt TVS_SHOWSELALWAYS 0x00000020 SingleExpand true lt style gt TVS_SINGLEEXPAND 0x00000400 TrackSelect true lt style gt TVS_TRACKSELECT 0 00000200 Class TOOLBAR lt class gt ToolbarWindow32 Attributes ALTDrag true lt st
284. w items to an odd height By default the height of items must be an even value NoScroll Boolean If true disables both horizontal and vertical scrolling in the control The control will not display any scroll bars NoToolTips Boolean If true disables the automatic tool tip feature of tree view controls This feature automatically displays a tool tip containing the title of the item under the mouse cursor if the entire title is not currently visible RightToLeftReading Boolean 145 Does not add buttons to items at the root of the hierarchy To do so HasLines and LinesAtRoot must also be set at true 146 Does not link items at the root of the hierarchy To do so LinesAtRoot must also be set at true 7 The TVN GETINFOTIP notification 148 This value is ignored if HasLines false 124 Appendix C Usually windows display text left to right LTR Windows can be mirrored to display languages such as Hebrew or Arabic that read right to left RTL A tree view text is displayed in the same direction as the text in its parent window If true causes text to be displayed in the opposite direction from the text in the parent window ShowSelectionAlways Boolean Normally when the user clicks another control or another application the node that was selected loses its selection If true causes a selected item to remain selected when the tree view control loses focus SingleExpand Boolean If true a previously expand
285. wAdapter public void windowClosing WindowEvent e v removeAllElements dispose 147 Appendix D BRR KKK I KK IK I III III FlagTrie java Author Julien Marion This class represent a trie used to identifying the styles and extended styles of a dialog box or a control when processing the rc resource file 5 F k H k e e k He e H He A He e H e A k He K A He A A He e A de A k He e H kk CkCkCkCkCkCkCkCkCkCkCkCkCkCk package importresources import java util Vector public class FlagTrie Refer the root of the trie private TNode root Store the depth of the last node returned by the match method The depth of a node v is the number of ancestors of v excluding v itself Note that I could use a simple recursive algorithm to know the depth of a node v if isRoot v then return 0 else return 1 depth parent v But I must then add a new attribute to each node storing the reference to its parent private short depth Set up the trie with flags relevant to my transformation It is considered as a constant cannot be modified once created public FlagTrie root new TNode Add the flag used in my correspondence which are default in the shortcut notation Button styles that correspond to the 8 types of buttons addFlag BS_DEFPUSHBUTTON 0x1 addFlag BS_CHECKBOX 0x2 addFlag BS AUTOCHECKBOX 0x3 addFlag BS RADIOBUTTON 0x4
286. window cannot be created or if the system cannot create a special data segment for an edit control NoldleMessage Boolean If true suppresses messages that the system would otherwise send to the owner of a modal dialog box that is entering an idle state A modal dialog box enters an idle state when no messages are waiting in its queue after it has processed one or more previous messages SetForeGround Boolean If true brings the dialog box to the foreground 9 This style is useful for modal dialog boxes that require immediate attention from the user regardless of whether the owner window is the foreground window Language String A language identifier specifying the language of the dialog box Sublanguage String A sublanguage identifier SetFont Boolean If true indicates that FontName see beyond contains the font to use for text in the client area and controls of the dialog box If possible the system selects a font according to the specified font data FontName String Specifies the name of the typeface for the font that the system uses to draw text in the dialog box this attribute enables then to set something other than the system font for use with dialog box text 104 Applies to 16 bit applications only 105 The WM ENTERIDLE messages 1 Causes the system to use SetForegroundWindow function This function puts the thread that created the window into the foreground and activates the window Keyboard in
287. x from my first example which are not always visually identifiable for some controls Match whole word only Match case Regular expression Wrap around z Transform backslash expressions We could divide the client area in different ways The following illustrates one possibility to create the first boxes hbox111 Find what Enix j Match whole word only Direction Mark All Dent 5 hbox112 Metchcase hbox1 C T Down Regular expression hbox113 Transform backslash expressions vbox11 vbox12 7 And not to the attribute id of a CIO These two identifiers have not the same utility 62 GROUPBOX box containing each control that participates in the Group relationship graphicalCio borderWidth 1 borderType line borderColor 000000 Width Height h box width w 4 xChar height h 8 yChar Text t and size of t gt 0 graphicalCio defaultBorderTitle t HorizontalAlignment left graphicalCio borderTitleAlign left HorizontalAlignment center graphicalCio borderTitleAlign middle HorizontalAlignment right graphicalCio borderTitleAlign right RADIOBUTTON PushLike false radioButton Text t cio defaultContent t without any amp characters Group true radioButton groupName a given group name for each radio buttons following this radio button in the template and having Gr
288. y as in the binary res resource file 1 if the style is present 0 else In this case the hexadecimal number B7 for the up down control to the binary 21 number 10110111 which correspond to the UDS_WRAP UDS SETBUDDYINT UDS ALIGNRIGHT UDS AUTOBUDDY UDS ARROWKEYS UDS NOTHOUSANDS flags combination Note also that the bitmap the first control has not the same dimension in Resource Tuner that in the application see in appendix 4 1 4 Fourth example from WinDirStat This example corresponds to the dialog box called up by selecting Configure WindirStat from the Options menu Notice that the tab control doesn t appear to the right In fact there is one dialog box specification in the resource file for each tab item the dialog box called WinDirStat which aggregates them is missing WinDirStat Settings Dialog 143 2 General Directory List Cleanups Report Treemap Static Static Static Static NE Gang Bright Cushion Height Seale ness Shading Factor Style Light Incidence 5 Show Grid Grid Col Style 1 Light Incidence Static roirstat ad a Show Grid Grid Color Reset to Korstet Sequoiaview Highlight Rectangle Defaults C SSMO The following is the related part of the resource script file from Resource Hacker 143 DIALOGEX 0 0 380 202 STYLE DS_FIXEDSYS WS_CHILD WS_DISABLED WS_CAPTI
289. y Direction 1 Match case Up specified The user has to change manually the size Regular expression Down 51 Wrap around of the dialog box as the size of some components if Transform backslash expressions 481 text with new font fits in the graphical component Note finally that the colours are not in my UML diagram That is they are not specified in a resource file but specific to Windows Such data that could be deduced seeing that Windows 6 I don t know if we can find documentation about this pixel information I just know that the Windows function GetClientRect obtains the dimensions in pixels and the function MapDialogRect converts the character coordinates in the dialog box to pixel coordinates in the client area 9 To do this I ve edited the desired font in a decompiler made a print screen and used MSPaint in C Program Files Accessories the number of pixels 70 In fact never seen that in a resource file 7 Here I some examples in Windows The grey colour d8e9ec is the surface color of a dialog box and the backgroud color of a control to agree with the color of the client area of the dialog box in which it is designed to be displayed By default the colour of an active title bar is blue e45403 and the white ffffff bold text has the Trebuchet MS font of size 10 The colour of text displayed in the client area of a dialog box is always black 000000 61 inter
290. y digits to be entered into the edit control WantReturn Boolean When the multiline edit control is in a dialog box pressing the ENTER key has the same effect as pressing the default push button If true a carriage return is inserted when the user presses the ENTER key while entering text into a multiple line edit control OEMConvert Boolean If true text entered in the edit control is converted from the Windows character set to the OEM character set and then back to the Windows character set This ensures proper character conversion when the application calls the function to convert a Windows string in the edit control to OEM characters RICHEDIT This class defines a rich edit control It s a window in which the user can enter edit format print and save text The text can be assigned character and paragraph formatting and can include embedded Component Object Model COM objects Rich edit controls support almost all of the messages and notification messages used with multiline edit controls Thus applications that already use edit controls can be easily changed to use rich edit controls 124 For combo box see further text in both the selection field and the list is converted 15 This style has no effect on a single line edit control 126 This style is most useful for edit controls that contain filenames that will be used on file systems that do not support Unicode 114 Appendix C Additional messages and not
291. yle DS SETFONT typeface val FontName lt pointsize gt val FontSize lt italic gt TRUE italic FALSE weight val Weight style 05 SHELLFONT 0x00001000 0x00002000 0x00000400 0x00000008 0x00000020 0x00000080 0x00000010 0x00000100 0x00000200 0x00000002 0x00000040 0x00000048 Other attributes can be inherited from the WINDOW class in addition to the attribute GeneralStyle always set to popup Class WINDOW Attibutes Text text val Text GeneralStyle 2 popup style WS POPUP 0x80000000 GeneralStyle overlapped lt style gt WS_OVERLAPPED 0x00000000 GeneralStyle child lt style gt WS CHILD 0x40000000 Border true lt style gt WS_BORDER 0x00800000 Caption true amp Border true lt style gt WS CAPTION 0 00 00000 ClipChildren true lt style gt WS_CLIPCHILDREN 0x02000000 ClipSimblings true lt style gt WS_CLIPSIMBLINGS 0x04000000 Disabled true style WS_DISABLED 0x08000000 DialogFrame true amp Caption false lt style gt WS_DLGFRAME 0x00400000 Group true lt style gt WS GROUP 0x00020000 TabStop true lt style gt WS_TABSTOP 0 00010000 HorizontalScrollBar true lt style gt WS_HSCROLL 0x00100000 MaximizeBox true lt style gt WS_MAXIMIZEBOX 0 00010000 Maximized true lt style gt WS_MAXIMIZE 0x01000000 MinimizeBox true lt style g
292. yle gt TBSTYLE_ALTDRAG 0 00000400 CustomErase true lt style gt TBSTYLE_CUSTOMERASE 0 00002000 Flat true lt style gt TBSTYLE_FLAT 0x00000800 Transparent true lt style gt TBSTYLE_TRANSPARENT 0x00008000 List true lt style gt TBSTYLE_LIST 0x00001000 RegisterDrop true lt style gt TBSTYLE_REGISTERDROP 0x00004000 ToolTips true lt style gt TBSTYLE_TOOLTIPS 0x00000100 WrapAble true lt style gt TBSTYLE WRAPABLE 0 00000200 NoResize true lt style gt CCS_NORESIZE 0x00000004 NoParentAlign true lt style gt CCS_NOPARENTALIGN 0 00000008 Bottom true lt style gt CCS BOTTOM 0 00000003 NoDivider true lt style gt CCS_NODIVIDER 0 00000040 Adjustable true lt style gt CCS_ADJUSTABLE 0x00000020 Class TAB lt class gt SysTabControl32 Attributes Type tabs lt style gt TCS_TABS 0x00000000 Type buttons lt style gt TCS_BUTTONS 0x00000100 Bottom true lt style gt TCS_BOTTOM 0x00000002 FixedWidth true lt style gt TCS_FIXEDWIDTH 0 00000400 FlatButtons true lt style gt TCS_FLATBUTTONS 0x00000008 43 FocusNever true style TCS_FOCUSNEVER 0x00008000 FocusOnButtonDown true style TCS_FOCUSONBUTTONDOWN 0x00001000 ForceLeft icon style TCS_FORCEICONLEFT 0 00000010 ForceLeft label lt style gt TCS_FORCELABELLEFT 0x00000020 HotTrack true lt style gt TCS_HOTTRACK 0x00
293. yout of the specified UI will have to be displayed in the composer and the UsiXML specifications will have to be generated in the XML editor The UsiXML file can then for example serve as input in forward engineering to generate UI code designed for another platform Using GrafiXML in my method has several useful advantages Firstly this will considerably facilitate my implementation I can use built in methods to generate and manage elements at the desired level of abstraction after having defined transformations rules Then the designer can view the result in a graphical form when reverse engineering a resource script file and not only a XML specification This gives some confidence in the reliability of the tool without having to implement some code giving the rendering This graphical representation will also help me to validate my tool in the testing phase The actual result can be rapidly compared with the expected one and the produced model can be easily analysed Finally GrafiXML is able to automatically generate UI code in HTML XHTML Extensible HyperText Markup Language XUL and Java thanks to a series of plug ins Reengineering of a resource script file can then be automated to obtain the code in these high level languages The development of a new plug in enhances also the functionalities of GrafiXML Existing UIs can be reused and incorporated in a project current edited in the tool We can see the utility of the plug in that I will de

Download Pdf Manuals

image

Related Search

Related Contents

MagicCylinder  Guide de service  CMA3000 DEMO KIT User Manual  ML-800-FS User Manual - DryCal  Troubleshooting service  768 Manual de Usuario - Why Univision Mobile?    DVTel EA-201-0 Encoder User Manual  ATD Tools ATD-30324 Fan User Manual  IP-200 MANUEL D`INSTALLATION (FRANÇAIS)  

Copyright © All rights reserved.
Failed to retrieve file