Click here to Skip to main content
15,902,635 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to design a 2D Map designer in a worskpace MDI application Pin
Blake Miller3-Aug-05 10:26
Blake Miller3-Aug-05 10:26 
AnswerRe: How to design a 2D Map designer in a worskpace MDI application Pin
Graham Bradshaw3-Aug-05 13:00
Graham Bradshaw3-Aug-05 13:00 
Generalpls help: Access Violation Pin
valerie993-Aug-05 9:14
valerie993-Aug-05 9:14 
GeneralRe: pls help: Access Violation Pin
David Crow3-Aug-05 10:18
David Crow3-Aug-05 10:18 
GeneralRe: pls help: Access Violation Pin
valerie993-Aug-05 10:40
valerie993-Aug-05 10:40 
GeneralRe: pls help: Access Violation Pin
Blake Miller3-Aug-05 10:28
Blake Miller3-Aug-05 10:28 
GeneralRe: pls help: Access Violation Pin
valerie993-Aug-05 10:53
valerie993-Aug-05 10:53 
GeneralRe: pls help: Access Violation Pin
valerie993-Aug-05 12:48
valerie993-Aug-05 12:48 
GeneralCalibration in ATM machines Pin
celllllllll3-Aug-05 7:52
celllllllll3-Aug-05 7:52 
GeneralRe: Calibration in ATM machines Pin
Maximilien3-Aug-05 8:15
Maximilien3-Aug-05 8:15 
GeneralRe: Calibration in ATM machines Pin
celllllllll3-Aug-05 8:23
celllllllll3-Aug-05 8:23 
GeneralRe: Calibration in ATM machines Pin
GKarRacer3-Aug-05 8:36
GKarRacer3-Aug-05 8:36 
GeneralRe: Calibration in ATM machines Pin
celllllllll3-Aug-05 12:16
celllllllll3-Aug-05 12:16 
GeneralRe: Calibration in ATM machines Pin
GKarRacer3-Aug-05 13:18
GKarRacer3-Aug-05 13:18 
GeneralRe: Calibration in ATM machines Pin
celllllllll3-Aug-05 14:00
celllllllll3-Aug-05 14:00 
Thanks for your help...
I don't know but if I use here IsWindow, I am getting the same result as I was getting it earlier.

I am sending you my code ....have a look and let me know is this correct to detect the calibration , I mean when that window closes.

Here's the code:

{
CTouchScreenAPI* pTouch;
HWND hCalWin;
DWORD procId;
HANDLE hProcess;
DWORD dwWaitResult;

pTouch = CTouchScreenAPI::Create();
if (pTouch)
{
if (pTouch->Init())
pTouch->Recalibrate(FALSE);
else
MessageBox(NULL, "Created touchscreen interface OK, but Init() failed", "Info", MB_OK);

HWND hCalWin = ::FindWindow(pszABSPOINT_WND_CLASS_NAME, NULL);

while( true )
{
if( ! IsWindow(hCalWin) )
break; // window is gone;
Sleep(1000); // wait a second for window to close
};

GetWindowThreadProcessId(hCalWin, &procId);
hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, procId);

while (1)
{
dwWaitResult = MsgWaitForMultipleObjects(1, &hProcess, FALSE, 30*1000, QS_PAINT);
if (dwWaitResult == WAIT_OBJECT_0 + 1)
{
MSG xMsg;

while (PeekMessage(&xMsg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&xMsg);
DispatchMessage(&xMsg);
}
}
else if (dwWaitResult == WAIT_TIMEOUT)
{
SendMessage(hCalWin, WM_CLOSE, 0, 0);
TerminateProcess(hProcess, 0);
break;
}
else dwWaitResult == WAIT_OBJECT_0;
{
//Calibration process completed;
break;
}
}



Thanks
Preeti

Preeti9
GeneralRe: Calibration in ATM machines Pin
GKarRacer4-Aug-05 6:16
GKarRacer4-Aug-05 6:16 
GeneralRe: Calibration in ATM machines Pin
celllllllll4-Aug-05 8:32
celllllllll4-Aug-05 8:32 
GeneralRe: Calibration in ATM machines Pin
GKarRacer4-Aug-05 9:03
GKarRacer4-Aug-05 9:03 
GeneralRe: Calibration in ATM machines Pin
celllllllll4-Aug-05 11:15
celllllllll4-Aug-05 11:15 
GeneralRe: Calibration in ATM machines Pin
GKarRacer4-Aug-05 11:42
GKarRacer4-Aug-05 11:42 
GeneralRe: Calibration in ATM machines Pin
celllllllll4-Aug-05 12:13
celllllllll4-Aug-05 12:13 
GeneralRe: Calibration in ATM machines Pin
celllllllll5-Aug-05 5:58
celllllllll5-Aug-05 5:58 
GeneralRe: Calibration in ATM machines Pin
GKarRacer5-Aug-05 10:11
GKarRacer5-Aug-05 10:11 
GeneralRe: Calibration in ATM machines Pin
celllllllll5-Aug-05 11:53
celllllllll5-Aug-05 11:53 
Generalproblem in CFtpConnection::OpenFile() Pin
Aditya Rao3-Aug-05 7:47
Aditya Rao3-Aug-05 7:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.