Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Closing a launched window
#1
If i use a run statement like:

Code:
Copy      Help
int h = run("cmd.exe" "%comspec% /k ''C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat'' x86 && cd\ && cd Program Files\Microsoft Visual Studio 10.0\VC" "" "" 0x800);

How do I close that window when I am done. It is most likely not going to be the active window, as I will have moved onto doing other things.

I have tried flavors of the following (some of these might only work with a handle, which I also tried by doing __Handle h = run(....)):

Code:
Copy      Help
;;act h ;;for testing
clo id(h "cmd")
    ;;CloseHandle(h)
    ;;PostMessage h WM_SYSCOMMAND SC_CLOSE 0
    ;;PostMessage h WM_CLOSE 0 0

When it is an int variable set for "run", is that the ID? Please advise on this scenario.

Thank you
#2
Function ( Function60 )
Function Function60
Code:
Copy      Help
int h = run("cmd.exe" "%comspec% /k ''C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat'' x86 && cd\ && cd Program Files\Microsoft Visual Studio 10.0\VC" "" "" 0x800)

wait 4
clo h
#3
run returns process handle, it is not useful to close window. Also it can get get window handle. To create code, use the "Run program" dialog from the floating toolbar in QM.


Forum Jump:


Users browsing this thread: 1 Guest(s)