Click here to Skip to main content
16,016,192 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMultiple Document Templates and CWinApp::OnFileNew() Pin
Anton Loukine4-Apr-02 11:39
Anton Loukine4-Apr-02 11:39 
GeneralRe: Multiple Document Templates and CWinApp::OnFileNew() Pin
Tomasz Sowinski4-Apr-02 11:45
Tomasz Sowinski4-Apr-02 11:45 
GeneralClosing in CWinApp Pin
dazinith4-Apr-02 10:56
dazinith4-Apr-02 10:56 
GeneralRe: Closing in CWinApp Pin
Christian Graus4-Apr-02 11:02
protectorChristian Graus4-Apr-02 11:02 
GeneralRe: Closing in CWinApp Pin
dazinith4-Apr-02 11:15
dazinith4-Apr-02 11:15 
GeneralRe: Closing in CWinApp Pin
Mazdak4-Apr-02 11:10
Mazdak4-Apr-02 11:10 
GeneralgetAttribute Pin
Gerosa4-Apr-02 9:20
Gerosa4-Apr-02 9:20 
GeneralCreateWindow from DLL Pin
User 66584-Apr-02 9:13
User 66584-Apr-02 9:13 
Hi
is it possible to create a window from a DLL?
The window shall display some debug output in this window, but I can't get it to work.
This is what I have so far, but it doesn't work Frown | :(

long WINAPI WindowProc(HWND hWnd, UINT wMessage, WPARAM wParam, LPARAM lParam)
{
    return DefWindowProc(hWnd, wMessage, wParam, lParam);
}

void CreateLogWindow()
{
	static char szAppName[] = "LogWindow" ;
	
	HWND		hWnd;
	WNDCLASS	WndClass;

	WndClass.style = CS_HREDRAW | CS_VREDRAW;
	WndClass.lpfnWndProc = WindowProc;
	WndClass.cbClsExtra = 0;
	WndClass.cbWndExtra = 0;
	WndClass.hbrBackground = (HBRUSH) GetStockObject(LTGRAY_BRUSH);
	WndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
	WndClass.hIcon = 0;
	WndClass.hInstance = hInstance;
	WndClass.lpszClassName = "Testprogramm";
	WndClass.lpszMenuName = NULL;

	RegisterClass(&WndClass);

	hWnd = CreateWindow(
		"LogWindow",
		"LogWindow",
		WS_CAPTION | WS_THICKFRAME | WS_VISIBLE,
		0,
		0,
		250,//GetSystemMetrics(SM_CXSCREEN),
		250,//GetSystemMetrics(SM_CYSCREEN),
		NULL,
		NULL,
		hInstance,
		NULL
	);

	ShowWindow(hWnd, SW_SHOW);
	UpdateWindow(hWnd);
	SetFocus(hWnd);
}


Any help is greatly appreciated

regards

modified 12-Sep-18 21:01pm.

GeneralRe: CreateWindow from DLL Pin
Tomasz Sowinski4-Apr-02 9:16
Tomasz Sowinski4-Apr-02 9:16 
GeneralRe: CreateWindow from DLL Pin
User 66584-Apr-02 9:27
User 66584-Apr-02 9:27 
GeneralRe: CreateWindow from DLL [corrected] Pin
Joaquín M López Muñoz4-Apr-02 9:37
Joaquín M López Muñoz4-Apr-02 9:37 
GeneralRe: CreateWindow from DLL [corrected] Pin
User 66584-Apr-02 9:55
User 66584-Apr-02 9:55 
GeneralRe: CreateWindow from DLL [corrected] Pin
Joaquín M López Muñoz4-Apr-02 9:58
Joaquín M López Muñoz4-Apr-02 9:58 
GeneralRe: CreateWindow from DLL [corrected] Pin
User 66584-Apr-02 10:02
User 66584-Apr-02 10:02 
GeneralRe: CreateWindow from DLL [corrected] Pin
Joaquín M López Muñoz4-Apr-02 10:07
Joaquín M López Muñoz4-Apr-02 10:07 
GeneralRe: CreateWindow from DLL [corrected] Pin
User 66584-Apr-02 10:12
User 66584-Apr-02 10:12 
GeneralRe: CreateWindow from DLL [corrected] Pin
Joaquín M López Muñoz4-Apr-02 10:18
Joaquín M López Muñoz4-Apr-02 10:18 
GeneralRe: CreateWindow from DLL [corrected] Pin
User 66584-Apr-02 10:22
User 66584-Apr-02 10:22 
GeneralRe: CreateWindow from DLL [corrected] Pin
Joaquín M López Muñoz4-Apr-02 10:25
Joaquín M López Muñoz4-Apr-02 10:25 
GeneralRe: CreateWindow from DLL Pin
Jeremy Falcon4-Apr-02 9:39
professionalJeremy Falcon4-Apr-02 9:39 
GeneralRe: CreateWindow from DLL Pin
User 66584-Apr-02 9:46
User 66584-Apr-02 9:46 
GeneralRe: CreateWindow from DLL Pin
Jeremy Falcon4-Apr-02 10:12
professionalJeremy Falcon4-Apr-02 10:12 
GeneralRe: CreateWindow from DLL Pin
Tim Smith4-Apr-02 10:19
Tim Smith4-Apr-02 10:19 
GeneralRe: CreateWindow from DLL Pin
User 66584-Apr-02 10:16
User 66584-Apr-02 10:16 
GeneralRe: CreateWindow from DLL Pin
Tomasz Sowinski4-Apr-02 10:21
Tomasz Sowinski4-Apr-02 10:21 

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.