diff --git a/rostests/winetests/GUI/WinetestsGUI.rc b/rostests/winetests/GUI/WinetestsGUI.rc index f94b017235c..05d06f5f098 100644 --- a/rostests/winetests/GUI/WinetestsGUI.rc +++ b/rostests/winetests/GUI/WinetestsGUI.rc @@ -3,9 +3,9 @@ #include "resource.h" -#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Character Map\0" -#define REACTOS_STR_INTERNAL_NAME "charmap\0" -#define REACTOS_STR_ORIGINAL_FILENAME "charmap.exe\0" +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS API test GUI\0" +#define REACTOS_STR_INTERNAL_NAME "WinetestsGUI\0" +#define REACTOS_STR_ORIGINAL_FILENAME "WinetestsGUI.exe\0" //#include #include "rsrc.rc" diff --git a/rostests/winetests/GUI/browsewnd.c b/rostests/winetests/GUI/browsewnd.c index 1520fb846d8..4725412470c 100644 --- a/rostests/winetests/GUI/browsewnd.c +++ b/rostests/winetests/GUI/browsewnd.c @@ -1,5 +1,5 @@ /* - * PROJECT: ReactOS Character Map + * PROJECT: ReactOS API Test GUI * LICENSE: GPL - See COPYING in the top level directory * FILE: * PURPOSE: browse dialog implementation @@ -10,6 +10,10 @@ #include #define DLL_SEARCH_DIR L"\\Debug\\testlibs\\*" +#define IL_MAIN 0 +#define IL_TEST 1 + +typedef wchar_t *(__cdecl *DLLNAME)(); static INT GetNumberOfDllsInFolder(LPWSTR lpFolder) @@ -128,31 +132,67 @@ InsertIntoTreeView(HWND hTreeView, static VOID PopulateTreeView(PMAIN_WND_INFO pInfo) { - HWND hTreeView; HTREEITEM hRoot; - HBITMAP hComp; - TCHAR ComputerName[MAX_PATH]; - DWORD dwSize = MAX_PATH; - INT RootImage; + HIMAGELIST hImgList; + DLLNAME GetTestName; + HMODULE hDll; + LPWSTR lpDllPath; + LPWSTR lpTestName; + INT RootImage, i; - hTreeView = GetDlgItem(pInfo->hBrowseDlg, IDC_TREEVIEW); + pInfo->hBrowseTV = GetDlgItem(pInfo->hBrowseDlg, IDC_TREEVIEW); - (void)TreeView_DeleteAllItems(hTreeView); + (void)TreeView_DeleteAllItems(pInfo->hBrowseTV); - /* insert the root item into the tree */ - hRoot = InsertIntoTreeView(hTreeView, + hImgList = InitImageList(IDI_ICON, + IDI_TESTS, + 16, + 16); + if (!hImgList) return; + + (void)TreeView_SetImageList(pInfo->hBrowseTV, + hImgList, + TVSIL_NORMAL); + + /* insert the root item into the tree */ + hRoot = InsertIntoTreeView(pInfo->hBrowseTV, NULL, - ComputerName, + L"Full", NULL, - 0);//RootImage); + IL_MAIN); + + for (i = 0; i < pInfo->numDlls; i++) + { + lpDllPath = pInfo->lpDllList + (MAX_PATH * i); + + hDll = LoadLibraryW(lpDllPath); + if (hDll) + { + GetTestName = (DLLNAME)GetProcAddress(hDll, "GetTestName"); + if (GetTestName) + { + lpTestName = GetTestName(); + + InsertIntoTreeView(pInfo->hBrowseTV, + hRoot, + lpTestName, + lpDllPath, + IL_TEST); + + // add individual tests as children + + } + + FreeLibrary(hDll); + } + } } static VOID PopulateTestList(PMAIN_WND_INFO pInfo) { - INT numFiles; - - if ((numFiles = GetListOfTestDlls(pInfo))) + pInfo->numDlls = GetListOfTestDlls(pInfo); + if (pInfo->numDlls) { PopulateTreeView(pInfo); } diff --git a/rostests/winetests/GUI/mainwnd.c b/rostests/winetests/GUI/mainwnd.c index 8003e467e0f..113dcd091eb 100644 --- a/rostests/winetests/GUI/mainwnd.c +++ b/rostests/winetests/GUI/mainwnd.c @@ -1,5 +1,5 @@ /* - * PROJECT: ReactOS Character Map + * PROJECT: ReactOS API Test GUI * LICENSE: GPL - See COPYING in the top level directory * FILE: * PURPOSE: main dialog implementation diff --git a/rostests/winetests/GUI/misc.c b/rostests/winetests/GUI/misc.c index ac7f2cc0f18..97f92ea8106 100644 --- a/rostests/winetests/GUI/misc.c +++ b/rostests/winetests/GUI/misc.c @@ -1,5 +1,5 @@ /* - * PROJECT: ReactOS Services + * PROJECT: ReactOS API Test GUI * LICENSE: GPL - See COPYING in the top level directory * FILE: * PURPOSE: miscallanous functions @@ -221,15 +221,15 @@ InitImageList(UINT StartResource, UINT Width, UINT Height) { - HBITMAP hBitmap; + HICON hIcon; HIMAGELIST hImageList; UINT i; - INT Ret; + INT Ret; /* Create the toolbar icon image list */ hImageList = ImageList_Create(Width, Height, - ILC_MASK | ILC_COLOR24, + ILC_MASK | ILC_COLOR32, EndResource - StartResource, 0); if (hImageList == NULL) @@ -238,23 +238,26 @@ InitImageList(UINT StartResource, /* Add all icons to the image list */ for (i = StartResource; i <= EndResource; i++) { - hBitmap = (HBITMAP)LoadImage(hInstance, - MAKEINTRESOURCE(i), - IMAGE_BITMAP, - Width, - Height, - LR_LOADTRANSPARENT); - if (hBitmap == NULL) - return NULL; + hIcon = (HBITMAP)LoadImage(hInstance, + MAKEINTRESOURCE(i), + IMAGE_ICON, + Width, + Height, + LR_DEFAULTCOLOR); + if (hIcon == NULL) + goto fail; - Ret = ImageList_AddMasked(hImageList, - hBitmap, - RGB(255, 0, 128)); + Ret = ImageList_AddIcon(hImageList, + hIcon); if (Ret == -1) - return NULL; + goto fail; - DeleteObject(hBitmap); + DestroyIcon(hIcon); } return hImageList; + +fail: + ImageList_Destroy(hImageList); + return NULL; } diff --git a/rostests/winetests/GUI/precomp.h b/rostests/winetests/GUI/precomp.h index ea7aa1e06fd..785bc89498d 100644 --- a/rostests/winetests/GUI/precomp.h +++ b/rostests/winetests/GUI/precomp.h @@ -11,10 +11,11 @@ extern HINSTANCE hInstance; typedef struct _MAIN_WND_INFO { - HWND hMainWnd; - HWND hBrowseDlg; - HWND hStatus; - int nCmdShow; + HWND hMainWnd; + HWND hBrowseDlg; + HWND hBrowseTV; + HWND hStatus; + int nCmdShow; HICON hSmIcon; HICON hBgIcon; @@ -25,14 +26,19 @@ typedef struct _MAIN_WND_INFO BOOL bIsUserAnAdmin; LPWSTR lpDllList; + INT numDlls; } MAIN_WND_INFO, *PMAIN_WND_INFO; +/* dll exports */ +wchar_t *GetTestName(); + /* browsewnd.c */ BOOL CALLBACK BrowseDlgProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam); /* misc.c */ +HIMAGELIST InitImageList(UINT StartResource, UINT EndResource, UINT Width, UINT Height); VOID DisplayString(LPWSTR lpMsg); VOID DisplayError(INT err); diff --git a/rostests/winetests/GUI/res/main.ico b/rostests/winetests/GUI/res/main.ico new file mode 100644 index 00000000000..50d143f08fd Binary files /dev/null and b/rostests/winetests/GUI/res/main.ico differ diff --git a/rostests/winetests/GUI/res/tests.ico b/rostests/winetests/GUI/res/tests.ico new file mode 100644 index 00000000000..b792d0655c9 Binary files /dev/null and b/rostests/winetests/GUI/res/tests.ico differ diff --git a/rostests/winetests/GUI/resource.h b/rostests/winetests/GUI/resource.h index 934e43d4378..e206fbcb082 100644 --- a/rostests/winetests/GUI/resource.h +++ b/rostests/winetests/GUI/resource.h @@ -3,7 +3,7 @@ #define IDM_ABOUT 104 #define IDM_EXIT 105 #define IDI_ICON 107 -#define IDI_SMALL 108 +#define IDI_TESTS 108 #define IDC_DELETE 109 #define IDR_MAINFRAME 128 #define IDC_LIST 1000 diff --git a/rostests/winetests/GUI/rsrc.rc b/rostests/winetests/GUI/rsrc.rc index 0225c2e2c44..5fb3d83f3e8 100644 --- a/rostests/winetests/GUI/rsrc.rc +++ b/rostests/winetests/GUI/rsrc.rc @@ -3,7 +3,8 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -IDI_ICON ICON "res/charmap.ico" +IDI_ICON ICON "res/main.ico" +IDI_TESTS ICON "res/tests.ico" //#include "lang/bg-BG.rc" //#include "lang/ca-ES.rc"