Create winapi_shell_search.c

This commit is contained in:
Jan Bodnar 2016-04-07 15:43:36 +02:00
parent bcc62396ae
commit a52d337904

View File

@ -0,0 +1,24 @@
#include <windows.h>
#include <wchar.h>
#include "Shlwapi.h"
#pragma comment(lib, "Shlwapi.lib")
int wmain(void) {
wchar_t buf[] = L"Today is a rainy day.";
wchar_t *search_word = L"rainy";
int len = wcslen(search_word);
LPWSTR pr = StrStrW(buf, search_word);
if (pr == NULL) {
wprintf(L"No match\n", buf);
} else {
wprintf(L"%.*ls is found\n", len, pr);
}
return 0;
}