Skip to content

Commit

Permalink
SHAutoComplete関数を使ったフォルダ位置の入力補完 (sakura-editor#1969)
Browse files Browse the repository at this point in the history
  • Loading branch information
beru committed Aug 29, 2024
1 parent fe4cc6d commit ad063bb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sakura_core/apiwrap/StdControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ UNICODE版では問題無いが、ANSI版では設定の前にコード変換す

#include <windows.h>
#include <Commctrl.h>
#include <shlwapi.h>
#include "mem/CNativeW.h"
#include <vector>

Expand Down Expand Up @@ -219,6 +220,15 @@ namespace ApiWrap{
{
::SendMessage( hwndCombo, CB_GETEDITSEL, WPARAM( &dwSelStart ), LPARAM( &dwSelEnd ) );
}
inline void Combo_SHAutoComplete( HWND hwndCombo, DWORD dwFlags )
{
COMBOBOXINFO comboInfo;
comboInfo.cbSize = sizeof(comboInfo);
if (0 != GetComboBoxInfo(hwndCombo, &comboInfo))
{
SHAutoComplete(comboInfo.hwndItem, dwFlags);
}
}

// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- //
// リストボックス //
Expand Down
3 changes: 3 additions & 0 deletions sakura_core/dlg/CDlgGrep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,9 @@ BOOL CDlgGrep::OnInitDialog( HWND hwndDlg, WPARAM wParam, LPARAM lParam )
Combo_SetExtendedUI( GetItemHwnd( IDC_COMBO_EXCLUDE_FILE ), TRUE );
Combo_SetExtendedUI( GetItemHwnd( IDC_COMBO_EXCLUDE_FOLDER ), TRUE );

/* 入力補完を機能させる */
Combo_SHAutoComplete(GetItemHwnd( IDC_COMBO_FOLDER ), SHACF_FILESYS_DIRS|SHACF_AUTOAPPEND_FORCE_ON);

/* ダイアログのアイコン */
//2002.02.08 Grepアイコンも大きいアイコンと小さいアイコンを別々にする。
HICON hIconBig, hIconSmall;
Expand Down

0 comments on commit ad063bb

Please sign in to comment.