From 5bcb7f11cf8d82b47f896b1420b29b23b072eaac Mon Sep 17 00:00:00 2001 From: Samuel Venable Date: Fri, 29 Nov 2024 10:53:07 -0500 Subject: [PATCH] Add Win32 Example Batch Script --- filedialogs/demo/GetForegroundWindow.c | 6 ++ filedialogs/demo/GetForegroundWindow.sln | 25 +++++ filedialogs/demo/GetForegroundWindow.vcxproj | 93 +++++++++++++++++++ .../demo/GetForegroundWindow.vcxproj.filters | 22 +++++ .../demo/GetForegroundWindow.vcxproj.user | 4 + .../demo/RunWin32FileDialogsExample.bat | 23 +++++ 6 files changed, 173 insertions(+) create mode 100644 filedialogs/demo/GetForegroundWindow.c create mode 100644 filedialogs/demo/GetForegroundWindow.sln create mode 100644 filedialogs/demo/GetForegroundWindow.vcxproj create mode 100644 filedialogs/demo/GetForegroundWindow.vcxproj.filters create mode 100644 filedialogs/demo/GetForegroundWindow.vcxproj.user create mode 100644 filedialogs/demo/RunWin32FileDialogsExample.bat diff --git a/filedialogs/demo/GetForegroundWindow.c b/filedialogs/demo/GetForegroundWindow.c new file mode 100644 index 0000000..70e77d9 --- /dev/null +++ b/filedialogs/demo/GetForegroundWindow.c @@ -0,0 +1,6 @@ +#include +#include + +int main() { + printf("%llu", (unsigned long long)(void *)GetForegroundWindow()); +} diff --git a/filedialogs/demo/GetForegroundWindow.sln b/filedialogs/demo/GetForegroundWindow.sln new file mode 100644 index 0000000..13855f8 --- /dev/null +++ b/filedialogs/demo/GetForegroundWindow.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34316.72 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GetForegroundWindow", "GetForegroundWindow.vcxproj", "{D0D7FFA4-3FF1-40B9-BEBF-E22B09381995}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D0D7FFA4-3FF1-40B9-BEBF-E22B09381995}.Release|x64.ActiveCfg = Release|x64 + {D0D7FFA4-3FF1-40B9-BEBF-E22B09381995}.Release|x64.Build.0 = Release|x64 + {D0D7FFA4-3FF1-40B9-BEBF-E22B09381995}.Release|x86.ActiveCfg = Release|Win32 + {D0D7FFA4-3FF1-40B9-BEBF-E22B09381995}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7BECB96A-DF91-41F8-8E3C-5C5FE0658C27} + EndGlobalSection +EndGlobal diff --git a/filedialogs/demo/GetForegroundWindow.vcxproj b/filedialogs/demo/GetForegroundWindow.vcxproj new file mode 100644 index 0000000..9559c9c --- /dev/null +++ b/filedialogs/demo/GetForegroundWindow.vcxproj @@ -0,0 +1,93 @@ + + + + + Release + Win32 + + + Release + x64 + + + + 17.0 + Win32Proj + {d0d7ffa4-3ff1-40b9-bebf-e22b09381995} + GetForegroundWindow + 10.0 + + + + Application + false + v143 + true + MultiByte + + + Application + false + v143 + true + MultiByte + + + + + + + + + + + + + + + $(SolutionDir)\ + + + $(SolutionDir)\ + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + + + Console + true + true + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/filedialogs/demo/GetForegroundWindow.vcxproj.filters b/filedialogs/demo/GetForegroundWindow.vcxproj.filters new file mode 100644 index 0000000..36b451a --- /dev/null +++ b/filedialogs/demo/GetForegroundWindow.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + \ No newline at end of file diff --git a/filedialogs/demo/GetForegroundWindow.vcxproj.user b/filedialogs/demo/GetForegroundWindow.vcxproj.user new file mode 100644 index 0000000..0f14913 --- /dev/null +++ b/filedialogs/demo/GetForegroundWindow.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/filedialogs/demo/RunWin32FileDialogsExample.bat b/filedialogs/demo/RunWin32FileDialogsExample.bat new file mode 100644 index 0000000..a9e12e7 --- /dev/null +++ b/filedialogs/demo/RunWin32FileDialogsExample.bat @@ -0,0 +1,23 @@ +@echo off +cd /d "%~dp0" +GetForegroundWindow > GetForegroundWindow.txt +set /p IMGUI_DIALOG_PARENT=< GetForegroundWindow.txt +set IMGUI_DIALOG_WIDTH=720 +set IMGUI_DIALOG_HEIGHT=380 +set IMGUI_DIALOG_THEME=2 +set IMGUI_TEXT_COLOR_0=1 +set IMGUI_TEXT_COLOR_1=1 +set IMGUI_TEXT_COLOR_2=1 +set IMGUI_HEAD_COLOR_0=0.35 +set IMGUI_HEAD_COLOR_1=0.35 +set IMGUI_HEAD_COLOR_2=0.35 +set IMGUI_AREA_COLOR_0=0.05 +set IMGUI_AREA_COLOR_1=0.05 +set IMGUI_AREA_COLOR_2=0.05 +set IMGUI_BODY_COLOR_0=1 +set IMGUI_BODY_COLOR_1=1 +set IMGUI_BODY_COLOR_2=1 +set IMGUI_POPS_COLOR_0=0.07 +set IMGUI_POPS_COLOR_1=0.07 +set IMGUI_POPS_COLOR_2=0.07 +..\filedialogs --get-open-filename "Portable Network Graphic (*.png)|*.png|Graphic Interchange Format (*.gif)|*.gif" "Untitled.png" \ No newline at end of file