forked from elifiner/recaps
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfixlayouts.h
39 lines (30 loc) · 1.21 KB
/
fixlayouts.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once
typedef struct
{
UINT format;
HANDLE dataHandle;
} ClipboardFormat;
typedef struct
{
int count;
ClipboardFormat* dataArray;
} ClipboardData;
// time in milliseconds to allow the target application
// to execute commands simulated by keystrokes
#define REMOTE_APP_WAIT 100
// The main function that converts the current selected text in the active
// window from one layout to another.
void ConvertSelectedTextInActiveWindow(HKL hklSource, HKL hklTarget);
// Functions to convert UNICODE strings between keyboard layouts
WCHAR LayoutConvertChar(WCHAR ch, HKL hklSource, HKL hklTarget);
size_t LayoutConvertString(const WCHAR* str, WCHAR* buffer, size_t size, HKL hklSource, HKL hklTarget);
HKL DetectLayoutFromString(const WCHAR* str, BOOL* pmatches);
// Functions to store and restore all of the data in the clipboard
BOOL StoreClipboardData(ClipboardData* formats);
BOOL RestoreClipboardData(ClipboardData* formats);
// Convenience functions for the clipboard
WCHAR* GetClipboardText();
BOOL SetClipboardText(const WCHAR* text);
// Functions that simulate key presses in the current window
void SendKeyCombo(BYTE vk, BOOL ctrl, BOOL alt, BOOL shift);
void SendAltShift();