PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
How to close Camera app after opening it using CameraCaptureDialog
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
How to close Camera app after opening it using CameraCaptureDialog
![]() |
How to close Camera app after opening it using CameraCaptureDialog |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi,
I am using the following code from my VB.NET program to take a picture and save it to the database. Everything works fine, except when I close my program, the camera application is still open. Is there anyway to close this app from inside of VB after I'm done taking pics? Dim cameraDialog As New CameraCaptureDialog With cameraDialog .Owner = Me .Mode = CameraCaptureMode.Still .StillQuality = CameraCaptureStillQuality.Normal .Title = "Take a Picture" .DefaultFileName = strFileName .InitialDirectory = strDirectory End With 'code that saves the picture to the database and displays it in a list cameraDialog = Nothing Thanks, Heather |
|
|
|
#2 |
|
Guest
Posts: n/a
|
You could try sending the OK button to it as a key. OpenNETCF has a wrapper
for PostKeybdMessage that should do that. Not sure that this is the best/right way to do it, but I think that it will work. Paul T. "Heather B." <hbaker@pro-merchnospam.com> wrote in message news:c73b41a28c7140bbbcb44346425bd93d@ureader.com... > Hi, > > I am using the following code from my VB.NET program to take a picture and > save it to the database. Everything works fine, except when I close my > program, the camera application is still open. Is there anyway to close > this app from inside of VB after I'm done taking pics? > > Dim cameraDialog As New CameraCaptureDialog > > With cameraDialog > .Owner = Me > .Mode = CameraCaptureMode.Still > .StillQuality = CameraCaptureStillQuality.Normal > .Title = "Take a Picture" > .DefaultFileName = strFileName > .InitialDirectory = strDirectory > End With > > 'code that saves the picture to the database > and displays it in a list > > cameraDialog = Nothing > > Thanks, > Heather |
|
|
|
#3 |
|
Guest
Posts: n/a
|
I'd just like to know if a solution to this problem was ever identified. I
have run into the same issue in a C# app. If possible, I'd like a solution that does not involve OpenNETCF, since my app does not otherwise require it. Thank you, Matthew Fleming DermVision |
|
|
|
#4 |
|
Guest
Posts: n/a
|
"Paul G. Tobey [eMVP]" wrote: > You could try sending the OK button to it as a key. OpenNETCF has a wrapper > for PostKeybdMessage that should do that. > > Not sure that this is the best/right way to do it, but I think that it will > work. > > Paul T. I wasn't able to follow this advice, because I couldn't figure out how to press the "OK" button using PostKeybdMessage. There is a virtual key code for a mouse click, but how can we know the pointer is positioned over the button? Instead, here is what seems to work: extern "C" __declspec(dllexport) void closeCameraApp() { HWND cameraHandle = FindWindow(L"WCE_IA_Camera_Main", NULL); if (cameraHandle!=NULL) SendMessage(cameraHandle, WM_CLOSE, NULL, NULL); } This is called via PInvoke from managed code, of course. The "WCE_IA_Camera_Main" window class I got using Remote Spy. Hopefully it will work for CameraCaptureDialog running on any device, but I have only one device for testing, an HTC Apache. Regards, Matthew Fleming DermVision, LLC |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

