tutorials.de Buch-Aktion 05/2012
ERLEDIGT
NEIN
ANTWORTEN
2
ZUGRIFFE
1083
EMPFEHLEN
  • An Twitter übertragen
  • An Facebook übertragen
AUF DIESES THEMA
ANTWORTEN
  1. #1
    MedRamBO MedRamBO ist offline Mitglied Silber
    Registriert seit
    Oct 2007
    Beiträge
    94
    Hi Leute,

    ich hab mir heute ein kleines Win32 Tool geschrieben welches Zeichenketten MD5 crypted und dann wieder ausgibt.
    Das klappt soweit ganz gut, um genau zu sein einwandfrei. Da dachte ich mir könnte man mal Userfriendly sein wie es so schön heißt und eine art "Copy to Clipboard" Funktion integrieren.
    Nach ein paar Nachforschungen auf MSDN dachte ich zu wissen wie es geht, aber leider ist mein Clipbord danach immer noch leer

    Könnte mir jemand aushelfen?
    Danke für alle Ideeen!


    Code :
    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
    
    #include <windows.h>
    #include "stdafx.h"
    #include <iostream>
     
     
    using namespace std;
     
     
    void main ( void )
    {
        char* Uncrypted = (char*)malloc(0xC8);
        memset(Uncrypted,0,0xC8);
        char Crypted[200];
     
        cout<<"Please enter the String which you want to crypt: "<<endl;
        cin>>Uncrypted;
     
        sprintf( Crypted, "%s", MD5String( (char*)Uncrypted ) );
        
        OpenClipboard( NULL );
        EmptyClipboard();
        SetClipboardData( CF_OEMTEXT, Crypted );
        CloseClipboard();
     
        cout<<"\nThe output String is: "<<Crypted<<endl;
        system("PAUSE");
    }
     

  2. #2
    MedRamBO MedRamBO ist offline Mitglied Silber
    Registriert seit
    Oct 2007
    Beiträge
    94
    Keine Ideen Leute?
     

  3. #3
    Avatar von devDevil
    devDevil devDevil ist offline Mitglied Platin
    Registriert seit
    Jun 2005
    Beiträge
    662
    Warum mischt du C und C++ usw.? (u. void main gibt es nicht)

    Code cpp:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    
    #include <windows.h>
    #include "stdafx.h"
     
    #include <iostream>
     
    int main ()
    {
        // read user input
        std::cout << "String: ";
        std::string input;
        std::getline(std::cin, input);
     
        // crypt string
        input = ::MD5String(input.c_str());
        
        // put into clipboard
        // ...
        
        std::clog << "Copied the crypted string into clipboard ...\n"
                      << "String: " << input;
     
        std::cin.ignore();
    }
    ... und warum das nicht geht, mit dem in die Zwischenablage kopieren?
    Zitat Zitat von [url]http://msdn.microsoft.com/en-us/library/ms649037(VS.85).aspx[/url]
    Before calling EmptyClipboard, an application must open the clipboard by using the OpenClipboard function. If the application specifies a NULL window handle when opening the clipboard, EmptyClipboard succeeds but sets the clipboard owner to NULL. Note that this causes SetClipboardData to fail.
     

Ähnliche Themen

  1. Probleme bei Mini tool TextToExcel
    Von Tis im Forum Java
    Antworten: 8
    Letzter Beitrag: 09.09.10, 12:31
  2. Probleme mit Move/Scale/Rotate Tool
    Von michitschi im Forum Autodesk Maya (ehemals Alias)
    Antworten: 2
    Letzter Beitrag: 19.10.07, 20:10
  3. Antworten: 3
    Letzter Beitrag: 16.08.05, 17:18
  4. Probleme mit jar Tool
    Von Mikma im Forum Java
    Antworten: 12
    Letzter Beitrag: 17.01.05, 14:38
  5. Probleme mit copy()
    Von djnelly im Forum PHP
    Antworten: 4
    Letzter Beitrag: 28.06.04, 10:17