Bring OpenOffice MainWindow to front (C++, Windows)
Bring OpenOffice MainWindow to front (C++, Windows)
I need to bring the OpenOffice window to front, when it is already open.
At the moment I have a XWindow instance, there I can use setFocus, but this will not bring the application to front.
1)
Is there some other API call to bring the OpenOffice window to front, instead of blinking.
2)
I know how to do this when I have the processID. Is there a way to retrieve the processID directly via an API call?
3)
When there I no direct way to retrieve the processID via SDK, then I know how to do this when I could change the Caption of the OpenOffice MainWindow.
What is the API call to change the caption of a window?
1,2 or 3
At the moment I have a XWindow instance, there I can use setFocus, but this will not bring the application to front.
1)
Is there some other API call to bring the OpenOffice window to front, instead of blinking.
2)
I know how to do this when I have the processID. Is there a way to retrieve the processID directly via an API call?
3)
When there I no direct way to retrieve the processID via SDK, then I know how to do this when I could change the Caption of the OpenOffice MainWindow.
What is the API call to change the caption of a window?
1,2 or 3
OpenOffice 4.1 on Windows
Re: Bring OpenOffice MainWindow to front (C++, Windows)
Call toFront method on the container window of the document frame:
http://www.openoffice.org/api/docs/comm ... ml#toFront
http://www.openoffice.org/api/docs/comm ... ml#toFront
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
Apache OpenOffice 4-dev on Xubuntu 14.04
Re: Bring OpenOffice MainWindow to front (C++, Windows)
I am very new to the OpenOffice SDK, so I do it like this:
Is this the right way?
The window is unfortunately not put to front.
Is this the right way to create/retrieve a XTopWindow?
When this is the correct code, then it doesn't work. Then I would need to get the process ID, there I have some code to put a process in front.
Is this the right way?
Code: Select all
Reference <XModel> xModel(xOfficeDocument_, UNO_QUERY );
auto xContainerWindow_ = xModel->getCurrentController()->getFrame()->getContainerWindow();
auto xContainerWindow_->setVisible(sal_True);
// to activate
Reference<XTopWindow > xParentWindowTop(xContainerWindow_, UNO_QUERY);
xParentWindowTop->toFront();
Is this the right way to create/retrieve a XTopWindow?
When this is the correct code, then it doesn't work. Then I would need to get the process ID, there I have some code to put a process in front.
OpenOffice 4.1 on Windows
Re: Bring OpenOffice MainWindow to front (C++, Windows)
I'm not sure why toFront method is not working on Windows environment.
http://www.openoffice.org/api/docs/comm ... wPeer.html
You can find the interface on the container window. In general, the container window is system child window.
See:When this is the correct code, then it doesn't work. Then I would need to get the process ID, there I have some code to put a process in front.
http://www.openoffice.org/api/docs/comm ... wPeer.html
You can find the interface on the container window. In general, the container window is system child window.
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
Apache OpenOffice 4-dev on Xubuntu 14.04
Re: Bring OpenOffice MainWindow to front (C++, Windows)
The window is just blinking. A common issue on windows.
The link you have provided mention a function called sal_getGlobalProcessId
But I don't find a link to the description of this function, so that I can now which included it needs and how to call it?
Do you have a code snippet for me, please?
The link you have provided mention a function called sal_getGlobalProcessId
But I don't find a link to the description of this function, so that I can now which included it needs and how to call it?
Do you have a code snippet for me, please?
OpenOffice 4.1 on Windows
Re: Bring OpenOffice MainWindow to front (C++, Windows)
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Re: Bring OpenOffice MainWindow to front (C++, Windows)
@RoryOF
This is the same link again, to a function which requires as input a processID, which I don't have.
This is the same link again, to a function which requires as input a processID, which I don't have.
OpenOffice 4.1 on Windows
Re: Bring OpenOffice MainWindow to front (C++, Windows)
Currently, the first argument is ignored. Pass empty sequence.zack wrote:The window is just blinking. A common issue on windows.
The link you have provided mention a function called sal_getGlobalProcessId
But I don't find a link to the description of this function, so that I can now which included it needs and how to call it?
Do you have a code snippet for me, please?
It seems sal_getGlobalProcessId is renamed to rtl_getGlobalProcessId.
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
Apache OpenOffice 4-dev on Xubuntu 14.04
Re: Bring OpenOffice MainWindow to front (C++, Windows)
I have a problem reading/understanding the documentation.
What header do I have to include to use getWindowHandle?
What header to I have to include to use rtl_getGlobalProcessId?
I found this: https://www.openoffice.org/api/docs/cpp ... ess.h.html but where is this process.h file?
The function seems to do not the right thing, because I need the processID from one specific instance of OpenOffice.
So I guess there must be a second argument for this instance...
Some small code snippet would help me a lot here. Thanks!
What header do I have to include to use getWindowHandle?
What header to I have to include to use rtl_getGlobalProcessId?
I found this: https://www.openoffice.org/api/docs/cpp ... ess.h.html but where is this process.h file?
The function seems to do not the right thing, because I need the processID from one specific instance of OpenOffice.
So I guess there must be a second argument for this instance...
Some small code snippet would help me a lot here. Thanks!
OpenOffice 4.1 on Windows
Re: Bring OpenOffice MainWindow to front (C++, Windows)
I was able to bring the window to front with using, with using the getWindowHandle method.
1)
My question is, there is always an soffice.bin in the taskmanager, what is this?
2)
For every window I create there is not a new instance created. Is it somehow possible to create for every new swriter application a new instance?
Code: Select all
Reference<XSystemDependentWindowPeer> system = Reference<XSystemDependentWindowPeer>(window, UNO_QUERY);
Any hwnd = system->getWindowHandle(Sequence<sal_Int8>(0), com::sun::star::lang::SystemDependent::SYSTEM_WIN32);
sal_Int32 handle = hwnd.get<sal_Int32>();
DWORD processID = 0;
GetWindowThreadProcessId( (HWND)(LONG_PTR)(handle ), &processID);
My question is, there is always an soffice.bin in the taskmanager, what is this?
2)
For every window I create there is not a new instance created. Is it somehow possible to create for every new swriter application a new instance?
OpenOffice 4.1 on Windows
Re: Bring OpenOffice MainWindow to front (C++, Windows)
The soffice.bin in taskmanager indicates that the OpenOffice suite is running.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS