Jump to content
Sign in to follow this  
siti

Detect Modal Dialog Box

Recommended Posts

cik siti ada satu masalah...

macam mana nak detect sama ada modal dialog box dipaparkan dalam application kita? kaedah yang diperlukan samada melalui fungsi MFC atau winapi.

thanks in advance!

*p/s: kalau nak lebih hebat, masukkan juga untuk detect message box

Share this post


Link to post
Share on other sites

Apa maksud cik siti nak detect dialog box?

Cik siti boleh guna function OnInitDialog() sebelum mesej dihantar.

BOOL CMyDialog::OnInitDialog()
{
  CDialog::OnInitDialog()

  // masukkan initialization

  PostMessage(WM_SHOW_DIALOG_B); //hantar mesej ke dialog

  return TRUE;
}

Sumber: Programming for Windows 98/NT (penulisnye tak ingat)

Share this post


Link to post
Share on other sites

ok, cik siti sebenarnya telah implemented satu low level keyboard service untuk windows. semuanya telah berjalan ok (so far) tapi siti nak disable service ini apabila ada modal dialog box atau message box dipaparkan pada screen. apa yang siti tulis telah dimasukkan ke dalam DLL dan sesiapa sahaja boleh memanggil fungsi ini daripada DLL tersebut. masalahnya siti tak akan tahu bilakah pemanggil akan memaparkan modal dialog box atau message box.

ada sesiapa yang boleh beri idea tak?

enumerate kesemua window pada screen dan detect which one is a dialog box? tapi tak tahu samada jenis modal atau modeless!!! lagi malang apabila MFC telah wrap sesetengah window menggunakan class mereka sendiri...

tolong! tolong! tolong!

Share this post


Link to post
Share on other sites

err... mohon maaf, siti tak dapat nak edarkan atau berikan source code (atau DLL) tersebut kepada zeph kerana ia melanggar polisi dan perjanjian yang telah siti buat. sad.gif

Share this post


Link to post
Share on other sites

hello siti :}, zeph gave me the new putera forum and now i'm here once again :}. anyway for ur problem, i talked to a few friends and looked up MSDN and from what i've found, is to set a flag and hook the API IsDialogMessage, if it is called once with the hWnd of the dialog window, then u have yourself a modeless dialog, so maybe have a wait of 1 second or so. sorry if i make it sound so easy smile.gif

References:

http://msdn.microsoft.com/library/default....DialogBoxes.asp

cheers

Kwai

Share this post


Link to post
Share on other sites

1. most of MFC applications boleh jalan ok... tapi ada juga yang tak ok mad.gif

2. application delphi tak boleh langsung since bukan derieved dari class Dialog sad.gif

tapi beribu-ribu terima kasih cik siti ucapkan kepada semua yang sudi menolong laugh.gif

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...