I
im_chc
Hi,
I want to make the Excel window to be foreground.
I created a VB6 form and use:
Dim xlApp as Excel.Application
set xlApp = getObject("", "Excel.Application")
xlApp.Visible = true
Then at some point I have to do Msgbox, however I have to bring my form
to foreground or else it will be behind the excel window:
FormFoo.setFocus
Msgbox ("System msg")
However I don't know how to bring up the Excel window again.
I thought I could do xlApp.ActiveWindow.Activate (let's say only one
excel window), but doesn't work.
I know that I can get the hWnd value from xlApp, I tried to call
ShowWindow() and SetForegroundWindow(), but don't work. The WIN32 API
said if the window is not created by my process, it won't work (both
functions will return 0, and they did).
I tried to do SendMessage(XL_hWnd, WM_Activate), but the doc also said
"the window will expect to receive also WM_MOUSE", but I don't know
what to do about that.
So what should I do? There should be some simple way to do so.
Or, if I have to do SendMessage(), where can I get tutorials etc to
know how to do the windows SendMessage stuffs?
Help will be appreciated, thanks!
I want to make the Excel window to be foreground.
I created a VB6 form and use:
Dim xlApp as Excel.Application
set xlApp = getObject("", "Excel.Application")
xlApp.Visible = true
Then at some point I have to do Msgbox, however I have to bring my form
to foreground or else it will be behind the excel window:
FormFoo.setFocus
Msgbox ("System msg")
However I don't know how to bring up the Excel window again.
I thought I could do xlApp.ActiveWindow.Activate (let's say only one
excel window), but doesn't work.
I know that I can get the hWnd value from xlApp, I tried to call
ShowWindow() and SetForegroundWindow(), but don't work. The WIN32 API
said if the window is not created by my process, it won't work (both
functions will return 0, and they did).
I tried to do SendMessage(XL_hWnd, WM_Activate), but the doc also said
"the window will expect to receive also WM_MOUSE", but I don't know
what to do about that.
So what should I do? There should be some simple way to do so.
Or, if I have to do SendMessage(), where can I get tutorials etc to
know how to do the windows SendMessage stuffs?
Help will be appreciated, thanks!