emy
New Member
Hello
Posts: 45
|
Post by emy on Jun 27, 2021 3:31:24 GMT -5
Hello every one I would like to know if it is possible to close a file i.e anotherfile.ktn started by namefile.bas Thank You Regards. Following what I have tried, but it doesn't work ! trytest.zip (1.32 KB)
|
|
|
Post by Stefan Pendl on Jun 27, 2021 14:03:50 GMT -5
|
|
|
Post by Brandon Parker on Jun 27, 2021 20:08:37 GMT -5
Try using the code below. This may not always work due to permissions and such, but it proves fruitful quite often. It seems to close the Hello.tkn after it is running using the LB Runtime with no issues.
Print SendMessage(FindWindow("H E L L O !"), _WM_CLOSE, _NULL, _NULL) End
'_________________________________________________________________________________________________________________________________________________________ '_________________________________________________________________________________________________________________________________________________________
Function FindWindow(lpWindowName$) lpWindowName$ = lpWindowName$ + chr$(0) CallDLL #user32, "FindWindowA", _NULL As ulong, _ lpWindowName$ As ptr, _ FindWindow As ulong End Function
'_________________________________________________________________________________________________________________________________________________________ '_________________________________________________________________________________________________________________________________________________________
Function SendMessage(hWnd, Msg, wParam, lParam) CallDLL #user32, "SendMessageA" , hWnd As ulong, _ Msg As long, _ wParam As long, _ lParam As long, _ SendMessage As long End Function
{:0)
Brandon Parker
|
|
emy
New Member
Hello
Posts: 45
|
Post by emy on Jun 28, 2021 8:34:41 GMT -5
Thank You Stefan for Your answer. I will take a look at the sample.
Thank You Brandon for Your answer. I will try the example code.
I will let You know about.
Regards.
|
|