Click here to Skip to main content
16,007,472 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Show bitmap on Button Pin
Ravi Bhavnani8-Aug-05 9:47
professionalRavi Bhavnani8-Aug-05 9:47 
GeneralRe: Show bitmap on Button Pin
ThatsAlok8-Aug-05 18:32
ThatsAlok8-Aug-05 18:32 
GeneralWM_PAINT wackienss Pin
Peter Weyzen8-Aug-05 8:19
Peter Weyzen8-Aug-05 8:19 
GeneralRe: WM_PAINT wackienss Pin
Jose Lamas Rios8-Aug-05 8:24
Jose Lamas Rios8-Aug-05 8:24 
GeneralRe: WM_PAINT wackienss Pin
Peter Weyzen8-Aug-05 8:31
Peter Weyzen8-Aug-05 8:31 
Generaldetecting a window in win32 Pin
celllllllll8-Aug-05 6:17
celllllllll8-Aug-05 6:17 
GeneralRe: detecting a window in win32 Pin
BlackDice8-Aug-05 6:26
BlackDice8-Aug-05 6:26 
GeneralRe: detecting a window in win32 Pin
celllllllll8-Aug-05 7:13
celllllllll8-Aug-05 7:13 
Thanks for replying...

Here's my 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();
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



/* SetForegroundWindow(hCalWin);
DWORD AllowSetForegroundWindow(procId);
if (AnyPopup())
{
DisplayWindow(hCalWin);
}
//AnyPopup();


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;
}





This program is running calibration of a machine.
When I run this on command window, it does the calibration and the cursor in command window moves to the next line showing that calibration is done without detection.
I want to detect that window.

Please help
THanks

Preeti9
GeneralRe: detecting a window in win32 Pin
David Crow8-Aug-05 8:07
David Crow8-Aug-05 8:07 
GeneralRe: detecting a window in win32 Pin
celllllllll8-Aug-05 11:29
celllllllll8-Aug-05 11:29 
GeneralRe: detecting a window in win32 Pin
ThatsAlok8-Aug-05 18:18
ThatsAlok8-Aug-05 18:18 
GeneralRe: detecting a window in win32 Pin
David Crow9-Aug-05 2:27
David Crow9-Aug-05 2:27 
GeneralHiding ScrollBars Pin
raybert8-Aug-05 5:40
raybert8-Aug-05 5:40 
GeneralRe: Hiding ScrollBars Pin
Jose Lamas Rios8-Aug-05 6:41
Jose Lamas Rios8-Aug-05 6:41 
GeneralRe: Hiding ScrollBars Pin
raybert8-Aug-05 8:04
raybert8-Aug-05 8:04 
GeneralRe: Hiding ScrollBars Pin
Jose Lamas Rios8-Aug-05 8:17
Jose Lamas Rios8-Aug-05 8:17 
GeneralD3DXCreateTextureFromFile and CBitmap Pin
akira328-Aug-05 4:58
akira328-Aug-05 4:58 
GeneralOleControl crashes i.e. on shutdown Pin
Ed Deighton8-Aug-05 4:45
Ed Deighton8-Aug-05 4:45 
GeneralEmbedding the Player Control in an MFC Project Pin
c+-8-Aug-05 3:56
c+-8-Aug-05 3:56 
GeneralRe: Embedding the Player Control in an MFC Project Pin
Marc Soleda8-Aug-05 5:39
Marc Soleda8-Aug-05 5:39 
GeneralRe: Embedding the Player Control in an MFC Project Pin
Marc Soleda8-Aug-05 7:48
Marc Soleda8-Aug-05 7:48 
GeneralRe: Embedding the Player Control in an MFC Project Pin
c+-8-Aug-05 17:53
c+-8-Aug-05 17:53 
GeneralRe: Embedding the Player Control in an MFC Project Pin
Marc Soleda8-Aug-05 19:23
Marc Soleda8-Aug-05 19:23 
GeneralStringFromCLSID Pin
Alexander M.,8-Aug-05 3:29
Alexander M.,8-Aug-05 3:29 
GeneralRe: StringFromCLSID Pin
Tim Smith8-Aug-05 3:58
Tim Smith8-Aug-05 3:58 

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.