Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Close another Application
Message
From
19/05/2004 09:33:51
 
 
To
18/05/2004 23:59:57
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00905160
Message ID:
00905249
Views:
20
This works for me:
#DEFINE WM_CLOSE   0x10
DECLARE LONG FindWindow IN User32 ;
	STRING cClassName, STRING cWindowTitle
DECLARE LONG SendMessage IN User32 ;
	LONG HWND, LONG Msg, LONG wParam, LONG LPARAM

HWND = FindWindow( NULL, 'Calculator')
IF HWND > 0
	SendMessage( HWND, WM_CLOSE, 0, 0 )
ENDIF
RETURN
>I try to close another Application eg. Ms Calculator by using API call. I try the following code but it does not work.
>
>
>
>DECLARE INTEGER FindWindow ;
> IN WIN32API STRING cNull,STRING cWinName
>
>
>DECLARE INTEGER SendMessage IN user32;
> INTEGER hWnd,;
> INTEGER Msg,;
> INTEGER wParam,;
> INTEGER lParam
>
>
>mWinHandle = FindWindow(0,'Calculator')
>IF mWinHandle > 0
> SendMessage(mWinHandle,10,0,0)
>ELSE
> MESSAGEBOX(mWinHandle)
>ENDIF
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform