Author: weiden
Date: Thu Sep 27 00:41:57 2007
New Revision: 29221
URL:
http://svn.reactos.org/svn/reactos?rev=29221&view=rev
Log:
Display the display device adapter name and show device properties
Modified:
trunk/reactos/dll/win32/shellext/deskadp/deskadp.c
trunk/reactos/dll/win32/shellext/deskadp/deskadp.h
trunk/reactos/dll/win32/shellext/deskadp/lang/en-US.rc
trunk/reactos/dll/win32/shellext/deskadp/precomp.h
trunk/reactos/dll/win32/shellext/deskadp/resource.h
Modified: trunk/reactos/dll/win32/shellext/deskadp/deskadp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskadp…
==============================================================================
--- trunk/reactos/dll/win32/shellext/deskadp/deskadp.c (original)
+++ trunk/reactos/dll/win32/shellext/deskadp/deskadp.c Thu Sep 27 00:41:57 2007
@@ -4,6 +4,54 @@
#include <debug.h>
static HINSTANCE hInstance;
+
+typedef INT_PTR (WINAPI *PDEVICEPROPERTIESEXW)(HWND,LPCWSTR,LPCWSTR,DWORD,BOOL);
+
+static VOID
+ShowAdapterProperties(PDESKDISPLAYADAPTER This)
+{
+ HMODULE hDevMgr;
+ PDEVICEPROPERTIESEXW pDevicePropertiesExW;
+
+ hDevMgr = LoadLibrary(TEXT("devmgr.dll"));
+ if (hDevMgr != NULL)
+ {
+ pDevicePropertiesExW = (PDEVICEPROPERTIESEXW)GetProcAddress(hDevMgr,
+
"DevicePropertiesExW");
+ if (pDevicePropertiesExW != NULL)
+ {
+ pDevicePropertiesExW(This->hwndDlg,
+ NULL,
+ This->lpDeviceId,
+ 0,
+ FALSE);
+ }
+
+ FreeLibrary(hDevMgr);
+ }
+}
+
+static VOID
+InitDisplayAdapterDialog(PDESKDISPLAYADAPTER This)
+{
+ LPTSTR lpAdapterName;
+
+ This->lpDeviceId = QueryDeskCplString(This->pdtobj,
+ RegisterClipboardFormat(DESK_EXT_DISPLAYID));
+ EnableWindow(GetDlgItem(This->hwndDlg,
+ IDC_ADAPTERPROPERTIES),
+ This->lpDeviceId != NULL && This->lpDeviceId[0] !=
TEXT('\0'));
+ lpAdapterName = QueryDeskCplString(This->pdtobj,
+ RegisterClipboardFormat(DESK_EXT_DISPLAYNAME));
+ if (lpAdapterName != NULL)
+ {
+ SetDlgItemText(This->hwndDlg,
+ IDC_ADAPTERNAME,
+ lpAdapterName);
+
+ LocalFree((HLOCAL)lpAdapterName);
+ }
+}
static INT_PTR CALLBACK
DisplayAdapterDlgProc(HWND hwndDlg,
@@ -24,12 +72,24 @@
{
case WM_INITDIALOG:
This = (PDESKDISPLAYADAPTER)((LPCPROPSHEETPAGE)lParam)->lParam;
+ This->hwndDlg = hwndDlg;
SetWindowLongPtr(hwndDlg,
DWL_USER,
(LONG_PTR)This);
+ InitDisplayAdapterDialog(This);
Ret = TRUE;
break;
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam))
+ {
+ case IDC_ADAPTERPROPERTIES:
+ ShowAdapterProperties(This);
+ break;
+ }
+
+ break;
}
return Ret;
@@ -48,6 +108,12 @@
{
LocalFree((HLOCAL)This->DeskExtInterface);
This->DeskExtInterface = NULL;
+ }
+
+ if (This->lpDeviceId != NULL)
+ {
+ LocalFree((HLOCAL)This->lpDeviceId);
+ This->lpDeviceId = NULL;
}
}
Modified: trunk/reactos/dll/win32/shellext/deskadp/deskadp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskadp…
==============================================================================
--- trunk/reactos/dll/win32/shellext/deskadp/deskadp.h (original)
+++ trunk/reactos/dll/win32/shellext/deskadp/deskadp.h Thu Sep 27 00:41:57 2007
@@ -8,8 +8,10 @@
const struct IClassFactoryVtbl *lpIClassFactoryVtbl;
DWORD ref;
+ HWND hwndDlg;
PDESK_EXT_INTERFACE DeskExtInterface;
IDataObject *pdtobj;
+ LPTSTR lpDeviceId;
} DESKDISPLAYADAPTER, *PDESKDISPLAYADAPTER;
extern LONG dll_refs;
Modified: trunk/reactos/dll/win32/shellext/deskadp/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskadp…
==============================================================================
--- trunk/reactos/dll/win32/shellext/deskadp/lang/en-US.rc (original)
+++ trunk/reactos/dll/win32/shellext/deskadp/lang/en-US.rc Thu Sep 27 00:41:57 2007
@@ -5,6 +5,8 @@
CAPTION "Adapter"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
-
+ GROUPBOX "Adapter Type", -1, 7, 3, 237, 50
+ LTEXT "", IDC_ADAPTERNAME, 40, 17, 190, 20
+ PUSHBUTTON "&Properties", IDC_ADAPTERPROPERTIES, 177, 33, 59, 14
END
Modified: trunk/reactos/dll/win32/shellext/deskadp/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskadp…
==============================================================================
--- trunk/reactos/dll/win32/shellext/deskadp/precomp.h (original)
+++ trunk/reactos/dll/win32/shellext/deskadp/precomp.h Thu Sep 27 00:41:57 2007
@@ -3,6 +3,7 @@
#define COBJMACROS
#include <windows.h>
+#include <tchar.h>
#include <shlobj.h>
#include <dll/desk/deskcplx.h>
#include "deskadp.h"
Modified: trunk/reactos/dll/win32/shellext/deskadp/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskadp…
==============================================================================
--- trunk/reactos/dll/win32/shellext/deskadp/resource.h (original)
+++ trunk/reactos/dll/win32/shellext/deskadp/resource.h Thu Sep 27 00:41:57 2007
@@ -3,4 +3,7 @@
#define IDD_DISPLAYADAPTER 100
+#define IDC_ADAPTERNAME 201
+#define IDC_ADAPTERPROPERTIES 201
+
#endif /* __RESOURCE__H */