36#define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), s)
43BOOL CALLBACK zingers_enum_proc(
window_handle hwnd, LPARAM lParam)
45 const int MAX_TITLE = 1024;
47 int chars = GetWindowText(hwnd, win_name, MAX_TITLE - 1);
50 if (
astring(from_unicode_temp(win_name)).ifind(window_name_sought) >= 0) {
51 matching_window = hwnd;
58int main(
int argc,
char *argv[])
62 if ( (cmds.entries() < 1)
64 out.
log(cmds.program_name().basename().raw() +
" usage:\n"
65 "this takes a single parameter, which is the name of a window\n"
66 "that is expected to be present in the current winstation. if the\n"
67 "window is found, its window handle is displayed.");
72 window_name_sought = title;
74 EnumWindows(zingers_enum_proc, 0);
75 if (!matching_window) {
76 out.
log(
"no matching window could be found. ignoring request.");
82 out.
log(
a_sprintf(
"window handle is 0x%lx (or %ld) for ", matching_window,
83 matching_window) + title +
".");
85 out.
log(
astring(
"no window found for ") + title +
".");
91int main(
int argc,
char *argv[])
97#ifdef __BUILD_STATIC_APPLICATION__
a_sprintf is a specialization of astring that provides printf style support.
Provides a dynamically resizable ASCII character string.
virtual char get(int index) const
a constant peek at the string's internals at the specified index.
virtual basis::outcome log(const basis::base_string &info, int filter)
sends the string "info" to the standard output device.
#define NULL_POINTER
The value representing a pointer to nothing.
int main(int argc, char *argv[])
Implements an application lock to ensure only one is running at once.
The guards collection helps in testing preconditions and reporting errors.
A platform independent way to obtain the timestamp of a file.
A logger that sends to the console screen using the standard output device.
A dynamic container class that holds any kind of object via pointers.
Support for unicode builds.
Aids in achievement of platform independence.