Click here to Skip to main content
15,898,732 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: List of files in a directory Pin
sunit52-Sep-05 0:56
sunit52-Sep-05 0:56 
QuestionProblem automating IE MSHTML SELECT Element Pin
SureshMahanty1-Sep-05 8:27
SureshMahanty1-Sep-05 8:27 
AnswerRe: Problem automating IE MSHTML SELECT Element Pin
Jose Lamas Rios1-Sep-05 15:46
Jose Lamas Rios1-Sep-05 15:46 
GeneralRe: Problem automating IE MSHTML SELECT Element Pin
SureshMahanty1-Sep-05 19:16
SureshMahanty1-Sep-05 19:16 
GeneralRe: Problem automating IE MSHTML SELECT Element Pin
Jose Lamas Rios2-Sep-05 3:31
Jose Lamas Rios2-Sep-05 3:31 
GeneralRe: Problem automating IE MSHTML SELECT Element Pin
SureshMahanty2-Sep-05 9:42
SureshMahanty2-Sep-05 9:42 
QuestionSafely closing a process Pin
srev1-Sep-05 6:09
srev1-Sep-05 6:09 
AnswerRe: Safely closing a process Pin
bugDanny1-Sep-05 9:51
bugDanny1-Sep-05 9:51 
Try using EnumWindows. Look it up on MSDN. EnumWindows will look at every windows handle for you, and then you just need a way of telling which window you want!

You need to write a function that EnumWindows will call. In this function use GetWindowText or GetClassName. Then compare each window with the text or class name you know you're looking for. How do you know what the text or class name for the window is? The text is easy. That's what's displayed in the bar at the very top of the window. The class name is better, if the program you're targeting has a stable class name. To find the class name of the window you want to target use Spy++. Be careful, though, because a program can have several windows and several class names for the windows. You just have to make sure to get the class name of the parent.

This method works great! I've used it myself. You have to be careful, though, because not all programs will let you close them safely. Internet Explorer or Windows Explorer (I think they're virtually the same thing) won't close if you send them the WM_CLOSE message. But hey, if you can find a way to safely close them, I'd like to know too!

Danny
AnswerRe: Safely closing a process Pin
ThatsAlok2-Sep-05 20:50
ThatsAlok2-Sep-05 20:50 
QuestionDCOM vs CORBA for distributed computing? Pin
Nemanja Trifunovic1-Sep-05 6:02
Nemanja Trifunovic1-Sep-05 6:02 
AnswerRe: DCOM vs CORBA for distributed computing? Pin
Zdeslav Vojkovic1-Sep-05 7:41
Zdeslav Vojkovic1-Sep-05 7:41 
GeneralRe: DCOM vs CORBA for distributed computing? Pin
Nemanja Trifunovic1-Sep-05 7:47
Nemanja Trifunovic1-Sep-05 7:47 
AnswerRe: DCOM vs CORBA for distributed computing? Pin
Roland Pibinger1-Sep-05 12:53
Roland Pibinger1-Sep-05 12:53 
GeneralRe: DCOM vs CORBA for distributed computing? Pin
Nemanja Trifunovic1-Sep-05 15:32
Nemanja Trifunovic1-Sep-05 15:32 
AnswerRe: DCOM vs CORBA for distributed computing? Pin
Bob Stanneveld1-Sep-05 19:33
Bob Stanneveld1-Sep-05 19:33 
QuestionTitle bar( caption bar) whith menu Pin
Neagoe Gabriel1-Sep-05 4:51
Neagoe Gabriel1-Sep-05 4:51 
Question#define syntax for create a class instance Pin
hyling1-Sep-05 4:19
hyling1-Sep-05 4:19 
AnswerRe: #define syntax for create a class instance Pin
toxcct1-Sep-05 4:36
toxcct1-Sep-05 4:36 
GeneralRe: #define syntax for create a class instance Pin
hyling1-Sep-05 6:42
hyling1-Sep-05 6:42 
AnswerRe: #define syntax for create a class instance Pin
Neagoe Gabriel1-Sep-05 4:53
Neagoe Gabriel1-Sep-05 4:53 
GeneralRe: #define syntax for create a class instance Pin
hyling1-Sep-05 6:44
hyling1-Sep-05 6:44 
GeneralRe: #define syntax for create a class instance Pin
Anonymous1-Sep-05 7:50
Anonymous1-Sep-05 7:50 
GeneralRe: #define syntax for create a class instance Pin
hyling2-Sep-05 7:32
hyling2-Sep-05 7:32 
QuestionControl's Coordinates Pin
Anonymous1-Sep-05 3:32
Anonymous1-Sep-05 3:32 
AnswerRe: Control's Coordinates Pin
toxcct1-Sep-05 3:37
toxcct1-Sep-05 3:37 

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.