Showing Form without vbModal in VB? For the programmers out there... :D - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4) +---- Forum: Scripting (/forumdisplay.php?fid=39) +----- Forum: Plug-Ins (/forumdisplay.php?fid=28) +------ Thread: Showing Form without vbModal in VB? For the programmers out there... :D (/showthread.php?tid=45041) Showing Form without vbModal in VB? For the programmers out there... :D by (CyBeRDuDe) on 05-20-2005 at 08:00 PM
Is it possible in a MsgPlus! Plugin to show a form without using the vbModal arguement, since it puts Messenger "on hold"... I need to show a form without holding back on Messenger.... RE: Showing Form without vbModal in VB? For the programmers out there... :D by matty on 05-21-2005 at 04:05 AM
RE: Showing Form without vbModal in VB? For the programmers out there... :D by Mike on 05-21-2005 at 11:46 AM
quote:If you want to get the hwnd of a form, doesn't it need to be shown? What I would do, is to enum all the windows, and use the EnableWindow API on msn's windows hWnds... Did you try the above...? RE: Showing Form without vbModal in VB? For the programmers out there... :D by CookieRevised on 05-21-2005 at 01:11 PM
quote:No, it must simply exist (aka loaded in memory), and in VB a created form in your project always exist... quote:Cyberdude isn't talking about MSN Messenger windows. RE: Showing Form without vbModal in VB? For the programmers out there... :D by RaceProUK on 05-21-2005 at 01:56 PM
quote:You sure? I would have thought the form was loaded on the first .Show line. I suppose if that's the case, you can use 'Load Form1'. Probably wouldn't make any difference whether the form was loaded or not when that line is executed: it just makes certain. RE: RE: Showing Form without vbModal in VB? For the programmers out there... :D by CookieRevised on 05-21-2005 at 02:47 PM
quote:yes... although I maybe didn't explained it well... quote:The normal command for loading a form is "Load", but this will not show the form yet. The "Show" method itself, also automatically loads the form if it wasn't loaded already and then shows the form. This is the same as its counterpart method "Hide", it also automatically loads the form if it wasn't loaded already and then hides the form. But a form is not only automatically loaded when used with methods or commands, it is also loads automatically whenever you use a property of the form itself, hence when using .hWnd the forms gets loaded. quote:in this case, yep. you can check this yourself: code:You'll see it is a valid handle again because the form was loaded again But note that DestroyWindow will effectivly destroy the form in memory!! After DestroyWindow you wont be able to show the form again; it's like it never existed, everything will be cleared. Hence I said in my first reply to this thread that a form always exists in memory in VB. RE: Showing Form without vbModal in VB? For the programmers out there... :D by (CyBeRDuDe) on 05-21-2005 at 02:50 PM
quote:This is SO NICE!!! .. Works perfectly.. Well.. At least until now.. .. Well.. I have some problems with my odl code.. just need to rewrite eveyrthing I think... But thanks.... I just didn't think you could use the ShowWindow api like that.. but It works brilliant, showing forms without putting Messenger on hold... Nice matty... .. Well.. I gues thread is kinda closed now.. .. RE: Showing Form without vbModal in VB? For the programmers out there... :D by CookieRevised on 05-21-2005 at 03:10 PM
quote:You can do even a lot more with it 'Hides the window and activates another window. Public Const SW_HIDE = 0 'Activates and displays a window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when displaying the window for the first time. Public Const SW_SHOWNORMAL = 1 'Activates the window and displays it as a minimized window. Public Const SW_SHOWMINIMIZED = 2 'Activates the window and displays it as a maximized window. Public Const SW_SHOWMAXIMIZED = 3 'Displays a window in its most recent size and position. The active window remains active. Public Const SW_SHOWNOACTIVATE = 4 'Activates the window and displays it in its current size and position. Public Const SW_SHOW = 5 'Minimizes the specified window and activates the next top-level window in the Z order. Public Const SW_MINIMIZE = 6 'Displays the window as a minimized window. The active window remains active. Public Const SW_SHOWMINNOACTIVE = 7 'Displays the window in its current state. The active window remains active. Public Const SW_SHOWNA = 8 'Activates and displays the window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when restoring a minimized window. Public Const SW_RESTORE = 9 'Sets the show state based on the SW_ flag specified in the STARTUPINFO structure passed to the CreateProcess function by the program that started the application. Public Const SW_SHOWDEFAULT = 10 RE: Showing Form without vbModal in VB? For the programmers out there... :D by DeVill on 07-03-2005 at 12:20 PM
That's grate! But I have problem with this one... I have a tag with: code: Allow is a global boolean! Now the command desapeares, and Okay1 is displayed, but message is not sent... first I thought it hade something to do with DoEvents, but that's not the case, if I remove the line with ShowWindow, than it works! |