Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Win32Console.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <fstream>
- BOOL CALLBACK enumWindowsHandler(HWND hWnd, LPARAM lParam)
- {
- if (!IsWindow(hWnd)) {
- return false;
- }
- wchar_t title[250];
- GetWindowText(hWnd, title, sizeof(title));
- int result = wcscmp(title, L"Калькулятор");
- if (result == 0) {
- wprintf(L"%s", title);
- *lParam = hWnd;
- }
- return true;
- }
- int main()
- {
- // Set locale
- std::locale::global(std::locale("Russian_Russia"));
- HWND hwnd;
- EnumWindows(enumWindowsHandler, (LPARAM)&hwnd);
- Sleep(1000 * 100);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment