Jump to content
Xtreme .Net Talk

Merrion

*Experts*
  • Posts

    269
  • Joined

  • Last visited

Everything posted by Merrion

  1. MCLHotkey.Net - A .NET system-wide hotkey component To use, add the component to a windows form and set the properties to describe what key combination will trigger the hotkey. Once running, the HotkeyPressed event will be triggered whenever that key combination is pressed, system wide. Version 1.1 (Beta) Known issues: * The component properties do not set correctly through the front end - only a portion of the possible VKey values are shown Right - now where's my cocoa? mclhotkeynet.zip
  2. The black dot indicates that you have been involved in that thread...IIRC
  3. Check out IrishDev - an Irish based user group that does .Net meetings every week...tonights meeting is .NET security which I'm probably going to (workload permitting).
  4. Yup - the clipboard chain is system-wide.
  5. I've put a VB5 version in the sister site VisualBasicForum that should show you what I mean.
  6. There's an API way. Using: Declare Function SetClipboardViewer Lib "user32" Alias "SetClipboardViewer" (ByVal hwnd As Long) As Long Declare Function GetClipboardViewer Lib "user32" Alias "GetClipboardViewer" () As Long Declare Function ChangeClipboardChain Lib "user32" Alias "ChangeClipboardChain" (ByVal hwnd As Long, ByVal hWndNext As Long) As Long Public Const WM_DRAWCLIPBOARD = &H308 Public Const WM_CHANGECBCHAIN = &H30D When your form loads you havd a private variable mhwndNextCBViewer As Int32 which you set on form load thus: mhwndNextCBViewer = SetClipboardViewer(Me.hwnd) Then when you get the message WM_DRAWCLIPBOARD you know that the clipboard has changed. You also have to handle the WM_CHANGECBCHAIN message if it tells you that your mhwndNextCBViewer has been removed from the clipboard chain. If I get any spare time I'll try and knock together a component to wrap this functionaility...
  7. You can create controls in notepad if it so please you - anything that inherits from System.Windows.Forms.Control is a new control type.
  8. Big buttons are needed if you switch language settings to cn-HK (Cantonese) as you need bigger characters. Unfortuantely PrintMon already exists and is somewhat different from what I'm working on which is kinda like the outlook rules wizard stuff but for printers...
  9. Can anyone think of a clever, interesting name for a printer monitoring application?
  10. Often, especially where a customised or skinned look is desired, the form is created with the FormBorderStyle set to FixedSingle. However if you still want to move that skinned form you have a bit of a problem. Fortunately it is possible to handle the WM_NCHITTEST window message to make windows think the mouse is over the caption even where a form doesn't have one. 1. Defining a rectangle that emulates the form caption In the form: Public Class Form1 Inherits System.Windows.Forms.Form #Region "Private memeber variables" Dim rcCaption As Rectangle #End Region Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() '\\ Make the fake caption rectangle rcCaption = New Rectangle(0, 0, Me.Width, 29) End Sub Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint e.Graphics.FillRectangle(New SolidBrush(Color.Blue), rcCaption) End Sub Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message) '\\ We want to pretend that the rectangle rcCaption, is the caption bar so we can drag the form by it... If m.Msg = WM_NCHITTEST Then Call FakeCaptionForCaptionlessWindow(Me, m, rcCaption) Else MyBase.WndProc(m) End If End Sub End Class 2. The WM_NCHITTEST handler This is kept in a seperate module for reusability... Imports System.Windows.Forms '\\ --[ApiHitTestHandling]------------------------------------- '\\ Used to handle the WM_HITTEST message, to allow dragging of '\\ captionless windows... '\\ ----------------------------------------------------------- Module ApiHitTestHandling Public Const WM_NCHITTEST = &H84 Public Enum HitTestResult HTBORDER = 18 HTBOTTOM = 15 HTBOTTOMLEFT = 16 HTBOTTOMRIGHT = 17 HTCAPTION = 2 HTCLIENT = 1 HTERROR = (-2) HTGROWBOX = 4 HTHSCROLL = 6 HTLEFT = 10 HTMAXBUTTON = 9 HTMENU = 5 HTMINBUTTON = 8 HTNOWHERE = 0 HTRIGHT = 11 HTSYSMENU = 3 HTTOP = 12 HTTOPLEFT = 13 HTTOPRIGHT = 14 HTVSCROLL = 7 HTTRANSPARENT = (-1) HTOBJECT = 19 HTCLOSE = 20 HTHELP = 21 End Enum Public Sub FakeCaptionForCaptionlessWindow(ByVal fParent As Form, ByRef m As Message, ByVal CaptionRectangle As Rectangle) If m.Msg = WM_NCHITTEST Then '\\ If the mouse is in the rectangle that is considered to be the caption set the return value to HTCAPTION Dim ptClickLocation As New Point(m.LParam.ToInt32) ptClickLocation = fParent.PointToClient(ptClickLocation) If CaptionRectangle.Contains(ptClickLocation) Then m.Result = New IntPtr(HitTestResult.HTCAPTION) Else m.Result = New IntPtr(HitTestResult.HTCLIENT) End If End If End Sub End Module
  11. There's more here - takes too long to copy it over. Also, see MSDN for more info.
  12. WM_NCLBUTTONDOWN , WM_NCMBUTTONDOWN , WM_NCRBUTTONDOWN The mouse button (left, middle or right respectively) was pressed down while the pointer was over the non-client area of the window. WM_NCLBUTTONUP , WM_NCMBUTTONUP , WM_NCRBUTTONUP The mouse button (left, middle or right respectively) was released while the pointer was over the non-client area of the subclassed window. WM_NCMOUSEMOVE The mouse moved over the non client area of the form wParam - The bit of the non client area which the mouse event occured over. This can be one of: Public Enum enHitTestResult HTBORDER = 18 HTBOTTOM = 15 HTBOTTOMLEFT = 16 HTBOTTOMRIGHT = 17 HTCAPTION = 2 HTCLIENT = 1 HTERROR = (-2) HTGROWBOX = 4 HTHSCROLL = 6 HTLEFT = 10 HTMAXBUTTON = 9 HTMENU = 5 HTMINBUTTON = 8 HTNOWHERE = 0 HTRIGHT = 11 HTSYSMENU = 3 HTTOP = 12 HTTOPLEFT = 13 HTTOPRIGHT = 14 HTVSCROLL = 7 HTTRANSPARENT = (-1) HTOBJECT = 19 HTCLOSE = 20 HTHELP = 21 End Enum lParam - The lower 16 bits are an unsigned integer representing the x position of the mouse pointer when the event occured and the upper 16 bits are an unsigned integer representing the y position of the pointer.
  13. WM_MOVE This message is sent to a window when it has been moved. Not so useful now that VB at last has a Move event. wParam - Unused, set to zero lParam The upper 16 bits (HIWORD) hold the vertical (y) position of the window after the move, and the lower 16 bits (LOWORD) holds the horizontal(x) position of the window after the move. You can use this message to be notified whenever a user moves a form.
  14. WM_COMPACTING This message is sent to all top level windows when the operating system is running low on memory and is compacting the memory. wParam - The amount of time spent compacting : the higher this number is the more trouble windows is having freeing up memory lParam - Unused (set to zero)
  15. WM_CHAR This message is posted to a window when a keyboard key is pressed (other than ALT) and the window has the input focus. wParam - This is the virtual key number which corresponds to the vbKey constants like vbKeyA if key "A" was pressed. lParam - This holds additional information about the key press. Bits 0-15 is the repetition count (when a key is held down) Bits 16-23 is the scan code of the key - this is dependednt on the actual keyboard hardware Bit 29 is set if the ALT key is down Bit 30 is set if the key was already down i.e. the event is due to a key repetition Bit 31 is set if the ke is being pressed, i.e. opposite to bit 30
  16. WM_CAPTURECHANGED This message is sent to a window when it gains of loses the mouse capture, either as a result of the user or by the SetCapture API call. wParam - This parameter is ignored lParam - The window handle of the window which is gaining the focus.
  17. WM_ACTIVATEAPP This message is sent to the top level window of an application when that application gains or loses the focus. i.e. when the user ALT+TAB switches to/from it or clicks on the application in the task bar etc. wParam - This is non-zero if your application is gaining the focus, and zero if it is losing the focus. lParam - This is the thread handle of the other application. If your application gains the focus this is the thread handle of the application that lost the focus and if your application loses the focus this is the thread handle of the application that will get the focus next.
  18. Public Enum WindowMessages WM_ACTIVATE = &H6 WM_ACTIVATEAPP = &H1C WM_ASKCBFORMATNAME = &H30C WM_CANCELJOURNAL = &H4B WM_CANCELMODE = &H1F WM_CAPTURECHANGED = &H1F WM_CAPTURECHANGED_R = &H215 WM_CHANGECBCHAIN = &H30D WM_CHAR = &H102 WM_CHARTOITEM = &H2F WM_CHILDACTIVATE = &H22 WM_CHOOSEFONT_GETLOGFONT = &H401 WM_CHOOSEFONT_SETFLAGS = (&H400 + 102) WM_CHOOSEFONT_SETLOGFONT = (&H400 + 101) WM_CLEAR = &H303 WM_CLOSE = &H10 WM_COMMAND = &H111 WM_COMPACTING = &H41 WM_COMPAREITEM = &H39 WM_CONTEXTMENU = &H7B WM_CONVERTREQUESTEX = &H108 WM_COPY = &H301 WM_COPYDATA = &H4A WM_CREATE = &H1 WM_CTLCOLORBTN = &H135 WM_CTLCOLORDLG = &H136 WM_CTLCOLOREDIT = &H133 WM_CTLCOLORLISTBOX = &H134 WM_CTLCOLORMSGBOX = &H132 WM_CTLCOLORSCROLLBAR = &H137 WM_CTLCOLORSTATIC = &H138 WM_CUT = &H300 WM_DDE_ACK = (&H3E0 + 4) WM_DDE_ADVISE = (&H3E0 + 2) WM_DDE_DATA = (&H3E0 + 5) WM_DDE_EXECUTE = (&H3E0 + 8) WM_DDE_FIRST = &H3E0 WM_DDE_INITIATE = &H3E0 WM_DDE_LAST = (&H3E0 + 8) WM_DDE_POKE = (&H3E0 + 7) WM_DDE_REQUEST = (&H3E0 + 6) WM_DDE_TERMINATE = (&H3E0 + 1) WM_DDE_UNADVISE = (&H3E0 + 3) WM_DEADCHAR = &H103 WM_DELETEITEM = &H2D WM_DESTROY = &H2 WM_DESTROYCLIPBOARD = &H307 WM_DEVICECHANGE = &H219 WM_DEVMODECHANGE = &H1B WM_DRAWCLIPBOARD = &H308 WM_DRAWITEM = &H2B WM_DROPFILES = &H233 WM_ENABLE = &HA WM_ENDSESSION = &H16 WM_ENTERIDLE = &H121 WM_ENTERSIZEMOVE = &H231 WM_ENTERMENULOOP = &H211 WM_ERASEBKGND = &H14 WM_EXITMENULOOP = &H212 WM_EXITSIZEMOVE = &H232 WM_FONTCHANGE = &H1D WM_GETDLGCODE = &H87 WM_GETFONT = &H31 WM_GETHOTKEY = &H33 WM_GETMINMAXINFO = &H24 WM_GETTEXT = &HD WM_GETTEXTLENGTH = &HE WM_HELP = &H53 WM_HOTKEY = &H312 WM_HSCROLL = &H114 WM_HSCROLLCLIPBOARD = &H30E WM_ICONERASEBKGND = &H27 WM_IME_CHAR = &H286 WM_IME_COMPOSITION = &H10F WM_IME_COMPOSITIONFULL = &H284 WM_IME_CONTROL = &H283 WM_IME_ENDCOMPOSITION = &H10E WM_IME_KEYDOWN = &H290 WM_IME_KEYLAST = &H10F WM_IME_KEYUP = &H291 WM_IME_NOTIFY = &H282 WM_IME_SELECT = &H285 WM_IME_SETCONTEXT = &H281 WM_IME_STARTCOMPOSITION = &H10D WM_INITDIALOG = &H110 WM_INITMENU = &H116 WM_INITMENUPOPUP = &H117 WM_INPUTLANGCHANGEREQUEST = &H50 WM_INPUTLANGCHANGE = &H51 WM_KEYDOWN = &H100 WM_KEYUP = &H101 WM_KILLFOCUS = &H8 WM_LBUTTONDBLCLK = &H203 WM_LBUTTONDOWN = &H201 WM_LBUTTONUP = &H202 WM_MBUTTONDBLCLK = &H209 WM_MBUTTONDOWN = &H207 WM_MBUTTONUP = &H208 WM_MDIACTIVATE = &H222 WM_MDICASCADE = &H227 WM_MDICREATE = &H220 WM_MDIDESTROY = &H221 WM_MDIGETACTIVE = &H229 WM_MDIICONARRANGE = &H228 WM_MDIMAXIMIZE = &H225 WM_MDINEXT = &H224 WM_MDIREFRESHMENU = &H234 WM_MDIRESTORE = &H223 WM_MDISETMENU = &H230 WM_MDITILE = &H226 WM_MEASUREITEM = &H2C WM_MENUCHAR = &H120 WM_MENUSELECT = &H11F WM_MENURBUTTONUP = &H122 WM_MENUDRAG = &H123 WM_MENUGETOBJECT = &H124 WM_MENUCOMMAND = &H126 WM_MOUSEACTIVATE = &H21 WM_MOUSEHOVER = &H2A1 WM_MOUSELEAVE = &H2A3 WM_MOUSEMOVE = &H200 WM_MOUSEWHEEL = &H20A WM_MOVE = &H3 WM_MOVING = &H216 WM_NCACTIVATE = &H86 WM_NCCALCSIZE = &H83 WM_NCCREATE = &H81 WM_NCDESTROY = &H82 WM_NCHITTEST = &H84 WM_NCLBUTTONDBLCLK = &HA3 WM_NCLBUTTONDOWN = &HA1 WM_NCLBUTTONUP = &HA2 WM_NCMBUTTONDBLCLK = &HA9 WM_NCMBUTTONDOWN = &HA7 WM_NCMBUTTONUP = &HA8 WM_NCMOUSEMOVE = &HA0 WM_NCPAINT = &H85 WM_NCRBUTTONDBLCLK = &HA6 WM_NCRBUTTONDOWN = &HA4 WM_NCRBUTTONUP = &HA5 WM_NEXTDLGCTL = &H28 WM_NEXTMENU = &H213 WM_NULL = &H0 WM_PAINT = &HF WM_PAINTCLIPBOARD = &H309 WM_PAINTICON = &H26 WM_PALETTECHANGED = &H311 WM_PALETTEISCHANGING = &H310 WM_PARENTNOTIFY = &H210 WM_PASTE = &H302 WM_PENWINFIRST = &H380 WM_PENWINLAST = &H38F WM_POWER = &H48 WM_POWERBROADCAST = &H218 WM_PRINT = &H317 WM_PRINTCLIENT = &H318 WM_PSD_ENVSTAMPRECT = (&H400 + 5) WM_PSD_FULLPAGERECT = (&H400 + 1) WM_PSD_GREEKTEXTRECT = (&H400 + 4) WM_PSD_MARGINRECT = (&H400 + 3) WM_PSD_MINMARGINRECT = (&H400 + 2) WM_PSD_PAGESETUPDLG = (&H400) WM_PSD_YAFULLPAGERECT = (&H400 + 6) WM_QUERYDRAGICON = &H37 WM_QUERYENDSESSION = &H11 WM_QUERYNEWPALETTE = &H30F WM_QUERYOPEN = &H13 WM_QUEUESYNC = &H23 WM_QUIT = &H12 WM_RBUTTONDBLCLK = &H206 WM_RBUTTONDOWN = &H204 WM_RBUTTONUP = &H205 WM_RENDERALLFORMATS = &H306 WM_RENDERFORMAT = &H305 WM_SETCURSOR = &H20 WM_SETFOCUS = &H7 WM_SETFONT = &H30 WM_SETHOTKEY = &H32 WM_SETREDRAW = &HB WM_SETTEXT = &HC WM_SETTINGCHANGE = &H1A WM_SHOWWINDOW = &H18 WM_SIZE = &H5 WM_SIZING = &H214 WM_SIZECLIPBOARD = &H30B WM_SPOOLERSTATUS = &H2A WM_SYSCHAR = &H106 WM_SYSCOLORCHANGE = &H15 WM_SYSCOMMAND = &H112 WM_SYSDEADCHAR = &H107 WM_SYSKEYDOWN = &H104 WM_SYSKEYUP = &H105 WM_TIMECHANGE = &H1E WM_TIMER = &H113 WM_UNDO = &H304 WM_USER = &H400 WM_VKEYTOITEM = &H2E WM_VSCROLL = &H115 WM_VSCROLLCLIPBOARD = &H30A WM_WINDOWPOSCHANGED = &H47 WM_WINDOWPOSCHANGING = &H46 WM_WININICHANGE = &H1A WM_APPCOMMAND = &H319 End Enum
  19. By all means get the upgrade - they install side-by-side anyway. Main gains are in the compact framework world, but there's a bit of new VB.Net syntax as well.
  20. I wasn't suprised but I think that the install program should have either (a) listed all the things that needed uninstalling first or (b) had the option to do the uninstall itself.
  21. Man - this is taking a huge age. You have to uninstall trhe 2003 beta, J# 1.1 redistributable, MSDN 2003 library and .Net 1.1 (Beta) framework first...
  22. Visual Studio .NET 2003 Enterprise Architect and Windows 2003 Server arrived today - a long night of installing awaits :)
  23. Things that score highly in final year projects are things with a lot of academic theory and cross-discipline references. Suggest you do an implementation of the .NET Evolutionary Computing Framework...guaranteed professor pleaser.
  24. Hmm - the download is a whole load of documentation on how to integrate with Visual Studio help...but no tool :(
  25. Turns out there's this MSDN download... (Although my experiences with MS and help authoring ain't good.)
×
×
  • Create New...