Ja, im zweiten Codeblock habe ich aber schon deinen Vorschlag aufgegriffen und versucht umzusetzen.
Mein Ziel bei dem ganzen ist, dass ich das Programm starte und z.B. in Notepad etwas tippe und mein Programm aufgerufen wird, wenn ich eine bestimmte Tastenkombination drücke.
PS: Gute Nacht
Edit:
Ich glaube, ich habe in der MSDN gefunden, was ich eigentlich will, aber ich weiß nicht, wie ich das in PB umsetzen soll:
RegisterHotKey Function
The RegisterHotKey function defines a system-wide hot key.
Syntax
Code: Alles auswählen
BOOL RegisterHotKey(
HWND hWnd,
int id,
UINT fsModifiers,
UINT vk
);
Parameters
hWnd
[in] Handle to the window that will receive WM_HOTKEY messages generated by the hot key. If this parameter is NULL, WM_HOTKEY messages are posted to the message queue of the calling thread and must be processed in the message loop.
id
[in] Specifies the identifier of the hot key. No other hot key in the calling thread should have the same identifier. An application must specify a value in the range 0x0000 through 0xBFFF. A shared dynamic-link library (DLL) must specify a value in the range 0xC000 through 0xFFFF (the range returned by the GlobalAddAtom function). To avoid conflicts with hot-key identifiers defined by other shared DLLs, a DLL should use the GlobalAddAtom function to obtain the hot-key identifier.
fsModifiers
[in] Specifies keys that must be pressed in combination with the key specified by the uVirtKey parameter in order to generate the WM_HOTKEY message. The fsModifiers parameter can be a combination of the following values.
MOD_ALT
Either ALT key must be held down.
MOD_CONTROL
Either CTRL key must be held down.
MOD_SHIFT
Either SHIFT key must be held down.
MOD_WIN
Either WINDOWS key was held down. These keys are labeled with the Microsoft Windows logo.
vk
[in] Specifies the virtual-key code of the hot key.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.