Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #6689 > unrolled thread
| Started by | H_Fidler@yahoo.com |
|---|---|
| First post | 2014-03-20 05:03 -0700 |
| Last post | 2014-04-04 12:54 -0700 |
| Articles | 11 — 5 participants |
Back to article view | Back to comp.lang.clipper.visual-objects
transfer focus to Office H_Fidler@yahoo.com - 2014-03-20 05:03 -0700
Re: transfer focus to Office "Willie Moore" <williem@wmconsulting.com> - 2014-03-21 09:05 -0500
Re: transfer focus to Office H_Fidler@yahoo.com - 2014-03-21 14:53 -0700
Re: transfer focus to Office Giorgio <ngpollarolo@hotmail.com> - 2014-03-21 15:59 -0700
Re: transfer focus to Office Giorgio <ngpollarolo@hotmail.com> - 2014-03-21 16:03 -0700
Re: transfer focus to Office H_Fidler@yahoo.com - 2014-03-28 03:14 -0700
Re: transfer focus to Office Camille Kater <katercam@pt.lu> - 2014-03-28 14:03 +0100
Re: transfer focus to Office H_Fidler@yahoo.com - 2014-03-31 04:58 -0700
Re: transfer focus to Office Frans Wauters <info@wautersit.com> - 2014-03-31 06:29 -0700
Re: transfer focus to Office Giorgio <ngpollarolo@hotmail.com> - 2014-03-31 13:36 -0700
Re: transfer focus to Office H_Fidler@yahoo.com - 2014-04-04 12:54 -0700
| From | H_Fidler@yahoo.com |
|---|---|
| Date | 2014-03-20 05:03 -0700 |
| Subject | transfer focus to Office |
| Message-ID | <72116452-155a-45d1-867f-c8d9b09e8e80@googlegroups.com> |
I open an Excel file with:
self:oExcel := OLEAutoObject{"Excel.Application"}
I search a string in the file, and when I find it, I would like to pass the focus to the Excel file.
How to pass the focus?
Thanks
Henry
[toc] | [next] | [standalone]
| From | "Willie Moore" <williem@wmconsulting.com> |
|---|---|
| Date | 2014-03-21 09:05 -0500 |
| Message-ID | <lghgve$dm$1@speranza.aioe.org> |
| In reply to | #6689 |
Henry,
If you get the handle to the window you can just do a setfocus() function to
set the focus to that window.
Regards,
Willie
Vulcan VIP
wrote in message
news:72116452-155a-45d1-867f-c8d9b09e8e80@googlegroups.com...
I open an Excel file with:
self:oExcel := OLEAutoObject{"Excel.Application"}
I search a string in the file, and when I find it, I would like to pass the
focus to the Excel file.
How to pass the focus?
Thanks
Henry
[toc] | [prev] | [next] | [standalone]
| From | H_Fidler@yahoo.com |
|---|---|
| Date | 2014-03-21 14:53 -0700 |
| Message-ID | <aa4293d8-aaad-4fd9-b2b5-99e7c9298ad5@googlegroups.com> |
| In reply to | #6689 |
Willie, Thanks for the answer 1. How do I find the handle to the Office's window? 2. How do I SetFocus() with an handel? Thanks Henry
[toc] | [prev] | [next] | [standalone]
| From | Giorgio <ngpollarolo@hotmail.com> |
|---|---|
| Date | 2014-03-21 15:59 -0700 |
| Message-ID | <facd8f09-37d5-4969-bdda-36a04e7b3009@googlegroups.com> |
| In reply to | #6699 |
On Friday, March 21, 2014 3:53:42 PM UTC-6, H_Fi...@yahoo.com wrote: Perhaps that can help: nhandle:=FindWindow( String2Psz( "XLMAIN" ) > Willie, Thanks for the answer > > 1. How do I find the handle to the Office's window? > > 2. How do I SetFocus() with an handel? > > > > Thanks > > Henry
[toc] | [prev] | [next] | [standalone]
| From | Giorgio <ngpollarolo@hotmail.com> |
|---|---|
| Date | 2014-03-21 16:03 -0700 |
| Message-ID | <75fbc674-73b1-43a4-aa05-4487e5edf324@googlegroups.com> |
| In reply to | #6699 |
On Friday, March 21, 2014 3:53:42 PM UTC-6, H_Fi...@yahoo.com wrote: and setfocus(nhandle) > Willie, Thanks for the answer > > 1. How do I find the handle to the Office's window? > > 2. How do I SetFocus() with an handel? > > > > Thanks > > Henry
[toc] | [prev] | [next] | [standalone]
| From | H_Fidler@yahoo.com |
|---|---|
| Date | 2014-03-28 03:14 -0700 |
| Message-ID | <661195ef-7d31-4516-8e16-ef17348782b6@googlegroups.com> |
| In reply to | #6689 |
Giorgio, thanks for the answer.
I tried:
nHandle := FindWindow(String2Psz("Excel.exe"))
And I received a compiler error:
Actual parameter is missing or default value not specified.
Thanks for any help.
Henry
[toc] | [prev] | [next] | [standalone]
| From | Camille Kater <katercam@pt.lu> |
|---|---|
| Date | 2014-03-28 14:03 +0100 |
| Message-ID | <1396012637_5@vo.lu> |
| In reply to | #6718 |
Henry,
FindWindow requires 2 parameters:
HWND FindWindow(
LPCTSTR lpClassName,
// pointer to class name
LPCTSTR lpWindowName
// pointer to window name
);
Window name = caption of the window
You can Write:
FindWindow(NULL_PSZ,String2Psz(<Window caption>)
Camille
On 28/03/2014 11:14, H_Fidler@yahoo.com wrote:
> Giorgio, thanks for the answer.
>
> I tried:
> nHandle := FindWindow(String2Psz("Excel.exe"))
>
> And I received a compiler error:
> Actual parameter is missing or default value not specified.
>
> Thanks for any help.
>
> Henry
>
[toc] | [prev] | [next] | [standalone]
| From | H_Fidler@yahoo.com |
|---|---|
| Date | 2014-03-31 04:58 -0700 |
| Message-ID | <0b2fdbec-f869-423c-a29f-e77d224220f5@googlegroups.com> |
| In reply to | #6719 |
Thanks Camille
"Microsoft Excel" is the caption of the Excel, and I use:
nHandle := FindWindow(null_psz, String2Psz("Microsoft Excel"))
SetFocus(nHandle)
but the focus remain by CaVo.
Any ideas?
Thanks
Henry
[toc] | [prev] | [next] | [standalone]
| From | Frans Wauters <info@wautersit.com> |
|---|---|
| Date | 2014-03-31 06:29 -0700 |
| Message-ID | <2bfcb9a9-d7fd-4609-bb24-47c2e2bf1c6e@googlegroups.com> |
| In reply to | #6689 |
Hi Henry,
Maybe this helps to bring the application (XLS window) to the foreground:
IF ( nHandle != NULL_PTR )
SetForegroundWindow( nHandle )
RETURN 0
ENDIF
Regards,
Frans
[toc] | [prev] | [next] | [standalone]
| From | Giorgio <ngpollarolo@hotmail.com> |
|---|---|
| Date | 2014-03-31 13:36 -0700 |
| Message-ID | <c22bbede-b661-439c-924a-a7cee3fd6e2a@googlegroups.com> |
| In reply to | #6689 |
Hi Henry,
I have this code and its works while the excel window is not minimized:
h:=FindWindow( String2Psz( "XLMAIN" ), null_psz )
SetForegroundWindow(h)
SetFocus(h)
Giorgio
On Thursday, March 20, 2014 6:03:06 AM UTC-6, H_Fi...@yahoo.com wrote:
> I open an Excel file with:
>
> self:oExcel := OLEAutoObject{"Excel.Application"}
>
>
>
> I search a string in the file, and when I find it, I would like to pass the focus to the Excel file.
>
> How to pass the focus?
>
>
>
> Thanks
>
> Henry
[toc] | [prev] | [next] | [standalone]
| From | H_Fidler@yahoo.com |
|---|---|
| Date | 2014-04-04 12:54 -0700 |
| Message-ID | <9743daf6-cf4c-430c-83cf-2dbb99660e4b@googlegroups.com> |
| In reply to | #6731 |
Hi Giorgio Thanks, it works Henry
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.clipper.visual-objects
csiph-web