AltayKarakus
April 14th, 2003, 05:02 AM
Hi, everbody. I need a simple example or a tutorial at leaset some words about the following subject.
How could I create a windows program that does not have a clasic window but only a dialog that I could use it as my main window for a simple application and use it from system tray.
thanx ..
mahanare
April 14th, 2003, 07:05 AM
Hi,
regarding Dialog Based applications,
while creating your project
Select MFC appWizard (exe)
give some name to your project
click next
Select "Dialog Based Application" radio button in step 1
it starts a project just based on dialog based.
regarding System tray..
there are vast number of sample applications done by some good guys.. So I feel you need not re descover anything.
visit
http://www.codeguru.com/shell/tbhide.html
for more articles http://www.codeguru.com/shell and scroll down to Tray section where you can find few more samples.
or you can search on net with related key words which may give your more broader view of the problem
cheers
harinath
indiocolifa
April 14th, 2003, 09:59 AM
Heres a sample Win32 WinMain function which uses DialogBox instead of CreateWindowEx to create a main dialog box:
int WINAPI WinMain (HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
g_hInst = hInstance;
// show dialog-box
int dlgResult = DialogBox (g_hInst, MAKEINTRESOURCE(IDD_DLGMAIN), NULL, DlgProc);
return 0;
}
This is for a dialog created in the Resource Editor named IDD_DLGMAIN (see the MAKEINTRESOURCE macro there).
You need the dialog procedure for this to work:
BOOL CALLBACK DlgProc (HWND hwndDlg, UINT uMsg, WPARAM wparam, LPARAM lparam)
{
switch (uMsg)
{
case WM_INITDIALOG:
... (process messages here)
return TRUE;
}
Process the dialog buttons with the EndDialog function.
You should have a good start from here... look at MSDN for more info...
Good coding.