Hi all,
when I use this code, the Office program does open the file,
but the Dialog won't close...
I'm I doing something wrong?
File.Open("C:\\TOOLS\\EigenTEKST.rtf", "", SW_SHOWNORMAL);
Result = DialogEx.Close(0);
Professional Software Development Tools
Hi all,
when I use this code, the Office program does open the file,
but the Dialog won't close...
I'm I doing something wrong?
File.Open("C:\\TOOLS\\EigenTEKST.rtf", "", SW_SHOWNORMAL);
Result = DialogEx.Close(0);
I could be wrong, as I don't have the latest version yet, but I believe that DialogEx.Close is used for a Dialog Windows that is created by a DialogEX function.
I wouldn't expect it to have any effect at all on a regular window.
Confirmed here. I think the problem is that the dialog loses focus and once that happens, no more code is executed. This focus problem was reported in another thread.
Dermot
I am so out of here
i had found a bug in the dialog, but in all my tests i could always close the dialog window and useing the code like below
it opens the log file and the dialog closes with no problemsCode:File.Open("AutoPlay\\Docs\\-20070416.log", "", SW_SHOWNORMAL); Result = DialogEx.Close(0);
Dermot, you have confirmed this bug but it works fine for me, on what system did you test, i tested on Vista home premium
below is the apz i used to test
Last edited by RizlaUK; 02-01-2009 at 11:34 AM.
Open your eyes to Narcissism, Don't let her destroy your life!!
scrap that, i changed the code to
Code:File.Open("AutoPlay\\Docs\\-20070416.log", "", SW_SHOWNORMAL); Application.Sleep(1000) Result = DialogEx.Close(0); result = Dialog.Message("Notice", "Your message here.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
and now it dose not close the dialog at all, but the message dialog dose show ok, so the code is still getting executed, its the DialogEx.Close that is not executeing if the dialog loses focus, i will report this as a seprate bug
Last edited by RizlaUK; 10-21-2008 at 04:21 AM.
Open your eyes to Narcissism, Don't let her destroy your life!!
Ahhh... I misunderstood the question... I thought he was trying to use the DioalogEX.Close to close the window with the RTF file. (instead of the Dialog that had the "open" button for the RTF file)
Seems, smarter people than I, are already on the case.... carry on gentlemen.
Hello guys,
thanks for the thinking and efforts.
Very strange... it works when I take another file to open, like:
File.Open("AutoPlay\\Docs\\Letters.TXT", "", SW_SHOWNORMAL);
Result = DialogEx.Close(0);
(Here the file is opened by f.e. Editpad Lite)
It does NOT work when Office (=Word) opens a file, as in my first example.
yes, it worked for me useing notepad, but if there is a delay and the dialog loses focus before the close command then it fails, notepad and editpad both load quicker than word so the File.Open is executed faster and it jumps right on to the close command before it loses focus, simulate a lodeing delay with Application.Sleep and it will fail.
Open your eyes to Narcissism, Don't let her destroy your life!!
Hi Everyone,
This is he result of a bug in the dialog code that is causing problems when the dialog looses focus.
We're on the case and hopefully we'll have a fix out for everyone shortly.
Thanks for your patience.
MSI Factory The Next Generation Intelligent Setup Builder