Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use of Outlook
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Miscellaneous
Thread ID:
00720439
Message ID:
00720612
Views:
21
You could use an API call that will close the confirmation window automatically:
*This code will close most UI dialog boxes:

PROCEDURE CloseWindow
LPARAMETERS pcTitle, pcButtonCaption

#DEFINE WM_COMMAND     0x0111
#DEFINE WM_LBUTTONDOWN 0x0201
#DEFINE WM_LBUTTONUP   0x0202

DECLARE INTEGER FindWindow IN user32; 
    STRING lpClassName,; 
    STRING lpWindowName 

DECLARE INTEGER FindWindowEx IN user32;
  INTEGER hwndParent,       ;
  INTEGER hwndChildAfter,   ;
  STRING lpszClassName,    ;
  STRING lpszWindowCaption 
 
DECLARE INTEGER SendMessage IN user32; 
    INTEGER hWnd,; 
    INTEGER Msg,; 
    INTEGER wParam,; 
    INTEGER lParam 

  wndDialog = FindWindow( 0, pcTitle )
  wndButton = 0
  
  if wndDialog > 0    
    * Sometimes Message WM_COMMAND 0x00110818 isn't enough,
    *  if you MUST click "Cancel" or "Yes", etc
    *  then provide a button caption
    if VarType(pcButtonCaption)='C'
       wndButton = FindWindowEx( wndDialog, 0, 'Button', ;
                                 pcButtonCaption )      
       if wndButton > 0
         SendMessage(wndButton, WM_LBUTTONDOWN, 1, 0x00120025 )
         SendMessage(wndButton, WM_LBUTTONUP,   0, 0x00120025 )
         * Button Clicked message
         SendMessage(wndDialog, WM_COMMAND,     3, wndButton  )
       endif
    endif
    
    SendMessage(wndDialog, WM_COMMAND, 1, 0x00110818 )
  endif
return Str(wndDialog,10)+str(wndButton,10)  
Or a simpler version using Window scripting that was posted here last week
oShell = CREATEOBJECT('Wscript.Shell')
oShell.AppActivate('title of the window')
oShell.SendKeys('{Enter}')
oShell = .NULL.
>Hi,
>
>Andrew MacNeill's essays on the above have been exteremely helpfull and I would advise everybody to use them.
>Automatic EMail functionality has improved communication by an order of magnitude at our company and made us more efficient.
>
>I do need some help however with the XP machines finding their way to our desktops: On these machines, Outlook wants to "take over" and does not allow the automatic generation of EMail in the background.
>
>I have tried to find a box to "uncheck" but with no success.
>
>Any take on that?
>
>
>Thanks, J
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform