I am asking how to make a window application without main window (based only on dialogs)...?
I am asking how to make a window application without main window (based only on dialogs)...?
[C++]
IDE: DevC++ 4.9.9.2 (GCC 3.4.2)
2nd compiler: g++ (GCC 3.4.3/4.0.0)
3rd compiler: Borland 5.5
[C#]
IDE: Microsoft Visual C# Express 2005
2nd IDE: SharpDevelop
2nd compiler: csc in Command Prompt
.NET Framework: 2.0
[PHP]
Core: 5.1.0 beta 3
IDE: PHPEdit
2nd IDE: Notepad
Favourite extensions: exif,gd2,mysql
Favourite PEAR packages: DB, XML_RSS, ID3
Favourite databases: SQLite, MySQL
Be more specific on what you want. Do you want to make a dialog box from a resource file, or what? What is your program trying to do? Tell me more and I may be able to help you.
OK.
I don't want to have the main window, because it's too complicated to create all windows (buttons, listbox, etc.) and I want to use a dialog for main window (created in resource file and using own WindowProcedure).
My program will be for entering some data in MySQL database.
[C++]
IDE: DevC++ 4.9.9.2 (GCC 3.4.2)
2nd compiler: g++ (GCC 3.4.3/4.0.0)
3rd compiler: Borland 5.5
[C#]
IDE: Microsoft Visual C# Express 2005
2nd IDE: SharpDevelop
2nd compiler: csc in Command Prompt
.NET Framework: 2.0
[PHP]
Core: 5.1.0 beta 3
IDE: PHPEdit
2nd IDE: Notepad
Favourite extensions: exif,gd2,mysql
Favourite PEAR packages: DB, XML_RSS, ID3
Favourite databases: SQLite, MySQL
Code:#include <windows.h> HWND g_hwnd; BOOL CALLBACK DlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); /** * Main entry point */ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { DialogBoxParam(NULL, MAKEINTRESOURCE(IDD_DIALOG_MAIN), NULL, DlgProc, 0); return 0; } /** * Dialog procedure for the main dialog box. */ BOOL CALLBACK DlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_INITDIALOG: g_hwnd = hwndDlg; return TRUE; case WM_CLOSE: EndDialog(g_hwnd,0); return true; } return FALSE; }
and then I don't need WindowProcedure (LRESULT CALLBACK) function?
[C++]
IDE: DevC++ 4.9.9.2 (GCC 3.4.2)
2nd compiler: g++ (GCC 3.4.3/4.0.0)
3rd compiler: Borland 5.5
[C#]
IDE: Microsoft Visual C# Express 2005
2nd IDE: SharpDevelop
2nd compiler: csc in Command Prompt
.NET Framework: 2.0
[PHP]
Core: 5.1.0 beta 3
IDE: PHPEdit
2nd IDE: Notepad
Favourite extensions: exif,gd2,mysql
Favourite PEAR packages: DB, XML_RSS, ID3
Favourite databases: SQLite, MySQL
You still need a window procedure. In my example, the window procedure is the DlgProc function.
Yeah - i was using Dialog functions before, but I didn't remember!
Thanks for all help!
[C++]
IDE: DevC++ 4.9.9.2 (GCC 3.4.2)
2nd compiler: g++ (GCC 3.4.3/4.0.0)
3rd compiler: Borland 5.5
[C#]
IDE: Microsoft Visual C# Express 2005
2nd IDE: SharpDevelop
2nd compiler: csc in Command Prompt
.NET Framework: 2.0
[PHP]
Core: 5.1.0 beta 3
IDE: PHPEdit
2nd IDE: Notepad
Favourite extensions: exif,gd2,mysql
Favourite PEAR packages: DB, XML_RSS, ID3
Favourite databases: SQLite, MySQL