如何在windows mobile 2003 中使用SHCameraCapture函数?
------解决方案--------------------
不支持
------解决方案--------------------
楼主用下面这种办法试试看行不:
在相应的头文件中包含下列代码:
#paragram once
#include <aygshell.h>
//////////////////////////////////////////////////////////////////////////////
//
// Flags for camera capture UI
typedef enum {
CAMERACAPTURE_MODE_STILL = 0,
CAMERACAPTURE_MODE_VIDEOONLY,
CAMERACAPTURE_MODE_VIDEOWITHAUDIO,
} CAMERACAPTURE_MODE;
typedef enum {
CAMERACAPTURE_STILLQUALITY_DEFAULT = 0,
CAMERACAPTURE_STILLQUALITY_LOW,
CAMERACAPTURE_STILLQUALITY_NORMAL,
CAMERACAPTURE_STILLQUALITY_HIGH,
} CAMERACAPTURE_STILLQUALITY;
typedef enum {
CAMERACAPTURE_VIDEOTYPE_ALL = 0xFFFF,
CAMERACAPTURE_VIDEOTYPE_STANDARD = 1,
CAMERACAPTURE_VIDEOTYPE_MESSAGING = 2,
} CAMERACAPTURE_VIDEOTYPES;
typedef struct tagSHCAMERACAPTURE
{
DWORD cbSize;
HWND hwndOwner;
TCHAR szFile[MAX_PATH];
LPCTSTR pszInitialDir;
LPCTSTR pszDefaultFileName;
LPCTSTR pszTitle;
CAMERACAPTURE_STILLQUALITY StillQuality;
CAMERACAPTURE_VIDEOTYPES VideoTypes;
DWORD nResolutionWidth;
DWORD nResolutionHeight;
DWORD nVideoTimeLimit;
CAMERACAPTURE_MODE Mode;
} SHCAMERACAPTURE, *PSHCAMERACAPTURE;
HRESULT SHCameraCapture(PSHCAMERACAPTURE pshcc);
typedef HRESULT (*fnSHCameraCapture)(PSHCAMERACAPTURE pshcc);
HRESULT SHCameraCapture(PSHCAMERACAPTURE pshcc)
{
HRESULT hr = S_OK;
HINSTANCE hAygShell = LoadLibrary(TEXT( "aygshell.dll "));
fnSHCameraCapture funcSHCameraCapture = NULL;
if (!hAygShell) {
hr = HRESULT_FROM_WIN32(GetLastError());
goto FuncExit;
}
funcSHCameraCapture = (fnSHCameraCapture)GetProcAddress(hAygShell, TEXT( "SHCameraCapture "));
if (!funcSHCameraCapture) {
hr = HRESULT_FROM_WIN32(GetLastError());
goto FuncExit;
}
// call the API now
hr = funcSHCameraCapture(pshcc);
FuncExit:
if (hAygShell) {
FreeLibrary(hAygShell);
}
return hr;
}
我也是在网络上看到一个解决方法
具体来自:
http://windowsmobilepro.blogspot.com/2006/04/how-to-use-new-camera-api-in-windows.html