CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    May 2001
    Posts
    21

    CreateProcess to DOS-style GUI application-

    I have a problem with black window (like question from 15/05/01). I call from my app.(by CreateProcess) the MATLAB created exe, that open black window(like DOS) and from it - the GUI window. The app. use this wind. to output log.data, but I don't want see it.
    I can't call CreateProcess with SW_HIDE flag because the GUI window will be hidden too.
    I tried change size and position of black window, but I still have his button on the System Toolbar. How can I remove it?

    Elina

  2. #2
    igbrus is offline Elite Member Power Poster
    Join Date
    Aug 2000
    Location
    Los Angeles
    Posts
    4,658

    Re: CreateProcess to DOS-style GUI application-

    Did you try ShowWindow(hwnd,SW_HIDE)? It seems there isn't another way...

    Rating isn't important...But gurus respect it and keep high

  3. #3
    Join Date
    May 2001
    Posts
    21

    Re: CreateProcess to DOS-style GUI application-

    I actually do it yet and it's OK.
    The problem was that I must be call CreateProcess and after then make FindWindow and ShowWindow(..,SW_HIDE), so it doesn't hide the GUI window too.
    Thank u for response.


    Elina

  4. #4
    Join Date
    May 2002
    Posts
    511
    I also have a console window I need to hide. My FindWindow(), ShowWindow code works except on SOME Windows 2000 PCs.

    Does ShowWindow(hWnd, WS_HIDE) work for Win2000?

  5. #5
    igbrus is offline Elite Member Power Poster
    Join Date
    Aug 2000
    Location
    Los Angeles
    Posts
    4,658
    ShowWindow does work. I guess yours FindWindow doesn't work properly

  6. #6
    Join Date
    May 2002
    Posts
    511
    Thanks Igbrus! You were right the problem was with the FindWindow() not ShowWindow().

    Is there a simply way to retrieve the HWND of my console app other than FindWindow()?

  7. #7
    igbrus is offline Elite Member Power Poster
    Join Date
    Aug 2000
    Location
    Los Angeles
    Posts
    4,658
    Yes, try EnumThreadWindows

  8. #8
    Join Date
    May 2002
    Posts
    511
    Igbrus you absolutely ROCK!!

    That is sweet!

    EnumThreadWindows() and GetCurrentThreadId() will work great!

    Thanks again!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured