-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e018ce
commit a98e6e3
Showing
7 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "win_title.h" | ||
|
||
#include <Windows.h> | ||
|
||
namespace { | ||
constexpr int kMaxTitleLen = 255; | ||
} | ||
|
||
std::string utils::GetWinTitle(void* hwnd) { | ||
char buff[kMaxTitleLen + 1]; | ||
GetWindowTextA((HWND)hwnd, buff, sizeof(buff)); | ||
return std::string(buff); | ||
} | ||
|
||
bool utils::SetWinTitle(void* hwnd, const std::string& title) { | ||
return SetWindowTextA((HWND)hwnd, title.c_str()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#ifndef __UTILS_WIN_TITLE_H__ | ||
#define __UTILS_WIN_TITLE_H__ | ||
|
||
#include <string> | ||
|
||
namespace utils { | ||
std::string GetWinTitle(void* hwnd); | ||
bool SetWinTitle(void* hwnd, const std::string& title); | ||
} // namespace utils | ||
|
||
#endif // __UTILS_WIN_TITLE_H__ |