[Resubmit 1] programs/dxdiag: Create dummy application

Allen Hair allen.hair at gmail.com
Wed Mar 25 19:41:46 CDT 2009


Fixed a few minor issues with the patch as per Austin English's request:

1. Removed accidental reference to Notepad in En.rc comments.
2. Got rid of redundant email address in copyright notice.

- Allen Hair
-------------- next part --------------
From 96ccc7938e00f6aee2aab4f9ab2b824dd063af3a Mon Sep 17 00:00:00 2001
From: Allen Hair <allen.hair at gmail.com>
Date: Wed, 25 Mar 2009 17:17:45 -0700
Subject: programs/dxdiag: Create dummy application.

---
 configure.ac                 |    1 +
 programs/dxdiag/En.rc        |   39 +++++++++++++
 programs/dxdiag/Makefile.in  |   21 +++++++
 programs/dxdiag/dxdiag_res.h |   27 +++++++++
 programs/dxdiag/main.c       |  121 ++++++++++++++++++++++++++++++++++++++++++
 programs/dxdiag/rsrc.rc      |   29 ++++++++++
 6 files changed, 238 insertions(+), 0 deletions(-)
 create mode 100644 programs/dxdiag/En.rc
 create mode 100644 programs/dxdiag/Makefile.in
 create mode 100644 programs/dxdiag/dxdiag_res.h
 create mode 100644 programs/dxdiag/main.c
 create mode 100644 programs/dxdiag/rsrc.rc

diff --git a/configure.ac b/configure.ac
index fe40d1e..0eaec31 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2306,6 +2306,7 @@ WINE_CONFIG_MAKEFILE([programs/clock/Makefile],[programs/Makeprog.rules],[progra
 WINE_CONFIG_MAKEFILE([programs/cmd/Makefile],[programs/Makeprog.rules],[programs],[ALL_PROGRAM_DIRS,ALL_PROGRAM_INSTALL_DIRS])
 WINE_CONFIG_MAKEFILE([programs/cmdlgtst/Makefile],[programs/Makeprog.rules],[programs],[ALL_PROGRAM_DIRS])
 WINE_CONFIG_MAKEFILE([programs/control/Makefile],[programs/Makeprog.rules],[programs],[ALL_PROGRAM_DIRS,ALL_PROGRAM_INSTALL_DIRS])
+WINE_CONFIG_MAKEFILE([programs/dxdiag/Makefile],[programs/Makeprog.rules],[programs],[ALL_PROGRAM_DIRS,ALL_PROGRAM_INSTALL_DIRS])
 WINE_CONFIG_MAKEFILE([programs/eject/Makefile],[programs/Makeprog.rules],[programs],[ALL_PROGRAM_DIRS,ALL_PROGRAM_INSTALL_DIRS])
 WINE_CONFIG_MAKEFILE([programs/expand/Makefile],[programs/Makeprog.rules],[programs],[ALL_PROGRAM_DIRS,ALL_PROGRAM_INSTALL_DIRS])
 WINE_CONFIG_MAKEFILE([programs/explorer/Makefile],[programs/Makeprog.rules],[programs],[ALL_PROGRAM_DIRS,ALL_PROGRAM_INSTALL_DIRS])
diff --git a/programs/dxdiag/En.rc b/programs/dxdiag/En.rc
new file mode 100644
index 0000000..e0a02e6
--- /dev/null
+++ b/programs/dxdiag/En.rc
@@ -0,0 +1,39 @@
+/*
+ * DxDiag (English resources)
+ *
+ * Copyright 2009 Allen Hair
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
+
+DXDIAG_DLG DIALOGEX 0, 0, 484, 308
+STYLE   DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | \
+        WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
+EXSTYLE WS_EX_NOPARENTNOTIFY
+CAPTION "DirectX Diagnostic Tool"
+FONT 8, "MS Shell Dlg"
+{
+    CONTROL "", DXDIAG_TABCTRL, WC_TABCONTROL, 0, 7, 7, 470, 273
+    PUSHBUTTON "Help",                      DXDIAG_HELPBTN,   7, 287, 85, 14, \
+        WS_DISABLED
+    DEFPUSHBUTTON "Next Page",              DXDIAG_NEXTBTN, 213, 287, 85, 14, \
+        WS_DISABLED
+    PUSHBUTTON "Save All Information...",   DXDIAG_SAVEBTN, 302, 287, 85, 14, \
+        WS_DISABLED
+    PUSHBUTTON "Exit",                      DXDIAG_EXITBTN, 391, 287, 85, 14
+}
+
diff --git a/programs/dxdiag/Makefile.in b/programs/dxdiag/Makefile.in
new file mode 100644
index 0000000..0a56515
--- /dev/null
+++ b/programs/dxdiag/Makefile.in
@@ -0,0 +1,21 @@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../..
+SRCDIR    = @srcdir@
+VPATH     = @srcdir@
+MODULE    = dxdiag.exe
+APPMODE   = -mwindows -mno-cygwin
+IMPORTS   = comdlg32 comctl32 kernel32 shell32 user32 gdi32 advapi32 ole32 oleaut32
+EXTRAINCL = -I$(TOPSRCDIR)/include/msvcrt
+MODCFLAGS = @BUILTINFLAG@
+EXTRADEFS = -DNO_LIBWINE_PORT
+
+C_SRCS = \
+        main.c
+
+RC_SRCS = rsrc.rc
+
+CVG_SRCS =
+
+ at MAKE_PROG_RULES@
+
+ at DEPENDENCIES@  # everything below this line is overwritten by make depend
diff --git a/programs/dxdiag/dxdiag_res.h b/programs/dxdiag/dxdiag_res.h
new file mode 100644
index 0000000..03ea183
--- /dev/null
+++ b/programs/dxdiag/dxdiag_res.h
@@ -0,0 +1,27 @@
+/*
+ * Constants, used in resources.
+ *
+ * Copyright 2009 Allen Hair
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/* Main window element IDs */
+#define DXDIAG_DLG              0x100
+#define DXDIAG_TABCTRL          0x101
+#define DXDIAG_HELPBTN          0x102
+#define DXDIAG_NEXTBTN          0x103
+#define DXDIAG_SAVEBTN          0x104
+#define DXDIAG_EXITBTN          0x105
diff --git a/programs/dxdiag/main.c b/programs/dxdiag/main.c
new file mode 100644
index 0000000..d26359a
--- /dev/null
+++ b/programs/dxdiag/main.c
@@ -0,0 +1,121 @@
+/*
+ * DxDiag
+ *
+ * Copywrite 2009 Allen Hair
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ *
+ */
+
+#include "dxdiag_res.h"
+
+#include <windows.h>
+
+#include <stdio.h>
+
+
+/* Application callback proceedure */
+LRESULT CALLBACK DxDiag_DlgProc(HWND hWnd, UINT uMsg,
+                                WPARAM wParam, LPARAM lParam) {
+
+    /* Process messages */
+    switch(uMsg) {
+        case WM_INITDIALOG:
+            return TRUE;
+
+        case WM_DESTROY:
+            /* Shut down the application */
+            PostQuitMessage(WM_QUIT);
+            return TRUE;
+
+        case WM_COMMAND:
+            /* If the Help button was pressed */
+            if (LOWORD(wParam) == DXDIAG_HELPBTN) {
+                /* TODO: Help Button Proceedure */
+                return TRUE;
+            }
+
+            /* If the Next button was pressed */
+            if (LOWORD(wParam) == DXDIAG_NEXTBTN) {
+                /* TODO: Advance the tab selection */
+                return TRUE;
+            }
+
+            /* If the Save button was pressed */
+            if (LOWORD(wParam) == DXDIAG_SAVEBTN) {
+                /* TODO: Save Button Proceedure */
+                return TRUE;
+            }
+
+            /* If the Exit button was pressed */
+            if (LOWORD(wParam) == DXDIAG_EXITBTN) {
+                /* Shut down the application */
+                PostQuitMessage(WM_QUIT);
+                return TRUE;
+            }
+            break;
+
+        case WM_CLOSE:
+            /* Close the window */
+            DestroyWindow(hWnd);
+            return TRUE;
+
+        default:
+            break;
+    }
+
+    /* Return FALSE for unprocessed messages */
+    return FALSE;
+
+}
+/* WinMain - Application entry point */
+int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInstance,
+                    PSTR pCmdLine, int iCmdShow) {
+
+    HWND hApp;
+    MSG msg;
+    int status;
+
+    /* Initialize win32 control classes */
+    InitCommonControls();
+
+    /* Create the application dialog window */
+    hApp = CreateDialog(hInst, MAKEINTRESOURCE(DXDIAG_DLG),
+                        NULL, DxDiag_DlgProc);
+    if (!hApp) {
+        fprintf(stderr, "Could not create application dialog window.\n");
+        return FALSE;
+    }
+
+    /* Process messages */
+    while ((status = GetMessage(&msg, (HWND)NULL, 0, 0)) != 0) {
+        /* If there was a problem, quit */
+        if (status == -1) {
+            fprintf(stderr, "Error processing messages.\n");
+            return FALSE;
+        }
+
+        /* If the message is for us */
+        if (IsDialogMessage(hApp, &msg)) {
+            /* Process the message */
+            TranslateMessage(&msg);
+            DispatchMessage(&msg);
+        }
+    }
+
+    /* Return exit code */
+    return msg.wParam;
+}
+
diff --git a/programs/dxdiag/rsrc.rc b/programs/dxdiag/rsrc.rc
new file mode 100644
index 0000000..7d1ceda
--- /dev/null
+++ b/programs/dxdiag/rsrc.rc
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2009 Allen Hair
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <windef.h>
+#include <winbase.h>
+#include <winuser.h>
+#include <winnls.h>
+#include <commctrl.h>
+
+
+#include "dxdiag_res.h"
+
+/* Include language files (just english for now) */
+#include "En.rc"
-- 
1.6.2-rc2.GIT


More information about the wine-patches mailing list