on 07-10-2015 12:59 PM
Hi All,
When I need to open the 'OpenFileDialog' window in SAP, I used its 'ShowDialog(IWin32Window)' method, by parsing the 'Sap Business One''s Main window handler as the parameter.
It worked fine and showed on top of SAP screen, But when I try the same in SAP 9.1 it close the 'OpenFileDialog' box with the status of Cancel. Is there any other way to show this dialog on top of the SAP screen? Your thoughts and ideas are really appreciated.
Best Regards,
J S L Geeganage
Jeewan Sucharitha Lanka Geeganage:
> When I need to open the 'OpenFileDialog' window in
> SAP, I used its 'ShowDialog(IWin32Window)' method,
> by parsing the 'Sap Business One''s Main window
> handler as the parameter.
Strange. I have reported this error to the SAP sup-
port, and they said they fixed it. See note
1960726: 64-bit SAP Business One client cannot open
Windows modal forms as child windows.
P.S.: Attached is my original error report, for
whatever it is worth.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
The OpenFileDialog is an old recurring question.
From my side, the only piece of code which is working accross all versions and environments (so including TSE) can be found here: http://scn.sap.com/thread/40272 (search after Denis Sapunkov's answer).
You'll find attached Denis' contribution converted for my own Framework.
Regards,
Eric
Hi ERIC,
It works indeed. And I also tried to reproduce the issue with my previous code. But It won't. I changed following line
IntPtr ptr = GetForegroundWindow();
with
IntPtr ptr = System.Diagnostics.Process.GetProcessesByName("Sap business one").First().MainWindowHandle;
And my code was missing
while (!threadGetFile.IsAlive); // Wait for thread to get started
Thread.Sleep(1); // Wait a sec more
So now everything working well without refereeing the unmanaged code as well.
Regards,
J S L Geeganage
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.