35bool console::set_void(
const std::string& property,
const std::string& value_type,
const void* value_ptr)
38 if (property ==
"x") {
40 get_variant(x, value_type, value_ptr);
41 HWND console = GetConsoleWindow();
43 GetWindowRect(console, &rect);
44 SetWindowPos(console,HWND_BOTTOM,x,rect.top,0,0,SWP_NOSIZE|SWP_NOZORDER);
47 if (property ==
"y") {
49 get_variant(y, value_type, value_ptr);
50 HWND console = GetConsoleWindow();
52 GetWindowRect(console, &rect);
53 SetWindowPos(console, HWND_BOTTOM, rect.left, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
56 if (property ==
"w") {
58 get_variant(w, value_type, value_ptr);
59 HWND console = GetConsoleWindow();
61 GetWindowRect(console, &rect);
62 SetWindowPos(console, HWND_BOTTOM, 0, 0, w, rect.bottom - rect.top, SWP_NOMOVE | SWP_NOZORDER);
65 if (property ==
"h") {
67 get_variant(h, value_type, value_ptr);
68 HWND console = GetConsoleWindow();
70 GetWindowRect(console, &rect);
71 SetWindowPos(console, HWND_BOTTOM, 0, 0, rect.right - rect.left, h, SWP_NOMOVE | SWP_NOZORDER);