Click here to Skip to main content
15,889,578 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
Hi,

Yes, I am doubtful if I can use here Msgwaitformultipleobjects or not....
I wasn't able to implement this:

pTouch->Recalibrate();
HWND hWnd = FindWindow(...);
DWORD RecalProcID;
DWORD RecalThreadID = GetWindowThreadProcessId( hWnd, &ProcID );
DWORD MyProcID = GetCurrentProcessId();
DWORD MyThreadID = GetCurrentThreadId();
HANDLE hRecalThread = OpenThread( SYNCHRONIZE, FALSE, RecalThreadID );

This is giving me errors for OpenThread.
I am sending you my code again and please let me know how to proceed further to detect that calibration window.

Here's the code:


// TSCalibrate.cpp : Defines the entry point for the application.
//
#include "stdafx.h"

#include "CWin32AbsPointAPI.h"

void main ()
{
}

int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)

{
CTouchScreenAPI* pTouch;
HWND hCalWin;
DWORD SYNCRONIZE;
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);
GetWindowThreadProcessId(hCalWin, &procId); // retrieves the identifier of the thread that created this window.
hProcess = OpenProcess(SYNCHRONIZE, FALSE, procId);//returns a handle to an existing process object

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




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

while (PeekMessage(&xMsg, NULL, 0, 0, PM_REMOVE))
{

if (xMsg.message == WM_QUIT)
return 1;

TranslateMessage(&xMsg);
DispatchMessage(&xMsg);
}// end of PeekMessage while loop.

}
else if (dwWaitResult == WAIT_TIMEOUT)
{
SendMessage(hCalWin, WM_CLOSE, 0, 0);
//TerminateProcess(hProcess, 0);
break;
}
else dwWaitResult == WAIT_OBJECT_0;
{
//Calibration process completed;
break;
}
}

}
else
{
MessageBox(NULL, "Unable to get pointer to Touchscreen interface", "Info", MB_OK);
}


return 0;
}



Thanks
Wating for reply

Thanks Once again
I don't know if I can attach files to this email...otherwise I would have send you all the files to check....I am confused. PLease help.







Preeti9
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 
GeneralRe: problem in CFtpConnection::OpenFile() Pin
Anonymous3-Aug-05 12:13
Anonymous3-Aug-05 12:13 
Generalremoving spaces in string Pin
Anonymous3-Aug-05 7:39
Anonymous3-Aug-05 7:39 
GeneralRe: removing spaces in string Pin
David Crow3-Aug-05 7:52
David Crow3-Aug-05 7:52 
GeneralRe: removing spaces in string Pin
Anonymous3-Aug-05 12:15
Anonymous3-Aug-05 12:15 
GeneralRe: removing spaces in string Pin
Jose Lamas Rios3-Aug-05 19:06
Jose Lamas Rios3-Aug-05 19:06 
GeneralRe: removing spaces in string Pin
David Crow7-Aug-05 8:15
David Crow7-Aug-05 8:15 
General,remove spaces in a string Pin
Anonymous3-Aug-05 7:38
Anonymous3-Aug-05 7:38 
GeneralRe: ,remove spaces in a string Pin
Chris Meech3-Aug-05 8:16
Chris Meech3-Aug-05 8:16 
GeneralSoapToolkit Pin
Ed K3-Aug-05 7:37
Ed K3-Aug-05 7:37 
GeneralRe: SoapToolkit Pin
basementman3-Aug-05 8:06
basementman3-Aug-05 8:06 
GeneralCCombo :( Pin
Smith#3-Aug-05 7:17
Smith#3-Aug-05 7:17 

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.