Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Looking for a simple Dialog C++ solution
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00928187
Message ID:
00928302
Views:
21
Rick,

If I understand you correctly then the answer is relativly straightforward and can be achieved through the Platform API.

You begin by creating a dialog box using a template in Visual C++, making sure you set the Style to Popup (WS_POPUP if using CreateWindowEx function) and invoke it using the CreateDialog function.
HWND hwndProgress = NULL; 

if (!IsWindow(hwndProgress)) 
{ 
   hwndProgress = CreateDialog(hInst, 
                               MAKEINTRESOURCE(IDD_PROGRESS), 
                               NULL, 
                              (DLGPROC)TestProc); 

   ShowWindow(hwndProgress, SW_SHOW); 
} 
You provide a callback function with the correct signature to process messages for both external events (SendMessage) and internal events such as a Cancel button being clicked.
LRESULT CALLBACK TestProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) 
{ 
   switch (message) 
   { 
      case WM_INITDIALOG: 
         return TRUE; 
 
      case WM_COMMAND: 
         switch (LOWORD(wParam)) 
         { 
            case IDOK: 
               return TRUE;

            case IDCANCEL: 
               DestroyWindow(hwndDlg); 
               hwndProgress = NULL; 

               return TRUE; 

            case CUSTOMMSG:
               // Perform custom processing like updating child controls.
               return TRUE;
         } 
   } 

   return FALSE; 
} 
Once you have your HWND you can register custom external messages using the RegisterWindowMessage function and send them to the dialog, this in turn is catered for in the dialog callback function.
...

case APP_UPDATEEXENAME:
   SetDlgItemText(hwndDlg, IDD_EXEFILENAME, lpstrNewEXEFileName); 
   return TRUE; 

...
HTH
Neil
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform