Thank you for your help.
Tim Shor
Through liberal use of the Windows API.
1. Prototype the following API functions in your global map.
EnumWindowsProc(ULONG,LONG),BYTE,PASCAL,TYPE
EnumWindows(EnumWindowsProc,LONG),BYTE,PASCAL,PROC
GetWindowText(ULONG,ULONG,ULONG),LONG,PASCAL,NAME(''GetWindowTextA''),PROC
ShowWindow(ULONG,ULONG),BYTE,PASCAL,PROC
IsIconic(ULONG),BYTE,PASCAL
SetForegroundWindow(ULONG),BYTE,PASCAL,PROC
2. Write the EnumWindowsProc procedure. This must be a source
procedure that matches the prototype listed above. Call the two
parameters pHandle and pParam.
The procedure should be as follows:
DATA
SW_RESTORE EQUATE(9)
WindowName CSTRING(101)
CODE
GetWindowText(pHandle, ADDRESS(WindowName), SIZE(WindowName)
IF MATCH(WindowName, 'Text of Window',MATCH:Wild+MATCH:Case)
IF IsIconic(pHandle)
ShowWindow(pHandle, SW_RESTORE)
ELSE
SetForegroundWindow(pHandle)
END
RETURN False
END
RETURN True
3. Issue the following line whenever you want to find the window whose
name is 'Text of Window' and restore it.
EnumWindows(EnumWindowsProc, 0)
If you want to get even fancier, you can populate a CSTRING with the
name to search for, and pass its address as the second parameter to
EnumWindows. It will then get passed to EnumWindowsProc as the pParam
parameter.
Jason
The ABCFree templates will do want you want. Specifically the "Misc:
One Application Instance" Global template will determine if the
application is already running, and the "API: Enumerate Windows and
Child Windows" Global template will restore the existing application
to its previous state and give it focus. The ABCFree templates are
available at:
http://www.authord.com/Clarion/
Best Regards,
Geoff Spillane
On Mon, 14 Jul 2003 07:50:17 -0400, "Timofey Shor"
<kazac...@yahoo.com> wrote:
Thanks again.
Have a great day.
Tim Shor
"Jason Berkan" <jason_...@canada.com> wrote in message
news:3f133403...@news.softvelocity.com...
I want to know something.
In Clarion for DOS
Can you link with a C++ obj to use objs functions
Thanks
Yes, if you can export the C++ functions as C functions (extern "C").
Note that this means you cannot directly access a C++ object.
Linking a C module to Clarion is not simple - there is an entire
appendix in the CPD 2.1 Language Reference describing the process.
It is much simpler in Clarion for Windows, provided the C++ code is
compiled into a DLL.
Jason