Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Messagebox API
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Divers
Thread ID:
00475884
Message ID:
00476189
Vues:
35
George,

The message handling in VFP is pretty much standard, it gets freaky when it needs to deal with its child windows. I knocked together a FLL that monitors the windows message queue for VFP and the MessageBoxEx behaviour is standard and works. I think the problem lies in the assigning of the HWND in the MessageBoxEx() API function.
void SubClassMsgQueue(void)
{
   gfnOldWndProc = (WNDPROC)SetWindowLong(_WhToHwnd(_WMainWindow()), GWL_WNDPROC, (DWORD)SubClassFunc);
}

LRESULT WINAPI SubClassFunc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
   switch(uMsg)
   {
	case WM_HELP:
           _Execute("wait window 'Help' nowait");
           break;
   }

   return CallWindowProc(gfnOldWndProc, hWnd, uMsg, wParam, lParam);
}

void Invoke_Help(void)
{
   ::MessageBoxEx(_WhToHwnd(_WMainWindow()), 
      "Press the help button", 
      "VFP", 
      MB_HELP, 
      LANG_ENGLISH);
}
When I use the FLL and I call the Invoke_Help() command from VFP I get the messagebox with OK and Help buttons. Pressing the Help button fires a wait window containing the "Help" prompt.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform