Capture A Program Initializing And Stop It, So It Doesn't Interrupt Code?
Jun 22, 2009
A spreadsheet formatter that I made for the department opens and closes Excel spreadsheets in the backround. If someone opens Excel while the macro is running, it stalls the entire program. I need a way to sense Excel opening, then stop it, preferably with a message box saying what just happened.
View 1 Replies
ADVERTISEMENT
Aug 18, 2009
Microsoft's System.io.file.exists and System.io.directory.exists can take FOREVER, especially if you're in a situation, where you've unplugged from the network and you're looking in a share.
So, to get around this, I've created a thread that times out after 3 seconds. Returning false, if the calls above haven't yet returned. To do this, my main thread passes its instance to the new thread and immediately calls:
Thread.Sleep(TimeOutInSeconds * 1000) ' Where TimeOUtInSeconds = 3
The new thread then goes and checks for the file / folder using the System.io.file.exists / System.io.directory.exists functions.
Regardless of the result, then it uses the main thread's reference to call Thread.Interrupt().
My main thread doesn't get interrupted. It stays there for the full 3 seconds. If I were to change that to 3 minutes ( and I have ), it'll sleep for 3 minutes.
View 1 Replies
Apr 27, 2010
I have an event I want to do continuously until a button interrupt is pressed.
Here's the pseudo
Click button 1:
Check if button 2 is pressed
If not, do stuff
If so, stop doing stuff
End routine
So what I currently have is this:
Dim randominteger As Integer = 0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StartSampleButton.Click
[Code] .....
Unfortunately, it's never breaking outside of the first loop. How to get around it?
View 7 Replies
Jul 24, 2009
i have an application which i want the user to have access to forms base on their access right. I have a public module that that take care of the uers access right, but when I call this module from the form load event which return true(user has access to the form) then form load continue OR false(user dont hav access to the form) exit sub to discontue form load. but this is not stoping the form from loading.
'Check for user's permission
pubFormID = 107
'Call procedure
[Code].....
View 1 Replies
Jul 23, 2009
I have a form which i want to prevent from loading during the form initializition. which of the form event handles form initialization in VB.NET.
View 8 Replies
Jan 14, 2009
I have got some code that is working as i have edited the game.exe at a certain address, now i know the code can find the address, but I don't know how to make it stop searching for it if it isn't there.
here is the:
code:
So what I want to know, is how to stop this code, if the address doesn't exist.
View 4 Replies
Jun 20, 2012
Wasn't exactly sure how to word the title of the topic the best without making it a really long title, so I just stayed with a brief general topic to lure you guys into it .Anyways, I am using VB.NET and I have a PictureBox inside a panel that is not initially visible. Whenever a user clicks a button, I set the panel to visible, and I use Direct3D9 to render to the PictureBox but it does not work right when I set the panel to visible. I added a PictureBox_Paint function to handle the Paint event, but nothing. An interesting thing is if I sleep for about 1 or 2 seconds after I set the panel to visible and before I draw the picture with DirectX, it will draw it on. So it must be something when it is first setting it to visible that is affecting it. I do not have an actual image inside the picturebox, I am just using it to draw with DirectX.I'm not exactly sure what events are called right when you set the picturebox to visible.
View 6 Replies
Apr 5, 2009
So I am hacking together an app which listens to traffic using SharpPcap library, it reconstructs the packets from sessions using the code from TpcRcon.
Listening and reconstructing part work on their own . What I want is on each packet arrival main window gets an event so it can display the packet , and when session is reconstructed display a complete packet (I am interested in HTTP ones) . -That is where it breaks with weird symptoms: for example right now it does not stop on invoking stop listening method - the sharppcap library function hangs there forever waiting on this line of code : m_pcapThreadEvent.WaitOne();//wait for the 'stopped' signal from thread
I also had it not working and crashing in sharppcap function because I had omitted one parameter in form delegate- which makes no sense, because form delegate does not deal with packet capture at all and only reacts on "New Packet" event from my "Listener" class (which is only there to notify main form)
My app starts as module main instancing class "Listener". MainForm has it
registered as friend with event and handles even "New Packet"
Main Form:
Private Sub uiListenStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btListenStart.Click
aLogger.AddMessage("Started Listening")
[Code]....
View 1 Replies
Feb 13, 2010
I have a program and the program works fine. The only thing is that I want to shorten it up and stop using the same code over and over. I use the same redudant code through out the code. I want to write some functions in order to stop from having to use the same code over and over in my program. I wanted to know if someone could help me with functions: Here is part of my code below.
[Code]...
View 3 Replies
Oct 5, 2011
Why if I run the following code does the argument in the Add method pass {"foo2", "bar2"} in both method calls?
Dim myList As New List(Of String)
myList.AddRange(New String() {"foo", "bar"})
Add(New RandomClass("blah", myList ))
[CODE].....................
View 4 Replies
May 7, 2010
I have a dataset along with code for validation. When I use a datagridview and setting the EditMode to OnEnter I get the red exclamations telling me that I have an error when this is needed. This works all good. when I click the save button on the BindingNavigator, the application saves the record even when this validation is showing. How do I filter up this validation code through a datagridview and stop the program saving the data? If you need the code for more information, I will add this to the forum.
View 2 Replies
Jun 13, 2009
Out of curiosity, is there a way i can make a program stop or pause for a period of time (which i would choose) before continuing the code WITHOUT a timer.I think I've seen this done before, but I'm not positive.Also note that I'm talking about a forms application (not a console app if that would be any different.)
View 3 Replies
Oct 29, 2011
Currently I have the start-key for my vb.net application hardcoded like this:
GetAsyncKeyState(Keys.F2)
Where vb.net sais "F2 As System.Windows.Forms.Keys = 113" on mouse-over.But I want my users to be able to pick their own Key. If I make a drop-down box (combobox) and pre-define some choices in there (Like ESC or F3), all those choices are strings. How can I convert those strings to a System.Windows.Forms.Keys integer? Also, I'd like it to also be possible to "capture" a single keypress. So they'd click the "capture" button, and the next key they hit will be saved as the start/stop button. But I wouldn't even know where to begin looking for that one.
View 2 Replies
Nov 22, 2011
i added a timer for download speed calculation, but somewhere i did an error. After download is complete the kb/s counter still racing and stop debug has to be done by "Stop debugging" and not on close button.
Imports System.Net
Imports System.IO
[code].....
View 5 Replies
Apr 18, 2012
I'm seeing strange behaviour with a plugin for Readsoft that I'm developing.
I want it to stop on a breakpoint but it doesn't. The msgbox just before the place I put the breakpoint is displaying correctly, and the one right after it too.
here is the class with the breakpoint I want to stop to
here is the ReadSoft programm with the Msgbox displayed after the breakpoint line where debug didn't stop
PS : I'm using Visual Studio 2010 Professional, coding in VB.NET
View 3 Replies
Jun 11, 2012
I've got a simple tool written in VB in VS 2010 that has a series of command buttons which run Windows command files and the output is sent to a Rich textbox object on the main form (the comand files take awhile to run so I wanted the output to show up in the RTB as it was produced to show progress). All worked well until I made an update to the tool so that the series of buttons are no longer hard-coded, but created dynamically from information in the app.config file. To do this, I use a button
[Code]...
View 3 Replies
Mar 1, 2011
I have a START and STOP button and when the user clicks "start" the program does a whole bunch of calculations and all. However, I noticed that when I was testing the program I clicked STOP the program continues to execute stuff.
My START code is basically a while loop that iteratively does some calculations.
So I just put a boolean variable as the while condition and when user clicks stop its set to false and when user clicks start its set to true. However, when I click stop, the condition is set to false yes but it still executes all the code until the condition is re-evaluated right...so my question is how can I get out of the while loop when user instantly clicks "stop"?
View 5 Replies
Nov 1, 2009
I am trying to make an application with a start button and a stop button on a stop watch program. These are the codes I am using but my seconds on the stop watch don't start.
Public Form Dim intSecond As Integer = 0
Form 1
Private
Dim intSecond As Integer = 0
intSecond +=1
[Code]...
After I write my code and try to run the program, the seconds will not start,
View 3 Replies
Aug 4, 2010
I have written a application that searches the users computer for all files within a specified folder.Sometimes the number of files can be quite large. I would like the user to able to interrupt (end) this process.My code is handled by a button click in a VB win form.[code]I have tried various MsgBoxes that warn the user but I think a Esc Key or a Cancel button would be better.
View 8 Replies
Jan 17, 2012
I'm using a long string using SAPI speech and I want to be able stop the speech rather than have to listen to it babble on throughout the whole thing. So, in one function, we'll say it's the load function, it declares a speech string: [Code] I'm trying to get it to abort reading the audio but can't seem to figure out how to get it working. I've seen examples that have used SVSFlagsAsync and SVSFPurgeBefore Speak but I can't get either to be recognized and I've added (what I believe to be) the necessary resources to the library and added the imports at the top of the page. Does anyone know how to interrupt the speech?
View 1 Replies
Sep 24, 2010
i'm currently doing an assignment which is based on vb.net and sql server. here i wanna capture an image and i wanna save that into a sql table named 'customer'. i have downloaded the code for capture the image from the webcam and sWhen i click the save button in that app, its showing to save the captured image in a
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
Dim data As IDataObject
[code]....
View 2 Replies
Aug 1, 2010
I am using the BeginConnect method of a socket to connect to a server which may or may not be on line I need to provide my users with a countdown timer which they can abort the attempted connection if they wish to The question is; how can I interrupt the Begin Connect method of an asyncronous connection
View 1 Replies
Aug 25, 2009
May i know how to fire an event using the serial port interrupt method in visual basic windows form? Currently, now i am using the polling method which is using the timer event to continuously poll the port every 1sec.
But now i would like to change to the interrupt method which will fire up the same event without using the timer event.
[Code]...
View 4 Replies
Sep 30, 2010
I am really confused! My program doesn't work if I don't have Visual Studio here in my PC. To test it I have uninstalled Visual Studio. But my program doesn't work though Flash Player is present there (I have used Flash animation in the first form).
To be more sure about it I have installed Flash. But it's not working! That means the Flash animation file (.swf) is not making a problem! It needs support from Visual Studio to start. Doesn't it mean that some files are not attached with a setup file as a result it needs Visual Studio to run? Let me tell you how I create a setup file of my program.
CODE:
When I click on the icon of my program it shows the error message
CODE:
Reporting details: This error report includes information regarding the condition of WindowsApplication1. When the problem occurred the operating system version and computer hardware is use; your Digital Product ID, which could be used to identify your license; and the Internet Protocol(IP) anddress of your computer.
View 1 Replies
Dec 16, 2010
showing script for make a snapshot from an usb webcam?
View 4 Replies
Jan 19, 2010
I am trying to add the ability to select a camera to my program to start with I need to list the currently installed devices in a drop down menu much like what is used in MSN's webcam selection but the only thing that I can find that comes close is
Declare Function capGetDriverDescriptionA Lib "avicap32.dll" _
(ByVal wDriverIndex As Short, _
ByVal lpszName As String, ByVal cbName As Integer, ByVal lpszVer As String, _
ByVal cbVer As Integer) As Boolean
This, even with 4 different webcams installed, returns "Windows WDM image capture"
View 10 Replies
Aug 25, 2009
If I execute any shell command in VB application How can I capture the return code from the shell command. I have written something like this
shell(db2look ....,AppWinStyle.Hide)
Now I want to know the return code of the above command which ran using shell script.
View 1 Replies
May 20, 2009
I need to write an application that works in background.I'm writing my application in vb .net, but I don't know how to intercept system hooks by using .net classes.I know that there are windows apis such as SetWindowsHookEx, etc, but I just wondering if there is a way to use .net classes or methods such as WndProc.I tried to use it, but it works only if the form has focus active. My application must work in background.
View 3 Replies
Mar 1, 2010
Listening for an event from one program and capture it on another?is this possible, I'm asuming I would want to send a system wide event so I could capture it.My scenarioLet�s say I have this separate Splash animation (a series of png/bmp etc) but instead of having them in the main program itself I want them separate in a DLL/EXE.So how can I raise an event (probably system wide event I would imagine) letting the Main program know that the Splash DLL/EXE has finished it animation so the main app can continue?
View 9 Replies
Jun 12, 2011
I have been trying to figure out how to use Packet X to Capture Packets from a certain program that uses UDP. Does anyone know how to do so?
View 1 Replies