Visual Basic Help .. again. - Printable Version
-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: Visual Basic Help .. again. (/showthread.php?tid=76728)
Visual Basic Help .. again. by Ashylay on 08-12-2007 at 05:07 PM
2 QUESTIONS
---------------------------------------------
Alright well sorry for spamming the forum up asking for help on VB and I know i should search on google but i dont know what words to use for example, I didnt know a form was a form i thought it was a window so please dont blame me for creating threads instead of searching google. Im still a novice.
Well basically you know like on MessengerPlus!Live the windows arent the basic forms with the OS default border? (So say if you had windows vista the border would be the blue box with the content inside)
Just wondering is there a possible way to create my own using Visual Basic 2005 Express?
---------------------------------------------
How can I make toasts for my program (Just like MSN Toasts but for my own program)
RE: Visual Basic Help .. again. by TheSteve on 08-13-2007 at 10:41 AM
1. If I understand your question correctly, you want to be able to remove the default system window frame right?
You can do this with a window region. Here is an example.
code: Public Class Form1
Private Declare Function CreateRoundRectRgn Lib "gdi32.dll" (ByVal nLeftRect As Int32, ByVal nTopRect As Int32, _
ByVal nRightRect As Int32, ByVal nBottomRect As Int32, ByVal nWidthEllipse As Int32, ByVal nHeightEllipse As Int32) As IntPtr
Private Declare Function DeleteObject Lib "gdi32.dll" (ByVal nGdiObj As IntPtr) As Int32
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim hRgn As IntPtr
hRgn = CreateRoundRectRgn(ClientRectangle.Left + 5, ClientRectangle.Top + 40, ClientRectangle.Right - 5, ClientRectangle.Bottom - 5, 7, 7)
Region = Drawing.Region.FromHrgn(hRgn)
DeleteObject(hRgn)
End Sub
End Class
2. To make messenger like toasts, you would need to figure out where to place the toast, then create a window/form then set a timer so that you can hide the window when it's time. This is not a simple task for a beginner as you also need to be careful of other programs with toast so that you don't accidentally pop up out of turn.
In order to determine if it's your turn to be able to use toasts, create a mutex called "Microsoft.Messenger.ToastSemaphore". When you want to popup a toast, Ask windows for ownership of this mutex. When you get ownership of the mutex, it's your turn. When you're done popping up your toast, release owner ship of the mutex to allow other programs to use it.
RE: RE: Visual Basic Help .. again. by Ashylay on 08-13-2007 at 03:30 PM
Thanks so much! Real help!
|