Friday, February 1, 2013

EnScript - Making a Dialog


I introduce the usage of DialogClass.
Sometimes i make a EnScript, I Always  use these classes.
These give convenient functions.

GroupBoxClass void GroupBoxClass (WindowClass parent, const String &Title, int x, int y, int width, int height, ulong style, uint Count=0)
PathEditClass void PathEditClass (WindowClass parent, const String &Title, int x, int y, int width, int height, ulong style, String &Value, uint Options, const String &filelist="")
CheckBoxClass void CheckBoxClass (WindowClass parent, const String &Title, int x, int y, int width, int height, ulong style, bool &Value)
CheckBoxClass void CheckBoxClass (WindowClass parent, const String &Title, int x, int y, int width, int height, ulong style, NodeClass Node, uint prop)
DialogClass void DialogClass (WindowClass parent=null, const String &Name="")

- GroupBoxClass -
parent - The parent window
Title - Title bar text
x - The left coordinate of the control in dialog box units
y - The top coordinate of the control in dialog box units
width - The left coordinate of the control in dialog box units
height - The top coordinate of the control in dialog box units
style - BORDER | CAPTION | SIZEBOX | SYSMENU | TABSTOP | VSCROLL | HSCROLL | GROUP | MAXIMIZEBOX | MINIMIZEBOX | AUTOHSCROLL | AUTOVSCROLL | CENTER | LEFT | LOWERCASE | MULTILINE | NOHIDESEL | NUMBER | OEMCONVERT | PASSWORD | READONLY | RIGHT | UPPERCASE | WANTRETURN | DEFPUSHBUTTON | GROUPBOX | HORIZONTAL | LEFTTEXT | PUSHBUTTON
Count - Control count

- PathEditClass -
parent - The parent window
Title - Title bar text
x - The left coordinate of the control in dialog box units
y - The top coordinate of the control in dialog box units
width - The left coordinate of the control in dialog box units
height - The top coordinate of the control in dialog box units
style - BORDER | CAPTION | SIZEBOX | SYSMENU | TABSTOP | VSCROLL | HSCROLL | GROUP | MAXIMIZEBOX | MINIMIZEBOX | AUTOHSCROLL | AUTOVSCROLL | CENTER | LEFT | LOWERCASE | MULTILINE | NOHIDESEL | NUMBER | OEMCONVERT | PASSWORD | READONLY | RIGHT | UPPERCASE | WANTRETURN | DEFPUSHBUTTON | GROUPBOX | HORIZONTAL | LEFTTEXT | PUSHBUTTON
Value - The name of the control
Options - DISABLED | REQUIRED | FILEOPEN | FILECREATE | FOLDEROPEN
filelist - A list file types separated by \t. Ex: "Text Files\t*.txt\tData Files\t*.data"

- CheckBoxClass - 
Constructor
Arguments:
parent - Window that this object will belong to
title - Caption to be display above the checkbox
x - horizontal position where the top left corner of the control will be painted - can be a number or one of WindowClass::PlacementOptions flags
y - vertical position where the top left cornert of the control will be painted - can be a number or one of WindowClass::PlacementOptions flags
width - an integer value specifying the width of the control
height - an integer value specifying the height of the control
style - any of the WindowsClass::Styles flags Choose one of the following: BORDER, CAPTION, SIZEBOX, SYSMENU, TABSTOP, VSCROLL, HSCROLL, AUTOHSCROLL, AUTOVSCROLL, CENTER, GROUP, LEFT, LOWERCASE, MULTILINE, NOHIDESEL, NUMBER, OEMCONVERT, PASSWORD, READONLY, RIGHT, UPPERCASE, WANTRETURN, DEFPUSHBUTTON, GROUPBOX, HORIZONTAL, LEFTTEXT, PUSHBUTTON, MAXIMIZEBOX, MINIMIZEBOX.
value - the variable that holds the value of the control 

- DiallogClass - 
Constructor (does not paint the dialog)
parent - dialog
name - title bar caption 


It's a example.
class MainClass;
class ArtDialogClass: DialogClass {
    MainClass Main;
    GroupBoxClass group1, group2;
    PathEditClass saveFolder;
    CheckBoxClass ckMft, ckEvent, ckRegistry, ckPrefetch;
    CheckBoxClass ckDoc, ckDocx, ckXls,ckXlsx;
    ArtDialogClass(DialogClass parent, MainClass main):
    DialogClass(parent, "Artifacts EnScript for EnCase 7"),
    Main = main,
    saveFolder(this, "Artifacts Save Directory", 5, 5, 200, 15, 0, main.saveFolderPath, FOLDEROPEN|REQUIRED),
    group1(this, "log2timeline", 5, 30, 200, 90, 0),
    ckMft(this, "MFT File", 15, 45, 100, 12, 0, main.isMft),
    ckEvent(this, "Event Log File", 15, 60, 100, 12, 0, main.isEvent),
    ckRegistry(this, "Registry File", 15, 75, 100, 12, 0, main.isRegistry),
    ckPrefetch(this, "Prefetch File", 15, 90, 100, 12, 0, main.isPrefetch),
    group2(this, "documents", 5, 140, 200, 90, 0),
    ckDoc(this, "doc File", 15, 155, 100, 12, 0, main.isDoc),
    ckDocx(this, "docx File", 15, 170, 100, 12, 0, main.isDocx),
    ckXls(this, "xls File", 15, 185, 100, 12, 0, main.isXls),
    ckXlsx(this, "xlsx File", 15, 200, 100, 12, 0, main.isXlsx)
    {
    }
}

class MainClass {
  bool isMft, isEvent, isRegistry, isPrefetch;
  bool isDoc, isDocx, isXls, isXlsx;
  String saveFolderPath;
  void Main(CaseClass c) {
    saveFolderPath = "C:\\timeline";
    ArtDialogClass dlg(null, this);
    if (dlg.Execute() == SystemClass::OK) {
    String outPath = saveFolderPath + "\\";
    }
  }
}


If you copy upper code and paste and run, you can see the picture below.
It's just dialog.
But when you make a tool, upper code will make it more convenient.




No comments:

Post a Comment