Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

472 lines
17 KiB

  1. #include <windows.h>
  2. #include <commctrl.h>
  3. #include <shfusion.h>
  4. #include <commdlg.h>
  5. #include "uicommon.h"
  6. #include "simcrack.h"
  7. #include "pviewids.h"
  8. #include "resource.h"
  9. HINSTANCE g_hInstance;
  10. class CGetXYDlg
  11. {
  12. public:
  13. class CData
  14. {
  15. private:
  16. TCHAR m_szTitle[MAX_PATH];
  17. int m_nX, m_nY;
  18. private:
  19. CData( const CData & );
  20. CData &operator=( const CData & );
  21. public:
  22. CData(void)
  23. : m_nX(0), m_nY(0)
  24. {
  25. m_szTitle[0] = TEXT('\0');
  26. }
  27. void Title( LPCTSTR pszTitle )
  28. {
  29. if (pszTitle)
  30. lstrcpyn( m_szTitle, pszTitle, ARRAYSIZE(m_szTitle) );
  31. }
  32. LPCTSTR Title(void) const
  33. {
  34. return m_szTitle;
  35. }
  36. void X( int nX )
  37. {
  38. m_nX = nX;
  39. }
  40. void Y( int nY )
  41. {
  42. m_nY = nY;
  43. }
  44. int X( void ) const
  45. {
  46. return m_nX;
  47. }
  48. int Y( void ) const
  49. {
  50. return m_nY;
  51. }
  52. };
  53. private:
  54. HWND m_hWnd;
  55. CData *m_pData;
  56. private:
  57. CGetXYDlg(void);
  58. CGetXYDlg( const CGetXYDlg & );
  59. CGetXYDlg &operator=( const CGetXYDlg & );
  60. private:
  61. explicit CGetXYDlg( HWND hWnd )
  62. : m_hWnd(hWnd),
  63. m_pData(NULL)
  64. {
  65. }
  66. LRESULT OnInitDialog( WPARAM, LPARAM lParam )
  67. {
  68. m_pData = reinterpret_cast<CData*>(lParam);
  69. if (!m_pData)
  70. {
  71. EndDialog( m_hWnd, IDCANCEL );
  72. return 0;
  73. }
  74. if (lstrlen(m_pData->Title()))
  75. SetWindowText(m_hWnd,m_pData->Title());
  76. SetDlgItemInt( m_hWnd, IDC_X, m_pData->X(), TRUE );
  77. SetDlgItemInt( m_hWnd, IDC_Y, m_pData->Y(), TRUE );
  78. return 0;
  79. }
  80. void OnCancel( WPARAM, LPARAM )
  81. {
  82. EndDialog( m_hWnd, IDCANCEL );
  83. }
  84. void OnOK( WPARAM, LPARAM )
  85. {
  86. m_pData->X(GetDlgItemInt( m_hWnd, IDC_X, NULL, TRUE ));
  87. m_pData->Y(GetDlgItemInt( m_hWnd, IDC_Y, NULL, TRUE ));
  88. EndDialog( m_hWnd, IDOK );
  89. }
  90. LRESULT OnCommand( WPARAM wParam, LPARAM lParam )
  91. {
  92. SC_BEGIN_COMMAND_HANDLERS()
  93. {
  94. SC_HANDLE_COMMAND(IDOK,OnOK);
  95. SC_HANDLE_COMMAND(IDCANCEL,OnCancel);
  96. }
  97. SC_END_COMMAND_HANDLERS();
  98. }
  99. public:
  100. static INT_PTR CALLBACK DialogProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
  101. {
  102. SC_BEGIN_DIALOG_MESSAGE_HANDLERS(CGetXYDlg)
  103. {
  104. SC_HANDLE_DIALOG_MESSAGE( WM_INITDIALOG, OnInitDialog );
  105. SC_HANDLE_DIALOG_MESSAGE( WM_COMMAND, OnCommand );
  106. }
  107. SC_END_DIALOG_MESSAGE_HANDLERS();
  108. }
  109. };
  110. class CPreviewDlg
  111. {
  112. private:
  113. HWND m_hWnd;
  114. HWND m_hWndPreview;
  115. SIZE m_sizeResolution;
  116. public:
  117. CPreviewDlg( HWND hWnd )
  118. : m_hWnd(hWnd),m_hWndPreview(NULL)
  119. {
  120. m_sizeResolution.cx = 1000;
  121. m_sizeResolution.cy = 1000;
  122. }
  123. ~CPreviewDlg(void)
  124. {
  125. }
  126. void OnPreviewSelChange( WPARAM, LPARAM )
  127. {
  128. POINT ptOriginLogical, ptOriginPhysical;
  129. SIZE sizeExtentLogical, sizeExtentPhysical;
  130. WiaPreviewControl_GetSelOrigin( m_hWndPreview, 0, 0, &ptOriginLogical );
  131. WiaPreviewControl_GetSelOrigin( m_hWndPreview, 0, 1, &ptOriginPhysical );
  132. WiaPreviewControl_GetSelExtent( m_hWndPreview, 0, 0, &sizeExtentLogical );
  133. WiaPreviewControl_GetSelExtent( m_hWndPreview, 0, 1, &sizeExtentPhysical );
  134. SetWindowText( m_hWndPreview, TEXT("This is the window caption") );
  135. TCHAR szStr[MAX_PATH];
  136. wsprintf( szStr, TEXT("Log: (%d,%d), Phys: (%d,%d)"), sizeExtentLogical.cx, sizeExtentLogical.cy, sizeExtentPhysical.cx, sizeExtentPhysical.cy );
  137. SendDlgItemMessage( m_hWnd, IDC_EXTENT, WM_SETTEXT, 0, (LPARAM)szStr );
  138. wsprintf( szStr, TEXT("Log: (%d,%d), Phys: (%d,%d)"), ptOriginLogical.x, ptOriginLogical.y, ptOriginPhysical.x, ptOriginPhysical.y );
  139. SendDlgItemMessage( m_hWnd, IDC_ORIGIN, WM_SETTEXT, 0, (LPARAM)szStr );
  140. }
  141. LRESULT OnSize( WPARAM, LPARAM lParam )
  142. {
  143. RECT rcPreview;
  144. GetWindowRect( m_hWndPreview, &rcPreview );
  145. WiaUiUtil::ScreenToClient( m_hWnd, &rcPreview );
  146. MoveWindow( m_hWndPreview, rcPreview.left, rcPreview.top, LOWORD(lParam)-rcPreview.left-rcPreview.top, HIWORD(lParam)-rcPreview.top-rcPreview.top, TRUE );
  147. return 0;
  148. }
  149. void Update(void)
  150. {
  151. TCHAR szMsg[256];
  152. wsprintf( szMsg, TEXT("%d"), WiaPreviewControl_GetBorderSize( m_hWndPreview, FALSE ) );
  153. SendDlgItemMessage( m_hWnd, IDC_BORDERTEXT, WM_SETTEXT, 0, (LPARAM)szMsg );
  154. wsprintf( szMsg, TEXT("%d"), WiaPreviewControl_GetHandleSize( m_hWndPreview ) );
  155. SendDlgItemMessage( m_hWnd, IDC_SIZINGHANDLESTEXT, WM_SETTEXT, 0, (LPARAM)szMsg );
  156. wsprintf( szMsg, TEXT("%d"), WiaPreviewControl_GetBgAlpha( m_hWndPreview ) );
  157. SendDlgItemMessage( m_hWnd, IDC_ALPHAVALUETEXT, WM_SETTEXT, 0, (LPARAM)szMsg );
  158. }
  159. LRESULT OnInitDialog( WPARAM, LPARAM )
  160. {
  161. m_hWndPreview = GetDlgItem( m_hWnd, IDC_PREVIEW );
  162. SendDlgItemMessage( m_hWnd, IDC_BORDER, TBM_SETRANGE, TRUE, MAKELPARAM(0,25) );
  163. SendDlgItemMessage( m_hWnd, IDC_SIZINGHANDLES, TBM_SETRANGE, TRUE, MAKELPARAM(0,25) );
  164. SendDlgItemMessage( m_hWnd, IDC_ALPHAVALUE, TBM_SETRANGE, TRUE, MAKELPARAM(0,255) );
  165. SendDlgItemMessage( m_hWnd, IDC_BORDER, TBM_SETPOS, TRUE, WiaPreviewControl_GetBorderSize( m_hWndPreview, FALSE ) );
  166. SendDlgItemMessage( m_hWnd, IDC_SIZINGHANDLES, TBM_SETPOS, TRUE, WiaPreviewControl_GetHandleSize( m_hWndPreview ) );
  167. SendDlgItemMessage( m_hWnd, IDC_ALPHAVALUE, TBM_SETPOS, TRUE, WiaPreviewControl_GetBgAlpha( m_hWndPreview ) );
  168. SendDlgItemMessage( m_hWnd, IDC_NOIMAGE, BM_SETCHECK, BST_CHECKED, 0 );
  169. WiaPreviewControl_SetResolution( m_hWndPreview, &m_sizeResolution );
  170. PostMessage( m_hWnd, WM_COMMAND, MAKEWPARAM( IDC_PREVIEW, PWN_SELCHANGE ), 0 );
  171. Update();
  172. return 0;
  173. }
  174. void OnCancel( WPARAM, LPARAM )
  175. {
  176. EndDialog( m_hWnd, 0 );
  177. }
  178. void OnBitmapChange( WPARAM wParam, LPARAM )
  179. {
  180. HBITMAP hBitmap = NULL;
  181. switch (LOWORD(wParam))
  182. {
  183. case IDC_BW:
  184. hBitmap = (HBITMAP)LoadImage( g_hInstance, MAKEINTRESOURCE(IDB_BW), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION );
  185. break;
  186. case IDC_GRAY:
  187. hBitmap = (HBITMAP)LoadImage( g_hInstance, MAKEINTRESOURCE(IDB_GRAY), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION );
  188. break;
  189. case IDC_COLOR:
  190. hBitmap = (HBITMAP)LoadImage( g_hInstance, MAKEINTRESOURCE(IDB_COLOR), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION );
  191. break;
  192. }
  193. WiaPreviewControl_SetBitmap( m_hWndPreview, TRUE, FALSE, hBitmap );
  194. }
  195. LRESULT OnScroll( WPARAM, LPARAM lParam )
  196. {
  197. if (GetDlgItem(m_hWnd,IDC_BORDER)==(HWND)lParam)
  198. {
  199. int nSetting = static_cast<int>(SendDlgItemMessage( m_hWnd, IDC_BORDER, TBM_GETPOS, 0, 0 ));
  200. WiaPreviewControl_SetBorderSize( m_hWndPreview, TRUE, FALSE, nSetting );
  201. WiaPreviewControl_ClearSelection( m_hWndPreview );
  202. }
  203. if (GetDlgItem(m_hWnd,IDC_SIZINGHANDLES)==(HWND)lParam)
  204. {
  205. int nSetting = static_cast<int>(SendDlgItemMessage( m_hWnd, IDC_SIZINGHANDLES, TBM_GETPOS, 0, 0 ));
  206. WiaPreviewControl_SetHandleSize( m_hWndPreview, TRUE, nSetting );
  207. }
  208. if (GetDlgItem(m_hWnd,IDC_ALPHAVALUE)==(HWND)lParam)
  209. {
  210. int nSetting = static_cast<int>(SendDlgItemMessage( m_hWnd, IDC_ALPHAVALUE, TBM_GETPOS, 0, 0 ));
  211. WiaPreviewControl_SetBgAlpha( m_hWndPreview, TRUE, static_cast<BYTE>(nSetting) );
  212. }
  213. Update();
  214. return 0;
  215. }
  216. void OnDisabled( WPARAM, LPARAM )
  217. {
  218. EnableWindow( m_hWndPreview, BST_CHECKED!=SendDlgItemMessage( m_hWnd, IDC_DISABLED, BM_GETCHECK, 0, 0 ) );
  219. }
  220. void OnHandleStyle( WPARAM, LPARAM )
  221. {
  222. bool bRoundButtons = (BST_CHECKED==SendDlgItemMessage( m_hWnd, IDC_ROUNDHANDLES, BM_GETCHECK, 0, 0 ));
  223. bool bHollowHandle = (BST_CHECKED==SendDlgItemMessage( m_hWnd, IDC_HOLLOWHANDLE, BM_GETCHECK, 0, 0 ));
  224. UINT nStyle = 0;
  225. if (bRoundButtons)
  226. nStyle |= PREVIEW_WINDOW_ROUNDHANDLES;
  227. else nStyle |= PREVIEW_WINDOW_SQUAREHANDLES;
  228. if (bHollowHandle)
  229. nStyle |= PREVIEW_WINDOW_HOLLOWHANDLES;
  230. else nStyle |= PREVIEW_WINDOW_FILLEDHANDLES;
  231. WiaPreviewControl_SetHandleType( m_hWndPreview, TRUE, nStyle );
  232. }
  233. void OnPreviewMode( WPARAM, LPARAM )
  234. {
  235. bool bPreviewMode = (BST_CHECKED==SendDlgItemMessage( m_hWnd, IDC_PREVIEWMODE, BM_GETCHECK, 0, 0 ));
  236. WiaPreviewControl_SetPreviewMode( m_hWndPreview, bPreviewMode != FALSE );
  237. }
  238. void OnNullSelection( WPARAM, LPARAM )
  239. {
  240. bool bNullSelection = (BST_CHECKED==SendDlgItemMessage( m_hWnd, IDC_NULLSELECTION, BM_GETCHECK, 0, 0 ));
  241. WiaPreviewControl_AllowNullSelection( m_hWndPreview, bNullSelection != FALSE );
  242. }
  243. void OnDisableSelection( WPARAM, LPARAM )
  244. {
  245. bool bDisableSelection = (BST_CHECKED==SendDlgItemMessage( m_hWnd, IDC_DISABLESELECTION, BM_GETCHECK, 0, 0 ));
  246. WiaPreviewControl_DisableSelection( m_hWndPreview, bDisableSelection != FALSE );
  247. }
  248. void OnSolidSelection( WPARAM, LPARAM )
  249. {
  250. bool bSolidSelection = (BST_CHECKED==SendDlgItemMessage( m_hWnd, IDC_SOLIDSELECTION, BM_GETCHECK, 0, 0 ));
  251. bool bDoubleWidth = (BST_CHECKED==SendDlgItemMessage( m_hWnd, IDC_DOUBLEWIDTH, BM_GETCHECK, 0, 0 ));
  252. WiaPreviewControl_SetBorderStyle( m_hWndPreview, TRUE, bSolidSelection ? PS_SOLID : PS_DOT, bDoubleWidth ? 2 : 0 );
  253. }
  254. BOOL GetColor( COLORREF &cr )
  255. {
  256. static COLORREF crCustom[16];
  257. CHOOSECOLOR cc;
  258. ZeroMemory(&cc,sizeof(cc));
  259. ZeroMemory(&crCustom,sizeof(crCustom));
  260. cc.lStructSize = sizeof(cc);
  261. cc.hwndOwner = m_hWnd;
  262. cc.rgbResult = cr;
  263. cc.lpCustColors = crCustom;
  264. cc.Flags = CC_ANYCOLOR|CC_RGBINIT;
  265. if (ChooseColor(&cc))
  266. {
  267. cr = cc.rgbResult;
  268. return TRUE;
  269. }
  270. return FALSE;
  271. }
  272. void OnSelectedBorderColor( WPARAM, LPARAM )
  273. {
  274. COLORREF cr = 0;
  275. if (GetColor(cr))
  276. {
  277. WiaPreviewControl_SetBorderColor( m_hWndPreview, TRUE, PREVIEW_WINDOW_SELECTED, cr );
  278. }
  279. }
  280. void OnUnselectedBorderColor( WPARAM, LPARAM )
  281. {
  282. COLORREF cr = 0;
  283. if (GetColor(cr))
  284. {
  285. WiaPreviewControl_SetBorderColor( m_hWndPreview, TRUE, PREVIEW_WINDOW_UNSELECTED, cr );
  286. }
  287. }
  288. void OnDisableBorderColor( WPARAM, LPARAM )
  289. {
  290. COLORREF cr = 0;
  291. if (GetColor(cr))
  292. {
  293. WiaPreviewControl_SetBorderColor( m_hWndPreview, TRUE, PREVIEW_WINDOW_DISABLED, cr );
  294. }
  295. }
  296. void OnSelectedHandleColor( WPARAM, LPARAM )
  297. {
  298. COLORREF cr = 0;
  299. if (GetColor(cr))
  300. {
  301. WiaPreviewControl_SetHandleColor( m_hWndPreview, TRUE, PREVIEW_WINDOW_SELECTED, cr );
  302. }
  303. }
  304. void OnUnselectedHandleColor( WPARAM, LPARAM )
  305. {
  306. COLORREF cr = 0;
  307. if (GetColor(cr))
  308. {
  309. WiaPreviewControl_SetHandleColor( m_hWndPreview, TRUE, PREVIEW_WINDOW_UNSELECTED, cr );
  310. }
  311. }
  312. void OnDisableHandleColor( WPARAM, LPARAM )
  313. {
  314. COLORREF cr = 0;
  315. if (GetColor(cr))
  316. {
  317. WiaPreviewControl_SetHandleColor( m_hWndPreview, TRUE, PREVIEW_WINDOW_DISABLED, cr );
  318. }
  319. }
  320. void OnInnerColor( WPARAM, LPARAM )
  321. {
  322. COLORREF cr = 0;
  323. if (GetColor(cr))
  324. {
  325. WiaPreviewControl_SetBkColor( m_hWndPreview, TRUE, FALSE, cr );
  326. }
  327. }
  328. void OnOuterColor( WPARAM, LPARAM )
  329. {
  330. COLORREF cr = 0;
  331. if (GetColor(cr))
  332. {
  333. WiaPreviewControl_SetBkColor( m_hWndPreview, TRUE, TRUE, cr );
  334. }
  335. }
  336. void OnSetOrigin( WPARAM, LPARAM )
  337. {
  338. CSimpleString strTitle;
  339. POINT ptOrigin;
  340. WiaPreviewControl_GetSelOrigin( m_hWndPreview, 0, 0, &ptOrigin );
  341. strTitle.Format( TEXT("Enter Origin - Current Res: (%d,%d):"), m_sizeResolution.cx, m_sizeResolution.cy );
  342. CGetXYDlg::CData data;
  343. data.Title(strTitle);
  344. data.X( ptOrigin.x );
  345. data.Y( ptOrigin.y );
  346. INT_PTR nResult = DialogBoxParam( g_hInstance, MAKEINTRESOURCE(IDD_GETXYDLG), m_hWnd, CGetXYDlg::DialogProc, reinterpret_cast<LPARAM>(&data) );
  347. if (IDOK == nResult)
  348. {
  349. ptOrigin.x = data.X();
  350. ptOrigin.y = data.Y();
  351. WiaPreviewControl_SetResolution( m_hWndPreview, &m_sizeResolution );
  352. WiaPreviewControl_SetSelOrigin( m_hWndPreview, 0, 0, &ptOrigin );
  353. }
  354. }
  355. void OnSetExtent( WPARAM, LPARAM )
  356. {
  357. CSimpleString strTitle;
  358. SIZE sizeExtent;
  359. WiaPreviewControl_GetSelExtent( m_hWndPreview, 0, 0, &sizeExtent );
  360. strTitle.Format( TEXT("Enter Extent - Current Res: (%d,%d):"), m_sizeResolution.cx, m_sizeResolution.cy );
  361. CGetXYDlg::CData data;
  362. data.Title(strTitle);
  363. data.X( sizeExtent.cx );
  364. data.Y( sizeExtent.cy );
  365. INT_PTR nResult = DialogBoxParam( g_hInstance, MAKEINTRESOURCE(IDD_GETXYDLG), m_hWnd, CGetXYDlg::DialogProc, reinterpret_cast<LPARAM>(&data) );
  366. if (IDOK == nResult)
  367. {
  368. sizeExtent.cx = data.X();
  369. sizeExtent.cy = data.Y();
  370. WiaPreviewControl_SetResolution( m_hWndPreview, &m_sizeResolution );
  371. WiaPreviewControl_SetSelExtent( m_hWndPreview, 0, 0, &sizeExtent );
  372. }
  373. }
  374. void OnSetProgress( WPARAM, LPARAM )
  375. {
  376. WiaPreviewControl_SetProgress(m_hWndPreview,!WiaPreviewControl_GetProgress(m_hWndPreview));
  377. }
  378. LRESULT OnCommand( WPARAM wParam, LPARAM lParam )
  379. {
  380. SC_BEGIN_COMMAND_HANDLERS()
  381. {
  382. SC_HANDLE_COMMAND( IDC_PREVIEW, OnPreviewSelChange );
  383. SC_HANDLE_COMMAND( IDCANCEL, OnCancel );
  384. SC_HANDLE_COMMAND( IDC_BW, OnBitmapChange );
  385. SC_HANDLE_COMMAND( IDC_GRAY, OnBitmapChange );
  386. SC_HANDLE_COMMAND( IDC_COLOR, OnBitmapChange );
  387. SC_HANDLE_COMMAND( IDC_NOIMAGE, OnBitmapChange );
  388. SC_HANDLE_COMMAND( IDC_DISABLED, OnDisabled );
  389. SC_HANDLE_COMMAND( IDC_ROUNDHANDLES, OnHandleStyle );
  390. SC_HANDLE_COMMAND( IDC_HOLLOWHANDLE, OnHandleStyle );
  391. SC_HANDLE_COMMAND( IDC_PREVIEWMODE, OnPreviewMode );
  392. SC_HANDLE_COMMAND( IDC_NULLSELECTION, OnNullSelection );
  393. SC_HANDLE_COMMAND( IDC_DISABLESELECTION, OnDisableSelection );
  394. SC_HANDLE_COMMAND( IDC_INNERCOLOR, OnInnerColor );
  395. SC_HANDLE_COMMAND( IDC_OUTERCOLOR, OnOuterColor );
  396. SC_HANDLE_COMMAND( IDC_SOLIDSELECTION, OnSolidSelection );
  397. SC_HANDLE_COMMAND( IDC_DOUBLEWIDTH, OnSolidSelection );
  398. SC_HANDLE_COMMAND( IDC_SELECTEDBORDERCOLOR, OnSelectedBorderColor );
  399. SC_HANDLE_COMMAND( IDC_UNSELECTEDBORDERCOLOR, OnUnselectedBorderColor );
  400. SC_HANDLE_COMMAND( IDC_DISABLEBORDERCOLOR, OnDisableBorderColor );
  401. SC_HANDLE_COMMAND( IDC_SELECTEDHANDLECOLOR, OnSelectedHandleColor );
  402. SC_HANDLE_COMMAND( IDC_UNSELECTEDHANDLECOLOR, OnUnselectedHandleColor );
  403. SC_HANDLE_COMMAND( IDC_DISABLEHANDLECOLOR, OnDisableHandleColor );
  404. SC_HANDLE_COMMAND( IDC_SETORIGIN, OnSetOrigin );
  405. SC_HANDLE_COMMAND( IDC_SETEXTENT, OnSetExtent );
  406. SC_HANDLE_COMMAND( IDC_SETPROGRESS, OnSetProgress );
  407. }
  408. SC_END_COMMAND_HANDLERS();
  409. }
  410. LRESULT OnEnterSizeMove( WPARAM, LPARAM )
  411. {
  412. SendDlgItemMessage( m_hWnd, IDC_PREVIEW, WM_ENTERSIZEMOVE, 0, 0 );
  413. return 0;
  414. }
  415. LRESULT OnExitSizeMove( WPARAM, LPARAM )
  416. {
  417. SendDlgItemMessage( m_hWnd, IDC_PREVIEW, WM_EXITSIZEMOVE, 0, 0 );
  418. return 0;
  419. }
  420. static INT_PTR CALLBACK DialogProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
  421. {
  422. SC_BEGIN_DIALOG_MESSAGE_HANDLERS(CPreviewDlg)
  423. {
  424. SC_HANDLE_DIALOG_MESSAGE( WM_INITDIALOG, OnInitDialog );
  425. SC_HANDLE_DIALOG_MESSAGE( WM_COMMAND, OnCommand );
  426. SC_HANDLE_DIALOG_MESSAGE( WM_SIZE, OnSize );
  427. SC_HANDLE_DIALOG_MESSAGE( WM_HSCROLL, OnScroll );
  428. SC_HANDLE_DIALOG_MESSAGE( WM_ENTERSIZEMOVE, OnEnterSizeMove );
  429. SC_HANDLE_DIALOG_MESSAGE( WM_EXITSIZEMOVE, OnExitSizeMove );
  430. }
  431. SC_END_DIALOG_MESSAGE_HANDLERS();
  432. }
  433. };
  434. int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int )
  435. {
  436. WIA_DEBUG_CREATE( hInstance );
  437. g_hInstance = hInstance;
  438. SHFusionInitialize(NULL);
  439. InitCommonControls();
  440. RegisterWiaPreviewClasses( g_hInstance );
  441. if (-1==DialogBoxParam( hInstance, MAKEINTRESOURCE(IDD_TESTDLG), NULL, CPreviewDlg::DialogProc, NULL ))
  442. {
  443. DWORD dwError = GetLastError();
  444. }
  445. SHFusionUninitialize();
  446. WIA_DEBUG_DESTROY();
  447. return 0;
  448. }