Jump to content

Prevent window from showing up.

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
11 replies to this topic

#1
sakishrist

sakishrist

    Programmer

  • Members
  • PipPipPipPip
  • 109 posts
Hello all,
Is there any way to make a program that will prevent a window from showing up before it is even shown. What I actually do not want to happen is the window to show up for a moment and disappear. Is there any way of achieving that? Posted via CodeCall Mobile

#2
mbshinde78

mbshinde78

    Newbie

  • Members
  • PipPip
  • 19 posts
Hi,

yes it is possible. Are you creating the window using API or it is a VB Form?

Can you show the code?

Cheers

#3
sakishrist

sakishrist

    Programmer

  • Members
  • PipPipPipPip
  • 109 posts
The window is not one of the windows of my application, it belongs to another precess. That other process creates and shows it and I want to prevent it from being shown. Posted via CodeCall Mobile

#4
mbshinde78

mbshinde78

    Newbie

  • Members
  • PipPip
  • 19 posts
Hi,

You will need to call shellexecute API function if you want to open another program.

Then pass parameter SW_HIDE so that it won't show the window of the application. The SW_HIDE will be overridden if application you try to open forces to unhide itself.

Syntax

ShellExecute windowhandle, "open", "fullfilename", _
vbNullString, vbNullString, SW_HIDE

Cheers

#5
sakishrist

sakishrist

    Programmer

  • Members
  • PipPipPipPip
  • 109 posts
Well, thanks for that but it is not what I need. First of all the application is already running by the time I start mine. I do not need to start it. another thing is that if I use the SW_HIDE with SendMessage that just hides the window, it does not prevent the program to show it up again.
Is there any way to make it work?
Thanks!
Posted via CodeCall Mobile

#6
mbshinde78

mbshinde78

    Newbie

  • Members
  • PipPip
  • 19 posts
Hi,

That is so !

It means you already have the process id or window handle with you.

If other application has written code in timer or a thread which brings window up then there is no way we can hide it unless you know the developer of application and have some control over its code.

You can write code to keep an eye on the window and check if it shows up again and hide it but for a blink it will show up.

Sorry !

#7
sakishrist

sakishrist

    Programmer

  • Members
  • PipPipPipPip
  • 109 posts
Thanks. I also read somewhere about GetMessage (API). I am not really sure if it can help but could you explain what exactly it does and if it can be used in this case even if the window is showed for a blink?
Posted via CodeCall Mobile

#8
mbshinde78

mbshinde78

    Newbie

  • Members
  • PipPip
  • 19 posts
Hi,

GetMessage is generally not used in VB. If you write a program in vc++ then you need it. for example a vc program looks like this


hwnd = createwindow()

showwindow(hwnd)

while (getmessage(hwnd))
{
processmessage()
}

return 0;

So GetMessage is not useful.

May I ask, what is the program you are writing and you are opening (both)?

#9
sakishrist

sakishrist

    Programmer

  • Members
  • PipPipPipPip
  • 109 posts
Yes of course, I need to write this code as part of a bigger program. The ability I described above is to not allow the start menu window to show up. I do not want to do that from the registry or anywhere else that will require a restart. I need it to be able to run ones it is installed. I can give you a very good example of what I need it to be like, see the Start Killer. Sorry that I did not make it that clear from the beginning. Thanks.
Posted via CodeCall Mobile

#10
mbshinde78

mbshinde78

    Newbie

  • Members
  • PipPip
  • 19 posts
Why do not you want to open start menu?

#11
sakishrist

sakishrist

    Programmer

  • Members
  • PipPipPipPip
  • 109 posts
To prevent the user of having full access to a PC.
Can you help me please?
Posted via CodeCall Mobile

#12
sakishrist

sakishrist

    Programmer

  • Members
  • PipPipPipPip
  • 109 posts
Is it possible to achieve something with the SetWindowsHookEx? I read that it can receive messages before they are posted using WH_CALLWNDPROC. But is it actually a message that is sent when a window is being created?
Thanks!
Posted via CodeCall Mobile