Capture Resize Events Including Minimize Then Maximize?
Apr 16, 2009Capture resize events including minimize then maximize
View 1 RepliesCapture resize events including minimize then maximize
View 1 RepliesI am drawing graphics on the screen and when the form resizes it needs to clear and redraw all the graphics b/c the form is a different size and the graphics are supposed to scale with the size of the form. Well that works, but not for maximize or restore. So I had to look on the internet for how to capture the maximize and restore event. I got it from here and it does capture it, but it does all the events (such as redrawing the graphics) first and then it maximizes, which totally defeats the purpose. I tried to do Application. DoEvents but it still doesn't do it. Any way to have the graphics redraw AFTER it maximizes?
Code:
Private Const SC_RESTORE As Int32 = &HF120 'When a Form is Restored
Private Const SC_MINIMIZE As System.Int32 = &HF020& 'When a Form is Minimized
Private Const SC_MAXIMIZE As System.Int32 = &HF030& 'When a Form is Maximized
Private Const WM_SYSCOMMAND As System.Int32 = &H112 'Minimized/Maximized/Restore comes when we have this msg Const WM_NCLBUTTONDBLCLK As Int32 = &HA3 'When User Clicks on the Title Bar
Protected Overrides Sub WndProc(ByRef m As Message)
[Code] .....
How do you maximize a external minimized application that is already running?
iMatthiWare
MatthiWare N°1 .NET Freeware & Shareware site! Title: Project leader, Owner @ MatthiWare Current project: MW Virtual Desktop Contact: Admin@matthiware.net.ms Website: MatthiWare " MatthiWare... What else?!? "
I only found the form event for form closing or form closed, do you know any event for "minimize or maximun form"?
View 2 RepliesI have got Skype configured to launch minimized on windows starts.Now I need to bring Skype to front from a button from my full screen application button. I have got this code:
For Each p As Process In Process.GetProcessesByName("skype")
ShowWindow(p.MainWindowHandle, SHOW_WINDOW.SW_NORMAL)
Next p
I was wondering how to create my own minimize and maximize buttons. I would like a oddly shaped form, so my FormBorderStyle is set to None.
I still want the user to be able to minimize and maximize the form, and in vb6 it would have been like (I use commandbuttons on the form)[code]...
I have a form with formborderstyle = none. I already know how to move this form and resize it. But I want to maximize the form when you double click it.
I already know:
Private Sub Form1_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDoubleClick
WindowState = FormWindowState.Maximized
End Sub
Now its maximized, but now I want it to go to the previous size, so when you double click again when maximized, the form goes back the the previous state.
I'm building a border-less form so I can customize the Minimize-Maximize-Close buttons. I've noticed now that I can't move the form. I docked a panel up at the top of the form to replace the regular window border. I put custom Min Max Close on it. How could I program the panel to move the window like the border does with a regular window?
View 3 RepliesI wanted to know how to hide the three buttons on the form; close, minimize, and maximize.
View 2 RepliesI have an MDI application that uses the menustrip control. When the MDI Child window is maximized, there is no way to restore its size. There's a restore on the MDI parent but that restores the entire application. However, when I use the Main menu, there are two sets of Maximize/Minimize controls, one for the MDI parent and one for the MDI Child. The Mainmenu control adds a band that is used to display the Maximize/Minimize controls but the band the menustrip creates is not used to do the same.
View 3 RepliesI want to get status of an extarnal program for example notepad.is it minimize,maximize or active or in background? how can understand from my vb application?i think need to write api function. i found somethink from forums but they just control extarnal application not give a status.
View 2 RepliesI have created a software project for my college using vb.net 2008
View 2 RepliesI've a form with a couple of buttons and a richtext box, and I want to resize the richtext box to fit window when window is maximized.
Actually i press the maximize button and it expands the window but the controls stay in the same size. I want it to resize/shrink.
Allready used this (from here [URL]
[start]
Change AutoSize to false or set ... AutosizeMode to GrowOnly
I have the following code to control how a form is shut down. Specifically, when they click the red x at the top of the form. My question is, how do I control the minimize button at the top of the page. I want my forms to minimize to the information bar instead. I know how to send it there if I can capture the minimize event.
Private Sub xmlTest_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
e.Cancel = True '--- will not close form
[code].....
I would like a relatively hack-free way to do this? For example, the following takes a screenshot that doesn't include the semi-transparent window:[code]....
Either my google-fu really sucks or this is not as easy as it sounds. I'm pretty sure why this is happening because of the way the video driver would have to separate the memory to make this work, but I don't care why it doesn't work, I just want to do it without...
* print-screen key hacks
* 3rd party software
* SDK functions are OK but I'll upvote every object owned by the user that can show me it in pure framework (Just kidding but it would be nice).If This is the only way to do it, how to I do that in VB?
If you have ever noticed in the Task Manager, when you right-click on the running task, you have many options which include 'Minimize' and 'Maximize'. Is there anyway to do achieve this in vb?
View 1 Repliescan't seem to figure out the solution to. I have a form within a form that works fine. However when I want to maximize the form the top of it goes behind the menu bar rather than just below it as I would expect. Also, when I minimize the form it simply minimizes and hides behind the status bar at the bottom. I've tried adjust the location coordinates, window state, start location.
View 7 RepliesThis is my code to get screen captures every certain interval of time. But each image is being around 150kb and I want to make it smaller. what matters is the image size in kb to be around 70kb ( almost the half ) .
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim ScreenSize As Size = New Size(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height)
Dim screenGrab As New Bitmap(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height)
[code]....
I've written an app with a simple textbox which attempts to identify a user from their typing habits (interval between key presses, duration key is held, time between key strokes ie a->s is quicker than a->v for some users, shorter for others depending on typing style). It's far from perfect but it does correctly identify moderate-large differences in style.I'm hoping to use this as a form of security monitor - If the typing style of the user doesn't fit a recognised pattern, report to a central server.
Of course, the next step in testing this is to begin to capture "regular" typing habits - ie when browsing, switching between apps, etc.What I can't figure out how to do is capture keyboard input for all applications (excluding the login/welcome screen, alternate desktops, etc. - I have no reason to parse that and there's probably not enough input to analyse anyway)Disclaimer: Yes, I know this comes dangerously close to writing a keylogger which is verboten but if I wanted to do that, I'd write a keyboard driver in C++ - I'm sure it would be far more streamlined and easier to obfuscate than a hulking .Net MSIL assembly. I have no doubt I'll be fending off "That's a keylogger" comments but I've hit a wall and need to ask somewhere.
how can I capture an event like a button click or timer event, if I created the controls at run-time?
Ex: Dim a As Button
Dim b As Timer
I want to capture the click event of the button "a" and the timer event of the timer "b".
How can we capture events of msmq in vb.net.I dont see any events if I declare object type of System.MessageQueue. Do I need to include the COM MS Message Queue 3.0 lib to deal with events and message queue?
View 6 Replieswhen i try to minimize a form and restore to normal the form is being resize.It's resize getting extending a form when time to minimizing a form and restore it.my form is set to formborderstyle is fixedsingle and i'm using namespace. why is hapening like that...i don't know why
View 10 RepliesI'm writing a Windows Forms app that uses a DataGridView control. I have row select enabled on the control. I would like to trap the DoubleClick event, but it doesn't seem to fire reliably - I often have to double-click on a row 2 or 3 times before the event is triggered. Could anyone point me to a way to capture this more reliably?
View 1 RepliesI am trying to capture keyboard events in my vb.net applications. I am able to capture all the single key events. I am not able to capture (<) key which is (shift + ,) and (>) key which is (shift + .).
View 1 RepliesI am trying to capture SHUTDOWN and LOGOFF Events, so that I can be alerted when my process stops. The below code works in detecting these events. I am trying to get it to release the monitoring of the system events after the email has been sent, Being newer to VB, I am not sure how to do this. I copied this code from another google forum.
[Code]...
I'm trying to automate a product that provides no such automation capability.I've take a cursory look at loading the app in a separate AppDomain, and also, through reflection, executing the Program.Main() to get the app running. I also tried getting the windowhandle from a separately created Process object (which I've learned will not work).If I have a reference to their assembly added to my project so I can reference an instance of "TheirProduct.FormMain", what, if it's possible, is the best way to go about capturing events from that form? What I need to do is to be able to capture a couple events, and perform a few Button.PerformClick() against the form.
View 1 RepliesI am working on a site it is in VB.net, I need to createa mutliline text box. I am able to increase the height of the textbox as number of characters increases using java script,however when page get refreshed or loaded again then textbox size comes back to the default height.
Code:
<asp:TextBox ID="txtDescription" runat="server" TextMode="MultiLine" rows="3" onkeypress="grow();" Width="590px"></asp:TextBox>
[code].....
I am trying to find a way to capture keyboard events with the intent of preventing users from being able to hit Ctrl + Alt + Del while my application is running. I've spent several hours poking around looking for inspiration but only finding unclear and half-baked examples. As such, I was thrilled to stumble across the article: Managing Low-Level Keyboard Hooks in VB .NET written by Paul Kimmel [URL] This article is insightful, comprehensive, well-written, and I thought it was a huge help. One little problem though, the code that was provided did not work, (I knew it was too good to be true!).
Now, Mr. Kimmel seemed very knowledgable and I think that he probably tested his code, so quite likely the problem is something that I'm doing wrong seeing as I am a newbie. As the article suggests I cut and pasted his code into a module in my project (solution I guess is the proper term), and I call the HookKeyboard method from a button on a form, and Presto! Nothing happens. Stepping through this code I see that the second line in HookKeyboard:
[Code]...
Is there a easy way to maximize a window in VB when the maximize button is pressed so that everything that is contained in the Window (Forms, Panels) will also automatically resize to the screen size?
View 4 RepliesI want to maximize my form size when i maximize my window. means when i double click on window to maximize then my form also get maximize with window, i used dock property bt still not getting proper result.
View 16 Replies