Subject |
Re: prevent program opening twice |
From |
Charlie <tm@tc.com> |
Date |
Sat, 21 Sep 2024 17:15:51 -0400 |
Newsgroups |
dbase.getting-started |
Hey, thanks very much.
Please excuse my ignorance but I am having trouble understanding how this works.
I have tried this with the 2 functions in my functions program. It isn't working I think because ideally, I would like to do this in my initial program before it gets to the form.
Is there any way to do this from a program?
Thanks
Bernard Mouille Wrote:
> Hello Charlie,
>
> Look some code.
>
> // Returns true if the window is running ( _Lib1 ).
> function bd_IsWindowRun( cWindow, lMsgbox )
> if argcount() < 2
> lMsgbox = true
> endif
> if bd_FindWindow( null, cWindow ) <> 0
> if lMsgbox // Message if this function is used for not run 2 times the form.
> msgbox( "Window [ " + cWindow + " ] is running, Abort", "Find window", 48 )
> endif
> return true
> endif
> return false
>
> // Find the handle of a window( _lib1.cc ).
> function bd_FindWindow( cClass, cWindow )
> local hHandle
> if type( "FindWindowA" ) <> "FP"
> extern CHANDLE FindWindowA( CSTRING, CSTRING ) user32.dll
> endif
> hHandle = FindWindowA( cClass, cWindow )
> return hHandle
>
> Regards,
> Bernard.
>
>
>
>
>
> Charlie Wrote:
>
> > There was a post here a couple of years with instructions of preventing a form (i think) from opening twice. I can't seem to find it when searching. Can anyone point me to it? Thanks much.
>
|
|