Click here to Skip to main content
15,505,438 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDialogBox fuction not executing its procedure [SOLVED] Pin
coco24319-Aug-22 0:39
coco24319-Aug-22 0:39 
AnswerRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan19-Aug-22 1:38
mveRichard MacCutchan19-Aug-22 1:38 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24319-Aug-22 2:14
coco24319-Aug-22 2:14 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan19-Aug-22 2:47
mveRichard MacCutchan19-Aug-22 2:47 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24319-Aug-22 3:03
coco24319-Aug-22 3:03 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan19-Aug-22 3:29
mveRichard MacCutchan19-Aug-22 3:29 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24319-Aug-22 3:57
coco24319-Aug-22 3:57 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24319-Aug-22 4:20
coco24319-Aug-22 4:20 
Ok. Let's start over. I have elimiated the macros.

So:


.cpp file

C++
//
// Walk_Directories.cpp
//

//#include "CmnHdr.h"
#include <windows.h>  // tipul BOOL este definit in windows.h
#include "resource.h"
#include "WindowsX.h"




BOOL Dlg_OnInitDialog (HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
	RECT rc;

	// Associate an icon with the dialog box.
	//chSETDLGICONS(hwnd, IDI_DIRWALK, IDI_DIRWALK);
	 SendMessage(hwnd, WM_SETICON, TRUE, (LPARAM)LoadIcon(GetWindowInstance(hwnd),MAKEINTRESOURCE(IDI_DIRWALK)));                    
	 SendMessage(hwnd, WM_SETICON, FALSE, (LPARAM)LoadIcon(GetWindowInstance(hwnd),MAKEINTRESOURCE(IDI_DIRWALK)));                    

	GetClientRect(hwnd, &rc);
	SetWindowPos(GetDlgItem(hwnd, IDC_TREE), NULL, 0, 0, rc.right, rc.bottom, SWP_NOZORDER);

	return(TRUE);
}


void Dlg_OnSize ( HWND hwnd, UINT state, int cx, int cy)
{
	SetWindowPos(GetDlgItem(hwnd, IDC_TREE), NULL, 0, 0, cx, cy, SWP_NOZORDER);	
}


INT_PTR CALLBACK Dlg_Proc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch (uMsg)
	{
	case WM_INITDIALOG:
		SetDlgMsgResult(hwnd, uMsg, HANDLE_WM_INITDIALOG(hwnd, wParam, lParam, Dlg_OnInitDialog));
		//return Dlg_OnInitDialog(hwnd, (HWND)wParam, lParam);
    break;
	//chHANDLE_DLGMSG(hwnd, WM_INITDIALOG, Dlg_OnInitDialog);
	//chHANDLE_DLGMSG(hwnd, WM_SIZE, Dlg_OnSize);

	}

	return(FALSE);
}


int WINAPI WinMain(HINSTANCE hinstExe, HINSTANCE hinstPrev, LPSTR pszCmdLine, int nCmdShow)
{


DialogBox(hinstExe, MAKEINTRESOURCE(IDD_DIRWALK), NULL, Dlg_Proc);

return(0);
}


.rc file

C++
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (United States) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE 9, 1

#ifdef APSTUDIO_INVOKED



// Icon
// Icon with the lowest ID value placed first to ensure
// application icon remains consistent on all systems.
IDI_DIRWALK ICON DISCARDABLE "DirWalk.Ico"



// Dialog
IDD_DIRWALK DIALOG DISCARDABLE 10, 18, 250, 250
STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP|
              WS_VISIBLE| WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | DS_MODALFRAME
CAPTION "Directory Walk"
FONT 8, "System"
BEGIN
       LISTBOX     IDC_TREE,0,0,0,0,NOT LBS_NOTIFY |
	                      LBX_NOINTEGRAL_HEIGHT | NOT WS_BORDER |
			   WS_VSCROLL | WS_HSCROLL | WS_GROUP |
			   WS_TABSTOP 
END




/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE  
BEGIN
    "resource.h\0"
END

2 TEXTINCLUDE  
BEGIN
    "#include ""afxres.h""\r\n"
    "\0"
END

3 TEXTINCLUDE  
BEGIN
    "\r\n"
    "\0"
END

#endif    // APSTUDIO_INVOKED

#endif    // English (United States) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED



resource file:

C++
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by DirWalk.rc

#define IDI_DIRWALK                     400
#define IDC_TREE                        401
#define IDD_DIRWALK	                    402






// Next default values for new objects
// 
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE        101
#define _APS_NEXT_COMMAND_VALUE         40001
#define _APS_NEXT_CONTROL_VALUE         1001
#define _APS_NEXT_SYMED_VALUE           101

#endif
#endif



Why my dialog box isn't displayed?
SuggestionRe: DialogBox fuction not executing its procedure Pin
David Crow19-Aug-22 5:34
David Crow19-Aug-22 5:34 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan19-Aug-22 5:40
mveRichard MacCutchan19-Aug-22 5:40 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24319-Aug-22 6:15
coco24319-Aug-22 6:15 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan19-Aug-22 6:52
mveRichard MacCutchan19-Aug-22 6:52 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24319-Aug-22 7:16
coco24319-Aug-22 7:16 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan19-Aug-22 9:09
mveRichard MacCutchan19-Aug-22 9:09 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24320-Aug-22 0:47
coco24320-Aug-22 0:47 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan20-Aug-22 0:58
mveRichard MacCutchan20-Aug-22 0:58 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24320-Aug-22 1:06
coco24320-Aug-22 1:06 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan21-Aug-22 2:56
mveRichard MacCutchan21-Aug-22 2:56 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24321-Aug-22 8:51
coco24321-Aug-22 8:51 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan21-Aug-22 10:03
mveRichard MacCutchan21-Aug-22 10:03 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24321-Aug-22 11:16
coco24321-Aug-22 11:16 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24322-Aug-22 10:58
coco24322-Aug-22 10:58 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan22-Aug-22 22:22
mveRichard MacCutchan22-Aug-22 22:22 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan23-Aug-22 1:23
mveRichard MacCutchan23-Aug-22 1:23 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24323-Aug-22 7:30
coco24323-Aug-22 7:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.