|
Hey everyone ~
This is my first post here and I hope someone can help me. I am trying to call my application that is already running in the system tray with a shortcut when it does not have the focus. I've thought about using a keyboard listener but there has to be a different and easier way to do this. Maybe it could be done by using a desktop shortcut to load another copy of the program but check to see if its already running and give that application the focus. If that makes any sense.
Another question that has nothing to do with the first one is how do you maximize your application if your have a dual monitor setup. There is a built in button that gets applied to your form if you have an ATI video card but I have no idea on how to call that if thats possible at all. But that then leaves everyone else out of luck that doesn't have that card.
If anyone can help me i would greatly appreciate it. Thanks in advance.
FuzMan ~
|
|
|
|
|
Sorry Everyone ~
Forgot to tell you I am using VB.NET 2003. With the newest Framework installed. Thanks again.
FuzMan ~
|
|
|
|
|
I'd like to know how to do this as well.
Anyone have an answer/suggestion?
|
|
|
|
|
I am trying to intercept calls to the SaveAs and FileOpen dialog boxes in notepad and wordpad. In other words when I click File->Open I want my own window to popup instead the usual dialog box.
I am a beginner to intermediate programmer and have looke at Hooks expecialy the SysMsgProc function but this is a little over my head. I would appreciate any help and source code that can be supplied.
Thanks
HD
|
|
|
|
|
Not possible. In Word it is because the Word object model fires off an event signaling an applicaiton that these dialogs are about to be shown. But, Notepad and Wordpad don't have object models, let alone fire off any event before a dialog is shown.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hy everyone!
Is there a chance to get the language of the Word programm?
Because I do want to do the following:
If it is english then set constants to the english version, if it is German then set it to the german version etc.
So I wonder if there is an easy way to get the language to set the constants correctly! So I would be interested what this has to look like in VBA for Word and where it is stored there!
Thanks!
Stephan.
|
|
|
|
|
Word will use the current Regional and Language Options settings, which in VB.NET, is can be had from the Application.CurrentCulture[^] property.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Well as you can see i am a newbie at VB.net :->
I try learning to code, by using some code samples.
However in some msdn sample, it says add the "common dialog control"
on screen i have all kind of controls under the on the left side 'under the label: window forms. I also checked under: menu > projects > where one can add various things but my wanted 'common dialog control' is in none of them ... ??? (must it perhaps be added??) ??
I had a book also but it is not explaining me where to find this in the gui.
Answer must be easy i believe it's often used, but i cannt find it.
jipiee i'm on vb
|
|
|
|
|
In VB6 You could add the common dialog control.
In vb.Net the common dialog control is divided in several controls thar are on the left side of the vs ide called the toolbox.
Yoou have the openfiledialog, the savefiledialog, etc...
All this are part of the all in one common dialog control.
|
|
|
|
|
hi, i want the treeview to be right to left, i use VB6.0 i need code pleeeeeeeeeeeeeeeeeeeeeeeeeeease
Thanks alot
Hamody
|
|
|
|
|
The TreeView control doesn't have proper support for RtL. If you use the properties of the control, the tree is still drawn left to right, but the text of the nodes is right to left.
If you use the "mirror" method to flip a left drawn treeview over to the right, all the tree icons are also reversed.
Your best bet would be to search the web for a replacement TreeView control that implements proper support for RTL. They're all over the place, seemingly everyone sells one.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hallo everybody,,,!
Please anybody if can help me...!
I have problem with my login user code ..,
If the user type the wrong password the messagebox couldn't appear "Pasword does not match with username", but the messagebox appeared is "Username does not exist" asa same as we type the wrong username.
THe code is written below :
Dim ds As New DataSet<br />
Dim dt As DataTable<br />
Dim dr As DataRow<br />
Dim username As String = Me.txtUserName.Text<br />
Dim password As String = Me.txtPassword.Text<br />
Dim strSql As String = "SELECT * FROM users where username='" + username + "' and password='" + password + "'"<br />
Dim oleConn As New OleDb.OleDbConnection("provider=microsoft.jet.oledb.4.0;Data Source=data\persedkont.mdb")<br />
Dim oleDa As New OleDb.OleDbDataAdapter(strSql, oleConn)<br />
oleDa.Fill(ds)<br />
dt = ds.Tables(0)<br />
If (dt.Rows.Count = 0) Then<br />
MessageBox.Show(username + " does not exists!", "Login Fail", MessageBoxButtons.OK, MessageBoxIcon.Error)<br />
Else<br />
dr = dt.Rows(0)<br />
Dim pass As String = dr(2).ToString<br />
Dim userId As String = dr(1).ToString<br />
If (dt.Rows.Count = 0) And password <> pass Then<br />
MessageBox.Show("Password does not match with username.", "Login Fail", MessageBoxButtons.OK, MessageBoxIcon.Error)<br />
Me.clearForm()<br />
Else<br />
If password = pass Then<br />
Me.clearForm()<br />
Me.Close()<br />
End If<br />
End If<br />
End If<br />
'MessageBox.Show(strSql)<br />
Try<br />
Catch ex As Exception<br />
MessageBox.Show("Wrong UserId or Password")<br />
End Try
Thank's verymuch for help.
Best Regards,
Ahmad Rifai Yusuf
|
|
|
|
|
hi man i dont know, u can make a select statement to select justonly the password of the entered user name, and then compare it with the entered password ..... if doesnt match give the message box with a sentence u want ......
Thanks alot
Hamody
|
|
|
|
|
HAve u checked whether the table has any rows in it
because the Message box should pop only when the table rows are 0
and also when you are executing the fill method of dataadpater also aspecify the TAble name and use the table insted of index while retrieving the populated table
I think this should answer all your queries
Mandar Patankar
MCP
|
|
|
|
|
Hi, I wanna help you handling...
so for username adn password i will show u my idea (maybe easy one)
If me.txtUserName.Text<>"john" Then
msgbox("the user " & me.txtUserName.Text & "doesnt exist")
ElseIf me.txtPasswor.Text<>"kenedy" Then
msgbox("password incorrect")
EndIf
this is a simple code for username and password for login without using DB
|
|
|
|
|
I want to know that how to write a module in VB.NET.
Actually in my project, below is the code which is used in 15 forms. If i make a module of this code and call it in every form, then it will be a good technique
Here is the code
=============
Dim cm As New SqlClient.SqlCommand
Dim cn As New SqlClient.SqlConnection
cn.ConnectionString = "data source=abc; initial catalog=books; user id= sa; password=sa;"
cn.Open()
cm.Connection = cn
cm.CommandText = "select * from info"
cm.CommandType = CommandType.Text
please tell me that to write a module, and how to call that module in a form.
Please solve my this problem.
Regards,
Eshban
EsHbAn BaHaDuR
|
|
|
|
|
Hello,
Right click your project and then click on Add->Add Module. Give the module any name.
Create a Function within the module, such as: (in this case, I named my Module "Functions" and my Function "Test()". I used the code you provided just for an example. You can name the Module and the Function differently. Here is the complete module)
Module Functions
Function test()
Dim cm As New SqlClient.SqlCommand
Dim cn As New SqlClient.SqlConnection
cn.ConnectionString = "data source=abc; initial catalog=books; user id= sa; password=sa;"
cn.Open()
cm.Connection = cn
cm.CommandText = "select * from info"
cm.CommandType = CommandType.Text
End Function
End Module
To call the function, all that you need to do is use the function name that you put it under. In my case, I would use test() wherever I needed the code to be executed.
I hope this solves your problem ,
Programmer2k4
My sig:
"The so-called 'Bugs' do not exist, they are merely features hidden by developers with message boxes that say 'An unhandled exception has occurred'." - Programmer2k4
"And it is a professional faux pas to pay someone else to destroy your computer when you are perfectly capable of destroying it yourself." - Roger Wright
I now use my CodeProject Blog!
|
|
|
|
|
hi,
you are done a wonderful job (SQL code generator) but there is a problem in my system while executing your project. at run time a message "Could not bind to the new display member.
Parameter name: newDisplayMember" is displayed and the project can't run on my machine. so please be kind enough to give me a remedy as soon as possible. my email id is shiju_puravoor@hotmail.com.
thanking you,
yours truely,
theertha
|
|
|
|
|
The chances of the person you posted this message for are zero! The only place your going to get a response from this person is if you post your message in his article's forum, not here.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
I am currently writing an application using the Windows Media Player library to read files. However, since Windows Media Player takes a couple seconds to buffer the data, everytime I call WMP1.status it returns "Opening Media..." (a string ). Is it possible to pause/stall the sub or function until the value for WMP1.status changes? (For an example, once it changes from the "Opening Media...", I could go about doing the rest of my function.)
I have tried using a Do Loop, however, with the way I coded it, the loop freezes the application forever.
Edit:
I have noticed something strange with the behavior of Windows Media Player. After I set it to a file, and I display a MsgBox , it all loads very fast; however, without a message box, it seems to take quite a while. Is this caused due to the MsgBox 'somewhat rushing' the previous code to finish loading? It doesn't matter what the contents of the MsgBox are, as long as it (the MsgBox ) is displayed. Would it be possible for me to fake the MsgBox , so that the user doesn't have to press any buttons, and yet it still forces the previous code to run fast?
Edit #2:
Is it possible for me to stall the Sub of the Button Click event for a predetermined amount of time (eg, 3 seconds) to allow the media player to finish loading?
This problem has really gotten me this time.
Any suggestions or help will be greatly appreciated,
Programmer2k4
My sig:
"The so-called 'Bugs' do not exist, they are merely features hidden by developers with message boxes that say 'An unhandled exception has occurred'." - Programmer2k4
"And it is a professional faux pas to pay someone else to destroy your computer when you are perfectly capable of destroying it yourself." - Roger Wright
I now use my CodeProject Blog!
|
|
|
|
|
Programmer2k4 wrote:
However, since Windows Media Player takes a couple seconds to buffer the data, everytime I call WMP1.status it returns "Opening Media..." (a string). Is it possible to pause/stall the sub or function until the value for WMP1.status changes?
No. The usual way to achieve this is to let the object you use notify you when its state has changed. According to the Windows Media Player 10 SDK[^] there is a Player.StatusChange Event[^]. So instead of constantly checking the Player.status[^] property you should use an event handler.
Programmer2k4 wrote:
I have tried using a Do Loop, however, with the way I coded it, the loop freezes the application forever.
Don't use polling[^] as long as there's a better alternative, especially not by using a loop as it (without any precautions) will take all available CPU time. If you really need polling then at least use a timer[^].
Programmer2k4 wrote:
After I set it to a file, and I display a MsgBox, it all loads very fast; however, without a message box, it seems to take quite a while. Is this caused due to the MsgBox 'somewhat rushing' the previous code to finish loading?
I guess that this is just a side effect of your usage of polling. As long as the message box is displayed your program is not "trapped" in your loop which leaves considerably more CPU time for the Media Player. I suggest you try to solve your problem with event handling. If you run into any problems just ask again (maybe with some small code excerpts this time).
Best regards
Dennis
|
|
|
|
|
Thanks for the information in regards to my problem. I never knew there was a Windows Media Player 10 SDK, the whole time I've been trying just to link to the file under "C:\Windows\"
Thanks,
Programmer2k4
My sig:
"The so-called 'Bugs' do not exist, they are merely features hidden by developers with message boxes that say 'An unhandled exception has occurred'." - Programmer2k4
"And it is a professional faux pas to pay someone else to destroy your computer when you are perfectly capable of destroying it yourself." - Roger Wright
I now use my CodeProject Blog!
|
|
|
|
|
Edit #2
You can use Threads to stop the function for predetermined amount of time.
|
|
|
|
|
Hi,
I'm a beginner programmer and I was wondering would it be possible to make a simple program in VB or C++ that would allow you wake up your pc from stand by or hibernate mode? If so, how would I go about doing this?
Thanks,
Jackie
|
|
|
|
|