Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grab Basket of questions
Message
From
16/03/2016 13:16:02
 
 
To
14/03/2016 23:34:44
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01633086
Message ID:
01633185
Views:
57
Hi John,

Regarding # 1, this is what I use to check for other windows with the same title.
cSearchFor = UPPER(ALLTRIM( "YourMainWindowCaption" ))
nHWnd = GetDesktopWindow()	&& API
nHWnd = GetWindow(nHWnd, 5) && API - Get first child window
nNext = 2
lFound = .F.
cTitleBar = ""
do while NOT lFound
  if NOT EMPTY(nHWnd)
    cTitleBar = SPACE(200) + CHR(0)
    nTextLen = GetWindowText(nHWnd, @cTitleBar, 200)  && API
    cTitleBar = UPPER(LEFT(cTitleBar, nTextLen))
 	lFound = (cTitleBar = cSearchFor) 
    if NOT lFound
      nHWnd = GetWindow(nHWnd, nNext)	&& API
    endif
  else
    lFound = .T.
  endif
enddo

return (lFound)
The API call declarations are all that you'll need to get that working, but they're easy to find on news2news.

Regarding # 4: I use a launcher application to drop the main executable to the users temp folder and launch it from there. If the executable is large, this could take a moment or two. To remedy that, I only invoke the copy if the exe isn't already there or it's has a different date/time stamp than the network version. As a side benefit, you never have to kick anyone out to update the network executable. By running it form the local drive, the network instance is never the one that's running.

Hope that helps!
~Erik Folley
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform