mirror of
https://github.com/janbodnar/Windows-API-examples.git
synced 2024-11-24 11:25:30 +00:00
25 lines
445 B
C
25 lines
445 B
C
#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;
|
|
}
|