Using the WinApi dialogs, there's two types modal and modeless.
1. A MODAL dialog is called with:
DialogBox(hInstance, MAKEINTRESOURCE(IDD_MYDIALOG), hWnd, (DLGPROC)MYDIALOGFUNCTIONNAME);
This type of dialog when called will hold the execution of your program until the dialog ends, ie closed, cancel or okay button has been pressed. It is the most commen dialog.
2. A MODELESS dialog is called with:
CreateDialog(hInstance, MAKEINTRESOURCE(IDD_MYDIALOG), hWnd, (DLGPROC)MYDIALOGFUNCTIONNAME);
This dialog will allow your program to carry on running, however, you will have to check the dialog by maybe using a flag to say it's running. These dialogs are useful for controlling things in real-time situations.
When editing a resource in ResEdit it will give you 2 files, a ".h" file and a ".rc" file. The ".h" file has to be included in your program somewhere were you are using it. You will notice that from ResEdit it will give lines like this:
#define IDD_MYDIALOG 100
These are used when creating your dialog.
Other defines will have such things as IDC_MYCONTROL. These are used within the messaging system.
In the above I've called my CallBack - MYDIALOGFUNCTIONNAME which is usually setup (this is just a skeleton) like this:
BOOL CALLBACK MYDIALOGFUNCTIONNAME(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch (Msg)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
switch(wParam)
{
case IDOK:
EndDialog(hWndDlg, 0);
return TRUE;
}
break;
}
return FALSE;
}
Within the WM_INITDIALOG you will transfer your own values into the controls on the dialog before it gets run. ie. Transferring your coordinates to the dialog. On MODELESS dialogs, it's useful from here to set a flag to let your program know that the dialog is active.
As you will notice within the WM_COMMAND braces the IDOK which is the OKAY button on the dialog. This ends the dialog, closes it down. In here you can transfer your data from the dialog back to your own variables. It is also here where you would reset your flag if using a MODELESS dialog so that your program is aware that the dialog has ended.
The rest is basically up to you, but I do recommend getting the Win32Api reference if you do go any further with working with resources. As well as that, I've found that googling any refernces comes up with a mine of information and tutorial which will help you understand the Win32Api programming.
Good luck...
Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!