ressource laden in winmain...



  • hi leute!
    ich hab ein win32 application ich bin jetzt drauf gekommen das ich eine GUI brauche! wo ich in einen textfeld was reinschreiben will, hab no 1 kombinationsfeld!
    ich hab ne ressource gemacht u win mein win 32 application hinzugefügt! wie kann ich das ding in int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nCmdShow) laden???
    da braucht man ja kein mfc oder?

    wie kann werte von dem kombinationsfeld und einem eingabe feld in einen std::string speichern? hab da 3 elemente in dem kobinationsfeld: 0676, 0650, 0699! und im eingabefeld eine 8 stellige nummer....

    cu!



  • coder1 schrieb:

    wie kann ich das ding in int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nCmdShow) laden???
    da braucht man ja kein mfc oder?

    Nein, das geht mit CreateDialog bzw. DialogBox (je nach dem, ob der Dialog modal sein soll, oder nicht)

    coder1 schrieb:

    wie kann werte von dem kombinationsfeld und einem eingabe feld in einen std::string speichern? hab da 3 elemente in dem kobinationsfeld: 0676, 0650, 0699!

    Ist das eine ComboBox oder eine ListBox?

    coder1 schrieb:

    und im eingabefeld eine 8 stellige nummer...

    GetWindowText oder GetDlgItemInt sollte das sein, was du brauchst. 🙂



  • Nein, das geht mit CreateDialog bzw. DialogBox (je nach dem, ob der Dialog modal sein soll, oder nicht)

    modal???

    ansatz:

    DialogBox(hinst, MAKEINTRESOURCE(DLG_DELETEITEM), hwnd, (DLGPROC)DeleteItemProc)
    

    was ist MAKEINTRESOURCE...verlangt ja die id der dialogbox im ressourceeditor? was sind die anderen parameter?
    hinst = Handle zum module?
    MAKEINTRESOURCE = Pointer auf die Ressource?
    hwnd = Handle zum fenster!
    (DLGPROC)DeleteItemProc = Pointer zur Dialogbox?

    naja etwas schwierig mit den begriffen...vielleicht kann einer besser erklären!?

    Ist das eine ComboBox oder eine ListBox?

    brauche ne combobox!

    ich will mein winapi programm als klasse aufbauen....könnt ihr mir mal ein gutes beispiel zeigen, hab noch kaum winapi progs gesehn als klasse!?

    cu 😃



  • coder1 schrieb:

    modal???

    When creating the modal dialog box, the system makes it the active window. The dialog box remains active until the dialog box procedure calls the EndDialog function or the system activates a window in another application. Neither the user nor the application can make the owner window active until the modal dialog box is destroyed.
    [...]
    A modeless dialog box neither disables the owner window nor sends messages to it. When creating the dialog box, the system makes it the active window, but the user or the application can change the active window at any time. If the dialog box does become inactive, it remains above the owner window in the Z order, even if the owner window is active.

    coder1 schrieb:

    was ist MAKEINTRESOURCE...verlangt ja die id der dialogbox im ressourceeditor?

    Das ist ein Marko:

    The MAKEINTRESOURCE macro converts an integer value to a resource type compatible with the resource-management functions. This macro is used in place of a string containing the name of the resource.

    coder1 schrieb:

    was sind die anderen parameter?

    Hier sind doch die ganzen Parameter genau erklärt 👎

    coder1 schrieb:

    brauche ne combobox!

    Hier solltest du eigentlich die nötigen Infos finden 😉

    coder1 schrieb:

    ich will mein winapi programm als klasse aufbauen....könnt ihr mir mal ein gutes beispiel zeigen, hab noch kaum winapi progs gesehn als klasse!?

    Also das mit der eigenen Fensterklasse würde ich mir bei deinem Kenntnisstand ganz schnell wieder aus dem Kopf schlagen - also entweder nimmst du eine fertige Klassenbibliothek, oder nimmst eben die WinAPI, so wie sie ist.


Anmelden zum Antworten