Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Kreiranje shortcut-a preko WinAPI-ja?

[es] :: C/C++ programiranje :: Kreiranje shortcut-a preko WinAPI-ja?

[ Pregleda: 3392 | Odgovora: 3 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

Predrag Damnjanovic
Predrag Damnjanovic
Nis, Srbija

Član broj: 141
Poruke: 1305
*.verat.net

Sajt: www.mycity.rs


+1 Profil

icon Kreiranje shortcut-a preko WinAPI-ja?09.10.2003. u 18:20 - pre 249 meseci
pretrazio sam i ES i google - ne nalazim nista vezano za winapi, pronalazim neke VB script primere....

moze mala pomoc?
 
Odgovor na temu

mladenovicz
Zeljko Mladenovic
Xoran Technologies, Inc., Ann Arbor, MI,
USA / Software Engineer
Ann Arbor, MI, USA

Član broj: 6598
Poruke: 2065
*.yubc.net

Jabber: mladenovicz@elitesecurity.org
ICQ: 95144142
Sajt: yubc.net/~mz


Profil

icon Re: Kreiranje shortcut-a preko WinAPI-ja?09.10.2003. u 18:36 - pre 249 meseci
Ne znam da li ovo moze da ti pomogne :

http://www.elitesecurity.org/tema/28314
 
Odgovor na temu

stalker
Branko Kokanovic
Beograd

Član broj: 11897
Poruke: 606
*.drenik.net



+2 Profil

icon Re: Kreiranje shortcut-a preko WinAPI-ja?09.10.2003. u 18:37 - pre 249 meseci
Ovaj kod pravi shortcut i shortcutkey Ctrl+Alt+L
Poziva se sa:
Code:

hResult=CreateShortcut("Source fajl",Destination fajl","shortcut");


Evo i funkcije(ako nesto nije jasno ili ne radi,pitaj)


Code:

HRESULT CreateShortcut(LPCSTR pszShortcutFile,LPSTR pszLink,LPSTR pszDesc)
{
    HRESULT hres;
    HRESULT hResult;
    IShellLink *psl;

    hResult=CoInitialize(NULL);
    // Create an IShellLink object and get a pointer to the IShellLink 
    // interface (returned from CoCreateInstance).
    hres = CoCreateInstance (CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
    IID_IShellLink, (void **)&psl);
    if (SUCCEEDED (hres)){
        IPersistFile *ppf;

        // Query IShellLink for the IPersistFile interface for 
        // saving the shortcut in persistent storage.
        hres = psl->QueryInterface (IID_IPersistFile, (void **)&ppf);
        if (SUCCEEDED (hres)){ 
            WORD wsz [MAX_PATH]; // buffer for Unicode string
        
            // Set the path to the shortcut target.
            hres = psl->SetPath (pszShortcutFile);

            //Set shortcut key
            WORD HotKey;
            HotKey=MAKEWORD(76,HOTKEYF_ALT | HOTKEYF_CONTROL);
            hres=psl->SetHotkey(HotKey);
            // Set the description of the shortcut.
            hres = psl->SetDescription (pszDesc);

            // Ensure that the string consists of ANSI characters.
            MultiByteToWideChar (CP_ACP, 0, pszLink, -1, wsz, MAX_PATH);

            // Save the shortcut via the IPersistFile::Save member function.
            hres = ppf->Save (wsz, TRUE);

            // Release the pointer to IPersistFile.
            ppf->Release ();
        }
        // Release the pointer to IShellLink.
        psl->Release ();
    }
    CoUninitialize();
    return hres;
}
 
Odgovor na temu

Predrag Damnjanovic
Predrag Damnjanovic
Nis, Srbija

Član broj: 141
Poruke: 1305
*.verat.net

Sajt: www.mycity.rs


+1 Profil

icon Re: Kreiranje shortcut-a preko WinAPI-ja?09.10.2003. u 19:06 - pre 249 meseci
upravo sam nasao i ja slican primer, sa istim funkcijama - http://groups.google.com/group...888%40news.borg.com&rnum=5

hvala svima... sors radi !
 
Odgovor na temu

[es] :: C/C++ programiranje :: Kreiranje shortcut-a preko WinAPI-ja?

[ Pregleda: 3392 | Odgovora: 3 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.