Click here to Skip to main content
15,921,990 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: firewall by-passing Pin
avi-wildthing15-Aug-05 15:53
avi-wildthing15-Aug-05 15:53 
GeneralRe: firewall by-passing Pin
ThatsAlok15-Aug-05 18:27
ThatsAlok15-Aug-05 18:27 
GeneralRe: firewall by-passing Pin
fat_boy19-Aug-05 4:42
fat_boy19-Aug-05 4:42 
GeneralHooking Pin
celllllllll15-Aug-05 6:27
celllllllll15-Aug-05 6:27 
GeneralRe: Hooking Pin
Rage15-Aug-05 6:51
professionalRage15-Aug-05 6:51 
GeneralRe: Hooking Pin
celllllllll15-Aug-05 11:16
celllllllll15-Aug-05 11:16 
GeneralRe: Hooking Pin
Rage15-Aug-05 20:34
professionalRage15-Aug-05 20:34 
GeneralRe: Hooking Pin
celllllllll16-Aug-05 7:15
celllllllll16-Aug-05 7:15 
Thanks for the reply...


What if I use IsWindow function and then use while loop and at the end give sleep of like 1/2 a second....
Here is my program:


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

// Create top window class
//WinClass wc(ID_MAIN, hInstance,MainWndProc);
//hCalWin = wc.GetRunningWindow ();

// Is there a running instance of this program?
if (hCalWin !=0)
{
if( IsWindow(hCalWin) )
GetWindow(hCalWin, nCmdShow ); // handle of original window // relationship flag
//hCalWin->ShowWindow(SW_SHOW);

ShowWindow (hCalWin, SW_RESTORE);
while (1)
{
Sleep (1000);
}

return 0;
}

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.

int i=1;
while (i<10000)
{
i=i++;
}
}
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;

}





Help
Thanks

Preeti9
GeneralRe: Hooking Pin
celllllllll15-Aug-05 11:32
celllllllll15-Aug-05 11:32 
GeneralUninitialized pointer Pin
valerie9915-Aug-05 5:58
valerie9915-Aug-05 5:58 
GeneralRe: Uninitialized pointer Pin
David Crow15-Aug-05 6:27
David Crow15-Aug-05 6:27 
GeneralRe: Uninitialized pointer Pin
valerie9915-Aug-05 6:40
valerie9915-Aug-05 6:40 
GeneralRe: Uninitialized pointer Pin
Maximilien15-Aug-05 7:12
Maximilien15-Aug-05 7:12 
GeneralRe: Uninitialized pointer Pin
Rage15-Aug-05 7:03
professionalRage15-Aug-05 7:03 
GeneralRe: Uninitialized pointer Pin
Maximilien15-Aug-05 7:06
Maximilien15-Aug-05 7:06 
GeneralRe: Uninitialized pointer Pin
Jose Lamas Rios15-Aug-05 9:49
Jose Lamas Rios15-Aug-05 9:49 
GeneralRe: Uninitialized pointer Pin
valerie9915-Aug-05 11:09
valerie9915-Aug-05 11:09 
GeneralAfxIsValidString does not seem to work. Pin
mcgahanfl15-Aug-05 5:56
mcgahanfl15-Aug-05 5:56 
GeneralRe: AfxIsValidString does not seem to work. Pin
David Crow15-Aug-05 6:30
David Crow15-Aug-05 6:30 
GeneralRe: AfxIsValidString does not seem to work. Pin
Rage15-Aug-05 7:12
professionalRage15-Aug-05 7:12 
GeneralRe: AfxIsValidString does not seem to work. Pin
David Crow15-Aug-05 7:32
David Crow15-Aug-05 7:32 
GeneralRe: AfxIsValidString does not seem to work. Pin
mcgahanfl15-Aug-05 7:51
mcgahanfl15-Aug-05 7:51 
GeneralRe: AfxIsValidString does not seem to work. Pin
mcgahanfl15-Aug-05 7:53
mcgahanfl15-Aug-05 7:53 
GeneralRe: AfxIsValidString does not seem to work. Pin
Blake Miller15-Aug-05 10:14
Blake Miller15-Aug-05 10:14 
GeneralRe: AfxIsValidString does not seem to work. Pin
mcgahanfl15-Aug-05 10:24
mcgahanfl15-Aug-05 10:24 

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.