Hi,
I create a dialog with resource editor, i also open the resource.rc as text and add CLASS tag.
Then i try to use CreateDialog api to show this window and do some processing.
Although i expect to receive WM_INITDIALOG message to initialize some variables i never get this message.
some part of code is below, and i will appreciate who tries to help me,
Kind Regards
---------
MSG msg;
static TCHAR szApp[]="Deneme";
HWND hwnd;
WNDCLASS wcl;
wcl.cbClsExtra = 0;
wcl.cbWndExtra = DLGWINDOWEXTRA;
wcl.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1);
wcl.hCursor = LoadCursor(NULL,IDC_ARROW);
wcl.hIcon = LoadIcon(NULL,IDI_APPLICATION);
wcl.hInstance = hInst;
wcl.lpfnWndProc = WndProc;
wcl.lpszClassName = szApp;
wcl.lpszMenuName = NULL;
wcl.style = CS_VREDRAW|CS_HREDRAW;
if(!RegisterClass(&wcl)) return 1;
hwnd = CreateDialog(hInst,MAKEINTRESOURCE(IDD_INFO_ADAPTERS),0,NULL);
ShowWindow(hwnd,nShow);
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam ;
}
LRESULT CALLBACK WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
BOOL bReturn;
switch(msg)
{
// i never get WM_INITDIALOG msg
case WM_INITDIALOG:
MessageBox(hwnd,"initial","initial",MB_OK);
SetDlgItemText(hwnd,IDC_EDIT_NAME,"Volkan Uzun"
return TRUE;
Read between the lines
I create a dialog with resource editor, i also open the resource.rc as text and add CLASS tag.
Then i try to use CreateDialog api to show this window and do some processing.
Although i expect to receive WM_INITDIALOG message to initialize some variables i never get this message.
some part of code is below, and i will appreciate who tries to help me,
Kind Regards
---------
MSG msg;
static TCHAR szApp[]="Deneme";
HWND hwnd;
WNDCLASS wcl;
wcl.cbClsExtra = 0;
wcl.cbWndExtra = DLGWINDOWEXTRA;
wcl.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1);
wcl.hCursor = LoadCursor(NULL,IDC_ARROW);
wcl.hIcon = LoadIcon(NULL,IDI_APPLICATION);
wcl.hInstance = hInst;
wcl.lpfnWndProc = WndProc;
wcl.lpszClassName = szApp;
wcl.lpszMenuName = NULL;
wcl.style = CS_VREDRAW|CS_HREDRAW;
if(!RegisterClass(&wcl)) return 1;
hwnd = CreateDialog(hInst,MAKEINTRESOURCE(IDD_INFO_ADAPTERS),0,NULL);
ShowWindow(hwnd,nShow);
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam ;
}
LRESULT CALLBACK WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
BOOL bReturn;
switch(msg)
{
// i never get WM_INITDIALOG msg
case WM_INITDIALOG:
MessageBox(hwnd,"initial","initial",MB_OK);
SetDlgItemText(hwnd,IDC_EDIT_NAME,"Volkan Uzun"
return TRUE;
Read between the lines