#include <windows.h>
#include "Resource.h"
HWND hWnd;
LRESULT CALLBACK DlgProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
DialogBox(hInstance, MAKEINTRESOURCE(IDD_Main), hWnd, reinterpret_cast<DLGPROC>(DlgProc));
return FALSE;
}
LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
HWND edit = GetDlgItem(hWndDlg,IDC_Window);
HWND input = GetDlgItem(hWndDlg,IDC_Input);
HWND inputB = GetDlgItem(hWndDlg,(GetWindowText(input,NULL,NULL)));
switch(wParam)
{
case ID_Close:
EndDialog(hWndDlg, 0);
return TRUE;
case IDC_Submit:
SetWindowText(edit,(const char *)inputB);
return TRUE;
}
break;
}
return FALSE;
}
no error but it doesnt take the text from IDC_Input and display it in IDC_Window when i pressed the IDC_Submit button.
im just starting Gui's so bare with me :(
You probably guessed this but its using DialogBox Resources and what not but im guessing you can see that already,