From 47b196174ebd0133ef2d8cee20218cfa893a2e1a Mon Sep 17 00:00:00 2001 From: "Fred T. Hamster" Date: Wed, 18 Feb 2026 16:53:50 -0500 Subject: [PATCH] upgraded to feisty, still working on compiling --- .../library/tests_processes/find_window.cpp | 87 ++++++++++--------- .../tests_processes/makefile.shutdowner | 9 +- ..._alerter.cpp => test_shutdown_alerter.cpp} | 16 ++-- .../library/tests_processes/zing_window.cpp | 78 ++++++++--------- 4 files changed, 99 insertions(+), 91 deletions(-) rename nucleus/library/tests_processes/{t_shutdown_alerter.cpp => test_shutdown_alerter.cpp} (82%) diff --git a/nucleus/library/tests_processes/find_window.cpp b/nucleus/library/tests_processes/find_window.cpp index b94df20c..3c5fc27b 100644 --- a/nucleus/library/tests_processes/find_window.cpp +++ b/nucleus/library/tests_processes/find_window.cpp @@ -17,19 +17,26 @@ * Please send any updates to: fred@gruntose.com * \*****************************************************************************/ -#include +#include +#include +#include #include -#include -#include -#include +#include #include -#include -#include +#include -HOOPLE_STARTUP_CODE; +using namespace application; +using namespace basis; +using namespace filesystem; +using namespace loggers; +using namespace structures; +//using namespace timely; -window_handle matching_window = NIL; -istring window_name_sought; +#undef LOG +#define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), s) + +window_handle matching_window = NULL_POINTER; +astring window_name_sought; BOOL CALLBACK zingers_enum_proc(window_handle hwnd, LPARAM lParam) { @@ -38,7 +45,7 @@ BOOL CALLBACK zingers_enum_proc(window_handle hwnd, LPARAM lParam) int chars = GetWindowText(hwnd, win_name, MAX_TITLE - 1); if (chars > 0) { // see if the current window matches what we're looking for. - if (istring(from_unicode_temp(win_name)).ifind(window_name_sought) >= 0) { + if (astring(from_unicode_temp(win_name)).ifind(window_name_sought) >= 0) { matching_window = hwnd; return false; // don't keep going. } @@ -58,8 +65,8 @@ int main(int argc, char *argv[]) "window is found, its window handle is displayed."); return 1; } - istring title = cmds.get(0).text(); - matching_window = NIL; // reset our match first. + astring title = cmds.get(0).text(); + matching_window = NULL_POINTER; // reset our match first. window_name_sought = title; // enumerate the windows looking for a match. EnumWindows(zingers_enum_proc, 0); @@ -70,10 +77,10 @@ int main(int argc, char *argv[]) //out.log("found matching window handle..."); if (matching_window) - out.log(isprintf("window handle is 0x%lx (or %ld) for ", matching_window, + out.log(a_sprintf("window handle is 0x%lx (or %ld) for ", matching_window, matching_window) + title + "."); else - out.log(istring("no window found for ") + title + "."); + out.log(astring("no window found for ") + title + "."); return 0; } @@ -82,54 +89,54 @@ int main(int argc, char *argv[]) #include #include #include - #include + #include #include #include #include - #include + #include #include #include #include - #include + #include #include #include #include #include - #include + #include #include #include #include #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include #include #include #include #include #include - #include - #include + #include + #include #include - #include - #include - #include + #include + #include + #include #include - #include - #include - #include + #include + #include + #include #include #include - #include + #include #endif // __BUILD_STATIC_APPLICATION__ diff --git a/nucleus/library/tests_processes/makefile.shutdowner b/nucleus/library/tests_processes/makefile.shutdowner index c937eda7..eba80213 100644 --- a/nucleus/library/tests_processes/makefile.shutdowner +++ b/nucleus/library/tests_processes/makefile.shutdowner @@ -2,11 +2,12 @@ CONSOLE_MODE = t include cpp/variables.def -PROJECT = t_shutdown_alerter +PROJECT = test_shutdown_alerter TYPE = test -TARGETS = t_shutdown_alerter.exe -LOCAL_LIBS_USED = basis i_library -RUN_TARGETS = +TARGETS = test_shutdown_alerter.exe +LOCAL_LIBS_USED = basis +##i_library +RUN_TARGETS = $(ACTUAL_TARGETS) include cpp/rules.def diff --git a/nucleus/library/tests_processes/t_shutdown_alerter.cpp b/nucleus/library/tests_processes/test_shutdown_alerter.cpp similarity index 82% rename from nucleus/library/tests_processes/t_shutdown_alerter.cpp rename to nucleus/library/tests_processes/test_shutdown_alerter.cpp index 05d6d291..d7c5b112 100644 --- a/nucleus/library/tests_processes/t_shutdown_alerter.cpp +++ b/nucleus/library/tests_processes/test_shutdown_alerter.cpp @@ -17,16 +17,16 @@ * Please send any updates to: fred@gruntose.com * \*****************************************************************************/ -#include -#include -#include -#include +#include + +#include +#include #include HOOPLE_STARTUP_CODE; -#define BASE_LOG(s) STAMPED_EMERGENCY_LOG(program_wide_logger(), s) -#define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger(), s) +#define BASE_LOG(s) STAMPED_EMERGENCY_LOG(program_wide_logger::get(), s) +#define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), s) const int TIMING_CYCLE = 1408; // how frequently timer should be hit. @@ -42,9 +42,9 @@ public: int main(int formal(argc), char *formal(argv)[]) { my_anchor w; - BASE_LOG(isprintf("timer will hit every %d ms.", TIMING_CYCLE)); + BASE_LOG(a_sprintf("timer will hit every %d ms.", TIMING_CYCLE)); shutdown_alerter::launch_console(w, - filename(portable::application_name()).basename(), TIMING_CYCLE); + filename(application_configuration::application_name()).basename(), TIMING_CYCLE); return 0; } diff --git a/nucleus/library/tests_processes/zing_window.cpp b/nucleus/library/tests_processes/zing_window.cpp index 592b4a2b..78fda90d 100644 --- a/nucleus/library/tests_processes/zing_window.cpp +++ b/nucleus/library/tests_processes/zing_window.cpp @@ -22,21 +22,21 @@ * Please send any updates to: fred@gruntose.com * \*****************************************************************************/ -#include +#include #include -#include -#include -#include +#include + +#include #include -#include -#include +#include +#include #include HOOPLE_STARTUP_CODE; -window_handle matching_window = NIL; -istring window_name_sought; +window_handle matching_window = NULL_POINTER; +astring window_name_sought; BOOL CALLBACK zingers_enum_proc(window_handle hwnd, LPARAM lParam) { @@ -45,7 +45,7 @@ BOOL CALLBACK zingers_enum_proc(window_handle hwnd, LPARAM lParam) int chars = GetWindowText(hwnd, win_name, MAX_TITLE - 1); if (chars > 0) { // see if the current window matches what we're looking for. - if (istring(from_unicode_temp(win_name)).ifind(window_name_sought) >= 0) { + if (astring(from_unicode_temp(win_name)).ifind(window_name_sought) >= 0) { matching_window = hwnd; return false; // don't keep going. } @@ -68,12 +68,12 @@ int main(int argc, char *argv[]) "message chosen, the window will behave in various different ways.\n" "If there are a third or fourth parameter, then these are taken as\n" "the extra data to send in the PostMessage call for zinging."); - out.log(isprintf("\nExample windows message values:\n\t" + out.log(a_sprintf("\nExample windows message values:\n\t" "WM_CLOSE = %d\n\tWM_PAINT = %d", WM_CLOSE, WM_PAINT)); return 1; } - istring junk_text = cmds.get(0).text(); + astring junk_text = cmds.get(0).text(); bool saw_hex_code = false; if (junk_text.begins("0x")) { // we have a hex code. we will key off of that, which assumes that there @@ -106,7 +106,7 @@ int main(int argc, char *argv[]) } if (has_alpha) { // reset our match first. - matching_window = NIL; + matching_window = NULL_POINTER; window_name_sought = junk_text; //out.log("saw non-numbers in handle, trying as name."); // enumerate the windows looking for a match. @@ -139,7 +139,7 @@ int main(int argc, char *argv[]) PostMessage(handle, event, p1, p2); - out.log(isprintf("posted at 0x%lx the zing (%u %u %u)", handle, event, + out.log(a_sprintf("posted at 0x%lx the zing (%u %u %u)", handle, event, p1, p2)); return 0; @@ -149,54 +149,54 @@ int main(int argc, char *argv[]) // static dependencies found by buildor_gen_deps.sh: #include #include - #include + #include #include #include #include - #include + #include #include #include #include - #include + #include #include #include #include #include - #include + #include #include #include #include #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include #include #include #include #include #include - #include - #include + #include + #include #include - #include - #include - #include + #include + #include + #include #include - #include - #include - #include + #include + #include + #include #include #include - #include + #include #endif // __BUILD_STATIC_APPLICATION__ -- 2.43.0