Click here to Skip to main content
16,005,037 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalhelp....... Pin
nivsah28-Sep-04 17:54
nivsah28-Sep-04 17:54 
GeneralRe: help....... Pin
Ravi Bhavnani28-Sep-04 18:32
professionalRavi Bhavnani28-Sep-04 18:32 
GeneralRe: help....... Pin
Ryan Binns28-Sep-04 18:51
Ryan Binns28-Sep-04 18:51 
QuestionHow to start a file's application in C++ Pin
Anonymous28-Sep-04 14:59
Anonymous28-Sep-04 14:59 
AnswerRe: How to start a file's application in C++ Pin
Scott H. Settlemier28-Sep-04 15:03
Scott H. Settlemier28-Sep-04 15:03 
AnswerRe: How to start a file's application in C++ Pin
Sujan Christo28-Sep-04 18:51
Sujan Christo28-Sep-04 18:51 
GeneralRe: How to start a file's application in C++ Pin
Anonymous1-Oct-04 12:00
Anonymous1-Oct-04 12:00 
GeneralEnumWindows Pin
dsubrama28-Sep-04 14:49
dsubrama28-Sep-04 14:49 
Hi all,

I am relatively new to api programming.I am trying to automate a process and am using EnumWindows to get all window handles. I am then using GetWindowText and strcmp to check which of the window handles corresponds to the relevent window. However it doesnt seem to work i.e., it doesnt simulate the push of the button....
I have pasted the code snippet below.. Any suggestions on how to resolve this will be terrific.
In the main program i have

EnumWindows((WNDENUMPROC) WinCallback, 0);

My function is:

BOOL CALLBACK WinCallback(HWND win, LPARAM nadda)
{
char temp[512];
GetWindowText(win, temp, 512);
printf("%s",temp);
if(!strcmp(temp,"RBNal_Optocomm"))
{
HWND hcomm = FindWindowEx((HWND) win,NULL,"BUTTON","COM 1");
LRESULT lResult2;
lResult2 = SendMessage((HWND) hcomm,(UINT) BM_CLICK,0,0);
return FALSE;
}
}

Please let me know of any suggestions.

D
GeneralRe: EnumWindows Pin
Jose Cezar S. Ynion28-Sep-04 17:02
Jose Cezar S. Ynion28-Sep-04 17:02 
GeneralRe: EnumWindows Pin
dsubrama29-Sep-04 7:19
dsubrama29-Sep-04 7:19 
GeneralRe: EnumWindows Pin
Jose Cezar S. Ynion29-Sep-04 16:58
Jose Cezar S. Ynion29-Sep-04 16:58 
GeneralRe: EnumWindows Pin
dsubrama30-Sep-04 17:55
dsubrama30-Sep-04 17:55 
GeneralSome views or ideas required.... Pin
Kiran Satish28-Sep-04 13:31
Kiran Satish28-Sep-04 13:31 
GeneralRe: Some views or ideas required.... Pin
Christian Graus28-Sep-04 14:17
protectorChristian Graus28-Sep-04 14:17 
GeneralRe: Some views or ideas required.... Pin
Scott H. Settlemier28-Sep-04 14:38
Scott H. Settlemier28-Sep-04 14:38 
GeneralRe: Some views or ideas required.... Pin
Kiran Satish29-Sep-04 10:17
Kiran Satish29-Sep-04 10:17 
GeneralClass Member Object Inheritance Pin
Hyland Computer Systems28-Sep-04 13:19
Hyland Computer Systems28-Sep-04 13:19 
QuestionHow to start another application and run it within another application Pin
Kiran Satish28-Sep-04 13:05
Kiran Satish28-Sep-04 13:05 
AnswerRe: How to start another application and run it within another application Pin
valikac28-Sep-04 16:14
valikac28-Sep-04 16:14 
GeneralRe: How to start another application and run it within another application Pin
Kiran Satish28-Sep-04 17:03
Kiran Satish28-Sep-04 17:03 
AnswerRe: How to start another application and run it within another application Pin
Sujan Christo28-Sep-04 18:57
Sujan Christo28-Sep-04 18:57 
GeneralRe: How to start another application and run it within another application Pin
Kiran Satish28-Sep-04 19:03
Kiran Satish28-Sep-04 19:03 
GeneralRe: How to start another application and run it within another application Pin
Sujan Christo28-Sep-04 19:29
Sujan Christo28-Sep-04 19:29 
AnswerRe: How to start another application and run it within another application Pin
Muhammad Azam29-Sep-04 1:42
Muhammad Azam29-Sep-04 1:42 
GeneralRe: How to start another application and run it within another application Pin
Kiran Satish29-Sep-04 11:00
Kiran Satish29-Sep-04 11:00 

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.