Changeset View
Changeset View
Standalone View
Standalone View
source/lib/sysdep/os/win/wsysdep.cpp
/* Copyright (C) 2011 Wildfire Games. | /* Copyright (C) 2020 Wildfire Games. | ||||
* | * | ||||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | ||||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | ||||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | ||||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | ||||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | ||||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | ||||
* the following conditions: | * the following conditions: | ||||
Show All 14 Lines | |||||
* Windows backend of the sysdep interface | * Windows backend of the sysdep interface | ||||
*/ | */ | ||||
#include "precompiled.h" | #include "precompiled.h" | ||||
#include "lib/sysdep/sysdep.h" | #include "lib/sysdep/sysdep.h" | ||||
#include "lib/alignment.h" | #include "lib/alignment.h" | ||||
#include "lib/sysdep/os/win/win.h" // includes windows.h; must come before shlobj | #include "lib/sysdep/os/win/win.h" // includes windows.h; must come before shlobj | ||||
#include <SDL_clipboard.h> // SDL_SetClipboardText | |||||
#include <shlobj.h> // pick_dir | #include <shlobj.h> // pick_dir | ||||
#include <shellapi.h> // open_url | #include <shellapi.h> // open_url | ||||
#include <Wincrypt.h> | #include <Wincrypt.h> | ||||
#include <WindowsX.h> // message crackers | #include <WindowsX.h> // message crackers | ||||
#include <winhttp.h> | #include <winhttp.h> | ||||
#include "lib/sysdep/clipboard.h" | |||||
Stan: Likely missing an SDL include. | |||||
#include "lib/sysdep/os/win/error_dialog.h" | #include "lib/sysdep/os/win/error_dialog.h" | ||||
#include "lib/sysdep/os/win/wutil.h" | #include "lib/sysdep/os/win/wutil.h" | ||||
#if CONFIG_ENABLE_BOOST | #if CONFIG_ENABLE_BOOST | ||||
# include <boost/algorithm/string.hpp> | # include <boost/algorithm/string.hpp> | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 158 Lines • ▼ Show 20 Lines | static BOOL dlg_OnInitDialog(HWND hDlg, HWND UNUSED(hWndFocus), LPARAM lParam) | ||||
return TRUE; // set default keyboard focus | return TRUE; // set default keyboard focus | ||||
} | } | ||||
static void dlg_OnCommand(HWND hDlg, int id, HWND UNUSED(hWndCtl), UINT UNUSED(codeNotify)) | static void dlg_OnCommand(HWND hDlg, int id, HWND UNUSED(hWndCtl), UINT UNUSED(codeNotify)) | ||||
{ | { | ||||
switch(id) | switch(id) | ||||
{ | { | ||||
case IDC_COPY: | case IDC_COPY: | ||||
Done Inline ActionsIt seems that it breaks the copy button in the error dialog (when you got a crash/assertion) on Windows. vladislavbelov: It seems that it breaks the copy button in the error dialog (when you got a crash/assertion) on… | |||||
Not Done Inline Actionscopy button copies properly Silier: copy button copies properly | |||||
{ | { | ||||
std::vector<wchar_t> buf(128*KiB); // (too big for stack) | std::vector<wchar_t> buf(128*KiB); // (too big for stack) | ||||
GetDlgItemTextW(hDlg, IDC_EDIT1, &buf[0], (int)buf.size()); | GetDlgItemTextW(hDlg, IDC_EDIT1, &buf[0], (int)buf.size()); | ||||
sys_clipboard_set(&buf[0]); | std::string string = utf8_from_wstring(&buf[0]); | ||||
SDL_SetClipboardText(string.c_str()); | |||||
break; | break; | ||||
} | } | ||||
case IDC_CONTINUE: | case IDC_CONTINUE: | ||||
EndDialog(hDlg, ERI_CONTINUE); | EndDialog(hDlg, ERI_CONTINUE); | ||||
break; | break; | ||||
case IDC_SUPPRESS: | case IDC_SUPPRESS: | ||||
EndDialog(hDlg, ERI_SUPPRESS); | EndDialog(hDlg, ERI_SUPPRESS); | ||||
▲ Show 20 Lines • Show All 387 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Likely missing an SDL include.