Status
Niet open voor verdere reacties.
Ik denk dat je hier C++ bedoeld.
Ik begrijp niet helemaal wat je precies wilt, maar ik denk dat je het in deze richting moet zoeken.
Code:
{
    HKEY hKey;
    // Check that UK Phone Codes    is installed
    if (RegOpenKeyEx(HKEY_CURRENT_USER,
        "Software\\MediaWeb\\Codes\\Settings",
        0, KEY_READ, &hKey) != ERROR_SUCCESS)
    {
        AfxMessageBox("Codes Not Installed");
        return;
    }
    CString strToLookup = NumberOrString;
    // Copy text into clipboard
    if (OpenClipboard(NULL))
    {
        HANDLE hMem = ::GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE ,
        strToLookup.GetLength()+1);
        if (!hMem) return;
        LPSTR lpStr = (LPSTR)::GlobalLock(hMem);
        strcpy(lpStr, strToLookup);
        ::GlobalUnlock(hMem);
        VERIFY(::SetClipboardData(CF_TEXT, hMem));
        ::CloseClipboard();
    } else
    {
        AfxMessageBox("Failed to open the clipboard!");
        return;
    }
    CWnd *pWnd;
    DWORD dwLen = sizeof(DWORD);
    DWORD dwKeyEn = 0;
    ::RegQueryValueEx(hKey, "HotkeyEnable", NULL, NULL,
                      (LPBYTE)&dwKeyEn, &dwLen);
    if (dwKeyEn && (pWnd = CWnd::FindWindow("#32770","Codes")))
    {
        DWORD dwHotkey = 0x78, dwHotmod = 0;
        // Read Hotkey settings    for UK Phone Codes. Use the correct
        // default values.
        ::RegQueryValueEx(hKey, "Hotkey", NULL, NULL,
                          (LPBYTE)&dwHotkey, &dwLen);
        ::RegQueryValueEx(hKey, "Hotmod", NULL, NULL,
                          (LPBYTE)&dwHotmod, &dwLen);
        // WM_HOTKEY is 0x0312.
        // If you have a fixed hot key then:
        // dwHotkey can be set the the virtual key code e.g. VK_F12
        // for F12 key.
        // dwHotmod is set to 0, 1 (Alt), 2 (Ctrl), or 4 (Shift)
        pWnd->SendMessage(WM_HOTKEY, 100, MAKELONG(dwHotmod, dwHotkey));
    } else
    {
        AfxMessageBox("Codes not running/hotkey not enabled");
    }
}
 
Laatst bewerkt door een moderator:
Bij deze gesloten,sinds 14 maart geen respons meer ook niet na herhaalde vraag.
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan