Sample Code

Windows Driver Samples/ USBView sample application/ C++/ uvcview.rc/

#include <windows.h>
#include <commctrl.h>
#include "resource.h"
#include <ntverp.h>

//////////////////////////////////////////////////////////////////////////////
//
// VERSION
//
#define VER_FILEDESCRIPTION_STR     "Microsoft\256 Windows(TM) USB device viewer"
#define VER_INTERNALNAME_STR        "USBView"
#define VER_ORIGINALFILENAME_STR    VER_INTERNALNAME_STR
#define VER_LEGALCOPYRIGHT_STR      "Copyright \251 Microsoft Corporation 1996-2011  All Rights Reserved."

#define VER_FILETYPE     VFT_APP
#define VER_FILESUBTYPE  VFT2_UNKNOWN

#include <common.ver>


//////////////////////////////////////////////////////////////////////////////
//
// ICON
//
IDI_ICON                ICON    DISCARDABLE     "USB.ICO"
IDI_BADICON             ICON    DISCARDABLE     "BANG.ICO"
IDI_COMPUTER            ICON    DISCARDABLE     "MONITOR.ICO"
IDI_HUB                 ICON    DISCARDABLE     "HUB.ICO"
IDI_NODEVICE            ICON    DISCARDABLE     "PORT.ICO"
IDI_NOSSDEVICE          ICON    DISCARDABLE     "SSPORT.ICO"
IDI_SSICON              ICON    DISCARDABLE     "SSUSB.ICO"

//////////////////////////////////////////////////////////////////////////////
//
// Cursor
//
IDC_SPLIT               CURSOR  DISCARDABLE     "SPLIT.CUR"

/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_MAINDIALOG DIALOGEX 0, 0, 415, 243
STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU |
    WS_THICKFRAME
CAPTION "USB Device Viewer"
MENU IDR_MENU
FONT 8, "MS Shell Dlg"
BEGIN
    CONTROL         "Tree1",IDC_TREE,"SysTreeView32",TVS_HASBUTTONS |
                    TVS_HASLINES | TVS_LINESATROOT | WS_BORDER | WS_TABSTOP,
                    0,0,120,234,WS_EX_CLIENTEDGE
    EDITTEXT        IDC_EDIT,120,0,295,234,ES_MULTILINE | ES_READONLY |
                    WS_VSCROLL | WS_HSCROLL
    CONTROL         "Devices Connected: 0",IDC_STATUS,"msctls_statusbar32",
                    SBARS_SIZEGRIP,
                    0,235,415,8
END


IDD_ABOUT DIALOG DISCARDABLE  0, 0, 230, 117
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About USBView"
FONT 8, "MS Shell Dlg"
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,90,100,50,14
    LTEXT           "USB Device Viewer",IDC_STATIC,54,15,104,8
    LTEXT           VER_LEGALCOPYRIGHT_STR,IDC_STATIC,54,45,145,8
    EDITTEXT        IDC_VERSION,54,60,110,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
    EDITTEXT        IDC_UVCVERSION,54,75,110,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
    ICON            IDI_ICON,IDC_STATIC,15,15,21,20
END


/////////////////////////////////////////////////////////////////////////////
//
// Menu
//

IDR_MENU MENU DISCARDABLE
BEGIN
    POPUP "&File"
    BEGIN
        MENUITEM "&Refresh\tF5",        ID_REFRESH
        MENUITEM SEPARATOR
        MENUITEM "Save Current &View ..."        ID_SAVE
        MENUITEM "Save As (&txt) ...",      ID_SAVEALL
        MENUITEM "Save As (&xml) ...\tF2",  ID_SAVEXML
        MENUITEM SEPARATOR

        MENUITEM "E&xit",         ID_EXIT
    END
    POPUP "&Options"
    BEGIN
        MENUITEM "&Auto Refresh",                   ID_AUTO_REFRESH, CHECKED
        MENUITEM "Show &Config Descriptors",        ID_CONFIG_DESCRIPTORS, CHECKED
        MENUITEM SEPARATOR
//      MENUITEM "&Show Description Annotations",   ID_ANNOTATION, CHECKED
        MENUITEM "&Log to debugger",                ID_LOG_DEBUG
    END
    POPUP "&Help"
    BEGIN
        MENUITEM "&About",                      ID_ABOUT
    END
END

//////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//

IDACCEL ACCELERATORS DISCARDABLE
BEGIN
    VK_F5,          ID_REFRESH,            VIRTKEY,NOINVERT
    VK_F2,          ID_SAVEXML,            VIRTKEY,NOINVERT
END

/////////////////////////////////////////////////////////////////////////////
//
// String Table
//

STRINGTABLE 
BEGIN
    IDS_STRINGBASE              "Base string"
END

STRINGTABLE 
BEGIN
    IDS_STANDARD_FONT           "Courier"
    IDS_STANDARD_FONT_HEIGHT    "\13"
    IDS_STANDARD_FONT_WIDTH     "\8"
END

STRINGTABLE DISCARDABLE
BEGIN
    IDS_USBVIEW_USAGE               "usbview usage:\nusbview [/?]\n\t/? - this usage message.\
                                    \n\t/q quiet mode, does not display 'Press any key to continue ...\n\t\
                                    \nusbview [/q] [/f] /saveall:<filename.txt>\
                                    \n\tsaveall - saves the USB tree view as a text file\
                                    \n\t/f - overwrite file if it already exists\n\nusbview [/q] [/f] /savexml:<filename.xml>\
                                    \n\tsavexml - saves the USB tree view as a xml file\n\t/f - overwrite file if it already exists\n\n"
    IDS_USBVIEW_PRESSKEY            "Press any key to continue ...\n"
    IDS_USBVIEW_INVALIDARG          "Invalid argument: [%1]\n"
    IDS_USBVIEW_FILE_EXISTS_TXT     "File: [%1] already exists, try `usbview /f /saveall:[%1]` to force overwrite\n"
    IDS_USBVIEW_FILE_EXISTS_XML     "File: [%1] already exists, try `usbview /f /savexml:[%1]` to force overwrite\n"
    IDS_USBVIEW_INTERNAL_ERROR      "An internal error occured, please report this as a bug\n"
    IDS_USBVIEW_SAVED_TO            "Usbview information saved to file : [%1]\n"
    IDS_USBVIEW_INVALID_FILENAME    "The argument : [%1] is invalid or incomplete.\n"
END 

Our Services

  • What our customers say about us?

© 2011-2024 All Rights Reserved. Joya Systems. 4425 South Mopac Building II Suite 101 Austin, TX 78735 Tel: 800-DEV-KERNEL

Privacy Policy. Terms of use. Valid XHTML & CSS