Einfache Dialog-Anwendung



  • Hallo zusammen,

    ich programmiere mit VS2008.

    Ich würde gerne ein Programm in C++ schreiben, welches auf einem Dialog statt auf einem normalen Window basiert.

    Mein jetziger Code:

    // tool.cpp : Definiert den Einstiegspunkt für die Anwendung.
    
    #include "stdafx.h"
    #include "tool.h"
    
    // Vorwärtsdeklarationen der in diesem Codemodul enthaltenen Funktionen:
    INT_PTR CALLBACK	DialogProc(HWND, UINT, WPARAM, LPARAM);
    INT_PTR CALLBACK	About(HWND, UINT, WPARAM, LPARAM);
    
    int APIENTRY _tWinMain(HINSTANCE hInstance,
                         HINSTANCE hPrevInstance,
                         LPTSTR    lpCmdLine,
                         int       nCmdShow)
    {
    	return DialogBox (hInstance, MAKEINTRESOURCE(IDD_MAINDLG), 0, DialogProc);
    }
    
    // Meldungshandler für HauptDialog.
    INT_PTR CALLBACK DialogProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
    {    
         switch (message)
         {
    	 case WM_INITDIALOG:
    		 return TRUE;
    
         case WM_CLOSE:
    		 EndDialog (hwnd,0);
    		 return TRUE;  
         }
    	 return FALSE;
    }
    
    // Meldungshandler für Infofeld.
    INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
    {
    	UNREFERENCED_PARAMETER(lParam);
    	switch (message)
    	{
    	case WM_INITDIALOG:
    		return (INT_PTR)TRUE;
    
    	case WM_COMMAND:
    		if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
    		{
    			EndDialog(hDlg, LOWORD(wParam));
    			return (INT_PTR)TRUE;
    		}
    		break;
    	}
    	return (INT_PTR)FALSE;
    }
    

    Ich weiß nicht, ob der Code vollkommen richtig ist, aber er funktioniert^^.
    Vielleicht habt ihr einen besseren Vorchlag..Wäre cool.

    Also das eigentliche Problem ist, dass der IDD_MAINDLG im Editor ganz normal aussieht (er beinhaltet ein Tab Control), aber als kompilierte Anwendung das Tab Control nicht funktioniert und anders aussieht:

    http://img151.imageshack.us/my.php?image=toolir2.jpg

    Ich hoffe, ihr könnt mir helfen,

    MfG,
    echo<delta>



  • Falsches Forum, gehört ins WinApi Forum.



  • sry, ich mache einen neuen Thread im WinApi-Forum auf.

    Mfg,
    echo<delta>


Anmelden zum Antworten