ReactOS 0.4.15-dev-8100-g1887773
insobjdlg.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "wine/winternl.h"
#include "winerror.h"
#include "wingdi.h"
#include "winuser.h"
#include "wine/debug.h"
#include "oledlg.h"
#include "resource.h"
Include dependency graph for insobjdlg.c:

Go to the source code of this file.

Classes

struct  InsertObjectDlgInfo
 

Typedefs

typedef HRESULT(* DLLREGISTER) (void)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (oledlg)
 
static INT_PTR CALLBACK UIInsertObjectDlgProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static LRESULT UIINSOBJDLG_OnWMCommand (HWND hwnd, WPARAM wParam, LPARAM lParam)
 
static void UIINSERTOBJECTDLG_InitDialog (InsertObjectDlgInfo *pdlgInfo)
 
static void UIINSERTOBJECTDLG_SelectCreateCtrl (InsertObjectDlgInfo *pdlgInfo)
 
static void UIINSERTOBJECTDLG_SelectCreateFromFile (InsertObjectDlgInfo *pdlgInfo)
 
static void UIINSERTOBJECTDLG_SelectCreateNew (InsertObjectDlgInfo *pdlgInfo)
 
static BOOL UIINSERTOBJECTDLG_PopulateObjectTypes (InsertObjectDlgInfo *pdlgInfo)
 
static void UIINSERTOBJECTDLG_FreeObjectTypes (InsertObjectDlgInfo *pdlgInfo)
 
static void UIINSERTOBJECTDLG_SelChange (InsertObjectDlgInfo *pdlgInfo)
 
static BOOL UIINSERTOBJECTDLG_OnOpen (InsertObjectDlgInfo *pdlgInfo)
 
static void UIINSERTOBJECTDLG_BrowseFile (InsertObjectDlgInfo *pdlgInfo)
 
static void UIINSERTOBJECTDLG_AddControl (InsertObjectDlgInfo *pdlgInfo)
 
UINT WINAPI OleUIInsertObjectA (LPOLEUIINSERTOBJECTA lpOleUIInsertObject)
 

Variables

HINSTANCE OLEDLG_hInstance
 
static const WCHAR OleUIInsertObjectInfoStr []
 

Typedef Documentation

◆ DLLREGISTER

typedef HRESULT(* DLLREGISTER) (void)

Definition at line 71 of file insobjdlg.c.

Function Documentation

◆ OleUIInsertObjectA()

UINT WINAPI OleUIInsertObjectA ( LPOLEUIINSERTOBJECTA  lpOleUIInsertObject)

Definition at line 80 of file insobjdlg.c.

81{
82 LRESULT lRes;
83 LPCVOID template;
84 HRSRC hRes;
85 InsertObjectDlgInfo dlgInfo;
86 HANDLE hDlgTmpl = 0;
87
88 if (lpOleUIInsertObject->lpszTemplate || lpOleUIInsertObject->hResource)
89 FIXME("Customized template not supported\n");
90
91 /* Create the dialog from a template */
94 {
96 }
97
98 if (!(hDlgTmpl = LoadResource(OLEDLG_hInstance, hRes )) ||
99 !(template = LockResource( hDlgTmpl )))
100 {
102 }
103
104 /* Initialize InsertObjectDlgInfo structure */
105 dlgInfo.lpOleUIInsertObject = lpOleUIInsertObject;
106 dlgInfo.bObjListInit = FALSE;
107
108 lRes = DialogBoxIndirectParamA(OLEDLG_hInstance, (const DLGTEMPLATE*) template,
109 lpOleUIInsertObject->hWndOwner, UIInsertObjectDlgProc,
110 (LPARAM) &dlgInfo);
111
112 /* Unable to create the dialog */
113 if( lRes == -1)
115
116 return lRes;
117}
#define FIXME(fmt,...)
Definition: debug.h:114
#define FALSE
Definition: types.h:117
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
#define UIINSERTOBJECT
Definition: resource.h:31
static INT_PTR CALLBACK UIInsertObjectDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: insobjdlg.c:125
HINSTANCE OLEDLG_hInstance
Definition: oledlg_main.c:39
#define OLEUI_ERR_DIALOGFAILURE
Definition: oledlg.h:79
#define OLEUI_ERR_FINDTEMPLATEFAILURE
Definition: oledlg.h:77
#define OLEUI_ERR_LOADTEMPLATEFAILURE
Definition: oledlg.h:78
#define RT_DIALOG
Definition: pedump.c:367
LPOLEUIINSERTOBJECTA lpOleUIInsertObject
Definition: insobjdlg.c:42
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
CONST void * LPCVOID
Definition: windef.h:191
INT_PTR WINAPI DialogBoxIndirectParamA(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
char * LPSTR
Definition: xmlstorage.h:182

◆ UIINSERTOBJECTDLG_AddControl()

static void UIINSERTOBJECTDLG_AddControl ( InsertObjectDlgInfo pdlgInfo)
static

Definition at line 557 of file insobjdlg.c.

558{
560 char fname[MAX_PATH];
561 char title[32];
562
563 fn.lStructSize = sizeof(OPENFILENAMEA);
564 fn.hwndOwner = pdlgInfo->hwndSelf;
565 fn.hInstance = 0;
566 fn.lpstrFilter = "OLE Controls\0*.ocx\0Libraries\0*.dll\0All Files\0*.*\0\0";
567 fn.lpstrCustomFilter = NULL;
568 fn.nMaxCustFilter = 0;
569 fn.nFilterIndex = 0;
570
571 fname[0] = 0;
572 fn.lpstrFile = fname;
573 fn.nMaxFile = MAX_PATH;
574
575 fn.lpstrFileTitle = NULL;
576 fn.nMaxFileTitle = 0;
577 fn.lpstrInitialDir = NULL;
578
580 fn.lpstrTitle = title;
581
584 fn.nFileOffset = 0;
585 fn.nFileExtension = 0;
586 fn.lpstrDefExt = NULL;
587 fn.lCustData = 0;
588 fn.lpfnHook = NULL;
589 fn.lpTemplateName = NULL;
590
591 if (GetOpenFileNameA(&fn))
592 {
593 HMODULE hMod;
594 BOOL bValid = FALSE;
595
596 hMod = LoadLibraryA(fn.lpstrFile);
597
598 if (hMod)
599 {
600 DLLREGISTER regproc;
601
602 regproc = (DLLREGISTER) GetProcAddress(hMod, "DllRegisterServer");
603 if (regproc)
604 {
605 if (S_OK == regproc())
606 {
608 bValid = TRUE;
609 }
610 }
611
612 FreeLibrary(hMod);
613 }
614
615 if (!bValid)
616 {
617 WCHAR title[32];
618 WCHAR msg[256];
619
622
624 }
625 }
626}
#define msg(x)
Definition: auth_time.c:54
#define OFN_EXPLORER
Definition: commdlg.h:104
#define OFN_LONGNAMES
Definition: commdlg.h:108
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
struct tagOFNA OPENFILENAMEA
#define OFN_FILEMUSTEXIST
Definition: commdlg.h:106
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
BOOL WINAPI GetOpenFileNameA(OPENFILENAMEA *ofn)
Definition: filedlg.c:4701
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
#define MAX_PATH
Definition: compat.h:34
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
#define IDS_NOTOLEMOD
Definition: resource.h:28
#define IDS_NOTOLEMODCAPTION
Definition: resource.h:29
#define IDS_BROWSE
Definition: resource.h:27
unsigned int BOOL
Definition: ntddk_ex.h:94
static BOOL UIINSERTOBJECTDLG_PopulateObjectTypes(InsertObjectDlgInfo *pdlgInfo)
Definition: insobjdlg.c:332
HRESULT(* DLLREGISTER)(void)
Definition: insobjdlg.c:71
#define S_OK
Definition: intsafe.h:52
static char title[]
Definition: ps.c:92
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int WINAPI LoadStringA(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPSTR lpBuffer, _In_ int cchBufferMax)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_ICONEXCLAMATION
Definition: winuser.h:785
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by UIINSOBJDLG_OnWMCommand().

◆ UIINSERTOBJECTDLG_BrowseFile()

static void UIINSERTOBJECTDLG_BrowseFile ( InsertObjectDlgInfo pdlgInfo)
static

Definition at line 513 of file insobjdlg.c.

514{
516 char fname[MAX_PATH];
517 char title[32];
518
519 fn.lStructSize = sizeof(OPENFILENAMEA);
520 fn.hwndOwner = pdlgInfo->hwndSelf;
521 fn.hInstance = 0;
522 fn.lpstrFilter = "All Files\0*.*\0\0";
523 fn.lpstrCustomFilter = NULL;
524 fn.nMaxCustFilter = 0;
525 fn.nFilterIndex = 0;
526
527 SendMessageA(pdlgInfo->hwndFileTB, WM_GETTEXT, MAX_PATH, (LPARAM)fname);
528 fn.lpstrFile = fname;
529 fn.nMaxFile = MAX_PATH;
530
531 fn.lpstrFileTitle = NULL;
532 fn.nMaxFileTitle = 0;
533 fn.lpstrInitialDir = NULL;
534
536 fn.lpstrTitle = title;
537
540 fn.nFileOffset = 0;
541 fn.nFileExtension = 0;
542 fn.lpstrDefExt = NULL;
543 fn.lCustData = 0;
544 fn.lpfnHook = NULL;
545 fn.lpTemplateName = NULL;
546
547 if (GetOpenFileNameA(&fn))
548 SendMessageA(pdlgInfo->hwndFileTB, WM_SETTEXT, 0, (LPARAM)fn.lpstrFile);
549}
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_GETTEXT
Definition: winuser.h:1618
#define WM_SETTEXT
Definition: winuser.h:1617

Referenced by UIINSOBJDLG_OnWMCommand().

◆ UIINSERTOBJECTDLG_FreeObjectTypes()

static void UIINSERTOBJECTDLG_FreeObjectTypes ( InsertObjectDlgInfo pdlgInfo)
static

Definition at line 397 of file insobjdlg.c.

398{
399 UINT i, count;
400
401 count = SendMessageA(pdlgInfo->hwndObjTypeLB, LB_GETCOUNT, 0, 0);
402
403 for (i = 0; i < count; i++)
404 {
405 CLSID* lpclsid = (CLSID*) SendMessageA(pdlgInfo->hwndObjTypeLB,
406 LB_GETITEMDATA, i, 0);
407 HeapFree(GetProcessHeap(), 0, lpclsid);
408 }
409}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: ndis.h:50
#define LB_GETCOUNT
Definition: winuser.h:2038
#define LB_GETITEMDATA
Definition: winuser.h:2041

Referenced by UIINSERTOBJECTDLG_PopulateObjectTypes(), and UIInsertObjectDlgProc().

◆ UIINSERTOBJECTDLG_InitDialog()

static void UIINSERTOBJECTDLG_InitDialog ( InsertObjectDlgInfo pdlgInfo)
static

Definition at line 214 of file insobjdlg.c.

215{
216 /* Initialize InsertObjectDlgInfo data structure */
217 pdlgInfo->hwndObjTypeLB = GetDlgItem(pdlgInfo->hwndSelf, IDC_OBJTYPELIST);
218 pdlgInfo->hwndObjTypeLBL = GetDlgItem(pdlgInfo->hwndSelf, IDC_OBJTYPELBL);
219 pdlgInfo->hwndFileLBL = GetDlgItem(pdlgInfo->hwndSelf, IDC_FILELBL);
220 pdlgInfo->hwndFileTB = GetDlgItem(pdlgInfo->hwndSelf, IDC_FILE);
222 pdlgInfo->hwndCreateNewCB = GetDlgItem(pdlgInfo->hwndSelf, IDC_CREATENEW);
224 pdlgInfo->hwndDisplayIconCB = GetDlgItem(pdlgInfo->hwndSelf, IDC_ASICON);
225 pdlgInfo->hwndAddCtrlBTN = GetDlgItem(pdlgInfo->hwndSelf, IDC_ADDCONTROL);
226 pdlgInfo->hwndBrowseBTN = GetDlgItem(pdlgInfo->hwndSelf, IDC_BROWSE);
227 pdlgInfo->hwndResultDesc = GetDlgItem(pdlgInfo->hwndSelf, IDC_RESULTDESC);
228
229 /* Setup dialog controls based on flags */
230 if (pdlgInfo->lpOleUIInsertObject->lpszCaption)
232
239
244 else /* (pdlgInfo->lpOleUIInsertObject->dwFlags & IOF_SELECTCREATENEW) */
246}
#define IDC_BROWSE
Definition: resource.h:21
#define IDC_OBJTYPELIST
Definition: resource.h:33
#define IDC_FILELBL
Definition: resource.h:43
#define IDC_CREATEFROMFILE
Definition: resource.h:37
#define IDC_CREATENEW
Definition: resource.h:35
#define IDC_ADDCONTROL
Definition: resource.h:40
#define IDC_ASICON
Definition: resource.h:41
#define IDC_OBJTYPELBL
Definition: resource.h:38
#define IDC_RESULTDESC
Definition: resource.h:39
#define IDC_CREATECONTROL
Definition: resource.h:36
#define IDC_FILE
Definition: resource.h:44
static void UIINSERTOBJECTDLG_SelectCreateCtrl(InsertObjectDlgInfo *pdlgInfo)
Definition: insobjdlg.c:254
static void UIINSERTOBJECTDLG_SelectCreateNew(InsertObjectDlgInfo *pdlgInfo)
Definition: insobjdlg.c:278
static void UIINSERTOBJECTDLG_SelectCreateFromFile(InsertObjectDlgInfo *pdlgInfo)
Definition: insobjdlg.c:305
#define IOF_SELECTCREATEFROMFILE
Definition: oledlg.h:202
#define IOF_SHOWINSERTCONTROL
Definition: oledlg.h:212
#define IOF_DISABLEDISPLAYASICON
Definition: oledlg.h:210
#define IOF_CHECKDISPLAYASICON
Definition: oledlg.h:204
#define IOF_SELECTCREATECONTROL
Definition: oledlg.h:213
HWND hwndCreateFromFileCB
Definition: insobjdlg.c:50
#define SW_HIDE
Definition: winuser.h:768
BOOL WINAPI SetWindowTextA(_In_ HWND, _In_opt_ LPCSTR)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define SW_SHOW
Definition: winuser.h:775

Referenced by UIInsertObjectDlgProc().

◆ UIINSERTOBJECTDLG_OnOpen()

static BOOL UIINSERTOBJECTDLG_OnOpen ( InsertObjectDlgInfo pdlgInfo)
static

Definition at line 442 of file insobjdlg.c.

443{
444 BOOL bret = FALSE;
445
446 if (BST_CHECKED == SendMessageA(pdlgInfo->hwndCreateCtrlCB, BM_GETCHECK, 0, 0) ||
448 {
449 INT index = SendMessageA(pdlgInfo->hwndObjTypeLB, LB_GETCURSEL, 0, 0);
450
451 if (index >= 0)
452 {
453 CLSID* clsid = (CLSID*) SendMessageA(pdlgInfo->hwndObjTypeLB,
455 pdlgInfo->lpOleUIInsertObject->clsid = *clsid;
456
458 {
459 pdlgInfo->lpOleUIInsertObject->sc= OleCreate(
460 &pdlgInfo->lpOleUIInsertObject->clsid,
461 &pdlgInfo->lpOleUIInsertObject->iid,
466 pdlgInfo->lpOleUIInsertObject->ppvObj);
467 }
468
469 bret = TRUE;
470 }
471 }
472 else if (BST_CHECKED == SendMessageA(pdlgInfo->hwndCreateFromFileCB, BM_GETCHECK, 0, 0))
473 {
474 if (pdlgInfo->lpOleUIInsertObject->lpszFile)
475 {
477 WCHAR wcsFile[MAX_PATH];
478
479 if (SendMessageW(pdlgInfo->hwndFileTB, WM_GETTEXT, MAX_PATH, (LPARAM)wcsFile))
480 WideCharToMultiByte(CP_ACP, 0, wcsFile, -1,
482
483 if (SUCCEEDED(hres = GetClassFile(wcsFile, &pdlgInfo->lpOleUIInsertObject->clsid)))
484 {
486 {
488 &pdlgInfo->lpOleUIInsertObject->clsid,
489 wcsFile,
490 &pdlgInfo->lpOleUIInsertObject->iid,
495 pdlgInfo->lpOleUIInsertObject->ppvObj);
496 }
497
498 bret = TRUE;
499 }
500 pdlgInfo->lpOleUIInsertObject->sc = hres;
501 }
502 }
503
504 return bret;
505}
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
HRESULT WINAPI GetClassFile(LPCOLESTR filePathName, CLSID *pclsid)
Definition: moniker.c:1213
HRESULT WINAPI OleCreate(REFCLSID rclsid, REFIID riid, DWORD renderopt, LPFORMATETC pFormatEtc, LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID *ppvObj)
Definition: ole2.c:2609
GLuint index
Definition: glext.h:6031
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT hres
Definition: protocol.c:465
REFCLSID clsid
Definition: msctf.c:82
HRESULT WINAPI OleCreateFromFile(REFCLSID clsid, const OLECHAR *filename, REFIID iid, DWORD renderopt, FORMATETC *fmt, IOleClientSite *client_site, IStorage *storage, void **obj)
Definition: ole2impl.c:402
#define IOF_CREATEFILEOBJECT
Definition: oledlg.h:206
#define IOF_CREATENEWOBJECT
Definition: oledlg.h:205
LPFORMATETC lpFormatEtc
Definition: oledlg.h:162
LPOLECLIENTSITE lpIOleClientSite
Definition: oledlg.h:163
LPSTORAGE lpIStorage
Definition: oledlg.h:164
int32_t INT
Definition: typedefs.h:58
#define LB_GETCURSEL
Definition: winuser.h:2039
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BST_CHECKED
Definition: winuser.h:197
#define BM_GETCHECK
Definition: winuser.h:1918

Referenced by UIINSOBJDLG_OnWMCommand().

◆ UIINSERTOBJECTDLG_PopulateObjectTypes()

static BOOL UIINSERTOBJECTDLG_PopulateObjectTypes ( InsertObjectDlgInfo pdlgInfo)
static

Definition at line 332 of file insobjdlg.c.

333{
334 static const WCHAR szClsid[] = {'C','L','S','I','D',0};
335 static const WCHAR szInsertable[] = {'I','n','s','e','r','t','a','b','l','e',0};
336 static const WCHAR szNotInsertable[] = {'N','o','t','I','n','s','e','r','t','a','b','l','e',0};
337 DWORD i;
338 LONG len;
339 HKEY hkclsids;
340 HKEY hkey;
341 CLSID clsid;
342 LSTATUS ret;
343 WCHAR keydesc[MAX_PATH];
344 WCHAR keyname[MAX_PATH];
345 WCHAR szclsid[128];
346 DWORD index = 0;
347
349
350 RegOpenKeyExW(HKEY_CLASSES_ROOT, szClsid, 0, KEY_READ, &hkclsids);
351
352 while (ERROR_SUCCESS == (ret = RegEnumKeyW(hkclsids, index, szclsid, ARRAY_SIZE(szclsid))))
353 {
354 index++;
355
356 RegOpenKeyExW(hkclsids, szclsid, 0, KEY_READ, &hkey);
357
358 len = sizeof(keyname);
359 if (ERROR_SUCCESS != RegQueryValueW(hkey, szInsertable, keyname, &len))
360 continue;
361
362 len = sizeof(keyname);
363 if (ERROR_SUCCESS == RegQueryValueW(hkey, szNotInsertable, keyname, &len))
364 continue;
365
366 CLSIDFromString(szclsid, &clsid);
367
368 for (i = 0; i < pdlgInfo->lpOleUIInsertObject->cClsidExclude; i++)
370 break;
371
372 if (i < pdlgInfo->lpOleUIInsertObject->cClsidExclude)
373 continue;
374
375 len = sizeof(keydesc);
376 if (ERROR_SUCCESS == RegQueryValueW(hkey, NULL, keydesc, &len))
377 {
378 CLSID* lpclsid = HeapAlloc(GetProcessHeap(), 0, sizeof(CLSID));
379 *lpclsid = clsid;
380
381 len = SendMessageW(pdlgInfo->hwndObjTypeLB, LB_ADDSTRING, 0, (LPARAM)keydesc);
382 SendMessageW(pdlgInfo->hwndObjTypeLB, LB_SETITEMDATA, len, (LPARAM)lpclsid);
383 }
384 }
385
386 pdlgInfo->bObjListInit = (ret == ERROR_NO_MORE_ITEMS);
387
388 return pdlgInfo->bObjListInit;
389}
#define ARRAY_SIZE(A)
Definition: main.h:33
#define ERROR_SUCCESS
Definition: deptool.c:10
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LSTATUS WINAPI RegQueryValueW(HKEY hkey, LPCWSTR name, LPWSTR data, LPLONG count)
Definition: reg.c:4241
LONG WINAPI RegEnumKeyW(HKEY hKey, DWORD dwIndex, LPWSTR lpName, DWORD cbName)
Definition: reg.c:2393
#define HeapAlloc
Definition: compat.h:733
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2338
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
static void UIINSERTOBJECTDLG_FreeObjectTypes(InsertObjectDlgInfo *pdlgInfo)
Definition: insobjdlg.c:397
#define KEY_READ
Definition: nt_native.h:1023
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
LPCLSID lpClsidExclude
Definition: oledlg.h:159
int ret
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define LB_ADDSTRING
Definition: winuser.h:2031
#define LB_SETITEMDATA
Definition: winuser.h:2065

Referenced by UIINSERTOBJECTDLG_AddControl(), UIINSERTOBJECTDLG_SelectCreateCtrl(), and UIINSERTOBJECTDLG_SelectCreateNew().

◆ UIINSERTOBJECTDLG_SelChange()

static void UIINSERTOBJECTDLG_SelChange ( InsertObjectDlgInfo pdlgInfo)
static

Definition at line 417 of file insobjdlg.c.

418{
419 INT index;
420 WCHAR objname[MAX_PATH];
421 WCHAR objdesc[MAX_PATH];
422 WCHAR resstr[MAX_PATH];
423
424 TRACE("\n");
425
427 ((index = SendMessageW(pdlgInfo->hwndObjTypeLB, LB_GETCURSEL, 0, 0)) >= 0) &&
428 SendMessageW(pdlgInfo->hwndObjTypeLB, LB_GETTEXT, index, (LPARAM)objname))
429 wsprintfW(objdesc, resstr, objname);
430 else
431 objdesc[0] = 0;
432
433 SendMessageW(pdlgInfo->hwndResultDesc, WM_SETTEXT, 0, (LPARAM)objdesc);
434}
#define index(s, c)
Definition: various.h:29
#define IDS_RESULTOBJDESC
Definition: resource.h:25
#define TRACE(s)
Definition: solgame.cpp:4
#define LB_GETTEXT
Definition: winuser.h:2049
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)

Referenced by UIINSERTOBJECTDLG_SelectCreateNew(), and UIINSOBJDLG_OnWMCommand().

◆ UIINSERTOBJECTDLG_SelectCreateCtrl()

static void UIINSERTOBJECTDLG_SelectCreateCtrl ( InsertObjectDlgInfo pdlgInfo)
static

Definition at line 254 of file insobjdlg.c.

255{
257 ShowWindow(pdlgInfo->hwndFileLBL, SW_HIDE);
258 ShowWindow(pdlgInfo->hwndFileTB, SW_HIDE);
259 ShowWindow(pdlgInfo->hwndBrowseBTN, SW_HIDE);
260
262 ShowWindow(pdlgInfo->hwndObjTypeLB, SW_SHOW);
264
266
267 /* Populate object type listbox */
268 if (!pdlgInfo->bObjListInit)
270}
#define BM_SETCHECK
Definition: winuser.h:1921

Referenced by UIINSERTOBJECTDLG_InitDialog(), and UIINSOBJDLG_OnWMCommand().

◆ UIINSERTOBJECTDLG_SelectCreateFromFile()

static void UIINSERTOBJECTDLG_SelectCreateFromFile ( InsertObjectDlgInfo pdlgInfo)
static

Definition at line 305 of file insobjdlg.c.

306{
307 WCHAR resstr[MAX_PATH];
308
311 ShowWindow(pdlgInfo->hwndObjTypeLB, SW_HIDE);
312
315
316 ShowWindow(pdlgInfo->hwndFileLBL, SW_SHOW);
317 ShowWindow(pdlgInfo->hwndFileTB, SW_SHOW);
318 ShowWindow(pdlgInfo->hwndBrowseBTN, SW_SHOW);
319
321
323 SendMessageW(pdlgInfo->hwndResultDesc, WM_SETTEXT, 0, (LPARAM)resstr);
324}
#define IDS_RESULTFILEOBJDESC
Definition: resource.h:26

Referenced by UIINSERTOBJECTDLG_InitDialog(), and UIINSOBJDLG_OnWMCommand().

◆ UIINSERTOBJECTDLG_SelectCreateNew()

static void UIINSERTOBJECTDLG_SelectCreateNew ( InsertObjectDlgInfo pdlgInfo)
static

Definition at line 278 of file insobjdlg.c.

279{
280 ShowWindow(pdlgInfo->hwndFileLBL, SW_HIDE);
281 ShowWindow(pdlgInfo->hwndFileTB, SW_HIDE);
283 ShowWindow(pdlgInfo->hwndBrowseBTN, SW_HIDE);
284
287
289 ShowWindow(pdlgInfo->hwndObjTypeLB, SW_SHOW);
290
292
293 if (!pdlgInfo->bObjListInit)
295
297}
static void UIINSERTOBJECTDLG_SelChange(InsertObjectDlgInfo *pdlgInfo)
Definition: insobjdlg.c:417

Referenced by UIINSERTOBJECTDLG_InitDialog(), and UIINSOBJDLG_OnWMCommand().

◆ UIInsertObjectDlgProc()

INT_PTR CALLBACK UIInsertObjectDlgProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 125 of file insobjdlg.c.

126{
128
129 switch(uMsg)
130 {
131 case WM_INITDIALOG:
132 {
134
135 pdlgInfo->hwndSelf = hwnd;
136
138
140
141 return 0;
142 }
143
144 case WM_COMMAND:
146
147 case WM_DESTROY:
148 if (pdlgInfo)
151 return FALSE;
152
153 default :
154 return FALSE;
155 }
156}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static LRESULT UIINSOBJDLG_OnWMCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
Definition: insobjdlg.c:164
static const WCHAR OleUIInsertObjectInfoStr[]
Definition: insobjdlg.c:74
static void UIINSERTOBJECTDLG_InitDialog(InsertObjectDlgInfo *pdlgInfo)
Definition: insobjdlg.c:214
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
HANDLE WINAPI RemovePropW(_In_ HWND, _In_ LPCWSTR)
#define WM_COMMAND
Definition: winuser.h:1740
#define WM_INITDIALOG
Definition: winuser.h:1739
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
#define WM_DESTROY
Definition: winuser.h:1609

Referenced by OleUIInsertObjectA().

◆ UIINSOBJDLG_OnWMCommand()

static LRESULT UIINSOBJDLG_OnWMCommand ( HWND  hwnd,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 164 of file insobjdlg.c.

165{
167 WORD wNotifyCode = HIWORD(wParam);
168 WORD wID = LOWORD(wParam);
169
170 switch(wID)
171 {
172 case IDOK:
174 break;
175
176 case IDCANCEL:
178 break;
179
182 break;
183
184 case IDC_CREATENEW:
186 break;
187
190 break;
191
192 case IDC_BROWSE:
194 break;
195
196 case IDC_ADDCONTROL:
198 break;
199
200 case IDC_OBJTYPELIST:
201 if (wNotifyCode == LBN_SELCHANGE)
203 break;
204 }
205 return 0;
206}
unsigned short WORD
Definition: ntddk_ex.h:93
static void UIINSERTOBJECTDLG_AddControl(InsertObjectDlgInfo *pdlgInfo)
Definition: insobjdlg.c:557
static BOOL UIINSERTOBJECTDLG_OnOpen(InsertObjectDlgInfo *pdlgInfo)
Definition: insobjdlg.c:442
static void UIINSERTOBJECTDLG_BrowseFile(InsertObjectDlgInfo *pdlgInfo)
Definition: insobjdlg.c:513
#define LOWORD(l)
Definition: pedump.c:82
#define HIWORD(l)
Definition: typedefs.h:247
#define IDCANCEL
Definition: winuser.h:831
#define IDOK
Definition: winuser.h:830
#define LBN_SELCHANGE
Definition: winuser.h:2075
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

Referenced by UIInsertObjectDlgProc().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( oledlg  )

Variable Documentation

◆ OLEDLG_hInstance

◆ OleUIInsertObjectInfoStr

const WCHAR OleUIInsertObjectInfoStr[]
static
Initial value:
= {'O','l','e','U','I','I','n','s','e','r','t','O','b','j','e','c','t',
'I','n','f','o','S','t','r',0}

Definition at line 74 of file insobjdlg.c.

Referenced by UIInsertObjectDlgProc(), and UIINSOBJDLG_OnWMCommand().