1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
// Quick && Dirty : globals
wchar_t little_buffer[128];
HWND app_window;
//---------------------------------------------------------------------------
BOOL CALLBACK find_window_java(HWND one_window, LPARAM)
{
UnicodeString window_text;
bool ret;
if ( GetWindowText(one_window, little_buffer, 128) > 0) {
window_text = little_buffer;
if (window_text == L"Java Application") {
app_window = one_window;
ret = false;
} else {
ret = true;
}
// main_form->memo_result->Lines->Add(window_text);
} else {
ret = true;
// main_form->memo_result->Lines->Add(L"????");
}
return ret;
}
//---------------------------------------------------------------------------
BOOL CALLBACK find_window_java_pid(HWND one_window, LPARAM pid)
{
DWORD window_pid;
bool ret;
/**/ GetWindowThreadProcessId(one_window, &window_pid);
if (window_pid == (DWORD) pid) {
app_window = one_window;
ret = false;
} else {
ret = true;
}
// main_form->memo_result->Lines->Add(IntToStr((int) window_pid));
return ret;
}
//---------------------------------------------------------------------------
BOOL CALLBACK find_edits(HWND one_child, LPARAM has_verbose)
{
UnicodeString child_str, child_class;
if (has_verbose == 1) {
if ( GetWindowText(one_child, little_buffer, 128) > 0) {
child_str = little_buffer;
} else {
child_str = L"???";
}
}
if ( GetClassName(one_child, little_buffer, 128) > 0) {
child_class = little_buffer;
if (child_class == L"TEdit") {
if (main_form->radio_button_show->Checked) {
SendMessage(one_child, EM_SETPASSWORDCHAR, L'\0', 0);
} else {
SendMessage(one_child, EM_SETPASSWORDCHAR, L'●', 0);
}
}
} else {
child_class = L"???";
}
child_str = (child_str + L" - " + child_class);
// if (has_verbose == 1) { main_form->memo_result->Lines->Add(child_str); }
return true;
}
//--------------------------------------------------------------------------- |
Partager