mirror of
https://github.com/Ximi1970/systray-x.git
synced 2026-02-26 16:10:43 +01:00
windowctrl-win : use std::array instead of c-style array
This commit is contained in:
@@ -8,6 +8,11 @@
|
||||
#include <tlhelp32.h>
|
||||
#include <CommCtrl.h>
|
||||
|
||||
/*
|
||||
* Standard library includes
|
||||
*/
|
||||
#include <array>
|
||||
|
||||
/*
|
||||
* Qt includes
|
||||
*/
|
||||
@@ -87,9 +92,9 @@ bool WindowCtrlWin::findWindow( const QString& title )
|
||||
*/
|
||||
BOOL CALLBACK WindowCtrlWin::enumWindowsTitleProc( HWND hwnd, LPARAM lParam )
|
||||
{
|
||||
char buffer[ 128 ];
|
||||
int written = GetWindowTextA( hwnd, buffer, 128 );
|
||||
if( written && strstr( buffer, (char*)lParam ) != nullptr )
|
||||
std::array<char, 128> buffer;
|
||||
int written = GetWindowTextA( hwnd, buffer.data(), int(buffer.size()) );
|
||||
if( written && strstr( buffer.data(), (char*)lParam ) != nullptr )
|
||||
{
|
||||
m_tb_windows.append( (quint64)hwnd );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user